CSignalBar: unified var init inside constructors

Origin commit data
------------------
Commit: e61a4e46c0
Author: Thilo Graf <dbt@novatux.de>
Date: 2016-04-26 (Tue, 26 Apr 2016)
This commit is contained in:
2016-04-26 12:02:49 +02:00
parent a404fca5c1
commit 301046f963
2 changed files with 28 additions and 31 deletions

View File

@@ -40,17 +40,37 @@ using namespace std;
CSignalBar::CSignalBar(CComponentsForm *parent)
{
initVarSigBar();
sb_name = "SIG";
initDimensions();
initSBItems();
initParent(parent);
initVarSigBar(0, 0, 100, SB_MIN_HEIGHT, NULL, "SIG", parent);
}
CSignalBar::CSignalBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const string& sbname, CComponentsForm *parent)
{
initVarSigBar();
initVarSigBar(xpos, ypos, w, h, frontend_ref, sbname, parent);
}
void CSignalBar::initVarSigBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const std::string& sbname, CComponentsForm *parent)
{
cc_item_type = CC_ITEMTYPE_FRM_SIGNALBAR;
corner_rad = 0;
corner_type = 0;
append_x_offset = 2;
append_y_offset = 2;
sb_scale_height = -1;
dy_font = CNeutrinoFonts::getInstance();
sb_caption_color= COL_INFOBAR_TEXT;
sb_val_mode = CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT;
sb_lastsig = 0;
sb_signal = 0;
sb_frontend = NULL;
sb_scale = NULL;
sb_vlbl = NULL;
sb_lbl = NULL;
sb_frontend = frontend_ref;
x = xpos;
y = ypos;
@@ -99,29 +119,6 @@ void CSignalBar::initSBItems()
initSBarName();
}
void CSignalBar::initVarSigBar()
{
corner_rad = 0;
corner_type = 0;
append_x_offset = 2;
append_y_offset = 2;
height = SB_MIN_HEIGHT;
cc_item_type = CC_ITEMTYPE_FRM_SIGNALBAR;
sb_scale_height = -1;
dy_font = CNeutrinoFonts::getInstance();
sb_caption_color= COL_INFOBAR_TEXT;
sb_val_mode = CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT;
sb_lastsig = 0;
sb_signal = 0;
sb_frontend = NULL;
sb_scale = NULL;
sb_vlbl = NULL;
sb_lbl = NULL;
}
void CSignalBar::initSBarScale()
{
//create scale object if required

View File

@@ -91,7 +91,7 @@ class CSignalBar : public CComponentsForm, public CCTextScreen
uint16_t sb_signal;
///initialize all needed basich attributes and objects
void initVarSigBar();
void initVarSigBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const std::string& sb_name, CComponentsForm *parent);
///initianlize position and dimensions of signalbar container
void initDimensions();
///initialize scale object