本文整理汇总了C++中ToggleButton::SetTag方法的典型用法代码示例。如果您正苦于以下问题:C++ ToggleButton::SetTag方法的具体用法?C++ ToggleButton::SetTag怎么用?C++ ToggleButton::SetTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToggleButton
的用法示例。
在下文中一共展示了ToggleButton::SetTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mRoot
TicTacToeLogic::TicTacToeLogic(Noesis::Gui::FrameworkElement* uiRoot): mRoot(uiRoot)
{
NS_ASSERT(mRoot);
mBoardPanel = NsStaticCast<FrameworkElement*>(mRoot->FindName("Board"));
NS_ASSERT(mBoardPanel);
mBoardPanel->MouseLeftButtonDown() += MakeDelegate(this, &TicTacToeLogic::BoardClicked);
for (NsSize row = 0; row < 3; ++row)
{
for (NsSize col = 0; col < 3; ++col)
{
NsString cellName = NsString::Format("Cell%u%u", row, col);
ToggleButton* btn = NsStaticCast<ToggleButton*>(mRoot->FindName(cellName.c_str()));
NS_ASSERT(btn);
Cell& cell = mBoard[row][col];
cell.btn = btn;
Ptr<Boxing::BoxedValue> boxedCell = Boxing::Box<Cell*>(&cell);
btn->SetTag(boxedCell.GetPtr());
btn->SetIsEnabled(false);
btn->Checked() += MakeDelegate(this, &TicTacToeLogic::CellChecked);
}
}
mStatusText = NsStaticCast<TextBlock*>(mRoot->FindName("StatusText"));
NS_ASSERT(mStatusText);
mScorePlayer1Text = NsStaticCast<TextBlock*>(mRoot->FindName("ScorePlayer1"));
NS_ASSERT(mScorePlayer1Text);
mScorePlayer2Text = NsStaticCast<TextBlock*>(mRoot->FindName("ScorePlayer2"));
NS_ASSERT(mScorePlayer2Text);
mScoreTiesText = NsStaticCast<TextBlock*>(mRoot->FindName("ScoreTies"));
NS_ASSERT(mScoreTiesText);
mScoreText = 0;
Ptr<ResourceKeyString> key;
key = ResourceKeyString::Create("WinAnim");
mWinAnimation = NsStaticCast<Storyboard*>(mRoot->FindResource(key.GetPtr()));
mWinAnimation->Completed() += MakeDelegate(this, &TicTacToeLogic::WinAnimationCompleted);
key = ResourceKeyString::Create("TieAnim");
mTieAnimation = NsStaticCast<Storyboard*>(mRoot->FindResource(key.GetPtr()));
mTieAnimation->Completed() += MakeDelegate(this, &TicTacToeLogic::TieAnimationCompleted);
key = ResourceKeyString::Create("ResetAnim");
mResetAnimation = NsStaticCast<Storyboard*>(mRoot->FindResource(key.GetPtr()));
mResetAnimation->Completed() += MakeDelegate(this, &TicTacToeLogic::ResetAnimationCompleted);
key = ResourceKeyString::Create("ProgressAnim");
mProgressAnimation = NsStaticCast<Storyboard*>(mRoot->FindResource(key.GetPtr()));
key = ResourceKeyString::Create("ProgressFadeAnim");
mProgressFadeAnimation = NsStaticCast<Storyboard*>(mRoot->FindResource(key.GetPtr()));
mProgressFadeAnimation->Completed() += MakeDelegate(this,
&TicTacToeLogic::ProgressFadeAnimationCompleted);
key = ResourceKeyString::Create("ScoreHalfAnim");
mScoreHalfAnimation = NsStaticCast<Storyboard*>(mRoot->FindResource(key.GetPtr()));
mScoreHalfAnimation->Completed() += MakeDelegate(this,
&TicTacToeLogic::ScoreHalfAnimationCompleted);
key = ResourceKeyString::Create("ScoreEndAnim");
mScoreEndAnimation = NsStaticCast<Storyboard*>(mRoot->FindResource(key.GetPtr()));
key = ResourceKeyString::Create("StatusHalfAnim");
mStatusHalfAnimation = NsStaticCast<Storyboard*>(mRoot->FindResource(key.GetPtr()));
mStatusHalfAnimation->Completed() += MakeDelegate(this,
&TicTacToeLogic::StatusHalfAnimationCompleted);
key = ResourceKeyString::Create("StatusEndAnim");
mStatusEndAnimation = NsStaticCast<Storyboard*>(mRoot->FindResource(key.GetPtr()));
mStatusText->SetText("Player 1 Turn");
mPlayer = Player_1;
mLastStarterPlayer = Player_1;
mScorePlayer1 = 0;
mScorePlayer2 = 0;
mScoreTies = 0;
mScore = 0;
StartGame();
}