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


C++ WContainerWidget::setLayout方法代码示例

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


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

示例1: setTheme

Tester::Tester(const Wt::WEnvironment& env)
    : Wt::WApplication(env)
{

    setTheme(new Wt::WBootstrapTheme());
    useStyleSheet("resources/lpeg_tester.css");

    Wt::WContainerWidget* container = new Wt::WContainerWidget();
    container->setStyleClass("page");

    Wt::WVBoxLayout* vbox = new Wt::WVBoxLayout();
    container->setLayout(vbox);

    vbox->addWidget(Title(), 1);

    Wt::WHBoxLayout* hbox = new Wt::WHBoxLayout();
    vbox->addLayout(hbox);

    hbox->addWidget(Input(), 1);
    hbox->addWidget(Result(), 1);

    root()->addWidget(container);

    HandleInternalPath(internalPath());
    internalPathChanged().connect(this, &Tester::HandleInternalPath);
}
开发者ID:cluo,项目名称:lpeg_tester,代码行数:26,代码来源:lpeg_tester.cpp

示例2: WBreak

About::About() {
	WContainerWidget *cw = new 	WContainerWidget();
	
	cw->addWidget(new WBreak());
	cw->addWidget(new WBreak());

	
	this->addWidget(cw);
Wt::WContainerWidget *j = new Wt::WContainerWidget(this);
 j->resize(WLength::Auto, 200);

Wt::WGridLayout *lay = new Wt::WGridLayout();
store="<p>jonny jonny yes papa," 
      " Eating sugar no papa "
      "Telling lie, no papa " 
      "Open your mouth .</p>haha. ";


//lay->addWidget(new Wt::WText("this site is made by parvinder rajput. \n who are pursuing is b.tech from gndec ludhiana."),0,0);
// lay->addWidget(new Wt::WText("this is dean of consultancy cell"), 0, 2);
 //lay->addWidget(new Wt::WText("Hello"), 0, 0);
 
//lay->addWidget(new Wt::WImage("/images/Footer.jpg"), 0,0);
lay->addWidget(new Wt::WText(store ), 0,3);
lay->addWidget(new Wt::WImage("/images/jj.jpg"), 0,0);
lay->addWidget(new Wt::WImage("/images/uu.gif"), 0,2);
j->setLayout(lay); 
}
开发者ID:rupindar,项目名称:witty_website,代码行数:28,代码来源:test.C

示例3: onTokenReady

void CommentContainerWidget::onTokenReady(uint32_t token, bool ok)
{
    if(ok)
    {
        clear();
        std::vector<RsGxsComment> comments;
        //_CommentService->getRelatedComments(token, comments);
        _CommentService->getCommentData(token, comments);
        for(std::vector<RsGxsComment>::iterator vit = comments.begin(); vit != comments.end(); vit++)
        {
            RsGxsComment& comment = *vit;
            Wt::WContainerWidget* outerContainer = new Wt::WContainerWidget(this);
            Wt::WBorderLayout *layout = new Wt::WBorderLayout();
            outerContainer->setLayout(layout);
            AvatarWidgetWt* avatar = new AvatarWidgetWt(true);
            avatar->setIdentity(comment.mMeta.mAuthorId);
            layout->addWidget(avatar, Wt::WBorderLayout::West);
            Wt::WLabel* text = new Wt::WLabel(Wt::WString::fromUTF8(comment.mComment));
            layout->addWidget(text, Wt::WBorderLayout::Center);
        }
        // note: the widgets the pointers where pointing to where deleted by clear()
        _TextArea = new Wt::WTextArea(this);
        _TextArea->setEmptyText("your comment");
        //_IdChooser = new GxsIdChooserWt(this);
        _SubmitButton = new Wt::WPushButton("submit", this);
        _SubmitButton->clicked().connect(this, &CommentContainerWidget::onSubmitComment);
    }
    else
    {
        clear();
        new Wt::WLabel("FAIL", this);
    }
}
开发者ID:RetroShare,项目名称:rssocialnet,代码行数:33,代码来源:CommentContainerWidget.cpp

示例4: 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

示例5: renderUI

