bool CGUIBaseContainer::OnClick(DWORD actionID) { int subItem = 0; if (actionID == ACTION_SELECT_ITEM || actionID == ACTION_MOUSE_LEFT_CLICK) { if (m_staticContent) { // "select" action int selected = GetSelectedItem(); if (selected >= 0 && selected < (int)m_items.size()) { CFileItem *item = (CFileItem *)m_items[selected]; // multiple action strings are concat'd together, separated with " , " vector<CStdString> actions; StringUtils::SplitString(item->m_strPath, " , ", actions); for (unsigned int i = 0; i < actions.size(); i++) { CStdString action = actions[i]; action.Replace(",,", ","); CGUIMessage message(GUI_MSG_EXECUTE, GetID(), GetParentID()); message.SetStringParam(action); g_graphicsContext.SendMessage(message); } } return true; } // grab the currently focused subitem (if applicable) CGUIListItemLayout *focusedLayout = GetFocusedLayout(); if (focusedLayout) subItem = focusedLayout->GetFocus(); } // Don't know what to do, so send to our parent window. CGUIMessage msg(GUI_MSG_CLICKED, GetID(), GetParentID(), actionID, subItem); return SendWindowMessage(msg); }
bool CGUIBaseContainer::GetCondition(int condition, int data) const { switch (condition) { case CONTAINER_ROW: return (m_orientation == VERTICAL) ? (m_cursor == data) : true; case CONTAINER_COLUMN: return (m_orientation == HORIZONTAL) ? (m_cursor == data) : true; case CONTAINER_POSITION: return (m_cursor == data); case CONTAINER_HAS_NEXT: return (HasNextPage()); case CONTAINER_HAS_PREVIOUS: return (HasPreviousPage()); case CONTAINER_SUBITEM: { CGUIListItemLayout *layout = GetFocusedLayout(); return layout ? (layout->GetFocus() == (unsigned int)data) : false; } default: return false; } }