Wt examples  3.7.1
Functions
FormExample.C File Reference
#include "FormExample.h"
#include "Form.h"
#include <Wt/WApplication>
#include <Wt/WText>
#include <Wt/WStringUtil>

Go to the source code of this file.

Functions

WApplicationcreateApplication (const WEnvironment &env)
 
int main (int argc, char **argv)
 

Function Documentation

◆ createApplication()

WApplication* createApplication ( const WEnvironment env)

Definition at line 68 of file FormExample.C.

69 {
70  WApplication *app = new WApplication(env);
71  app->messageResourceBundle().use(WApplication::appRoot() + "form-example");
72  app->setTitle("Form example");
73 
74  app->root()->addWidget(new FormExample());
75 
76  WCssDecorationStyle langStyle;
77  langStyle.font().setSize(WFont::Smaller);
78  langStyle.setCursor(PointingHandCursor);
79  langStyle.setForegroundColor(blue);
80  langStyle.setTextDecoration(WCssDecorationStyle::Underline);
81  app->styleSheet().addRule(".lang", langStyle);
82 
83  langStyle.setCursor(ArrowCursor);
84  langStyle.font().setWeight(WFont::Bold);
85  app->styleSheet().addRule(".langcurrent", langStyle);
86 
87  return app;
88 }
WMessageResourceBundle & messageResourceBundle()
void setTitle(const WString &title)
void setCursor(Cursor c)
void setSize(FontSize size)
void setWeight(FontWeight weight, int value=400)
void use(const std::string &path, bool loadInMemory=true)
WContainerWidget * root() const
WCssTextRule * addRule(const std::string &selector, const WString &declarations, const std::string &ruleName=std::string())
Main widget for the Form example.
Definition: FormExample.h:29
void setForegroundColor(WColor color)
WCssStyleSheet & styleSheet()
virtual void addWidget(std::unique_ptr< WWidget > widget)
void setTextDecoration(WFlags< TextDecoration > decoration)

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 90 of file FormExample.C.

91 {
92  return WRun(argc, argv, &createApplication);
93 }
WApplication * createApplication(const WEnvironment &env)
Definition: FormExample.C:68

Generated on Tue Dec 15 2020 for the C++ Web Toolkit (Wt) by doxygen 1.8.13