void AdsEditor::renderUI() {
  AdsApplication *app = AdsApplication::adsApplication();
  cppdb::session &db = app->db_;
  
  clear();
  WPushButton *btn = new WPushButton("Criar Anuncio", this);
  btn->clicked().connect(this, &AdsEditor::novoAnuncio);
  WPushButton *update = new WPushButton("Atualiza", this);
  update->clicked().connect(this, &AdsEditor::renderUI);
  new WBreak(this);
  new WBreak(this);
  new WText("<h3>Lista de Anuncios</h3>",this);
  
  Wt::WContainerWidget *w = new Wt::WContainerWidget(this);
  w->resize(600, WLength::Auto);
  WVBoxLayout *layout = new Wt::WVBoxLayout();
  cppdb::result res = db <<
    "select id, titulo, url, imagem, texto, ativo "
    " from anuncio";
  while(res.next()) {
    WContainerWidget *cont = new WContainerWidget();
    AdsAnuncio *anuncio = new AdsAnuncio(cont);
    
    res >>  anuncio->id >> anuncio->titulo_ >> anuncio->link_ >>
      anuncio->imagem_ >> anuncio->texto_ >> anuncio->ativo_;    
    
    WPushButton *tituloBtn = new WPushButton("Titulo",cont);
    tituloBtn->clicked().connect(anuncio, &AdsAnuncio::editarTitulo);
    
    WPushButton *urlBtn = new WPushButton("URL",cont);
    urlBtn->clicked().connect(anuncio, &AdsAnuncio::editarURL);
    
    WPushButton *imagemBtn = new WPushButton("Imagem",cont);
    imagemBtn->clicked().connect(anuncio, &AdsAnuncio::editarImagem);
    
    WPushButton *textoBtn = new WPushButton("Texto",cont);
    textoBtn->clicked().connect(anuncio, &AdsAnuncio::editarTexto);
    
    WCheckBox *ativoCheck = new Wt::WCheckBox("Ativo",cont);
    if(anuncio->ativo_ == 1)
      ativoCheck->setChecked(true);
    else 
      ativoCheck->setChecked(false);
    ativoCheck->changed().connect(anuncio, &AdsAnuncio::changeAtiva);

    WPushButton *deletaBtn = new WPushButton("Deleta",cont);
    deletaBtn->clicked().connect(anuncio, &AdsAnuncio::deletaAnuncio);

    anuncio->renderUI();
    layout->addWidget(cont);
  }
  w->setLayout(layout);
}
开发者ID:trumae,项目名称:PractWave,代码行数:53,代码来源:AdsEditor.cpp

示例6: WText

void
WHexDump::init() {
    Wt::WVBoxLayout *vbox = new Wt::WVBoxLayout;
    setLayout(vbox);

    Wt::WContainerWidget *actionsBox = new Wt::WContainerWidget;
    vbox->addWidget(actionsBox);
    {
        new Wt::WText("Goto: ", actionsBox);
        wAddressEdit_ = new Wt::WLineEdit(actionsBox);
        wAddressEdit_->enterPressed().connect(this, &WHexDump::handleGoto);

        new Wt::WBreak(actionsBox);
        new Wt::WText("Search: ", actionsBox);
        wSearchEdit_ = new Wt::WLineEdit(actionsBox);
        wSearchEdit_->keyPressed().connect(this, &WHexDump::resetSearch);
        wSearchNext_ = new Wt::WPushButton("Find", actionsBox);
        wSearchNext_->clicked().connect(this, &WHexDump::handleSearch);
        wSearchResults_ = new Wt::WText("Enter a big-endian hexadecimal value", actionsBox);
        
    }

    Wt::WContainerWidget *tableContainer = new Wt::WContainerWidget;
    vbox->addWidget(tableContainer, 1 /*stretch*/);
    Wt::WHBoxLayout *hbox = new Wt::WHBoxLayout;        // so the table scrolls horizontally
    tableContainer->setLayout(hbox);

    model_ = new HexDumpModel;

    tableView_ = new Wt::WTableView;
    tableView_->setModel(model_);
    tableView_->setRowHeaderCount(1);                   // this must be first property set
    tableView_->setHeaderHeight(28);
    tableView_->setSortingEnabled(false);
    tableView_->setAlternatingRowColors(false);         // true interferes with our blacking out unmapped addresses
    tableView_->setColumnResizeEnabled(true);
    tableView_->setSelectionMode(Wt::SingleSelection);
    tableView_->setEditTriggers(Wt::WAbstractItemView::NoEditTrigger);
    tableView_->setColumnWidth(addressColumn, Wt::WLength(6, Wt::WLength::FontEm));
    tableView_->setColumnWidth(sep1Column, Wt::WLength(1, Wt::WLength::FontEm));
    tableView_->setColumnWidth(sep2Column, Wt::WLength(1, Wt::WLength::FontEm));
    for (size_t i=0; i<bytesPerRow; ++i) {
        int extra = 7==i%8 && i+1<bytesPerRow ? 1 : 0;
        tableView_->setColumnWidth(bytesColumn + i, Wt::WLength(2+extra, Wt::WLength::FontEm));
        tableView_->setColumnWidth(asciiColumn + i, Wt::WLength(2+extra, Wt::WLength::FontEm));
    }
    tableView_->clicked().connect(boost::bind(&WHexDump::handleClick, this, _1));
    hbox->addWidget(tableView_);
}
开发者ID:ian-bertolacci,项目名称:rose-develop,代码行数:49,代码来源:WHexDump.C

