• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ WPushButton类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中WPushButton的典型用法代码示例。如果您正苦于以下问题:C++ WPushButton类的具体用法?C++ WPushButton怎么用?C++ WPushButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: WTable

void menuWidget::revengeProposed()
{
    WApplication *app = WApplication::instance();
    information->setText("Revenge was proposed. Press start to begin");
    startGame->enable();
    revenge->disable();
    giveUp->disable();
    endGame->enable();
    gameButtons.clear();
    everything->clear();
    delete everything;
    everything = new WTable(this);
    for(int i = 0; i<SIZE; i++)
    {
        for(int j = 0; j<SIZE; j++) {
            WPushButton * newButton = new WPushButton();
            newButton->disable();
            newButton->resize(35,35); //images are 30x30, just in case
            newButton->setVerticalAlignment(Wt::AlignMiddle);
            newButton->clicked().connect(boost::bind(&menuWidget::processClickButton,this,newButton,i,j));
            everything->elementAt(i,j)->addWidget(newButton);
            gameButtons.insert(make_pair(Coordinates(j,i),newButton));
        }//adding the noughts&crosses buttons (225)
    }

    app->triggerUpdate();
}
开发者ID:micp,项目名称:ZPR,代码行数:27,代码来源:menuWidget.cpp


示例2: WPushButton

WInteractWidget *WNavigationBar::createExpandButton()
{
  WPushButton *result = new WPushButton(tr("Wt.WNavigationBar.expand-button"));
  result->setTextFormat(XHTMLText);
  wApp->theme()->apply(this, result, NavbarBtn);
  return result;
}
开发者ID:GuLinux,项目名称:wt,代码行数:7,代码来源:WNavigationBar.C


示例3: WApplication

/*
 * The env argument contains information about the new session, and
 * the initial request. It must be passed to the WApplication
 * constructor so it is typically also an argument for your custom
 * application constructor.
 */
HelloApplication::HelloApplication(const WEnvironment& env)
: WApplication(env)
{
  setTitle("Hello world");              // application title

                                        // show some text
  root()->addWidget(new WText("Your name, please ? "));
  nameEdit_ = new WLineEdit(root());    // allow text input
  nameEdit_->setFocus();                // give focus

                                        // create a button
  WPushButton *b = new WPushButton("Greet me.", root());
  b->setMargin(5, Left);                // add 5 pixels margin

  root()->addWidget(new WBreak());      // insert a line break

  greeting_ = new WText(root());        // empty text

  /*
   * Connect signals with slots
   *
   * - simple Wt-way
   */
  //b->clicked().connect(this, &HelloApplication::greet);

  /*
   * - using an arbitrary function object (binding values with boost::bind())
   */
  //nameEdit_->enterPressed().connect(boost::bind(&HelloApplication::greet, this));
}
开发者ID:4ukuta,项目名称:core,代码行数:36,代码来源:main.cpp


示例4: WApplication

WebGLDemo::WebGLDemo(const WEnvironment& env)
  : WApplication(env)
{
  setTitle("WebGL Demo");

  root()->addWidget(new WText("If your browser supports WebGL, you'll "
    "see a teapot below.<br/>Use your mouse to move around the teapot.<br/>"
    "Edit the shaders below the teapot to change how the teapot is rendered."));
  root()->addWidget(new WBreak());

  paintWidget_ = 0;

  glContainer_ = new WContainerWidget(root());
  glContainer_->resize(500, 500);
  glContainer_->setInline(false);

  WPushButton *updateButton = new WPushButton("Update shaders", root());
  updateButton->clicked().connect(this, &WebGLDemo::updateShaders);
  WPushButton *resetButton = new WPushButton("Reset shaders", root());
  resetButton->clicked().connect(this, &WebGLDemo::resetShaders);

  WTabWidget *tabs = new WTabWidget(root());

  fragmentShaderText_ = new WTextArea;
  fragmentShaderText_->resize(750, 250);
  tabs->addTab(fragmentShaderText_, "Fragment Shader");
  WText *shaderInfo = new WText(root());
  vertexShaderText_ = new WTextArea;
  vertexShaderText_->resize(750, 250);
  tabs->addTab(vertexShaderText_, "Vertex Shader");

  resetShaders();
}
开发者ID:913862627,项目名称:wt,代码行数:33,代码来源:teapot.C


示例5: WContainerWidget

