mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
CComponentsItem: add missing methodes for position setters
Parent items were not considered for position calculation.
This commit is contained in:
@@ -261,6 +261,20 @@ bool CComponentsItem::isAdded()
|
||||
return false;
|
||||
}
|
||||
|
||||
void CComponentsItem::setXPos(const int& xpos)
|
||||
{
|
||||
CCDraw::setXPos(xpos);
|
||||
if (cc_parent)
|
||||
cc_xr = cc_parent->getXPos() + x;
|
||||
}
|
||||
|
||||
void CComponentsItem::setYPos(const int& ypos)
|
||||
{
|
||||
CCDraw::setYPos(ypos);
|
||||
if (cc_parent)
|
||||
cc_yr = cc_parent->getYPos() + y;
|
||||
}
|
||||
|
||||
void CComponentsItem::setXPosP(const uint8_t& xpos_percent)
|
||||
{
|
||||
int x_tmp = cc_parent ? xpos_percent*cc_parent->getWidth() : xpos_percent*frameBuffer->getScreenWidth();
|
||||
|
@@ -134,6 +134,11 @@ class CComponentsItem : public CComponents
|
||||
///returns current number of page location of current item, see: cc_page_number
|
||||
virtual u_int8_t getPageNumber(){return cc_page_number;};
|
||||
|
||||
///set screen x-position, parameter as int
|
||||
virtual void setXPos(const int& xpos);
|
||||
///set screen y-position, parameter as int
|
||||
virtual void setYPos(const int& ypos);
|
||||
|
||||
///set screen x-position, parameter as uint8_t, percent x value related to current width of parent form or screen
|
||||
virtual void setXPosP(const uint8_t& xpos_percent);
|
||||
///set screen y-position, parameter as uint8_t, percent y value related to current height of parent form or screen
|
||||
|
Reference in New Issue
Block a user