当前位置: 首页>>代码示例>>C++>>正文


C++ CLTGUITextCtrl::SetAlignment方法代码示例

本文整理汇总了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();
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:88,代码来源:ScreenProfile.cpp


注:本文中的CLTGUITextCtrl::SetAlignment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。