本文整理汇总了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();
}
示例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)
}
示例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
}
示例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();
}
}