mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
CComponentsForm: add member to get pointer to selected items
This commit is contained in:
@@ -491,3 +491,14 @@ int CComponentsForm::getSelectedItem()
|
|||||||
return static_cast<int>(i);
|
return static_cast<int>(i);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CComponentsItem* CComponentsForm::getSelectedItemObject()
|
||||||
|
{
|
||||||
|
int sel = getSelectedItem();
|
||||||
|
CComponentsItem* ret = NULL;
|
||||||
|
if (sel != -1)
|
||||||
|
ret = static_cast<CComponentsItem*>(this->getCCItem(sel));
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -117,8 +117,10 @@ class CComponentsForm : public CComponentsItem
|
|||||||
virtual void paintPage(const u_int8_t& page_number, bool do_save_bg = CC_SAVE_SCREEN_NO);
|
virtual void paintPage(const u_int8_t& page_number, bool do_save_bg = CC_SAVE_SCREEN_NO);
|
||||||
///set width of scrollbar
|
///set width of scrollbar
|
||||||
virtual void setScrollBarWidth(const int& scrollbar_width){w_sb = scrollbar_width;};
|
virtual void setScrollBarWidth(const int& scrollbar_width){w_sb = scrollbar_width;};
|
||||||
///returns id of select item, return value as int, returns -1: if is nothing selected
|
///returns id of selected item, return value as int, returns -1: if is nothing selected
|
||||||
virtual int getSelectedItem();
|
virtual int getSelectedItem();
|
||||||
|
///returns pointer to selected item, return value as CComponentsItem*, returns NULL: if is nothing selected
|
||||||
|
virtual CComponentsItem* getSelectedItemObject();
|
||||||
///select a definied item, parameter1 as size_t
|
///select a definied item, parameter1 as size_t
|
||||||
virtual void setSelectedItem(int item_id);
|
virtual void setSelectedItem(int item_id);
|
||||||
///select a definied item, parameter1 as CComponentsItem*
|
///select a definied item, parameter1 as CComponentsItem*
|
||||||
|
Reference in New Issue
Block a user