CComponentsFrmClock: cleanup constructors

Remove single constructor, usage of default parameters in main constructor
have same effect.
This commit is contained in:
2013-12-25 18:14:31 +01:00
parent 82ed49a45a
commit bc8b81a190
2 changed files with 17 additions and 19 deletions

View File

@@ -41,18 +41,19 @@
using namespace std;
CComponentsFrmClock::CComponentsFrmClock()
{
initVarClock();
}
CComponentsFrmClock::CComponentsFrmClock( const int x_pos, const int y_pos, const int w, const int h,
CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, const int& y_pos, const int& w, const int& h,
const char* format_str, bool activ, bool has_shadow,
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
{
initVarClock();
initVarClock(x_pos, y_pos, w, h, format_str, activ, has_shadow, color_frame, color_body, color_shadow);
}
void CComponentsFrmClock::initVarClock( const int& x_pos, const int& y_pos, const int& w, const int& h,
const char* format_str, bool activ, bool has_shadow,
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
{
x = x_pos;
y = y_pos;
width = w;
@@ -63,15 +64,6 @@ CComponentsFrmClock::CComponentsFrmClock( const int x_pos, const int y_pos, cons
col_body = color_body;
col_shadow = color_shadow;
cl_format_str = format_str;
paintClock = false;
activeClock = activ;
if (activeClock)
startThread();
}
void CComponentsFrmClock::initVarClock()
{
cc_item_type = CC_ITEMTYPE_FRM_CLOCK;
corner_rad = RADIUS_SMALL;
@@ -80,7 +72,7 @@ void CComponentsFrmClock::initVarClock()
dyn_font_size = 0;
cl_col_text = COL_MENUCONTENT_TEXT;
cl_format_str = "%H:%M";
cl_format_str = format_str;
cl_align = CC_ALIGN_VER_CENTER | CC_ALIGN_HOR_CENTER;
cl_thread = 0;
@@ -88,6 +80,11 @@ void CComponentsFrmClock::initVarClock()
activeClock = true;
cl_blink_str = "";
paintClock = false;
activeClock = activ;
if (activeClock)
startThread();
}
CComponentsFrmClock::~CComponentsFrmClock()