コード例 #1
0
WApplication *createApplication(const WEnvironment& env)
{
  WApplication *app = new WApplication(env);
  app->setTitle(L"Hangman");
  new HangmanGame(app->root());  

  /*
   * The application style sheet (only for the highscore widget)
   */
  WCssDecorationStyle cellStyle;
  WBorder cellBorder;
  cellBorder.setStyle(WBorder::Solid);
  cellBorder.setWidth(WBorder::Explicit, WLength(1));
  cellBorder.setColor(WColor(Wt::lightGray));
  cellStyle.setBorder(cellBorder);

  app->styleSheet().addRule(".highscores * TD", cellStyle);

  cellStyle.font().setVariant(WFont::SmallCaps);

  app->styleSheet().addRule(".highscoresheader", cellStyle);

  cellStyle.font().setVariant(WFont::NormalVariant);
  cellStyle.font().setStyle(WFont::Italic);
  cellStyle.font().setWeight(WFont::Bold);

  app->styleSheet().addRule(".highscoresself", cellStyle);

  return app;
}
コード例 #2
0
ファイル: FormExample.C プロジェクト: AlexanderKotliar/wt
std::unique_ptr<WApplication> createApplication(const WEnvironment& env)
{
  std::unique_ptr<WApplication> app
      = cpp14::make_unique<WApplication>(env);
  app->messageResourceBundle().use(WApplication::appRoot() + "form-example");
  app->setTitle("Form example");

  app->root()->addWidget(cpp14::make_unique<FormExample>());

  WCssDecorationStyle langStyle;
  langStyle.font().setSize(FontSize::Smaller);
  langStyle.setCursor(Cursor::PointingHand);
  langStyle.setForegroundColor(WColor("blue"));
  langStyle.setTextDecoration(TextDecoration::Underline);
  app->styleSheet().addRule(".lang", langStyle);

  langStyle.setCursor(Cursor::Arrow);
  langStyle.font().setWeight(FontWeight::Bold);
  app->styleSheet().addRule(".langcurrent", langStyle);

  return app;
}