gui/components/cc_frm_clock.cpp: set CTextBox save screen and paint background flag;

add option to call first paint with save bg - default dont save;
detach clock thread
This commit is contained in:
[CST] Focus
2015-03-06 13:35:34 +03:00
parent 16a1927f4f
commit f50840ac96
2 changed files with 9 additions and 4 deletions

View File

@@ -191,6 +191,9 @@ void CComponentsFrmClock::initCCLockItems()
lbl->setColorAll(col_frame, col_body, col_shadow);
lbl->setText(stmp, CTextBox::CENTER, *getClockFont());
lbl->doPaintTextBoxBg(paint_bg);
lbl->enableTboxSaveScreen(save_tbox_screen);
//use matching height for digits for better vertical centerring into form
CTextBox* ctb = lbl->getCTextBoxObject();
if (ctb)
@@ -285,6 +288,7 @@ bool CComponentsFrmClock::startThread()
printf("[CComponentsFrmClock] [%s] pthread_create %s\n", __func__, strerror(errno));
return false;
}
pthread_detach(cl_thread);
}
return true;
}
@@ -298,19 +302,20 @@ bool CComponentsFrmClock::stopThread()
printf("[CComponentsFrmClock] [%s] pthread_cancel %s\n", __func__, strerror(errno));
return false;
}
#if 0
res = pthread_join(cl_thread, NULL);
if (res != 0){
printf("[CComponentsFrmClock] [%s] pthread_join %s\n", __func__, strerror(errno));
return false;
}
#endif
}
hide();
cl_thread = 0;
return true;
}
bool CComponentsFrmClock::Start()
bool CComponentsFrmClock::Start(bool do_save_bg)
{
if (!activeClock)
return false;
@@ -318,7 +323,7 @@ bool CComponentsFrmClock::Start()
startThread();
if (cl_thread) {
//ensure paint of segements on first paint
paint();
paint(do_save_bg);
paintClock = true;
}
return cl_thread == 0 ? false : true;