From 62519d4891ba201df4803de20249a1db583c0e39 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Dec 2016 16:42:13 +0100 Subject: [PATCH 1/4] CComponentsScrollBar: add easy to handle scrollbar methode Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/728b95ac1cfa3743e4a0df02c49b0dc447103ceb Author: Thilo Graf Date: 2016-12-15 (Thu, 15 Dec 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_scrollbar.cpp | 17 +++++ src/gui/components/cc_frm_scrollbar.h | 91 ++++++++++++++++++++++--- 2 files changed, 98 insertions(+), 10 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index dc277f6be..31127f683 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -189,3 +189,20 @@ void CComponentsScrollBar::initSegments() sb_segments_obj->front()->setCorner(RADIUS_MIN, CORNER_TOP); sb_segments_obj->back()->setCorner(RADIUS_MIN, CORNER_BOTTOM); } + + +void paintScrollBar( const int &x_pos, + const int &y_pos, + const int &w, + const int &h, + const int& count, + const int& current_num, + int shadow_mode, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) +{ + CComponentsScrollBar scrollbar(x_pos, y_pos, w, h, count, NULL, shadow_mode, color_frame, color_body, color_shadow); + scrollbar.setMarkID(current_num); + scrollbar.paint0(); +} diff --git a/src/gui/components/cc_frm_scrollbar.h b/src/gui/components/cc_frm_scrollbar.h index 731e83df5..8ea476fb7 100644 --- a/src/gui/components/cc_frm_scrollbar.h +++ b/src/gui/components/cc_frm_scrollbar.h @@ -60,24 +60,95 @@ class CComponentsScrollBar : public CComponentsFrmChain void initVarSbForm( const int& count); public: - CComponentsScrollBar( const int &x_pos, const int &y_pos, const int &w = 15, const int &h = 40, - const int& count = 1, + /**Class constructor to generate individual scrollbar objects + * + * @param[in] x_pos exepts type int, x position on screen + * @param[in] x_pos exepts type int, y position on screen modes are: + * @param[in] w exepts type int, width of scrollbar object + * @param[in] h exepts type int, height of scrollbar object + * @param[in] count optional, exepts type int, count of pages, default 1 + * + * usual paraemters: + * @param[in] parent optional, exepts type pointer to a parent CComponentsForm object, default NULL + * @param[in] shadow_mode optional, exepts type int defined by shadow mode enums, default CC_SHADOW_OFF + * @param[in] color_frame optional, exepts type fb_pixel_t, default COL_SCROLLBAR_ACTIVE_PLUS_0 + * @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE_PLUS_0 + * @param[in] color_shadow optional, exepts type fb_pixel_t, default COL_SHADOW_PLUS_0 + */ + CComponentsScrollBar( const int &x_pos, + const int &y_pos, + const int &w = 15, + const int &h = 40, + const int& count = 1, CComponentsForm *parent = NULL, - int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_SCROLLBAR_ACTIVE_PLUS_0, - fb_pixel_t color_body = COL_SCROLLBAR_PASSIVE_PLUS_0, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_SCROLLBAR_ACTIVE_PLUS_0, + fb_pixel_t color_body = COL_SCROLLBAR_PASSIVE_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); // ~CComponentsScrollBar(); //inherited from CComponentsForm - ///set marked segment, 1st = 0, 2nd = 1 ... - void setMarkID(const int& mark_id){sb_mark_id = mark_id; initSegments();}; - ///get current assigned marked id + /**Set current page number + * @return void + * + * @param[in] mark_id exepts type int, this sets the current selected page number. + * + * @see getMarkID() + */ + void setMarkID(const int& mark_id){sb_mark_id = mark_id; initSegments();} + + /**Gets current page number + * @return int + * + * @see setMarkID() + */ int getMarkID(){return sb_mark_id;}; - ///Sets count of scrollbar segments and is similar e.g. page count. Each segment is assigned to an id. Starting with id 0...n see also setMarkID(), getMarkID(). + /**Sets count of possible scrollbar segments (e.g. page count) and + * current selected page at once . + * Each segment is assigned to a page number. Starting with id 0...n + * @return void + * + * @param[in] segment_count exepts type int, sets the current count of pages. + * @param[in] mark_id optional, exepts type int, sets the current selected page number, default = 0 + * @see also setMarkID() + * getMarkID() + */ void setSegmentCount(const int& segment_count, const int& mark_id = 0); - ///Get count of current scrollbar segments + + /**Get count of current scrollbar segments (page count) + * @return int + * + * @see setSegmentCount() + */ int getSegmentCount(){return sb_segments_count;} }; + /**Small and easy to apply scrollbar paint methode without expilcit object declaration + * @return void + * + * @param[in] x_pos exepts type int, x position on screen + * @param[in] x_pos exepts type int, y position on screen modes are: + * @param[in] w exepts type int, width of scrollbar object + * @param[in] h exepts type int, height of scrollbar object + * @param[in] count exepts type int, count of pages, default 1 + * @param[in] current_num exepts type int, current selected page, default 0 + * + * usual paraemters: + * @param[in] parent optional, exepts type pointer to a parent CComponentsForm object, default NULL + * @param[in] shadow_mode optional, exepts type int defined by shadow mode enums, default CC_SHADOW_OFF + * @param[in] color_frame optional, exepts type fb_pixel_t, default COL_SCROLLBAR_ACTIVE_PLUS_0 + * @param[in] color_body optional, exepts type fb_pixel_t, default COL_SCROLLBAR_PASSIVE_PLUS_0 + * @param[in] color_shadow optional, exepts type fb_pixel_t, default COL_SHADOW_PLUS_0 + */ +void paintScrollBar( const int &x_pos, + const int &y_pos, + const int &w, + const int &h, + const int& count, + const int& current_num, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_SCROLLBAR_ACTIVE_PLUS_0, + fb_pixel_t color_body = COL_SCROLLBAR_PASSIVE_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + #endif From 1444902fa2186e42fee590de4cf36553f83c82c7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Dec 2016 16:52:51 +0100 Subject: [PATCH 2/4] CComponentsScrollBar: use corner settings for scrollbar body Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1d541834b1e10dd5f84e50375a5749cf85f43964 Author: Thilo Graf Date: 2016-12-15 (Thu, 15 Dec 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_scrollbar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 31127f683..ce0d281b8 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -81,6 +81,7 @@ void CComponentsScrollBar::initVarSbForm(const int& count) sb_up_obj = sb_down_obj = NULL; sb_segments_obj = NULL; + setCorner(RADIUS_MIN, CORNER_ALL); sb_up_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_UP) ; sb_down_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_DOWN); From 4c022bdeb0e1553917c5ab694babcdab3fb23dff Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Dec 2016 21:09:01 +0100 Subject: [PATCH 3/4] CComponentsScrollBar: fix pos and use current width to set height of arrows This fix size and position and dimensions of arrows. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6dda28d612e9fb46f2b3b86d726a4a40d73197bd Author: Thilo Graf Date: 2016-12-15 (Thu, 15 Dec 2016) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_scrollbar.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index ce0d281b8..b0ca25fca 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -111,22 +111,20 @@ void CComponentsScrollBar::initTopNaviIcon() { //initialize icon object if (sb_up_obj == NULL){ - sb_up_obj = new CComponentsPicture(CC_CENTERED, fr_thickness, sb_up_icon, this); + sb_up_obj = new CComponentsPicture(CC_CENTERED, fr_thickness, width-2*fr_thickness, width-2*fr_thickness, sb_up_icon, this); sb_up_obj->SetTransparent(CFrameBuffer::TM_BLACK); sb_up_obj->doPaintBg(false); } - sb_up_obj->setWidth(width-2*fr_thickness); } void CComponentsScrollBar::initBottomNaviIcon() { //initialize icon object if (sb_down_obj == NULL){ - sb_down_obj = new CComponentsPicture(CC_CENTERED, CC_APPEND, sb_down_icon, this); + sb_down_obj = new CComponentsPicture(CC_CENTERED, height - width-2*fr_thickness, width-2*fr_thickness, 0, sb_down_icon, this); sb_down_obj->SetTransparent(CFrameBuffer::TM_BLACK); sb_down_obj->doPaintBg(false); } - sb_down_obj->setWidth(width-2*fr_thickness); } void CComponentsScrollBar::initSegments() From 9558b979abd85c9c0f888f1afa1abcd48610915d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Dec 2016 22:02:21 +0100 Subject: [PATCH 4/4] CCDraw: reduce debug spam Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/689866c8726811bad558d8116e06c210c52aaaa9 Author: Thilo Graf Date: 2016-12-15 (Thu, 15 Dec 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index c0a281434..a5c455bb8 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -678,7 +678,7 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const in r, corner_type); }else - dprintf(DEBUG_NORMAL, "\033[33m[CCDraw][%s - %d], WARNING! render with bad dimensions [dx = %d dy = %d]\033[0m\n", __func__, __LINE__, v_fbdata[i].dx, v_fbdata[i].dy ); + dprintf(DEBUG_DEBUG, "\033[33m[CCDraw][%s - %d], WARNING! render with bad dimensions [dx = %d dy = %d]\033[0m\n", __func__, __LINE__, v_fbdata[i].dx, v_fbdata[i].dy ); if (v_fbdata[i].frame_thickness) frameBuffer->paintBoxFrame(v_fbdata[i].x,