本文整理汇总了C++中CGUIControl::GetAction方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIControl::GetAction方法的具体用法?C++ CGUIControl::GetAction怎么用?C++ CGUIControl::GetAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIControl
的用法示例。
在下文中一共展示了CGUIControl::GetAction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetControlById
//.........这里部分代码省略.........
switch(pGUIControl->GetControlType())
{
case CGUIControl::GUICONTROL_BUTTON:
pControl = new ControlButton();
li = ((CGUIButtonControl *)pGUIControl)->GetLabelInfo();
// note: conversion from infocolors -> plain colors here
((ControlButton*)pControl)->disabledColor = li.disabledColor;
((ControlButton*)pControl)->focusedColor = li.focusedColor;
((ControlButton*)pControl)->textColor = li.textColor;
((ControlButton*)pControl)->shadowColor = li.shadowColor;
if (li.font) ((ControlButton*)pControl)->strFont = li.font->GetFontName();
((ControlButton*)pControl)->align = li.align;
break;
case CGUIControl::GUICONTROL_LABEL:
pControl = new ControlLabel();
break;
case CGUIControl::GUICONTROL_SPIN:
pControl = new ControlSpin();
break;
case CGUIControl::GUICONTROL_FADELABEL:
pControl = new ControlFadeLabel();
break;
case CGUIControl::GUICONTROL_TEXTBOX:
pControl = new ControlTextBox();
break;
case CGUIControl::GUICONTROL_IMAGE:
case CGUIControl::GUICONTROL_BORDEREDIMAGE:
pControl = new ControlImage();
break;
case CGUIControl::GUICONTROL_PROGRESS:
pControl = new ControlProgress();
break;
case CGUIControl::GUICONTROL_SLIDER:
pControl = new ControlSlider();
break;
case CGUIControl::GUICONTAINER_LIST:
case CGUIControl::GUICONTAINER_WRAPLIST:
case CGUIControl::GUICONTAINER_FIXEDLIST:
case CGUIControl::GUICONTAINER_PANEL:
pControl = new ControlList();
// create a python spin control
((ControlList*)pControl)->pControlSpin = new ControlSpin();
break;
case CGUIControl::GUICONTROL_GROUP:
pControl = new ControlGroup();
break;
case CGUIControl::GUICONTROL_RADIO:
pControl = new ControlRadioButton();
li = ((CGUIRadioButtonControl *)pGUIControl)->GetLabelInfo();
// note: conversion from infocolors -> plain colors here
((ControlRadioButton*)pControl)->disabledColor = li.disabledColor;
((ControlRadioButton*)pControl)->focusedColor = li.focusedColor;
((ControlRadioButton*)pControl)->textColor = li.textColor;
((ControlRadioButton*)pControl)->shadowColor = li.shadowColor;
if (li.font) ((ControlRadioButton*)pControl)->strFont = li.font->GetFontName();
((ControlRadioButton*)pControl)->align = li.align;
break;
case CGUIControl::GUICONTROL_EDIT:
pControl = new ControlEdit();
li = ((CGUIEditControl *)pGUIControl)->GetLabelInfo();
// note: conversion from infocolors -> plain colors here
((ControlEdit*)pControl)->disabledColor = li.disabledColor;
((ControlEdit*)pControl)->textColor = li.textColor;
if (li.font) ((ControlEdit*)pControl)->strFont = li.font->GetFontName();
((ControlButton*)pControl)->align = li.align;
break;
default:
break;
}
if (!pControl)
// throw an exception
throw WindowException("Unknown control type for python");
// we have a valid control here, fill in all the 'Control' data
pControl->pGUIControl = pGUIControl;
pControl->iControlId = pGUIControl->GetID();
pControl->iParentId = iWindowId;
pControl->dwHeight = (int)pGUIControl->GetHeight();
pControl->dwWidth = (int)pGUIControl->GetWidth();
pControl->dwPosX = (int)pGUIControl->GetXPosition();
pControl->dwPosY = (int)pGUIControl->GetYPosition();
pControl->iControlUp = pGUIControl->GetAction(ACTION_MOVE_UP).GetNavigation();
pControl->iControlDown = pGUIControl->GetAction(ACTION_MOVE_DOWN).GetNavigation();
pControl->iControlLeft = pGUIControl->GetAction(ACTION_MOVE_LEFT).GetNavigation();
pControl->iControlRight = pGUIControl->GetAction(ACTION_MOVE_RIGHT).GetNavigation();
// It got this far so means the control isn't actually in the vector of controls
// so lets add it to save doing all that next time
vecControls.push_back(AddonClass::Ref<Control>(pControl));
// return the control with increased reference (+1)
return pControl;
}