WWidget *MvcWidgets::viewsCombo()
{
  WContainerWidget *result = new WContainerWidget();

  // WComboBox
#if !defined(WT_TARGET_JAVA)
  topic("WComboBox", "WSelectionBox", "Ext::ComboBox", result);
#else
  topic("WComboBox", "WSelectionBox", result);
#endif
  addText(tr("mvc-stringlistviews"), result);
  addText("<h3>WComboBox</h3>", result);
  (new WComboBox(result))->setModel(stringList_);

  // WSelectionBox
  addText("<h3>WSelectionBox</h3>", result);
  (new WSelectionBox(result))->setModel(stringList_);

#ifndef WT_TARGET_JAVA
  // Ext::ComboBox
  addText("<h3>Ext::ComboBox</h3>", result);
  extComboBox_ = new Ext::ComboBox(result);
  extComboBox_->setModel(stringList_);
  extComboBox_->setEditable(true);
  WPushButton *pb = new WPushButton("Press here to add the edited value "
				    "to the model", result);
  pb->clicked().connect(this, &MvcWidgets::comboBoxAdd);
#endif
  
  return result;
}
开发者ID:ReWeb3D,项目名称:wt,代码行数:31,代码来源:MvcWidgets.C


示例6: bindPanelTemplates

  void bindPanelTemplates() {
    if (!session_.user())
      return;

    dbo::Transaction t(session_);

    if (authorPanel_) {
      WPushButton *newPost = new WPushButton(tr("new-post"));
      newPost->clicked().connect(SLOT(this, BlogImpl::newPost));
      WContainerWidget *unpublishedPosts = new WContainerWidget();
      showPosts(session_.user()->allPosts(Post::Unpublished), unpublishedPosts);

      authorPanel_->bindString("user", session_.user()->name);
      authorPanel_->bindInt("unpublished-count",
			    (int)session_.user()->allPosts(Post::Unpublished)
			    .size());
      authorPanel_->bindInt("published-count",
			    (int)session_.user()->allPosts(Post::Published)
			    .size());
      authorPanel_->bindWidget("new-post", newPost);
      authorPanel_->bindWidget("unpublished-posts", unpublishedPosts);
    }

    t.commit();
  }
开发者ID:DTidd,项目名称:wt,代码行数:25,代码来源:BlogView.C


示例7: disconnect

void SimpleChatWidget::letLogin()
{
  disconnect();

  clear();

  WVBoxLayout *vLayout = new WVBoxLayout();
  setLayout(vLayout, AlignLeft | AlignTop);

  WHBoxLayout *hLayout = new WHBoxLayout();
  vLayout->addLayout(hLayout);

  hLayout->addWidget(new WLabel("User name:"), 0, AlignMiddle);
  hLayout->addWidget(userNameEdit_ = new WLineEdit(user_), 0, AlignMiddle);
  userNameEdit_->setFocus();

  WPushButton *b = new WPushButton("Login");
  hLayout->addWidget(b, 0, AlignMiddle);

  b->clicked().connect(this, &SimpleChatWidget::login);
  userNameEdit_->enterPressed().connect(this, &SimpleChatWidget::login);

  vLayout->addWidget(statusMsg_ = new WText());
  statusMsg_->setTextFormat(PlainText);
}
开发者ID:bvanhauwaert,项目名称:wt,代码行数:25,代码来源:SimpleChatWidget.C


示例8: WApplication

ChatApplication::ChatApplication(const WEnvironment& env,
				 SimpleChatServer& server)
  : WApplication(env),
    server_(server),
    env_(env)
{
  setTitle("Wt Chat");
  useStyleSheet("chatapp.css");

  messageResourceBundle().use(appRoot() + "simplechat");

  javaScriptTest();

  root()->addWidget(new WText(WString::tr("introduction")));

  SimpleChatWidget *chatWidget =
      new SimpleChatWidget(server_, root());
  chatWidget->setStyleClass("chat");

  root()->addWidget(new WText(WString::tr("details")));

  WPushButton *b = new WPushButton("I'm schizophrenic ...", root());
  b->clicked().connect(b, &WPushButton::hide);
  b->clicked().connect(this, &ChatApplication::addChatWidget);
}
开发者ID:913862627,项目名称:wt,代码行数:25,代码来源:simpleChat.C


示例9: WPushButton

