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


C++ WPushButton::disable方法代码示例

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


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

示例1: revengeProposed

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: processCreateNewGameButton

void menuWidget::processCreateNewGameButton(WPushButton *b)
{
    //stuff that requires database connection
    //if everything's fine, database return info (let's say "true")
    //and we can proceed
    information->setText("New game created, waiting for another player");
    gamePointer =  gamesConnector->newGame(*this);
    joined = false;
    ifCreator = true;
    endConnection->show();
    showGames->disable();
    gamesAvailable->hide();
    success->show();
    newGameButton->disable();
    startGame->disable();
    startGame->show();
    highScoresButton->hide();
    endGame->enable();
    endConnection->hide();
    success->hide();

    if(newGameButton) newGameButton->hide();
    showGames->hide();


    //preparing the game screen (nothing interesting above)
    gameButtons.clear();
    everything->clear();
    delete everything;
    everything = new WTable(this);
    //everything->setStyleClass("myStyle");
    for(int i = 0; i<SIZE; i++)
    {
        for(int j = 0; j<SIZE; j++) {
            WPushButton * newButton = new WPushButton();
            newButton->resize(35,35); //images are 30x30, just in case
            newButton->disable();
            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)
    }
    map<Coordinates,WPushButton*>::iterator it;
    for(it  = gameButtons.begin(); it!=gameButtons.end(); it++)
    {
        it->second->disable();
    }
    endGame->show();
    giveUp->show();
    revenge->show();
    revenge->disable();
    gamesConnector->unregister(*this);
    //adding two buttons on the right (End Game and Take Revenge)
}
开发者ID:micp,项目名称:ZPR,代码行数:55,代码来源:menuWidget.cpp

示例3: processRevengeButton

void menuWidget::processRevengeButton(WPushButton * b)
{
    information->setText("Revenge proposed. Press start to begin");
    gamePointer->revenge(*this);
    map<Coordinates,WPushButton*>::iterator it;
    for(it = gameButtons.begin(); it!=gameButtons.end(); it++)
    {
        removeWidget(it->second);
    }
    success->hide();
    startGame->enable();
    //preparing the scene (nothing interesting above)
    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)
    }

    revenge->disable();
    addWidget(endGame);
    addWidget(giveUp);
    addWidget(revenge);
    //we need to clear all modifications that was made on the game Buttons

}
开发者ID:micp,项目名称:ZPR,代码行数:36,代码来源:menuWidget.cpp

示例4: processChooseGameButton

void menuWidget::processChooseGameButton(WPushButton *b)
{
    information->setText("Press start game");
    endConnection->show();
    showGames->disable();
    gamesAvailable->hide();
    success->show();
    newGameButton->disable();
    startGame->enable();
    startGame->show();
    highScoresButton->hide();
    endGame->enable();
    endConnection->hide();
    success->hide();

    if(gamesAvailable) gamesAvailable->hide();
    if(newGameButton) newGameButton->hide();
    showGames->hide();
    int i;
    for( i = 0; i < joinButtons.size(); i++)
    {
        if(joinButtons[i].first == b)
            break;
    }

    gamePointer = gamesConnector->join(joinButtons[i].second, *this);
    //preparing the game screen (nothing interesting above)
    gameButtons.clear();
    removeWidget(everything);
    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->resize(35,35); //images are 30x30, just in case
            newButton->disable();
            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)
    }
    endGame->show();
    giveUp->show();
    revenge->show();
    revenge->disable();
    addWidget(everything);
    //adding two buttons on the right (End Game and Take Revenge)
    vector<std::pair<WPushButton*,GamesConnector::const_iterator> >::iterator it;
    for(it = joinButtons.begin(); it!=joinButtons.end(); ++it)
    {
        it->first->disable();
        //(*it)->hide();
        it->first->hide();
    }



}
开发者ID:micp,项目名称:ZPR,代码行数:61,代码来源:menuWidget.cpp


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