From 375451f0a6ef6b7dce410dd2e19d7fd58c1e1aeb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 30 Sep 2016 08:27:28 +0200 Subject: [PATCH] CComponentsForm: add parameters to setSelectedItem() methode Were not passed to items --- src/gui/components/cc_frm.cpp | 8 ++++---- src/gui/components/cc_frm.h | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 29ab9ba9e..45c086101 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -566,7 +566,7 @@ u_int8_t CComponentsForm::getPageCount() } -void CComponentsForm::setSelectedItem(int item_id) +void CComponentsForm::setSelectedItem(int item_id, const fb_pixel_t& sel_frame_col, const fb_pixel_t& frame_col, const fb_pixel_t& sel_body_col, const fb_pixel_t& body_col, const int& frame_w, const int& sel_frame_w) { size_t count = v_cc_items.size(); int id = item_id; @@ -590,19 +590,19 @@ void CComponentsForm::setSelectedItem(int item_id) } for (size_t i= 0; i< count; i++) - v_cc_items[i]->setSelected(i == (size_t)id); + v_cc_items[i]->setSelected(i == (size_t)id, sel_frame_col, frame_col, sel_body_col, body_col, frame_w, sel_frame_w); OnSelect(); } -void CComponentsForm::setSelectedItem(CComponentsItem* cc_item) +void CComponentsForm::setSelectedItem(CComponentsItem* cc_item, const fb_pixel_t& sel_frame_col, const fb_pixel_t& frame_col, const fb_pixel_t& sel_body_col, const fb_pixel_t& body_col, const int& frame_w, const int& sel_frame_w) { int id = getCCItemId(cc_item); if (id == -1){ dprintf(DEBUG_NORMAL, "[CComponentsForm] [%s - %d] invalid item parameter, no object available\n", __func__,__LINE__); return; } - setSelectedItem(id); + setSelectedItem(id, sel_frame_col, frame_col, sel_body_col, body_col, frame_w, sel_frame_w); } int CComponentsForm::getSelectedItem() diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 82a1a4df2..44f6b481e 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -145,9 +145,21 @@ class CComponentsForm : public CComponentsItem ///returns pointer to selected item, return value as CComponentsItem*, returns NULL: if is nothing selected virtual CComponentsItem* getSelectedItemObject(); ///select a definied item, parameter1 as size_t - virtual void setSelectedItem(int item_id); + virtual void setSelectedItem( int item_id, + const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0, + const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0, + const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0, + const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0, + const int& frame_w = 3, + const int& sel_frame_w = 3); ///select a definied item, parameter1 as CComponentsItem* - virtual void setSelectedItem(CComponentsItem* cc_item); + virtual void setSelectedItem( CComponentsItem* cc_item, + const fb_pixel_t& sel_frame_col = COL_MENUCONTENTSELECTED_PLUS_0, + const fb_pixel_t& frame_col = COL_SHADOW_PLUS_0, + const fb_pixel_t& sel_body_col = COL_MENUCONTENT_PLUS_0, + const fb_pixel_t& body_col = COL_MENUCONTENT_PLUS_0, + const int& frame_w = 3, + const int& sel_frame_w = 3); ///exec main method, see also sub exec methods virtual int exec();