WPushButton *WMessageBox::addButton(const WString& text, StandardButton result)
{
  WPushButton *b = new WPushButton(text, buttonContainer_);
  buttonMapper_->mapConnect(b->clicked(), result);

  return b;
}
开发者ID:ReWeb3D,项目名称:wt,代码行数:7,代码来源:WMessageBox.C


示例10: WApplication

WApplication *createApplication(const WEnvironment& env)
{
  WApplication *appl = new WApplication(env);

  new WText("<h1>Your mission</h1>", appl->root());
  WText *secret 
    = new WText("Your mission, Jim, should you accept, is to create solid "
		"web applications.",
		appl->root());

  new WBreak(appl->root()); new WBreak(appl->root());

  new WText("This program will quit in ", appl->root());
  CountDownWidget *countdown = new CountDownWidget(10, 0, 1000, appl->root());
  new WText(" seconds.", appl->root());

  new WBreak(appl->root()); new WBreak(appl->root());

  WPushButton *cancelButton = new WPushButton("Cancel!", appl->root());
  WPushButton *quitButton = new WPushButton("Quit", appl->root());
  quitButton->clicked().connect(appl, &WApplication::quit);

  countdown->done().connect(appl, &WApplication::quit);
  cancelButton->clicked().connect(countdown, &CountDownWidget::cancel);
  cancelButton->clicked().connect(cancelButton, &WFormWidget::disable);
  cancelButton->clicked().connect(secret, &WWidget::hide);

  return appl;
}
开发者ID:913862627,项目名称:wt,代码行数:29,代码来源:impossible.C


示例11:

WPopupMenu::~WPopupMenu()
{
  if (button_) {
    WPushButton *b = dynamic_cast<WPushButton *>(button_);
    if (b)
      b->setMenu(0);
  }
}
开发者ID:yarmola,项目名称:wt,代码行数:8,代码来源:WPopupMenu.C


示例12: WContainerWidget

CommentsContainerWidget::CommentsContainerWidget(string videoId, Session* session, WContainerWidget* parent)
  : WContainerWidget(parent), d(videoId, session)
{
  string querysql = "select content,last_updated,\
      auth_info.email as email,\
    auth_identity.identity as identity\
    from comment\
    inner join auth_info on comment.user_id = auth_info.user_id\
    inner join auth_identity on auth_info.id = auth_identity.auth_info_id\
  ";
  wApp->log("notice") << "comments query: " << querysql;
  auto query = d->session->query<CommentTuple>(querysql);
  query.where("media_id = ?").bind(videoId);
  query.where("auth_identity.provider = 'loginname'");
  query.orderBy("last_updated DESC");
  addWidget(WW<WText>(wtr("comments.label")).css("label").setInline(false));
  
  WTextArea* newCommentContent = new WTextArea();
  newCommentContent->setRows(3);
  newCommentContent->setInline(false);
  WPushButton* insertComment = WW<WPushButton>(wtr("comments.addcomment.button")).css("btn btn-primary btn-sm").onClick([=](WMouseEvent){
    if(newCommentContent->text().empty())
      return;
    Comment *comment = new Comment(videoId, d->session->user(), newCommentContent->text().toUTF8());
    Dbo::Transaction t(*d->session);
    Dbo::ptr< Comment > newComment = d->session->add(comment);
    t.commit();
    newCommentContent->setText("");
    commentViewers.commentAdded(videoId, newComment.id());
  });
  newCommentContent->keyWentUp().connect([=](WKeyEvent){
    insertComment->setEnabled(!newCommentContent->text().empty());
  });
  insertComment->setEnabled(false);
  
//     newCommentContent->setWidth(500);
  newCommentContent->addStyleClass("col-md-8");

  addWidget(WW<WContainerWidget>().css("add-comment-box row").add(newCommentContent).add(insertComment).setContentAlignment(AlignCenter));
  
  addWidget(d->commentsContainer = WW<WContainerWidget>().css("container") );

  Dbo::Transaction t(*d->session);
  for(CommentTuple comment : query.resultList())
    d->commentsContainer->addWidget(new CommentView(comment) );
  
  auto commentAdded = [=] (string commentVideoId, long commentId) {
    if(commentVideoId != videoId) return;
    Dbo::Transaction t(*d->session);
    auto query = d->session->query<CommentTuple>(querysql).where("comment.id = ?").bind(commentId);
    query.where("auth_identity.provider = 'loginname'");
    d->commentsContainer->insertWidget(0, new CommentView(query.resultValue()));
    d->commentsContainer->refresh();
    wApp->triggerUpdate();
  };
  
  commentViewers.addClient(wApp->sessionId(), commentAdded);
}
开发者ID:GuLinux,项目名称:Pandorica,代码行数:58,代码来源:commentscontainerwidget.cpp


