当前位置: 首页>>代码示例>>C++>>正文


C++ WText::setTextAlignment方法代码示例

本文整理汇总了C++中wt::WText::setTextAlignment方法的典型用法代码示例。如果您正苦于以下问题:C++ WText::setTextAlignment方法的具体用法?C++ WText::setTextAlignment怎么用?C++ WText::setTextAlignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wt::WText的用法示例。


在下文中一共展示了WText::setTextAlignment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setTitle

/**
  Constructor for View

  /usr/lib/Wt/examples/widgetgallery/examples/ComboBoxModel.cpp
  https://www.webtoolkit.eu/widgets/forms/combo-box
  https://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WComboBox.html

 */
View::View(const Wt::WEnvironment& env)
    : Wt::WApplication(env)
{
  setTitle("DropDown Demo");


  log("info") << "Test";

  // This is the container for the full screen.
  Wt::WContainerWidget *pScreenContainer = new Wt::WContainerWidget();
  pScreenContainer->resize(Wt::WLength::Auto, Wt::WLength::Auto);
  // Add the primary container to the root widget?
  root()->addWidget(pScreenContainer);

  // Choose the grid layout.
  Wt::WGridLayout *pScreenLayout = new Wt::WGridLayout();
  pScreenContainer->setLayout(pScreenLayout);

  int nRow = 0;
  int nColoumn = 0;

 
  // Create the label
  Wt::WText *lblSeriesChoice = new Wt::WText("Series:");
  // set right align the label
  lblSeriesChoice->setTextAlignment(Wt::AlignRight);
  pScreenLayout->addWidget(lblSeriesChoice, nRow, nColoumn+0);

  // Create the dropdown
  Wt::WComboBox *cbSeries = new Wt::WComboBox();
  cbSeries->addItem("");
  cbSeries->addItem("New");
  cbSeries->addItem("Krakken awoke");
  cbSeries->addItem("Appocalypse survival");
  cbSeries->setCurrentIndex(0); // Empty string
  pScreenLayout->addWidget(cbSeries, nRow, nColoumn+1);


  // Create the connection
  cbSeries->activated().connect(this, &View::DropDownSelectionChangeOtherDropDown);
  cbSeries->activated().connect(this, &View::DropDownSelectionChangeTab);
  /* Signals connect to Slots.
  * You may specify up to 6 arguments which may be of arbitrary types that are Copyable, that may be passed through the signal to connected slots.
  *   https://www.webtoolkit.eu/wt/doc/reference/html/group__signalslot.html
  * I think the 
  *   first parm - is a pointer to the target class.
  *   second parm - is the name of the method?
  * 
  * See: Wt::Signal.
  */


  /*
  * Let row 1 and column 1 take the excess space.?
  */
  pScreenLayout->setRowStretch(0, 0);
  pScreenLayout->setColumnStretch(0, 0);
} // end
开发者ID:hpepper,项目名称:wt-test,代码行数:66,代码来源:View.cpp


注:本文中的wt::WText::setTextAlignment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。