mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
CComponentsFrmClock: cleanup constructors
Remove single constructor, usage of default parameters in main constructor
have same effect.
Origin commit data
------------------
Commit: bc8b81a190
Author: Thilo Graf <dbt@novatux.de>
Date: 2013-12-25 (Wed, 25 Dec 2013)
This commit is contained in:
@@ -41,18 +41,19 @@
|
|||||||
|
|
||||||
using namespace std;
|
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,
|
const char* format_str, bool activ, bool has_shadow,
|
||||||
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_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;
|
x = x_pos;
|
||||||
y = y_pos;
|
y = y_pos;
|
||||||
width = w;
|
width = w;
|
||||||
@@ -63,15 +64,6 @@ CComponentsFrmClock::CComponentsFrmClock( const int x_pos, const int y_pos, cons
|
|||||||
col_body = color_body;
|
col_body = color_body;
|
||||||
col_shadow = color_shadow;
|
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;
|
cc_item_type = CC_ITEMTYPE_FRM_CLOCK;
|
||||||
corner_rad = RADIUS_SMALL;
|
corner_rad = RADIUS_SMALL;
|
||||||
|
|
||||||
@@ -80,7 +72,7 @@ void CComponentsFrmClock::initVarClock()
|
|||||||
dyn_font_size = 0;
|
dyn_font_size = 0;
|
||||||
|
|
||||||
cl_col_text = COL_MENUCONTENT_TEXT;
|
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_align = CC_ALIGN_VER_CENTER | CC_ALIGN_HOR_CENTER;
|
||||||
|
|
||||||
cl_thread = 0;
|
cl_thread = 0;
|
||||||
@@ -88,6 +80,11 @@ void CComponentsFrmClock::initVarClock()
|
|||||||
|
|
||||||
activeClock = true;
|
activeClock = true;
|
||||||
cl_blink_str = "";
|
cl_blink_str = "";
|
||||||
|
paintClock = false;
|
||||||
|
|
||||||
|
activeClock = activ;
|
||||||
|
if (activeClock)
|
||||||
|
startThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
CComponentsFrmClock::~CComponentsFrmClock()
|
CComponentsFrmClock::~CComponentsFrmClock()
|
||||||
|
@@ -78,7 +78,9 @@ class CComponentsFrmClock : public CComponentsForm
|
|||||||
int cl_align;
|
int cl_align;
|
||||||
|
|
||||||
///initialize all attributes and required objects
|
///initialize all attributes and required objects
|
||||||
void initVarClock();
|
void 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);
|
||||||
|
|
||||||
///initialize clock contents
|
///initialize clock contents
|
||||||
void initCCLockItems();
|
void initCCLockItems();
|
||||||
@@ -91,8 +93,7 @@ class CComponentsFrmClock : public CComponentsForm
|
|||||||
inline Font** getClockFont();
|
inline Font** getClockFont();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CComponentsFrmClock();
|
CComponentsFrmClock( const int& x_pos = 1, const int& y_pos = 1, const int& w = 200, const int& h = 48,
|
||||||
CComponentsFrmClock( const int x_pos, const int y_pos, const int w, const int h,
|
|
||||||
const char* format_str = "%H:%M", bool activ=true, bool has_shadow = CC_SHADOW_OFF,
|
const char* format_str = "%H:%M", bool activ=true, bool has_shadow = CC_SHADOW_OFF,
|
||||||
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
|
fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
|
||||||
virtual ~CComponentsFrmClock();
|
virtual ~CComponentsFrmClock();
|
||||||
|
Reference in New Issue
Block a user