示例13: WContainerWidget

void BasePage::addBook(){
	WContainerWidget *container = new WContainerWidget();
	Wt::WTemplate *t = new Wt::WTemplate(Wt::WString::tr("addBookForm"));
	
	WLineEdit *editTitle = new WLineEdit(container);
	editTitle->setPlaceholderText("title");
	t->bindWidget("title", editTitle);
	
	WLineEdit *editAuthor = new WLineEdit(container);
	editAuthor->setPlaceholderText("author");
	t->bindWidget("author", editAuthor);
	
	WLineEdit *editAuthorYears = new WLineEdit(container);
	editAuthorYears->setPlaceholderText("years of life");
	t->bindWidget("years", editAuthorYears);
	
	WLineEdit *editGenre = new WLineEdit(container);
	editGenre->setPlaceholderText("genre");
	t->bindWidget("genre", editGenre);
	
	WLineEdit *editYear = new WLineEdit(container);
	editYear->setPlaceholderText("year");
	t->bindWidget("year", editYear);
	
	WLineEdit *editSeria = new WLineEdit(container);
	editSeria->setPlaceholderText("seria");
	t->bindWidget("seria", editSeria);
	
	WLineEdit *editNumOfBooks = new WLineEdit(container);
	editNumOfBooks->setPlaceholderText("num of books");
	t->bindWidget("numOfBooks", editNumOfBooks);
	
	WLineEdit *editNumInSeria = new WLineEdit(container);
	editNumInSeria->setPlaceholderText("number in seria");
	t->bindWidget("numInSeria", editNumInSeria);
	
	WLineEdit *editMark = new WLineEdit(container);
	editMark->setPlaceholderText("mark");
	editMark->setValidator(new Wt::WIntValidator(1, 10));
	t->bindWidget("mark", editMark);
	
	WPushButton *button = new WPushButton("Add book", container);
	button->setMargin(10, Top | Bottom);

	button->clicked().connect(std::bind([=] () {BookManager bm; bm.addBook(editTitle->valueText().toUTF8(),
																		   editAuthor->valueText().toUTF8(),
																		   editAuthorYears->valueText().toUTF8(),
																		   editGenre->valueText().toUTF8(),
																		   intoInt(editYear),
																		   editSeria->valueText().toUTF8(),
																		   intoInt(editNumOfBooks),
																		   intoInt(editNumInSeria),
																		   intoInt(editMark)); }));
	
	t->bindWidget("button", button);
	_pagecontent->addWidget(t);	
}
开发者ID:leshkajou,项目名称:bookrate,代码行数:57,代码来源:basepage.cpp


示例14: WContainerWidget

