diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index ea7949519..b2e40f79e 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -107,6 +107,7 @@ void CSignalBar::initVarSigBar() 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; @@ -144,7 +145,7 @@ void CSignalBar::initSBarValue() if (sb_vlbl == NULL){ sb_vlbl = new CComponentsLabel(); sb_vlbl->doPaintBg(false); - sb_vlbl->setText("0%", CTextBox::NO_AUTO_LINEBREAK, sb_font); + sb_vlbl->setText(" 0%", sb_val_mode, sb_font); } //move and set dimensions @@ -217,7 +218,7 @@ void CSignalBar::paintScale() i_str << sig; string percent(i_str.str()); percent += "%"; - sb_vlbl->setText(percent, CTextBox::NO_AUTO_LINEBREAK | CTextBox::CENTER, sb_font); + sb_vlbl->setText(percent, sb_val_mode, sb_font); //we must force paint backround, because of changing values sb_vlbl->doPaintBg(true); diff --git a/src/gui/components/cc_frm_signalbars.h b/src/gui/components/cc_frm_signalbars.h index 460270f12..a5730e785 100644 --- a/src/gui/components/cc_frm_signalbars.h +++ b/src/gui/components/cc_frm_signalbars.h @@ -82,6 +82,8 @@ class CSignalBar : public CComponentsForm int sb_vlbl_width; ///property: width of caption int sb_lbl_width; + ///property: text mode of value, predefined type = CTextBox::NO_AUTO_LINEBREAK | CTextBox::CENTER + int sb_val_mode; ///cache last assingned signal value int sb_lastsig; @@ -131,8 +133,10 @@ class CSignalBar : public CComponentsForm ///returns the scale object, type = CProgressBar* virtual CProgressBar* getScaleObject(){return sb_scale;}; - ///returns the caption object, type = CComponentsLabel* - virtual CComponentsLabel* getLabelObject(){return sb_lbl;}; + ///returns the value label object, type = CComponentsLabel* + virtual CComponentsLabel* getLabelValObject(){return sb_vlbl;}; + ///returns the name label object, type = CComponentsLabel* + virtual CComponentsLabel* getLabelNameObject(){return sb_lbl;}; ///paint this items virtual void paint(bool do_save_bg); @@ -278,7 +282,7 @@ class CSignalBox : public CComponentsForm ///get caption color of signalbars, see also property 'sbx_caption_color' fb_pixel_t getTextColor(){return sbx_caption_color;}; - ///assigns the width of scale + ///assigns the width of scale in percent related of full width of signal box, the rest is reserved for text void setScaleWidth(const short & scale_width_percent){sbx_scale_w_percent = scale_width_percent;}; ///paint items