mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
*neutrino menu classes: new members added
insertItem(), removeItem(), getItemsCount(), getItem() git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1437 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -377,11 +377,43 @@ void CMenuWidget::resetWidget()
|
|||||||
selected=-1;
|
selected=-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMenuWidget::insertItem(const uint& item_id, CMenuItem* menuItem)
|
||||||
|
{
|
||||||
|
items.insert(items.begin()+item_id, menuItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CMenuWidget::removeItem(const uint& item_id)
|
||||||
|
{
|
||||||
|
items.erase(items.begin()+item_id);
|
||||||
|
}
|
||||||
|
|
||||||
bool CMenuWidget::hasItem()
|
bool CMenuWidget::hasItem()
|
||||||
{
|
{
|
||||||
return !items.empty();
|
return !items.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CMenuWidget::getItemId(CMenuItem* menuItem)
|
||||||
|
{
|
||||||
|
for (uint i= 0; i< items.size(); i++)
|
||||||
|
{
|
||||||
|
if (items[i] == menuItem)
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
CMenuItem* CMenuWidget::getItem(const uint& item_id)
|
||||||
|
{
|
||||||
|
for (uint i= 0; i< items.size(); i++)
|
||||||
|
{
|
||||||
|
if (i == item_id)
|
||||||
|
return items[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
std::string CMenuWidget::getName()
|
std::string CMenuWidget::getName()
|
||||||
{
|
{
|
||||||
if (name != NONEXISTANT_LOCALE)
|
if (name != NONEXISTANT_LOCALE)
|
||||||
|
@@ -420,6 +420,11 @@ class CMenuWidget : public CMenuTarget
|
|||||||
virtual void addIntroItems(neutrino_locale_t subhead_text = NONEXISTANT_LOCALE, neutrino_locale_t section_text = NONEXISTANT_LOCALE, int buttontype = BTN_TYPE_BACK );
|
virtual void addIntroItems(neutrino_locale_t subhead_text = NONEXISTANT_LOCALE, neutrino_locale_t section_text = NONEXISTANT_LOCALE, int buttontype = BTN_TYPE_BACK );
|
||||||
bool hasItem();
|
bool hasItem();
|
||||||
void resetWidget();
|
void resetWidget();
|
||||||
|
void insertItem(const uint& item_id, CMenuItem* menuItem);
|
||||||
|
void removeItem(const uint& item_id);
|
||||||
|
int getItemId(CMenuItem* menuItem);
|
||||||
|
int getItemsCount(){return items.size();};
|
||||||
|
CMenuItem* getItem(const uint& item_id);
|
||||||
virtual void paint();
|
virtual void paint();
|
||||||
virtual void hide();
|
virtual void hide();
|
||||||
virtual int exec(CMenuTarget* parent, const std::string & actionKey);
|
virtual int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||||
|
Reference in New Issue
Block a user