本文整理汇总了C++中CLTGUICtrl类的典型用法代码示例。如果您正苦于以下问题:C++ CLTGUICtrl类的具体用法?C++ CLTGUICtrl怎么用?C++ CLTGUICtrl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CLTGUICtrl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AdjustControlFrame
void CScreenConfigure::AdjustControlFrame()
{
if (m_nType >= kNumCommandTypes)
{
m_pFrame->Show(LTFALSE);
return;
}
uint16 nWd = m_nActionWidth + m_nEqualsWidth + m_nCommandWidth;
m_pFrame->Show(LTTRUE);
m_pList[m_nType]->CalculatePositions();
LTIntPt listpos = m_pList[m_nType]->GetBasePos();
uint16 i = m_pList[m_nType]->GetNumControls() - 1;
CLTGUICtrl *pCtrl = m_pList[m_nType]->GetControl(i);
if (pCtrl)
{
LTIntPt pos = pCtrl->GetBasePos();
uint16 nHt = (pos.y - listpos.y) + pCtrl->GetBaseHeight() + 4;
m_pFrame->SetSize(nWd+8,nHt);
m_pList[m_nType]->SetHeight(nHt);
}
}
示例2: GetControl
LTBOOL CFolderWeaponControls::OnRButtonUp(int x, int y)
{
// Get the control that the click was on
int nControlIndex=0;
if (GetControlUnderPoint(x, y, &nControlIndex))
{
CLTGUICtrl* pCtrl = GetControl(nControlIndex);
if (pCtrl && pCtrl->GetParam1())
{
CLTGUIColumnTextCtrl *pColumn=(CLTGUIColumnTextCtrl *)pCtrl;
int nAct = pCtrl->GetParam1()-1;
m_nActions[nAct] = GetPreviousCommand(m_nActions[nAct]);
int nWeaponId = g_pWeaponMgr->GetWeaponId(m_nActions[nAct]);
WEAPON *pWeapon = g_pWeaponMgr->GetWeapon(nWeaponId);
if (pWeapon)
pColumn->SetString(1,pWeapon->nNameId);
else
pColumn->SetString(1,IDS_CONTROL_UNASSIGNED);
UpdateSelection();
return LTTRUE;
}
}
return CBaseFolder::OnRButtonUp(x, y);
}
示例3: GetSelectedControl
// Override the left and right controls so that the volumes can be changed
LTBOOL CScreenAudio::OnLeft()
{
LTBOOL handled = LTFALSE;
CLTGUICtrl* pCtrl = GetSelectedControl();
if (pCtrl)
handled = pCtrl->OnLeft();
if (handled)
{
if (pCtrl == m_pMusicVolumeCtrl)
{
UpdateData(LTTRUE);
m_pMusicQualityCtrl->Enable(m_bMusicEnabled && m_nMusicVolume > MUSIC_MIN_VOL);
SaveSoundSettings();
}
else if (pCtrl == m_pMusicQualityCtrl)
ConfirmQualityChange(true);
else if (pCtrl == m_pSoundQualityCtrl)
ConfirmQualityChange(false);
else
SaveSoundSettings();
g_pInterfaceMgr->RequestInterfaceSound(IS_SELECT);
}
return handled;
}
示例4: GetControl
LTBOOL CFolderIntel::UpdateSelection()
{
LTBOOL bChanged = CBaseSelectionFolder::UpdateSelection();
if (bChanged)
{
CLTGUICtrl *pCtrl = GetControl(m_nLastListItem);
if (!pCtrl) return LTFALSE;
int nIndex = pCtrl->GetParam1();
if (!nIndex) return LTFALSE;
IntelItem *pItem = m_intelArray[nIndex-1];
HSTRING hStr = g_pLTClient->FormatString(pItem->nID);
m_pDescription->SetString(hStr);
g_pLTClient->FreeString(hStr);
CScaleFX* pScaleFX = g_pFXButeMgr->GetScaleFX(pItem->nType);
SAFE_STRCPY(m_szModel, pScaleFX->szFile);
SAFE_STRCPY(m_szSkin, pScaleFX->szSkin);
m_vScale = pScaleFX->vInitialScale;
m_bChromakey = pScaleFX->bChromakey;
if (pScaleFX->fDirOffset > 0.0f)
{
LTFLOAT fScaleMult = (100.0f/pScaleFX->fDirOffset);
VEC_MULSCALAR(m_vScale, m_vScale, fScaleMult);
}
CreateModelSFX();
}
return bChanged;
}
示例5: GetSelectedControl
LTBOOL CScreenDisplay::OnRight()
{
if (!CBaseScreen::OnRight()) return LTFALSE;
CLTGUICtrl* pCtrl = GetSelectedControl();
if (pCtrl == m_pHardwareCursor)
{
m_pHardwareCursor->UpdateData(LTTRUE);
if (m_bHardwareCursor)
{
MBCreate mb;
mb.eType = LTMB_YESNO;
mb.pFn = AreYouSureCallBack;
mb.pData = this;
g_pInterfaceMgr->ShowMessageBox(IDS_CONFIRM_CURSOR,&mb,0,LTFALSE);
}
else
{
g_pCursorMgr->UseHardwareCursor(LTFALSE);
WriteConsoleInt("HardwareCursor",0);
}
}
if (pCtrl == m_pGamma)
{
pCtrl->UpdateData();
float fGamma = ConvertToGamma(m_nGamma);
WriteConsoleFloat("GammaR",fGamma);
WriteConsoleFloat("GammaG",fGamma);
WriteConsoleFloat("GammaB",fGamma);
}
return LTTRUE;
}
示例6: GetSelectedControl
void CFolderWeaponControls::UpdateSelection()
{
CLTGUICtrl *pCtrl = GetSelectedControl();
if (!pCtrl) return;
int nComm = pCtrl->GetParam1();
if (!nComm) return;
uint8 nWeaponId = g_pWeaponMgr->GetWeaponId(m_nActions[nComm-1]);
if (nWeaponId != nLastId)
{
WEAPON* pWeapon = g_pWeaponMgr->GetWeapon(nWeaponId);
if (pWeapon)
{
SAFE_STRCPY(m_szModel, pWeapon->szInterfaceModel);
SAFE_STRCPY(m_szSkin, pWeapon->szInterfaceSkin);
VEC_COPY(m_vOffset, pWeapon->vInterfaceOffset);
m_fScale = pWeapon->fInterfaceScale;
CreateModelSFX();
}
nLastId = nWeaponId;
}
}
示例7: GetSelectedControl
bool CScreenDisplay::OnRight()
{
if (!CBaseScreen::OnRight()) return false;
CLTGUICtrl* pCtrl = GetSelectedControl();
if (pCtrl == m_pGamma)
{
pCtrl->UpdateData();
float fGamma = ConvertToGamma(m_nGamma);
WriteConsoleFloat("GammaR",fGamma);
WriteConsoleFloat("GammaG",fGamma);
WriteConsoleFloat("GammaB",fGamma);
}
return true;
}
示例8: GetControl
LTBOOL CFolderDisplay::OnRButtonUp(int x, int y)
{
// Get the control that the click was on
int nControlIndex=0;
if (GetControlUnderPoint(x, y, &nControlIndex))
{
CLTGUICtrl* pCtrl = GetControl(nControlIndex);
if (m_pCaptureCtrl && pCtrl != m_pCaptureCtrl)
return LTFALSE;
// If the mouse is over the same control now as it was when the down message was called
// then send the "left" message to the control.
if (nControlIndex == m_nRMouseDownItemSel)
{
if (pCtrl->IsEnabled())
{
if (GetSelectedControl() == m_pRendererCtrl)
{
// Get the current resolution
FolderDisplayResolution currentResolution=GetCurrentSelectedResolution();
LTBOOL handled = pCtrl->OnRButtonUp(x,y);
if (handled)
{
SetupResolutionCtrl();
// Set the resolution for the control
SetCurrentCtrlResolution(currentResolution);
}
return handled;
}
else if (pCtrl == m_pHardwareCursor)
{
return OnLeft();
}
else
{
SetSelection(nControlIndex);
return CBaseFolder::OnRButtonUp(x,y);
}
}
}
}
else
{
m_nRMouseDownItemSel= kNoSelection;
}
return LTFALSE;
}
示例9: switch
// Handle a keypress
LTBOOL CScreenConfigure::HandleKeyDown(int key, int rep)
{
LTBOOL handled = LTFALSE;
switch (key)
{
case VK_DELETE:
{
// Unassign the key
if (!m_bWaitingForKey && !m_fInputPauseTimeLeft)
{
CLTGUICtrl *pCtrl = m_pList[m_nType]->GetSelectedControl();
int nCommand = pCtrl->GetParam1();
CBindingData* pData = m_pProfile->FindBinding(nCommand);
UnBind( pData->nDeviceObjectId[0], NULL, DEVICETYPE_KEYBOARD);
UnBind( 0, pData->strTriggerName[1], DEVICETYPE_MOUSE);
if (g_pGameClientShell->HasGamepad())
UnBind( 0, pData->strTriggerName[2], DEVICETYPE_GAMEPAD);
else if (g_pGameClientShell->HasJoystick())
UnBind(0, pData->strTriggerName[2], DEVICETYPE_JOYSTICK);
else
UnBind(0, pData->strTriggerName[2], DEVICETYPE_UNKNOWN);
SetControlText(pCtrl);
handled = LTTRUE;
}
break;
}
}
// Check to see if the base class is handling this key
if (m_bWaitingForKey || m_fInputPauseTimeLeft)
return handled;
if (!handled)
{
handled = CBaseScreen::HandleKeyDown(key, rep);
}
// Handled the key
return handled;
}
示例10: 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);
}
}
}
}
}
示例11: GetControlUnderPoint
// Handles the mouse move message
LTBOOL CListCtrl::OnMouseMove(int x, int y)
{
x += g_pInterfaceResMgr->GetXOffset();
y += g_pInterfaceResMgr->GetYOffset();
int nControlUnderPoint=0;
CLTGUICtrl *pCtrl = GetControlUnderPoint(x, y, &nControlUnderPoint);
if (m_pUp && CanScrollUp())
m_pUp->Select(pCtrl == m_pUp);
if (m_pDown && CanScrollDown())
m_pDown->Select(pCtrl == m_pDown);
// If m_bEnableMouseMoveSelect is TRUE then select the item that the mouse is over
if (m_bEnableMouseMoveSelect)
{
if(pCtrl && nControlUnderPoint >= 0)
{
// Make sure we're enabled
if(!pCtrl->IsEnabled())
return LTFALSE;
if (GetSelectedItem() != nControlUnderPoint)
{
SelectItem(nControlUnderPoint);
return LTTRUE;
}
}
else
{
/*
//if not on anything select nothing
if ( m_nCurrentIndex < (int)m_controlArray.GetSize() )
{
m_controlArray[m_nCurrentIndex]->Select(FALSE);
}
m_nCurrentIndex = kNoSelection;
*/
}
}
return LTFALSE;
}
示例12: GetControl
bool CScreenDisplay::OnRButtonUp(int x, int y)
{
uint16 nControlIndex=0;
if (GetControlUnderPoint(x, y, &nControlIndex))
{
CLTGUICtrl* pCtrl = GetControl(nControlIndex);
if (pCtrl == m_pGamma)
{
if (!pCtrl->OnRButtonUp(x,y)) return false;
pCtrl->UpdateData();
float fGamma = ConvertToGamma(m_nGamma);
WriteConsoleFloat("GammaR",fGamma);
WriteConsoleFloat("GammaG",fGamma);
WriteConsoleFloat("GammaB",fGamma);
return true;
}
}
return CBaseScreen::OnRButtonUp(x, y);
}
示例13: GetControl
LTBOOL CScreenDisplay::OnRButtonUp(int x, int y)
{
uint16 nControlIndex=0;
if (GetControlUnderPoint(x, y, &nControlIndex))
{
CLTGUICtrl* pCtrl = GetControl(nControlIndex);
if (pCtrl == m_pHardwareCursor)
{
return OnLeft();
}
if (pCtrl == m_pGamma)
{
if (!pCtrl->OnRButtonUp(x,y)) return LTFALSE;
pCtrl->UpdateData();
float fGamma = ConvertToGamma(m_nGamma);
WriteConsoleFloat("GammaR",fGamma);
WriteConsoleFloat("GammaG",fGamma);
WriteConsoleFloat("GammaB",fGamma);
return LTTRUE;
}
}
return CBaseScreen::OnRButtonUp(x, y);
}
示例14: HideSubMenu
void CMenuMgr::SwitchToMenu(CBaseMenu *pNewMenu)
{
if (!pNewMenu || !pNewMenu->IsEnabled())
return;
if (m_pSubMenu)
{
HideSubMenu(true);
}
// Tell the old menu that it is losing focus
if (m_pCurrentMenu)
{
m_pCurrentMenu->OnFocus(LTFALSE);
}
m_pLastMenu = m_pCurrentMenu;
m_pCurrentMenu=pNewMenu;
// Tell the new menu that it is gaining focus
if (pNewMenu)
{
LTIntPt tmp = pNewMenu->GetBasePos();
tmp.y = 0;
pNewMenu->SetBasePos(tmp);
pNewMenu->OnFocus(LTTRUE);
m_MenuBar.SetScale(g_pInterfaceResMgr->GetXRatio());
for (uint8 i =0; i < m_MenuArray.size(); i++)
{
CLTGUICtrl* pCtrl = m_MenuBar.GetControl(i);
pCtrl->Enable(i != m_nMenuIndex);
}
}
}
示例15: UpdateEditOK
bool CMessageBox::HandleKeyDown(int key, int rep)
{
// XENON: Currently disabled in Xenon builds
#if !defined(PLATFORM_XENON)
if (!m_bVisible) return false;
if (m_eType == LTMB_EDIT)
{
//special handling for right and left arrows so that they may cycle through controls
// when the edit box is not selected
if (m_Dlg.GetSelectedControl() != m_pEdit)
{
if (key == VK_LEFT)
return m_Dlg.OnUp();
if (key == VK_RIGHT)
return m_Dlg.OnDown();
}
if (m_pEdit->HandleKeyDown(key,rep))
{
UpdateEditOK();
return true;
}
}
bool handled = false;
switch (key)
{
case VK_LEFT:
case VK_UP:
{
handled = m_Dlg.OnUp();
break;
}
case VK_RIGHT:
case VK_DOWN:
{
handled = m_Dlg.OnDown();
break;
}
case VK_RETURN:
{
handled = m_Dlg.OnEnter();
break;
}
case VK_ESCAPE:
{
if (!m_bIgnoreEsc)
{
Close(false);
handled = true;
}
break;
}
default:
{
if (m_nHotKey > 0 && key == m_nHotKey)
{
Close(true);
handled = true;
}
else
{
CLTGUICtrl* pCtrl = m_Dlg.GetSelectedControl();
if (pCtrl)
handled = pCtrl->HandleKeyDown(key,rep);
else
handled = false;
break;
}
}
}
// Handled the key
return handled;
#else // PLATFORM_XENON
return false;
#endif // PLATFORM_XENON
}