CComponents: implement scroll functionality into CComponentsForm

CComponentsForm provides page scroll if found more
than one pre defined page and is working with all derivated sub classes from CComponentsForm .

Pages are defined with setPageNumber(0...n) in items (1st page = 0). The item page number property is
defined in variable cc_page_number. The highest page number sets the
count of pages inside container to required value. Thats compellingly!

To show a page, we can use setCurrentPage(0...n ) and paintCurPage() or use directly paintPage(0...n).
Note: global paint() will show the current page. Default page is 0 (as first).
Use setCurrentPage(0...n) to change this before first call of paint().
Note: In CComponentsWindow class, these methods are applied to window body.

For examples, take a look into CTestMenu


Origin commit data
------------------
Branch: ni/coolstream
Commit: 672757606c
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-06-26 (Thu, 26 Jun 2014)



------------------
This commit was generated by Migit
This commit is contained in:
2014-06-26 09:59:19 +02:00
parent a78751ea55
commit 060a36dd6b
13 changed files with 485 additions and 24 deletions

View File

@@ -231,6 +231,9 @@ class CComponentsItem : public CComponents
bool cc_item_enabled;
///property: default not selected
bool cc_item_selected;
///property: page number, this defines current item page location, means: this item is embedded in a parent container on page number n, see also setPageNumber()
///default value is 0 for page one, any value > 0 causes handling for mutilple pages at parent container
uint8_t cc_page_number;
///Pointer to the form object in which this item is embedded.
///Is typically the type CComponentsForm or derived classes, default intialized with NULL
@@ -291,6 +294,11 @@ class CComponentsItem : public CComponents
///To generate an index, use genIndex()
virtual void setIndex(const int& index){cc_item_index = index;};
///sets page location of current item, parameter as uint8_t, see: cc_page_number
virtual void setPageNumber(const uint8_t& on_page_number){cc_page_number = on_page_number;};
///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 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