本文整理汇总了C++中CheckBox::SetChecked方法的典型用法代码示例。如果您正苦于以下问题:C++ CheckBox::SetChecked方法的具体用法?C++ CheckBox::SetChecked怎么用?C++ CheckBox::SetChecked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CheckBox
的用法示例。
在下文中一共展示了CheckBox::SetChecked方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleLayoutUpdated
/// Handle layout updated by adjusting the position of the overlays.
void HandleLayoutUpdated(StringHash eventType, VariantMap& eventData)
{
// Adjust the container size for child clipping effect
overlayContainer_->SetSize(GetParent()->GetSize());
for (unsigned i = 0; i < children_.Size(); ++i)
{
const IntVector2& position = children_[i]->GetPosition();
CheckBox* overlay = overlayContainer_->GetChildStaticCast<CheckBox>(i);
bool visible = children_[i]->IsVisible() && GetItemHierarchyParent(children_[i]);
overlay->SetVisible(visible);
if (visible)
{
overlay->SetPosition(position.x_, position.y_);
overlay->SetChecked(GetItemExpanded(children_[i]));
}
}
}
示例2: Run
bool InGameMenu::Run()
{
this->mSets[IGNBACKGROUND].AddSetToRenderer(this->mGe);
this->mSets[INGAMEMENU].AddSetToRenderer(this->mGe);
this->mIsRunning = true;
bool IsClicked = false;
bool mousePressed = false;
GUIEvent *returnEvent = NULL;
this->mGe->GetKeyListener()->KeyUp(VK_ESCAPE);
CursorControl cc;
cc.SetVisibility(true);
while(this->mIsRunning)
{
/*If mouse is clicked*/
if(IsClicked && !mousePressed)
{
mousePressed = true;
}
this->mGe->Update();
IsClicked = this->mGe->GetKeyListener()->IsClicked(1);
D3DXVECTOR2 mousePos;
mousePos = this->mGe->GetKeyListener()->GetMousePosition();
returnEvent = this->mSets[this->mCurrentSet].UpdateAndCheckCollision(mousePos.x, mousePos.y, IsClicked, this->mGe);
if(returnEvent == NULL)
returnEvent = this->mSets[this->mSubSet].UpdateAndCheckCollision(mousePos.x, mousePos.y, IsClicked, this->mGe);
if(returnEvent != NULL)
{
if(returnEvent->GetEventMessage() == "ChangeSetEvent")
{
ChangeSetEvent* temp = (ChangeSetEvent*)returnEvent;
int whatSet = temp->GetSet();
if(whatSet == IGNQUIT)
{
this->mSets[this->mCurrentSet].RemoveSetFromRenderer(this->mGe);
this->mSets[this->mSubSet].RemoveSetFromRenderer(this->mGe);
this->mIsRunning = false;
return false;
}
if(whatSet == IGNRESUME)
{
this->mSets[this->mCurrentSet].RemoveSetFromRenderer(this->mGe);
this->mSets[this->mSubSet].RemoveSetFromRenderer(this->mGe);
this->mIsRunning = false;
return true;
}
if(whatSet == IGNOPTIONS)
{
this->mSets[this->mCurrentSet].RemoveSetFromRenderer(this->mGe);
this->mSets[this->mSubSet].RemoveSetFromRenderer(this->mGe);
this->mCurrentSet = IGNOPTIONS;
this->mSets[this->mCurrentSet].AddSetToRenderer(this->mGe);
this->mSets[this->mSubSet].AddSetToRenderer(this->mGe);
}
if(whatSet == INGAMEMENU)
{
this->mSets[this->mCurrentSet].RemoveSetFromRenderer(this->mGe);
this->mSets[this->mSubSet].RemoveSetFromRenderer(this->mGe);
this->mCurrentSet = INGAMEMENU;
this->mSets[this->mCurrentSet].AddSetToRenderer(this->mGe);
}
}
else if(returnEvent->GetEventMessage() == "ChangeSubSetEvent")
{
this->mSets[this->mSubSet].RemoveSetFromRenderer(this->mGe);
ChangeSubSetEvent* tempReturnEvent = (ChangeSubSetEvent*)returnEvent;
int tempEventSet = tempReturnEvent->GetSet();
if(tempEventSet == IGNOPTIONS_SOUND)
{
CheckBox* temp = this->mSets[IGNOPTIONS_SOUND].GetCheckBox("Sound");
temp->SetChecked(GameOptions::isPlaying);
}
int set = tempReturnEvent->GetSet();
this->mSubSet = set;
this->mSets[this->mSubSet].AddSetToRenderer(this->mGe);
int menuChangeTime = 50;
while(menuChangeTime > 0)
menuChangeTime -= (int)this->mGe->Update();
}
else if(returnEvent->GetEventMessage() == "ChangeOptionEvent")
{
ChangeOptionEvent* tempReturnEvent = (ChangeOptionEvent*)returnEvent;
if(tempReturnEvent->GetOption() == "Sound")
{
if(tempReturnEvent->GetValue() == "true")
{
GameOptions::songPlaying->Unmute();
GameOptions::isPlaying = true;
}
else
{
GameOptions::songPlaying->Mute();
GameOptions::isPlaying = false;
//.........这里部分代码省略.........