本文整理汇总了C++中CLTGUITextCtrl::SetAlignment方法的典型用法代码示例。如果您正苦于以下问题:C++ CLTGUITextCtrl::SetAlignment方法的具体用法?C++ CLTGUITextCtrl::SetAlignment怎么用?C++ CLTGUITextCtrl::SetAlignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLTGUITextCtrl
的用法示例。
在下文中一共展示了CLTGUITextCtrl::SetAlignment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Build
// Build the screen
bool CScreenProfile::Build()
{
// Set the title's text
CreateTitle("IDS_TITLE_PROFILE");
CLTGUICtrl_create cs;
cs.rnBaseRect.m_vMin.Init();
cs.rnBaseRect.m_vMax = LTVector2n(m_ScreenRect.GetWidth(),g_pLayoutDB->GetInt32(m_hLayout,LDB_ScreenFontSize));
m_pCurrent = AddTextItem(L" ", cs, true);
cs.nCommandID = CMD_CREATE;
cs.szHelpID = "IDS_HELP_PROFILE_CREATE";
AddTextItem("IDS_CREATE", cs );
cs.nCommandID = CMD_LOAD;
cs.szHelpID = "IDS_HELP_PROFILE_LOAD";
AddTextItem("IDS_LOAD", cs);
cs.nCommandID = CMD_DELETE;
cs.szHelpID = "IDS_HELP_PROFILE_DELETE";
m_pDelete = AddTextItem("IDS_DELETE", cs);
LTRect2n dlgRect = g_pLayoutDB->GetRect(m_hLayout,LDB_ScreenDialogRect);
std::string sDlgFont = g_pLayoutDB->GetFont(m_hLayout,LDB_ScreenDialogFont);
uint8 nDlgFontSz = ( uint8 )g_pLayoutDB->GetInt32(m_hLayout,LDB_ScreenDialogSize);
sListFont = g_pLayoutDB->GetListFont(m_hLayout,0);
nListFontSz = g_pLayoutDB->GetListSize(m_hLayout,0);
CLTGUICtrl_create dcs;
dcs.rnBaseRect = dlgRect;
m_pDlg = debug_new(CLTGUIWindow);
m_pDlg->Create(TextureReference(g_pLayoutDB->GetString(m_hLayout,LDB_ScreenDialogFrame)),dcs);
LTVector2n tmp(8,8);
cs.nCommandID = NULL;
cs.szHelpID = "";
CLTGUITextCtrl *pCtrl = CreateTextItem("IDS_PROFILE_LIST", cs, true, sDlgFont.c_str(), nDlgFontSz);
m_pDlg->AddControl(pCtrl, tmp);
tmp.y += 24;
CLTGUIListCtrl_create listCs;
listCs.rnBaseRect.m_vMin.Init();
listCs.rnBaseRect.Right() = kDlgWd - 48;
listCs.rnBaseRect.Bottom() = kDlgWd - 64;
listCs.bArrows = true;
listCs.vnArrowSz = g_pLayoutDB->GetListArrowSize(m_hLayout,0);
m_pListCtrl = CreateList(listCs);
if (m_pListCtrl)
{
m_pListCtrl->SetIndent(g_pLayoutDB->GetListIndent(m_hLayout,0));
TextureReference hFrame(g_pLayoutDB->GetListFrameTexture(m_hLayout,0,0));
TextureReference hSelFrame(g_pLayoutDB->GetListFrameTexture(m_hLayout,0,1));
m_pListCtrl->SetFrame(hFrame,hSelFrame,g_pLayoutDB->GetListFrameExpand(m_hLayout,0));
m_pListCtrl->Show(true);
m_pDlg->AddControl(m_pListCtrl, tmp);
}
cs.nCommandID = CMD_CANCEL;
cs.szHelpID = "";
cs.rnBaseRect.Bottom() = nDlgFontSz;
cs.rnBaseRect.Right() = kDlgWd / 2;
pCtrl = CreateTextItem("IDS_CANCEL", cs, false, sDlgFont.c_str(), nDlgFontSz);
pCtrl->SetAlignment(kCenter);
tmp.x = kDlgWd / 2;
tmp.y = (kDlgHt - nDlgFontSz) - 8;
m_pDlg->AddControl(pCtrl, tmp);
AddControl(m_pDlg);
m_pDlg->Show(false);
m_pDlg->SetSelection(1);
UseBack(true);
// Make sure to call the base class
return CBaseScreen::Build();
}