示例7: setLayout

      PresetFilterPanel::PresetFilterPanel(org::esb::hive::PresetReader::FilterList &filter) :_filterlist(filter),  Wt::Ext::Panel() {
        setLayout(new Wt::WFitLayout());

        Wt::WContainerWidget * main = new Wt::WContainerWidget();
        grid = new Wt::WGridLayout();
        main->setLayout(grid);
        layout()->addWidget(main);

        grid->addWidget(filter_table = new PresetFilterTable(filter), 0, 0);
        _cont=new Wt::WContainerWidget();
        _cont->setLayout(new Wt::WBorderLayout());
        _cont->resize(600,300);
        grid->addWidget(_cont, 1, 0);
        filter_table->itemSelectionChanged().connect(SLOT(this,PresetFilterPanel::filterSelected));
      }
开发者ID:psychobob666,项目名称:MediaEncodingCluster,代码行数:15,代码来源:FilterPanel.cpp

示例8:

Home::Home() {
	
Wt::WContainerWidget *p = new Wt::WContainerWidget(this);
 p->resize(WLength::Auto, 200);

 Wt::WGridLayout *lay = new Wt::WGridLayout();
//lay->addWidget(new Wt::WText("this site is made by parvinder rajput. \n who are pursuing is b.tech from gndec ludhiana."),0,0);
// lay->addWidget(new Wt::WText("this is dean of consultancy cell"), 0, 2);
 //lay->addWidget(new Wt::WText("Hello"), 0, 0);
 
//lay->addWidget(new Wt::WImage("/images/Footer.jpg"), 0,0);
lay->addWidget(new Wt::WText("HERE GOES A SMALL RHYMES WEBSITE FOR NURSERY KIDS TO MAKE THEIR LEARNING INTERESTING."), 0,0);
lay->addWidget(new Wt::WImage("/images/images.jpeg"), 0,2);
lay->addWidget(new Wt::WImage("/images/images8.jpeg"), 0,1);
p->setLayout(lay);
}
开发者ID:rupindar,项目名称:witty_website,代码行数:16,代码来源:test.C

示例9: WContainerWidget