void Reports::createUi()
{

    WContainerWidget *dateSelectForm = new WContainerWidget(this);
    dateSelectForm ->setStyleClass("form-inline");
    dateSelectForm ->setId("dateselectform");

    WLabel *label;

    label = new WLabel(tr("reports.begindate"), dateSelectForm );
    m_pBeginDateEdit = new WDateEdit(dateSelectForm );
    //label->setBuddy(m_pBeginDateEdit->lineEdit());
    label->setBuddy(m_pBeginDateEdit);


    //m_pBeginDateEdit->setBottom(WDate(WDate::currentDate().year(), WDate::currentDate().month(), 1));
    m_pBeginDateEdit->setFormat("dd.MM.yyyy");
    m_pBeginDateEdit->setDate(WDate(WDate::currentDate().year(), WDate::currentDate().month(), 1));
    m_pBeginDateEdit->setTop(WDate::currentDate());
    //m_pBeginDateEdit->lineEdit()->validator()->setMandatory(true);
    m_pBeginDateEdit->validator()->setMandatory(true);
    m_pBeginDateEdit->setStyleClass("input-medium");
    //m_pBeginDateEdit->setWidth(120);


    label = new WLabel(tr("reports.enddate"), dateSelectForm );
    m_pEndDateEdit = new WDateEdit(dateSelectForm );
    //label->setBuddy(m_pEndDateEdit->lineEdit());
    label->setBuddy(m_pEndDateEdit);
    //m_pEndDateEdit->setBottom(WDate::currentDate());
    m_pEndDateEdit->setFormat("dd.MM.yyyy");
    m_pEndDateEdit->setDate(WDate::currentDate());
    m_pEndDateEdit->setTop(WDate::currentDate());
    //m_pEndDateEdit->lineEdit()->validator()->setMandatory(true);
    m_pEndDateEdit->validator()->setMandatory(true);
    m_pEndDateEdit->setStyleClass("input-medium");

    /*
    WContainerWidget *corner_kick = new WContainerWidget(dateSelectForm );
    corner_kick->setStyleClass("corner_kick get_filter");
    WTemplate *button = new WTemplate("<ins class=\"i1\"></ins><ins class=\"i2\"></ins><ins class=\"i3\"></ins><ins class=\"i4\"></ins>${anchor}",corner_kick);
    LineEdit *submitBtn = new LineEdit(0,LineEdit::Submit);
    submitBtn->setValueText(tr("reports.filtered"));
    submitBtn->clicked().connect(boost::bind(&Reports::changed, this, submitBtn));
    button->bindWidget("anchor",submitBtn);
    */

    //WTemplate *button = new WTemplate("<ins class=\"i1\"></ins><ins class=\"i2\"></ins><ins class=\"i3\"></ins><ins class=\"i4\"></ins>${anchor}",dateSelectForm);
    WPushButton *anchor = new WPushButton(tr("reports.filtered"),dateSelectForm);
    anchor->clicked().connect(boost::bind(&Reports::changed, this, dateSelectForm));
    //button->bindWidget("anchor",anchor);
    //button->setStyleClass("corner_kick get_filter");


    //(new WLabel(tr("reports.filtered"), corner_kick))->setBuddy(new LineEdit(corner_kick,LineEdit::Submit));

}
开发者ID:ineron,项目名称:fit-zakaz-portal,代码行数:57,代码来源:Reports.cpp


示例15: WText

void SVConditionParam::createAddButton(int nRow)
{
    WText("  " , (WContainerWidget*) m_pOperate->elementAt(nRow, 1));
    WPushButton * pAdd = new WPushButton(SVResString::getResString("IDS_Add"), (WContainerWidget*) m_pOperate->elementAt(nRow, 1));
    if(pAdd)
    {
        pAdd->setToolTip(SVResString::getResString("IDS_Add_Title"));
        WObject::connect(pAdd, SIGNAL(clicked()), this, SLOT(addCondition()));
    }
}
开发者ID:,项目名称:,代码行数:10,代码来源:


示例16: setTemplateText

void AuthWidget::createLoggedInView()
{
  setTemplateText(tr("Wt.Auth.template.logged-in"));

  bindString("user-name", login_.user().identity(Identity::LoginName));  

  WPushButton *logout = new WPushButton(tr("Wt.Auth.logout"));
  logout->clicked().connect(this, &AuthWidget::logout);

  bindWidget("logout", logout);
}
开发者ID:913862627,项目名称:wt,代码行数:11,代码来源:AuthWidget.C


示例17: model_

TreeViewExample::TreeViewExample(WStandardItemModel *model,
				 const WString& titleText)
  : model_(model)
{
  belgium_ = model_->item(0, 0)->child(0, 0);

  new WText(titleText, this);

  /*
   * Now create the view
   */
  WPanel *panel = new WPanel(this);
  panel->resize(600, 300);
  panel->setCentralWidget(treeView_ = new WTreeView());
  if (!WApplication::instance()->environment().ajax())
    treeView_->resize(WLength::Auto, 290);

  treeView_->setAlternatingRowColors(true);
  treeView_->setRowHeight(25);
  treeView_->setModel(model_);

  treeView_->setColumnWidth(1, WLength(100));
  treeView_->setColumnAlignment(1, AlignCenter);
  treeView_->setColumnWidth(3, WLength(100));
  treeView_->setColumnAlignment(3, AlignCenter);

  /*
  treeView_->setRowHeaderCount(1);
  treeView_->setColumnWidth(0, 300);
  */

  /*
   * Expand the first (and single) top level node
   */
  treeView_->setExpanded(model->index(0, 0), true);
  treeView_->setExpanded(model->index(0, 0, model->index(0, 0)), true);

  /*
   * Setup some buttons to manipulate the view and the model.
   */
  WContainerWidget *wc = new WContainerWidget(this);
  WPushButton *b;
  
  b = new WPushButton("Toggle row height", wc);
  b->clicked().connect(this, &TreeViewExample::toggleRowHeight);
  b->setToolTip("Toggles row height between 31px and 25px");
  
  b = new WPushButton("Toggle stripes", wc);
  b->clicked().connect(this, &TreeViewExample::toggleStripes);
  b->setToolTip("Toggle alternating row colors");
  
  b = new WPushButton("Toggle root", wc);
  b->clicked().connect(this, &TreeViewExample::toggleRoot);
  b->setToolTip("Toggles root item between all and the first continent.");

  b = new WPushButton("Add rows", wc);
  b->clicked().connect(this, &TreeViewExample::addRows);
  b->setToolTip("Adds some cities to Belgium");
}
开发者ID:ReWeb3D,项目名称:wt,代码行数:59,代码来源:TreeViewExample.C


