Wt examples  4.12.2
Loading...
Searching...
No Matches
ChartsApplication.C
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008 Emweb bv, Herent, Belgium.
3 *
4 * See the LICENSE file for terms of use.
5 */
6
7#include <Wt/WApplication.h>
8#include "ChartsExample.h"
9
10using namespace Wt;
11
13{
14public:
16 : WApplication(env)
17 {
18 setTitle("Charts example");
19
20 setCssTheme("polished");
21 messageResourceBundle().use(appRoot() + "charts");
22
23 root()->setPadding(10);
25
26 root()->addWidget(std::make_unique<ChartsExample>());
27
28 /*
29 * Set our style sheet last, so that it loaded after the ext stylesheets.
30 */
31 useStyleSheet("charts.css");
32 }
33};
34
35std::unique_ptr<WApplication> createApplication(const WEnvironment& env)
36{
37 return std::make_unique<ChartsApplication>(env);
38}
39
40int main(int argc, char **argv)
41{
42 return WRun(argc, argv, &createApplication);
43}
int main(int argc, char **argv)
std::unique_ptr< WApplication > createApplication(const WEnvironment &env)
ChartsApplication(const WEnvironment &env)
void setCssTheme(const std::string &name)
WMessageResourceBundle & messageResourceBundle()
WContainerWidget * root() const
void setTitle(const WString &title)
static std::string appRoot()
void useStyleSheet(const WLink &link, const std::string &media="all")
void setPadding(const WLength &padding, WFlags< Side > sides=AllSides)
virtual void addWidget(std::unique_ptr< WWidget > widget)
static WLength Auto
void use(const std::string &path, bool loadInMemory=true)
virtual void resize(const WLength &width, const WLength &height) override