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
------------------
Commit: 672757606c
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-06-26 (Thu, 26 Jun 2014)
This commit is contained in:
2014-06-26 09:59:19 +02:00
parent 60455587be
commit 3224594375
13 changed files with 485 additions and 24 deletions

View File

@@ -183,11 +183,23 @@ class CComponentsWindow : public CComponentsForm
///sets width of sidebars
void setWidthSidebar(const int& sidebar_width){ccw_w_sidebar = sidebar_width; initCCWItems();};
///sets current page, NOTE: this is simliar with setCurrentPage() known from basic class CComponentsForm, but here it is related only for window body object
void setCurrentPage(const u_int8_t& current_page);
///get current page, NOTE: this is simliar with getCurrentPage() known from basic class CComponentsForm, but here it is related only for window body object
u_int8_t getCurrentPage();
///paint window body items, this paints only the current page, body = page, current page is definied in body object, see setCurrentPage()
void paintCurPage(bool do_save_bg = CC_SAVE_SCREEN_NO);
///paint defined page of body, parameter number 0...n
void paintPage(const u_int8_t& page_number, bool do_save_bg = CC_SAVE_SCREEN_NO);
///set width of body scrollbar
void setScrollBarWidth(const int& scrollbar_width);
///refresh position and dimension and reinitialize elemenatary properties
void Refresh(){initCCWItems();};
///paint all window items, this overwriting paint() from CComponentsForm
virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
};
class CComponentsWindowMax : public CComponentsWindow