diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 0f4329ea3..a13193e09 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -87,6 +87,9 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, //set default text background behavior cc_txt_save_screen = false; + //enable refresh of all segments on each interval as default + cl_force_repaint = true; + //set default running clock properties cl_interval = interval_seconds; cl_timer = NULL; @@ -255,7 +258,7 @@ void CComponentsFrmClock::initCCLockItems() //set size, text, color of current item lbl->setDimensionsAll(x_tmp, y_tmp, w_tmp, h_tmp); lbl->setColorAll(col_frame, col_body, col_shadow); - lbl->forceTextPaint(false); + lbl->forceTextPaint(cl_force_repaint); lbl->setText(stmp, CTextBox::CENTER, cl_font, cl_col_text, cl_font_style); //init background behavior of segment diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index 23eb726ce..4595edd58 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -70,6 +70,9 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen ///text color int cl_col_text; + ///refresh mode + bool cl_force_repaint; + ///current time format std::string cl_format; ///primary time format @@ -151,7 +154,7 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen ///returns true, if clock is running virtual bool isRun() const {return cl_timer ? true : false;}; ///set refresh interval in seconds, default value=1 (=1 sec) - virtual void setClockInterval(const int& seconds){cl_interval = seconds;}; + virtual void setClockInterval(const int& seconds){cl_interval = seconds;} ///show clock on screen virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); @@ -163,6 +166,11 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen ///reinitialize clock contents virtual void refresh() { initCCLockItems(); } + ///enables force to repaint of all segments on each interval, Note: repaint of all segemts is default enabled. + void enableForceSegmentPaint(bool enable = true){cl_force_repaint = enable;} + ///disables repaint of all segments on each interval, repaint happens only on changed segment value + void disableForceSegmentPaint(){enableForceSegmentPaint(false);} + /**Member to modify background behavior of embeded segment objects * @param[in] mode * @li bool, default = true