本文整理汇总了C++中CGUIControl::SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIControl::SetPosition方法的具体用法?C++ CGUIControl::SetPosition怎么用?C++ CGUIControl::SetPosition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIControl
的用法示例。
在下文中一共展示了CGUIControl::SetPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Render
void CGUIDialogFileStacking::Render()
{
#ifdef PRE_SKIN_VERSION_2_1_COMPATIBILITY
if (m_iFrames <= 25)
{
// slide in...
int dwScreenWidth = g_settings.m_ResInfo[m_coordsRes].iWidth;
for (int i = 1; i <= m_iNumberOfFiles; ++i)
{
CGUIControl* pControl = (CGUIControl*)GetControl(i);
if (pControl)
{
DWORD dwEndPos = dwScreenWidth - ((m_iNumberOfFiles - i) * 32) - 140;
DWORD dwStartPos = dwScreenWidth;
float fStep = (float)(dwStartPos - dwEndPos);
fStep /= 25.0f;
fStep *= m_iFrames;
pControl->SetPosition((float)dwStartPos - fStep, pControl->GetYPosition() );
}
}
m_iFrames++;
}
#endif
CGUIDialog::Render();
}
示例2: UpdateFromControl
void CGUIWindowSettingsScreenCalibration::UpdateFromControl(int iControl)
{
std::string strStatus;
RESOLUTION_INFO info = g_graphicsContext.GetResInfo(m_Res[m_iCurRes]);
if (iControl == CONTROL_PIXEL_RATIO)
{
CGUIControl *pControl = GetControl(CONTROL_PIXEL_RATIO);
if (pControl)
{
float fWidth = (float)pControl->GetWidth();
float fHeight = (float)pControl->GetHeight();
info.fPixelRatio = fHeight / fWidth;
// recenter our control...
pControl->SetPosition((info.iWidth - pControl->GetWidth()) / 2,
(info.iHeight - pControl->GetHeight()) / 2);
strStatus = StringUtils::Format("%s (%5.3f)", g_localizeStrings.Get(275).c_str(), info.fPixelRatio);
SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 278);
}
}
else
{
const CGUIMoverControl *pControl = dynamic_cast<const CGUIMoverControl*>(GetControl(iControl));
if (pControl)
{
switch (iControl)
{
case CONTROL_TOP_LEFT:
{
info.Overscan.left = pControl->GetXLocation();
info.Overscan.top = pControl->GetYLocation();
strStatus = StringUtils::Format("%s (%i,%i)", g_localizeStrings.Get(272).c_str(), pControl->GetXLocation(), pControl->GetYLocation());
SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 276);
}
break;
case CONTROL_BOTTOM_RIGHT:
{
info.Overscan.right = pControl->GetXLocation();
info.Overscan.bottom = pControl->GetYLocation();
int iXOff1 = info.iWidth - pControl->GetXLocation();
int iYOff1 = info.iHeight - pControl->GetYLocation();
strStatus = StringUtils::Format("%s (%i,%i)", g_localizeStrings.Get(273).c_str(), iXOff1, iYOff1);
SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 276);
}
break;
case CONTROL_SUBTITLES:
{
info.iSubtitles = pControl->GetYLocation();
strStatus = StringUtils::Format("%s (%i)", g_localizeStrings.Get(274).c_str(), pControl->GetYLocation());
SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 277);
}
break;
}
}
}
g_graphicsContext.SetResInfo(m_Res[m_iCurRes], info);
// set the label control correctly
std::string strText;
if (g_Windowing.IsFullScreen())
strText = StringUtils::Format("%ix%[email protected]%.2f - %s | %s",
info.iScreenWidth,
info.iScreenHeight,
info.fRefreshRate,
g_localizeStrings.Get(244).c_str(),
strStatus.c_str());
else
strText = StringUtils::Format("%ix%i - %s | %s",
info.iScreenWidth,
info.iScreenHeight,
g_localizeStrings.Get(242).c_str(),
strStatus.c_str());
SET_CONTROL_LABEL(CONTROL_LABEL_ROW1, strText);
}