本文整理汇总了C++中CGUILabelControl::GetXPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUILabelControl::GetXPosition方法的具体用法?C++ CGUILabelControl::GetXPosition怎么用?C++ CGUILabelControl::GetXPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUILabelControl
的用法示例。
在下文中一共展示了CGUILabelControl::GetXPosition方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
bool CGUIDialog::Load(const CStdString& strFileName, bool bContainsPath)
{
m_renderOrder = 1;
if (!CGUIWindow::Load(strFileName, bContainsPath))
{
return false;
}
// Clip labels to extents
if (m_vecControls.size())
{
CGUIControl* pBase = m_vecControls[0];
for (ivecControls p = m_vecControls.begin() + 1; p != m_vecControls.end(); ++p)
{
if ((*p)->GetControlType() == CGUIControl::GUICONTROL_LABEL)
{
CGUILabelControl* pLabel = (CGUILabelControl*)(*p);
if (!pLabel->GetWidth())
{
float spacing = (pLabel->GetXPosition() - pBase->GetXPosition()) * 2;
pLabel->SetWidth(pBase->GetWidth() - spacing);
pLabel->SetTruncate(true);
}
}
}
}
return true;
}
示例2: OnWindowLoaded
void CGUIDialog::OnWindowLoaded()
{
CGUIWindow::OnWindowLoaded();
// Clip labels to extents
if (m_children.size())
{
CGUIControl* pBase = m_children[0];
for (iControls p = m_children.begin() + 1; p != m_children.end(); ++p)
{
if ((*p)->GetControlType() == CGUIControl::GUICONTROL_LABEL)
{
CGUILabelControl* pLabel = (CGUILabelControl*)(*p);
if (!pLabel->GetWidth())
{
float spacing = (pLabel->GetXPosition() - pBase->GetXPosition()) * 2;
pLabel->SetWidth(pBase->GetWidth() - spacing);
}
}
}
}
}
示例3: OnWindowLoaded
void CGUIDialogKeyboardGeneric::OnWindowLoaded()
{
CGUIEditControl *edit = (CGUIEditControl *)GetControl(CTL_EDIT);
if (!edit && g_SkinInfo && g_SkinInfo->APIVersion() < ADDON::AddonVersion("5.2.0"))
{
// backward compatibility: convert label to edit control
CGUILabelControl *label = (CGUILabelControl *)GetControl(CTL_LABEL_EDIT);
if (label && label->GetControlType() == CGUIControl::GUICONTROL_LABEL)
{
// create a new edit control positioned in the same spot
edit = new CGUIEditControl(label->GetParentID(), CTL_EDIT, label->GetXPosition(), label->GetYPosition(),
label->GetWidth(), label->GetHeight(), CTextureInfo(), CTextureInfo(),
label->GetLabelInfo(), "");
AddControl(edit);
m_defaultControl = CTL_EDIT;
m_defaultAlways = true;
}
}
// show the cursor always
if (edit)
edit->SetShowCursorAlways(true);
CGUIDialog::OnWindowLoaded();
}