本文整理汇总了C++中CLTGUICtrl::SetColors方法的典型用法代码示例。如果您正苦于以下问题:C++ CLTGUICtrl::SetColors方法的具体用法?C++ CLTGUICtrl::SetColors怎么用?C++ CLTGUICtrl::SetColors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLTGUICtrl
的用法示例。
在下文中一共展示了CLTGUICtrl::SetColors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnableMenuBar
void CMenuMgr::EnableMenuBar(bool bEnable/*=true*/, uint32 nMenuFlags/*=MB_ALL*/)
{
// Determine the state of each control based on the flags passed...
uint32 MBCtrlFlags[MB_NUM_CTRLS] =
{
MB_SYSTEM,
MB_MISSION,
MB_INVENTORY,
MB_KEYS,
MB_INTEL,
MB_PLAYER
};
if (!IsCoopMultiplayerGameType())
{
nMenuFlags &= ~(MB_MISSION & MB_KEYS & MB_INTEL & MB_PLAYER);
}
for (int i=0; i < MB_NUM_CTRLS; i++)
{
CLTGUICtrl* pCtrl = m_MenuBar.GetControl(i);
if (pCtrl)
{
if (MBCtrlFlags[i] & nMenuFlags)
{
pCtrl->Enable(bEnable);
}
else
{
pCtrl->Enable(!bEnable);
}
// Okay this is pretty much a hack since we use the disabled state to
// really specify a selected control (see CMenuMgr::SwitchToMenu()), but in the
// case of Enable = true we really want the menu bar to be disabled, we'll handle
// this here by changing the color of the disabled state...
if (pCtrl->IsDisabled())
{
pCtrl->SetColors(g_nSelectColor,argbBlack,argbGray);
}
else
{
// Control is enabled, so we'll set it's "disabled" color to white...
pCtrl->SetColors(g_nSelectColor,argbBlack,argbWhite);
// We need to disable the current menu control here using the new
// color (i.e., it will appear white signifying it is actually
// the current control)...
if (i == m_nMenuIndex)
{
pCtrl->Enable(false);
}
}
}
}
}