CComponentsItem: move/rename doCenter()to base class CComponentsItem

So it's possible to use this method for all cc-items.
setCenterPos() comes now with parameter 'along_mode' (CC_ALONG_X, CC_ALONG_Y).
So it's possible to center in x or y direction. As default are
both directions predefined.
This commit is contained in:
2014-02-27 19:43:30 +01:00
parent 38dffb8456
commit 8a897103ac
6 changed files with 22 additions and 12 deletions

View File

@@ -3,7 +3,7 @@
Copyright (C) 2001 by Steffen Hehn 'McClean'
Classes for generic GUI-related components.
Copyright (C) 2012, 2013, Thilo Graf 'dbt'
Copyright (C) 2012-2014, Thilo Graf 'dbt'
License: GPL
@@ -294,6 +294,9 @@ class CComponentsItem : public CComponents
///set x and y position as percent value from current parent or screen dimensions at once
///Note: position of bound components (items) means position related within parent form, not for screen!
virtual void setPosP(const uint8_t& xpos_percent, const uint8_t& ypos_percent);
///do center item on screen or within a parent form, parameter along_mode assigns direction of centering
virtual void setCenterPos(int along_mode = CC_ALONG_X | CC_ALONG_Y);
};
#endif