MainPage::MainPage(Wt::WApplication* app): WContainerWidget()
{
	app_ = app;
	contentsStack_ = new Wt::WStackedWidget();
	contentsStack_->setOverflow(WContainerWidget::OverflowAuto);
	contentsStack_->setStyleClass("contents");

	/*
	* Setup the menu (and submenus)
	*/
	Wt::WMenu *menu = new Wt::WMenu(contentsStack_, Wt::Vertical, 0);
	menu->setRenderAsList(true);
	menu->setStyleClass("menu");
	menu->setInternalPathEnabled();
	menu->setInternalBasePath("/");
	menu->itemSelected().connect(this, &MainPage::selectedMenuItem);
	
	Wt::WContainerWidget *w = new Wt::WContainerWidget(this);
	Wt::WBorderLayout *layout = new Wt::WBorderLayout();
	layout->addWidget(new Wt::WText("North-side is best"), Wt::WBorderLayout::North);
	layout->addWidget(new Wt::WText("South-side is best"), Wt::WBorderLayout::South);
	layout->addWidget(menu, Wt::WBorderLayout::West);
	layout->addWidget(contentsStack_, Wt::WBorderLayout::Center);

	// use layout but do not justify vertically
	w->setLayout(layout, Wt::AlignTop | Wt::AlignJustify);
	
	menu->addItem("Basics", new ClientsPage(this, &session_));
	menu->addItem("Form Widgets", new CommonPage(this, &session_));
	menu->addItem("Form Validators", new CommonPage(this, &session_));

	Wt::WSubMenuItem *smi = new Wt::WSubMenuItem("Sub menu", new CommonPage(this, &session_));
	Wt::WMenu *subMenu = new Wt::WMenu(contentsStack_, Wt::Vertical, 0);
	subMenu->setRenderAsList(true);

	smi->setSubMenu(subMenu);
	
	menu->addItem(smi);

	subMenu->setInternalPathEnabled();
	subMenu->setInternalBasePath("/" + smi->pathComponent());
	subMenu->setStyleClass("menu submenu");
	subMenu->itemSelected().connect(this, &MainPage::selectedMenuItem);
	
	subMenu->addItem("Sub Item 1", new CommonPage(this, &session_));
	subMenu->addItem("Sub Item 2", new CommonPage(this, &session_));
}
开发者ID:nickits,项目名称:cmst,代码行数:47,代码来源:mainpage.cpp

示例10: setLayout

      VideoPanel::VideoPanel(std::map<std::string, std::string>& p) : _parameter(p), Wt::Ext::Panel() {
        //        setLayout(new Wt::WFitLayout());
        Wt::WBorderLayout*l = new Wt::WBorderLayout();
        setLayout(l);
        std::set<std::string> avail_codecs;
        if (_parameter.count("available_codecs") > 0) {
          LOGDEBUG("Available codes" << _parameter["available_codecs"]);
          org::esb::util::StringTokenizer st(_parameter["available_codecs"], ",");
          while (st.hasMoreTokens()) {
            std::string codec_id = st.nextToken();
            avail_codecs.insert(codec_id);
            LOGDEBUG("avalable codec list" << codec_id);
          }
        }
        /*
         * Combobox for the Codec Selector
         */
        KeyValueModel * codec_model = new KeyValueModel();
        codec_model->addModelData("novideo", "No Video");
        codec_model->addModelData("copy", "Stream Copy");

        AVCodec *codec = NULL;
        int a = 0;
        while ((codec = av_codec_next(codec))) {
          if (codec->encode && codec->type == AVMEDIA_TYPE_VIDEO) {
            if (avail_codecs.count(codec->name) > 0) {
              codec_model->addModelData(codec->name, codec->long_name);
            } else {
              if (avail_codecs.size() == 0)
                codec_model->addModelData(codec->name, codec->long_name);
            }
          }
        }
        codec_model->sort(1);

        _codec = new ComboBox();

        _codec->setModel(codec_model);
        _codec->setModelColumn(1);
        _codec->setSelectedEntry(_parameter["codec_id"]);
        _codec->setTextSize(50);
        _codec->resize(300, Wt::WLength());


        _codec->activated().connect(SLOT(this, VideoPanel::codecSelected));


        main_panel = new Wt::Ext::Panel();
        Wt::WFitLayout * fit = new Wt::WFitLayout();
        main_panel->setLayout(fit);
        //main_panel->setBorder(false);

        l->addWidget(main_panel, Wt::WBorderLayout::Center);

        Wt::Ext::Panel * top_panel = new Wt::Ext::Panel();
        top_panel->resize(Wt::WLength(), 40);
        top_panel->setLayout(new Wt::WFitLayout());
        top_panel->setBorder(false);
        //        top_panel->layout()->addWidget(_codec);

        Wt::WContainerWidget *top = new Wt::WContainerWidget();
        top_panel->layout()->addWidget(top);
        Wt::WGridLayout * grid = new Wt::WGridLayout();
        top->setLayout(grid);
        top->resize(Wt::WLength(), 40);

        l->addWidget(top_panel, Wt::WBorderLayout::North);
        Wt::WLabel * label = new Wt::WLabel("Codec:");
        label->setBuddy(_codec);

        grid->addWidget(label, 0, 0);
        grid->addWidget(_codec, 0, 1);
        grid->addWidget(new Wt::WText(""), 0, 2);
        grid->setColumnStretch(1, 1);




        setCodecGui(_parameter["codec_id"]);
        //l->addWidget(builder,Wt::WBorderLayout::Center);
        //        return;
      }
