mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +02:00
CComponentsForm: add functions to get used or free space of form dimensions
This commit is contained in:
@@ -695,3 +695,21 @@ bool CComponentsForm::enableColBodyGradient(const int& enable_mode, const fb_pix
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CComponentsForm::getUsedDY()
|
||||||
|
{
|
||||||
|
int y_res = 0;
|
||||||
|
for (size_t i= 0; i< v_cc_items.size(); i++)
|
||||||
|
y_res = max(v_cc_items[i]->getYPos() + v_cc_items[i]->getHeight(), y_res);
|
||||||
|
|
||||||
|
return y_res;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CComponentsForm::getUsedDX()
|
||||||
|
{
|
||||||
|
int x_res = 0;
|
||||||
|
for (size_t i= 0; i< v_cc_items.size(); i++)
|
||||||
|
x_res = max(v_cc_items[i]->getXPos() + v_cc_items[i]->getWidth(), x_res);
|
||||||
|
|
||||||
|
return x_res;
|
||||||
|
}
|
||||||
|
@@ -183,6 +183,31 @@ class CComponentsForm : public CComponentsItem
|
|||||||
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 selected 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();
|
||||||
|
|
||||||
|
/**Function to get consumed space of items inside form in y direction.
|
||||||
|
* @return
|
||||||
|
* int, used lines
|
||||||
|
*/
|
||||||
|
int getUsedDY();
|
||||||
|
|
||||||
|
/**Function to get consumed space of items inside form in x direction.
|
||||||
|
* @return
|
||||||
|
* int, used lines
|
||||||
|
*/
|
||||||
|
int getUsedDX();
|
||||||
|
|
||||||
|
/**Function to get free usable space of items inside form in y direction.
|
||||||
|
* @return
|
||||||
|
* int, free lines
|
||||||
|
*/
|
||||||
|
int getFreeDY(){return height - getUsedDY();}
|
||||||
|
|
||||||
|
/**Function to get free usable space of items inside form in x direction.
|
||||||
|
* @return
|
||||||
|
* int, free lines
|
||||||
|
*/
|
||||||
|
int getFreeDX(){return width - getUsedDX();}
|
||||||
|
|
||||||
///returns pointer to selected item, return value as CComponentsItem*, returns NULL: if is nothing selected
|
///returns pointer to selected item, return value as CComponentsItem*, returns NULL: if is nothing selected
|
||||||
virtual CComponentsItem* getSelectedItemObject();
|
virtual CComponentsItem* getSelectedItemObject();
|
||||||
///select a definied item, parameter1 as size_t
|
///select a definied item, parameter1 as size_t
|
||||||
|
Reference in New Issue
Block a user