mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CComponentsIconForm: rework constructors
This commit is contained in:
@@ -35,36 +35,34 @@ using namespace std;
|
||||
//sub class CComponentsIconForm inherit from CComponentsForm
|
||||
CComponentsIconForm::CComponentsIconForm()
|
||||
{
|
||||
initVarIconForm();
|
||||
initVarIconForm(1, 1, 0, 0, vector<string>());
|
||||
}
|
||||
|
||||
|
||||
CComponentsIconForm::CComponentsIconForm(const int x_pos, const int y_pos, const int w, const int h, const std::vector<std::string> &v_icon_names, bool has_shadow,
|
||||
CComponentsIconForm::CComponentsIconForm( const int &x_pos, const int &y_pos, const int &w, const int &h,
|
||||
const std::vector<std::string> &v_icon_names,
|
||||
bool has_shadow,
|
||||
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
|
||||
{
|
||||
initVarIconForm();
|
||||
initVarIconForm(x_pos, y_pos, w, h, v_icon_names, has_shadow, color_frame, color_body, color_shadow);
|
||||
}
|
||||
|
||||
void CComponentsIconForm::initVarIconForm( const int &x_pos, const int &y_pos, const int &w, const int &h,
|
||||
const std::vector<std::string> &v_icon_names,
|
||||
bool has_shadow,
|
||||
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_FRM_ICONFORM;
|
||||
|
||||
x = x_pos;
|
||||
y = y_pos;
|
||||
width = w;
|
||||
height = h;
|
||||
v_icons = v_icon_names;
|
||||
shadow = has_shadow;
|
||||
col_frame = color_frame;
|
||||
col_body = color_body;
|
||||
col_shadow = color_shadow;
|
||||
|
||||
v_icons = v_icon_names;
|
||||
}
|
||||
|
||||
void CComponentsIconForm::initVarIconForm()
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_FRM_ICONFORM;
|
||||
|
||||
//set default width and height to 0, this causes a dynamic adaptation of width and height of form
|
||||
width = 0;
|
||||
height = 0;
|
||||
|
||||
v_icons.clear();
|
||||
ccif_offset = 2;
|
||||
ccif_icon_align = CC_ICONS_FRM_ALIGN_LEFT;
|
||||
}
|
||||
|
@@ -25,7 +25,6 @@
|
||||
#define __CC_FORM_ICONS_H__
|
||||
|
||||
#include "cc_frm.h"
|
||||
#include "cc_frm_icons.h"
|
||||
|
||||
class CComponentsIconForm : public CComponentsForm
|
||||
{
|
||||
@@ -35,12 +34,20 @@ class CComponentsIconForm : public CComponentsForm
|
||||
void initMaxHeight(int *pheight);
|
||||
|
||||
protected:
|
||||
void initVarIconForm();
|
||||
void initVarIconForm( const int &x_pos, const int &y_pos, const int &w, const int &h,
|
||||
const std::vector<std::string> &v_icon_names,
|
||||
bool has_shadow = CC_SHADOW_OFF,
|
||||
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
|
||||
fb_pixel_t color_body = COL_MENUHEAD_PLUS_0,
|
||||
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
|
||||
|
||||
public:
|
||||
CComponentsIconForm();
|
||||
CComponentsIconForm(const int x_pos, const int y_pos, const int w, const int h, const std::vector<std::string> &v_icon_names, bool has_shadow = CC_SHADOW_OFF,
|
||||
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
|
||||
CComponentsIconForm( const int &x_pos, const int &y_pos, const int &w, const int &h,
|
||||
const std::vector<std::string> &v_icon_names,
|
||||
bool has_shadow = CC_SHADOW_OFF,
|
||||
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
|
||||
fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
|
||||
// ~CComponentsIconForm(); //inherited from CComponentsForm
|
||||
|
||||
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||
|
Reference in New Issue
Block a user