开发者ID:psychobob666,项目名称:MediaEncodingCluster,代码行数:82,代码来源:VideoPanel.cpp

示例11: WCompositeWidget

RSWappSearchFilesPage::RSWappSearchFilesPage(Wt::WContainerWidget *parent,RsFiles *mfiles)
	: WCompositeWidget(parent),mFiles(mfiles)
{
	setImplementation(_impl = new Wt::WContainerWidget()) ;

	//_treeView = new Wt::WTreeView(_impl);
	_tableView = new Wt::WTableView(_impl);

	Wt::WVBoxLayout *layout = new Wt::WVBoxLayout() ;
	_impl->setLayout(layout) ;


	search_box = new Wt::WLineEdit(_impl) ;
	search_box->setText("mp3") ;
	search_box->enterPressed().connect(this,&RSWappSearchFilesPage::searchClicked) ;

	//search_box->setHeight(50) ;

	localcb = new Wt::WCheckBox(Wt::WString("Search Local"),_impl) ;
	remotecb = new Wt::WCheckBox(Wt::WString("Search Remote"),_impl) ;
	distantcb = new Wt::WCheckBox(Wt::WString("Search Distant"),_impl) ;

	localcb->setChecked(false);
	remotecb->setChecked(true);
	distantcb->setChecked(true);

	Wt::WPushButton *btn = new Wt::WPushButton("Search!") ;
	btn->clicked().connect(this,&RSWappSearchFilesPage::searchClicked) ;

	Wt::WContainerWidget *hSearchBox = new Wt::WContainerWidget();
	Wt::WHBoxLayout *hSearchLayout = new Wt::WHBoxLayout ;
	hSearchBox->setLayout(hSearchLayout);

	hSearchLayout->addWidget(search_box) ;
	hSearchLayout->addWidget(localcb);
	hSearchLayout->addWidget(distantcb);
	hSearchLayout->addWidget(remotecb);
	hSearchLayout->addWidget(btn) ;

	layout->addWidget(hSearchBox) ;
	search_box->setWidth(1000);

	_tableView->setAlternatingRowColors(true);

	_tableView->setSelectionMode(Wt::ExtendedSelection);
	_tableView->setDragEnabled(true);


	_tableView->setColumnWidth(0, 250);
	_tableView->setColumnWidth(1, 150);
	_tableView->setColumnWidth(2, 250);
	_tableView->setColumnWidth(3, 150);
	_tableView->setColumnWidth(4, 150);
	_tableView->setColumnWidth(5, 100);

	_shared_files_model = new LocalSearchFilesModel(mfiles) ;

	_tableView->setModel(_shared_files_model) ;

	_tableView->doubleClicked().connect(this,&RSWappSearchFilesPage::tableClicked) ;
	layout->addWidget(_tableView,1) ;

	_tableView->setHeight(300) ;


	Wt::WPushButton *dlbtn = new Wt::WPushButton("Download selected") ;
	dlbtn->clicked().connect(this,&RSWappSearchFilesPage::searchClicked) ;
	layout->addWidget(dlbtn) ;

	_timer = new Wt::WTimer(this) ;
	_timer->setInterval(5000) ;
	_timer->timeout().connect(this,&RSWappSearchFilesPage::refresh) ;
	_timer->start() ;
}
开发者ID:RetroShare,项目名称:RSWebUI,代码行数:74,代码来源:RSWappSearchFilesPage.cpp

示例12: switch

