本文整理汇总了C++中CGUIControl::SetFocus方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIControl::SetFocus方法的具体用法?C++ CGUIControl::SetFocus怎么用?C++ CGUIControl::SetFocus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIControl
的用法示例。
在下文中一共展示了CGUIControl::SetFocus方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoProcess
void CGUIDialogSettingsBase::DoProcess(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
// update alpha status of current button
bool bAlphaFaded = false;
CGUIControl *control = GetFirstFocusableControl(CONTROL_SETTINGS_START_BUTTONS + m_iCategory);
if (control && !control->HasFocus())
{
if (control->GetControlType() == CGUIControl::GUICONTROL_BUTTON)
{
control->SetFocus(true);
((CGUIButtonControl *)control)->SetAlpha(0x80);
bAlphaFaded = true;
}
else if (control->GetControlType() == CGUIControl::GUICONTROL_TOGGLEBUTTON)
{
control->SetFocus(true);
((CGUIButtonControl *)control)->SetSelected(true);
bAlphaFaded = true;
}
}
CGUIDialog::DoProcess(currentTime, dirtyregions);
if (control && bAlphaFaded)
{
control->SetFocus(false);
if (control->GetControlType() == CGUIControl::GUICONTROL_BUTTON)
((CGUIButtonControl *)control)->SetAlpha(0xFF);
else
((CGUIButtonControl *)control)->SetSelected(false);
}
}
示例2: DoProcess
void CGUIControllerWindow::DoProcess(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
/*
* Apply the faded focus texture to the current controller when unfocused
*/
CGUIControl* control = nullptr; // The controller button
bool bAlphaFaded = false; // True if the controller button has been focused and faded this frame
if (m_controllerList && m_controllerList->GetFocusedController() >= 0)
{
control = GetFirstFocusableControl(CONTROL_CONTROLLER_BUTTONS_START + m_controllerList->GetFocusedController());
if (control && !control->HasFocus())
{
if (control->GetControlType() == CGUIControl::GUICONTROL_BUTTON)
{
control->SetFocus(true);
static_cast<CGUIButtonControl*>(control)->SetAlpha(0x80);
bAlphaFaded = true;
}
}
}
CGUIDialog::DoProcess(currentTime, dirtyregions);
if (control && bAlphaFaded)
{
control->SetFocus(false);
if (control->GetControlType() == CGUIControl::GUICONTROL_BUTTON)
static_cast<CGUIButtonControl*>(control)->SetAlpha(0xFF);
}
}
示例3: DoProcess
void CGUIDialogAddonSettings::DoProcess(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
// update status of current section button
bool alphaFaded = false;
CGUIControl *control = GetFirstFocusableControl(CONTROL_START_SECTION + m_currentSection);
if (control && !control->HasFocus())
{
if (control->GetControlType() == CGUIControl::GUICONTROL_BUTTON)
{
control->SetFocus(true);
((CGUIButtonControl *)control)->SetAlpha(0x80);
alphaFaded = true;
}
else if (control->GetControlType() == CGUIControl::GUICONTROL_TOGGLEBUTTON)
{
control->SetFocus(true);
((CGUIButtonControl *)control)->SetSelected(true);
alphaFaded = true;
}
}
CGUIDialogBoxBase::DoProcess(currentTime, dirtyregions);
if (alphaFaded && m_active) // dialog may close
{
control->SetFocus(false);
if (control->GetControlType() == CGUIControl::GUICONTROL_BUTTON)
((CGUIButtonControl *)control)->SetAlpha(0xFF);
else
((CGUIButtonControl *)control)->SetSelected(false);
}
}
示例4: NextControl
void CGUIWindowSettingsScreenCalibration::NextControl()
{ // set the old control invisible and not focused, and choose the next control
CGUIControl *pControl = GetControl(m_iControl);
if (pControl)
{
pControl->SetVisible(false);
pControl->SetFocus(false);
}
// switch to the next control
m_iControl++;
if (m_iControl > CONTROL_PIXEL_RATIO)
m_iControl = CONTROL_TOP_LEFT;
// enable the new control
EnableControl(m_iControl);
}