From 8c23e7cc90b49f45cfcf5de1a1840304cc59f666 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 7 Apr 2017 21:44:32 +0200 Subject: [PATCH] CComponentsFrmClock: add members to control segment refreshing on interval Refreshing of segments is now enabled on default. In certain conditions this should be better. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/511486c404d79d1517232664fd5ed2e59ad25ec3 Author: Thilo Graf Date: 2017-04-07 (Fri, 07 Apr 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_clock.cpp | 5 ++++- src/gui/components/cc_frm_clock.h | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) 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