Wt::WContainerWidget*
Application::instantiateMainTabs() {
    Wt::WContainerWidget *mainTabContainer = new Wt::WContainerWidget;
    Wt::WVBoxLayout *vbox = new Wt::WVBoxLayout;
    mainTabContainer->setLayout(vbox);

    wMainTabs_ = new Wt::WTabWidget;
    wMainTabs_->currentChanged().connect(boost::bind(&Application::changeTab2, this, _1));
    vbox->addWidget(wMainTabs_, 1 /*stretch*/);

    for (size_t i=0; i<NMainTabs; ++i) {
        Wt::WString tabName;
        Wt::WContainerWidget *tabContent = NULL;
        switch ((MainTab)i) {
        case PartitionerTab: {
            tabName = "Partitioner";
            tabContent = wPartitioner_ = new WPartitioner(ctx_);
            wPartitioner_->specimenParsed().connect(boost::bind(&Application::handleSpecimenParsed, this, _1));
            wPartitioner_->specimenLoaded().connect(boost::bind(&Application::handleSpecimenLoaded, this, _1));
            wPartitioner_->specimenPartitioned().connect(boost::bind(&Application::handleSpecimenPartitioned, this, _1));
            break;
        }
        case MemoryMapTab: {
            tabName = "Memory Map";
            tabContent = wMemoryMap_ = new WMemoryMap;
            wMemoryMap_->mapChanged().connect(boost::bind(&Application::memoryMapChanged, this));
            wMemoryMap_->allowDownloads(ctx_.settings.allowDownloads);
            break;
        }
        case FunctionListTab: {
            tabName = "Functions";
            tabContent = wFunctionList_ = new WFunctionList(ctx_);
            wFunctionList_->functionChanged().connect(boost::bind(&Application::changeFunction, this, _1));
            wFunctionList_->functionRowDoubleClicked()
            .connect(boost::bind(&Application::changeFunctionDoubleClick, this, _1));
            break;
        }
        case FunctionSummaryTab: {
            tabName = "Summary";
            tabContent = wFunctionSummary_ = new WFunctionSummary(ctx_);
            break;
        }
        case FunctionCfgTab: {
            tabName = "CFG";
            tabContent = wFunctionCfg_ = new WFunctionCfg(ctx_);
            wFunctionCfg_->functionChanged().connect(boost::bind(&Application::changeFunction, this, _1));
            wFunctionCfg_->functionClicked().connect(boost::bind(&Application::changeFunction, this, _1));
            wFunctionCfg_->addressClicked().connect(boost::bind(&Application::showHexDumpAtAddress, this, _1));
            wFunctionCfg_->basicBlockClicked().connect(boost::bind(&Application::changeBasicBlock, this, _1));
            break;
        }
        case AssemblyTab: {
            tabName = "Assembly";
            tabContent = wAssembly_ = new WAssemblyListing(ctx_);
            break;
        }
        case HexDumpTab: {
            tabName = "Hexdump";
            tabContent = wHexDump_ = new WHexDump;
            wHexDump_->byteClicked().connect(boost::bind(&Application::updateAddressCrossReferences, this, _1));
            break;
        }
        case MagicTab: {
            tabName = "Magic";
            tabContent = wMagic_ = new WMagic;
            break;
        }
        case StringsTab: {
            tabName = "Strings";
            tabContent = wStrings_ = new WStrings;
            wStrings_->stringClicked().connect(boost::bind(&Application::updateStringCrossReferences, this, _1));
            break;
        }
        case StatusTab: {
            tabName = "Status";
            tabContent = wStatus_ = new WStatus(ctx_);
            break;
        }
        default:
            ASSERT_not_reachable("invalid main tab");
        }
        ASSERT_not_null(tabContent);
        ASSERT_forbid(tabName.empty());
        wMainTabs_->addTab(tabContent, tabName);
    }
    return mainTabContainer;
}
开发者ID:cathieO,项目名称:rose-develop,代码行数:87,代码来源:Application.C

示例13: login