示例18: WPushButton

void Recaptcha::add_buttons() {
    WPushButton* u = new WPushButton(tr("wc.common.Update"), get_impl());
    u->clicked().connect(this, &AbstractCaptcha::update);
    WPushButton* get_image = new WPushButton(get_impl());
    get_image->addStyleClass("recaptcha_only_if_audio");
    get_image->setText(tr("wc.captcha.Get_image"));
    get_image->clicked().connect(this, &Recaptcha::get_image);
    WPushButton* get_audio = new WPushButton(get_impl());
    get_audio->addStyleClass("recaptcha_only_if_image");
    get_audio->setText(tr("wc.captcha.Get_audio"));
    get_audio->clicked().connect(this, &Recaptcha::get_audio);
}
开发者ID:NCAR,项目名称:wt-classes,代码行数:12,代码来源:Recaptcha.cpp


示例19: session_

EditUsers::EditUsers(dbo::Session& aSession, const std::string& basePath)
: session_(aSession), basePath_(basePath)
{
  setStyleClass("user-editor");
  setTemplateText(tr("edit-users-list"));
  limitEdit_  = new WLineEdit;
  WPushButton* goLimit = new WPushButton(tr("go-limit"));
  goLimit->clicked().connect(SLOT(this,EditUsers::limitList));
  bindWidget("limit-edit",limitEdit_);
  bindWidget("limit-button",goLimit);
  limitList();
}
开发者ID:DTidd,项目名称:wt,代码行数:12,代码来源:EditUsers.C


示例20: WApplication

WebGLDemo::WebGLDemo(const WEnvironment& env)
  : WApplication(env)
{
    std::string googAnalytics(" var _gaq = _gaq || [];"
                              "_gaq.push(['_setAccount', 'UA-22447986-1']);"
                              "_gaq.push(['_trackPageview']);"
                              ""
                              "(function() {"
                              "  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;"
                              "  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';"
                              "  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);"
                              "})();");

   doJavaScript(googAnalytics);
    setTitle("Demo");

    root()->addWidget(new WText("Wt/WebGL Lesson 11: Spheres, Rotation Matrices, and Mouse Events"));
    root()->addWidget(new WBreak());
    drawGLWidget_ = 0;

    video=new WHTML5Video(root());
    video->addSource("ladybug8.webm");
    video->setPoster("./moon.gif");
    video->load();


    WPushButton *button = new WPushButton("push to start",root());
    button->clicked().connect(this,&WebGLDemo::main);



  //Set up the Timer in order to animate the scene.
  //timer = new WTimer(drawGLWidget_);
  //timer->setInterval(25);
  //timer->start();
  //timer->timeout().connect(this,&WebGLDemo::animate);// */

    /////////////////////////////////////////////
    root()->addWidget(new WBreak());
    root()->addWidget(new WBreak());
    root()->addWidget(new WBreak());
    root()->addWidget(new WText("This demo has been developed by Vicomtech-IK4 Research Center"));

    root()->addWidget(new WBreak());
    root()->addWidget(new WText("Based on the learningwebgl.com lessons."));
    root()->addWidget(new WBreak());
    root()->addWidget(new WText("www.vicomtech.es"));

    //root()->addWidget(new WBreak());
    //root()->addWidget(new WImage("vicomLogoSm.png"));
    /////////////////////////////////////////////
}
开发者ID:ReWeb3D,项目名称:wt,代码行数:52,代码来源:lesson11.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ wt::WRectF类代码示例发布时间:2022-05-31
下一篇:
C++ WPoint类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap