本文整理汇总了C++中CGUIListContainer::GetSelectedItem方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIListContainer::GetSelectedItem方法的具体用法?C++ CGUIListContainer::GetSelectedItem怎么用?C++ CGUIListContainer::GetSelectedItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIListContainer
的用法示例。
在下文中一共展示了CGUIListContainer::GetSelectedItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSelectedItem
int CGUIWindowFileManager::GetSelectedItem(int iControl)
{
if (iControl < 0 || iControl > 1) return -1;
CGUIListContainer *pControl = (CGUIListContainer *)GetControl(iControl + CONTROL_LEFT_LIST);
if (!pControl || !m_vecItems[iControl]->Size()) return -1;
return pControl->GetSelectedItem();
}
示例2: OnMessage
bool CGUIDialogVisualisationPresetList::OnMessage(CGUIMessage &message)
{
switch (message.GetMessage())
{
case GUI_MSG_CLICKED:
{
if (message.GetSenderId() == CONTROL_LIST && (message.GetParam1() == ACTION_SELECT_ITEM ||
message.GetParam1() == ACTION_MOUSE_LEFT_CLICK))
{
//clicked - ask for the preset to be changed to the new one
CGUIListContainer *pList = (CGUIListContainer *)GetControl(CONTROL_LIST);
if (pList)
{
int iItem = pList->GetSelectedItem();
if (m_viz)
m_viz->OnAction(VIS_ACTION_LOAD_PRESET, (void *)&iItem);
}
return true;
}
}
break;
case GUI_MSG_WINDOW_INIT:
{
CGUIDialog::OnMessage(message);
CGUIMessage msg(GUI_MSG_GET_VISUALISATION, 0, 0);
g_windowManager.SendMessage(msg);
SetVisualisation((CVisualisation*)msg.GetPointer());
return true;
}
break;
case GUI_MSG_WINDOW_DEINIT:
case GUI_MSG_VISUALISATION_UNLOADING:
{
m_viz = NULL;
CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), CONTROL_LIST);
OnMessage(msg);
Update();
}
break;
case GUI_MSG_VISUALISATION_LOADED:
{
SetVisualisation((CVisualisation*)message.GetPointer());
}
break;
}
return CGUIDialog::OnMessage(message);
}