void SimpleWebWidget::login()
{
	clear();

	btnGroundPower_ = new Wt::WPushButton("Ground Power\nconnect/disconnect");
	btnGroundAir_ = new Wt::WPushButton("Ground Air\n connect/disconnect");
	btnDoor1_ = new Wt::WPushButton("Open/Close\n Door1");
	btnDoor2_ = new Wt::WPushButton("Open/Close\n Door2");
	btnDoor3_ = new Wt::WPushButton("Open/Close\n Door3");
	btnPushBack1_ = new Wt::WPushButton("Start Pushback\nTail Left");
	btnPushBack2_ = new Wt::WPushButton("Start Pushback\nStraight");
	btnPushBack3_ = new Wt::WPushButton("Start Pushback\nTail Right");
	btnPushBack4_ = new Wt::WPushButton("STOP\nPushBack");

	btnVirtualKey1_ = new Wt::WPushButton("Send 1");
	btnVirtualKey2_ = new Wt::WPushButton("Send 2");
	btnVirtualKey3_ = new Wt::WPushButton("Send 3");
	btnVirtualKey4_ = new Wt::WPushButton("Send 4");
	btnVirtualKey5_ = new Wt::WPushButton("Send 5");
	btnVirtualKey6_ = new Wt::WPushButton("Send 6");
	btnVirtualKey7_ = new Wt::WPushButton("Send 7");
	btnVirtualKey8_ = new Wt::WPushButton("Send 8");
	btnVirtualKey9_ = new Wt::WPushButton("Send 9");
	btnVirtualKey0_ = new Wt::WPushButton("Send 0");
	btnVirtualKeyF12_ = new Wt::WPushButton("Send F12");

	txtWxrDep = new Wt::WText("DEPARTURE AIRPORT IS NOT SET");
	txtWxrTafDep = new Wt::WText("DEPARTURE AIRPORT IS NOT SET");
	txtWxrArr = new Wt::WText("ARRIVAL AIRPORT IS NOT SET");
	txtWxrTafArr = new Wt::WText("ARRIVAL AIRPORT IS NOT SET");

	txtGSXText = new Wt::WText("");

	btnGroundPower_->setStyleClass("btn-danger");
	btnGroundAir_->setStyleClass("btn-danger");

	btnDoor1_->setStyleClass("btn-danger");
	btnDoor2_->setStyleClass("btn-danger");
	btnDoor3_->setStyleClass("btn-danger");

	btnPushBack1_->setStyleClass("btn-danger");
	btnPushBack2_->setStyleClass("btn-danger");
	btnPushBack3_->setStyleClass("btn-danger");
	btnPushBack4_->setStyleClass("btn-danger");

	dialog = new Wt::WDialog("No connection");

	Wt::WLabel *label = new Wt::WLabel("Waiting for simulator connection with iFly 737NG",
		dialog->contents());


	Wt::WNavigationBar *navigation = new Wt::WNavigationBar();
	Wt::WStackedWidget *contentsStack = new Wt::WStackedWidget();

	Wt::WContainerWidget *groundContainer = new Wt::WContainerWidget();
	Wt::WContainerWidget *weatherContainer = new Wt::WContainerWidget();
	Wt::WContainerWidget *mapContainer = new Wt::WContainerWidget();
	Wt::WContainerWidget *infoContainer = new Wt::WContainerWidget();
	Wt::WContainerWidget *gsxContainer = new Wt::WContainerWidget();

	Wt::WContainerWidget *statusContainer = new Wt::WContainerWidget();

	Wt::WVBoxLayout *mainVLayout = new WVBoxLayout();

	setLayout(mainVLayout);

	// Create a navigation bar with a link to a web page.
	navigation->setTitle("737ng.kapsi.fi",
		"http://737ng.kapsi.fi");
	navigation->setResponsive(true);

	// Setup a Left-aligned menu.
	contentsStack->addStyleClass("contents");
	Wt::WMenu *leftMenu = new Wt::WMenu(contentsStack);
	navigation->addMenu(leftMenu);
	leftMenu->addItem("Ground", groundContainer);
	leftMenu->addItem("Weather", weatherContainer);
	leftMenu->addItem("Map", mapContainer);
	leftMenu->addItem("Info", infoContainer);
	leftMenu->addItem("GSX", gsxContainer);

	mainVLayout->addWidget(navigation, 0);
	mainVLayout->addWidget(contentsStack, 1);
	mainVLayout->addWidget(statusContainer, 0);

	Wt::WGroupBox *groundBox = new Wt::WGroupBox("Ground Equipment");
	groundBox->addStyleClass("fieldset-header");
	groundBox->addWidget(btnGroundPower_);
	groundBox->addWidget(btnGroundAir_);
	groundContainer->addWidget(groundBox);

	Wt::WGroupBox *doorBox = new Wt::WGroupBox("Aircraft Doors");
	doorBox->addStyleClass("fieldset-header");
	doorBox->addWidget(btnDoor1_);
	doorBox->addWidget(btnDoor2_);
	doorBox->addWidget(btnDoor3_);
	groundContainer->addWidget(doorBox);

	Wt::WGroupBox *pushBox = new Wt::WGroupBox("Default Pushback");
	pushBox->addStyleClass("fieldset-header");
//.........这里部分代码省略.........
开发者ID:jounip,项目名称:iFlyWebUi,代码行数:101,代码来源:SimpleWebWidget.cpp


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