cc_frm_clock: replaced paintClock with cl_blocked

for better readability
This commit is contained in:
2019-11-03 21:15:56 +01:00
parent 99645a570c
commit 794619df4f
2 changed files with 6 additions and 6 deletions

View File

@@ -94,7 +94,7 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos,
//set default running clock properties //set default running clock properties
cl_interval = interval_seconds; cl_interval = interval_seconds;
cl_timer = NULL; cl_timer = NULL;
paintClock = false; cl_blocked = true;
#if 0 #if 0
may_blit = true; may_blit = true;
#endif #endif
@@ -312,7 +312,7 @@ void CComponentsFrmClock::initCCLockItems()
//this member is provided for slot with timer event "OnTimer" //this member is provided for slot with timer event "OnTimer"
void CComponentsFrmClock::ShowTime() void CComponentsFrmClock::ShowTime()
{ {
if (paintClock) { if (!cl_blocked) {
//paint segements, but wihtout saved backgrounds //paint segements, but wihtout saved backgrounds
paint(CC_SAVE_SCREEN_NO); paint(CC_SAVE_SCREEN_NO);
} }
@@ -365,7 +365,7 @@ bool CComponentsFrmClock::stopClock()
bool CComponentsFrmClock::Start() bool CComponentsFrmClock::Start()
{ {
if (startClock()) { if (startClock()) {
paintClock = true; cl_blocked = !cc_allow_paint;
return true; return true;
} }
return false; return false;
@@ -374,7 +374,7 @@ bool CComponentsFrmClock::Start()
bool CComponentsFrmClock::Stop() bool CComponentsFrmClock::Stop()
{ {
if (stopClock()){ if (stopClock()){
paintClock = false; cl_blocked = true;
return true; return true;
} }

View File

@@ -63,7 +63,7 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen
char cl_timestr[32]; char cl_timestr[32];
///handle paint clock within thread and is not similar to cc_allow_paint ///handle paint clock within thread and is not similar to cc_allow_paint
bool paintClock; bool cl_blocked;
///object: font render object ///object: font render object
Font *cl_font; Font *cl_font;
@@ -151,7 +151,7 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen
///same like Stop() but for usage as simple call without return value ///same like Stop() but for usage as simple call without return value
void block(){Stop();} void block(){Stop();}
///return true on blocked status, blocked means clock can be initalized but would be not paint, to unblock use unblock() ///return true on blocked status, blocked means clock can be initalized but would be not paint, to unblock use unblock()
bool isBlocked(void) {return !paintClock;} bool isBlocked(void) {return cl_blocked;}
///returns true, if clock is running ///returns true, if clock is running
bool isRun() const {return cl_timer ? cl_timer->isRun() : false;} bool isRun() const {return cl_timer ? cl_timer->isRun() : false;}