本文整理汇总了C++中CLTGUITextCtrl::GetWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ CLTGUITextCtrl::GetWidth方法的具体用法?C++ CLTGUITextCtrl::GetWidth怎么用?C++ CLTGUITextCtrl::GetWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLTGUITextCtrl
的用法示例。
在下文中一共展示了CLTGUITextCtrl::GetWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
LTBOOL CMenuMgr::Init()
{
//build menu array
m_MenuArray.reserve(MENU_ID_UNASSIGNED);
//add menus here
m_MenuArray.push_back(&m_MenuSystem);
m_MenuArray.push_back(&m_MenuMission);
m_MenuArray.push_back(&m_MenuInventory);
m_MenuArray.push_back(&m_MenuKeys);
m_MenuArray.push_back(&m_MenuIntel);
m_MenuArray.push_back(&m_MenuPlayer);
//init menus
MenuArray::iterator iter = m_MenuArray.begin();
while (iter != m_MenuArray.end())
{
if (!(*iter)->Init())
return LTFALSE;
iter++;
}
m_fSlideInTime = g_pLayoutMgr->GetMenuSlideInTime();
m_fSlideOutTime = g_pLayoutMgr->GetMenuSlideOutTime();
m_nMenuPos = g_pLayoutMgr->GetMenuPosition();
char szTemp[128];
char *pTag = "Menu";
g_pLayoutMgr->GetString(pTag,"SlideInSound",szTemp,sizeof(szTemp));
m_sSlideInSound = szTemp;
g_pLayoutMgr->GetString(pTag,"SlideOutSound",szTemp,sizeof(szTemp));
m_sSlideOutSound = szTemp;
g_pLayoutMgr->GetString(pTag,"Bar",szTemp,sizeof(szTemp));
HTEXTURE hBar = g_pInterfaceResMgr->GetTexture(szTemp);
g_pLayoutMgr->GetString(pTag,"BarTip",szTemp,sizeof(szTemp));
HTEXTURE hBarTip = g_pInterfaceResMgr->GetTexture(szTemp);
LTIntPt size = g_pLayoutMgr->GetPoint(pTag,"BarSize");
uint8 fontFace = (uint8)g_pLayoutMgr->GetInt(pTag,"BarFont");
uint8 fontSize = (uint8)g_pLayoutMgr->GetInt(pTag,"BarFontSize");
m_nBarPos = g_pLayoutMgr->GetInt(pTag,"BarPosition");
int nBarSpacing = g_pLayoutMgr->GetInt(pTag,"BarSpacing");
LTVector vCol = g_pLayoutMgr->GetVector(pTag,"BarSelectColor");
uint8 nR = (uint8)vCol.x;
uint8 nG = (uint8)vCol.y;
uint8 nB = (uint8)vCol.z;
g_nSelectColor = SET_ARGB(0xFF,nR,nG,nB);
m_MenuBar.Init(hBar,hBarTip,size);
m_MenuBar.SetBasePos(LTIntPt(0,m_nBarPos));
CUIFont* pFont = g_pInterfaceResMgr->GetFont(fontFace);
LTIntPt offset(nBarSpacing,(size.y-fontSize)/2);
for (uint8 i =0; i < m_MenuArray.size(); i++)
{
CLTGUITextCtrl *pCtrl = debug_new(CLTGUITextCtrl);
CBaseMenu *pMenu = m_MenuArray[i];
pCtrl->Create(pMenu->GetTitle(),i,NULL,pFont,fontSize,&m_MenuBar);
pCtrl->SetColors(g_nSelectColor,argbBlack,argbWhite);
pCtrl->SetParam1(pMenu->GetMenuID());
m_MenuBar.AddControl(pCtrl,offset);
offset.x += nBarSpacing + pCtrl->GetWidth();
}
return LTTRUE;
}