mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-03 02:41:21 +02:00
Merge remote-tracking branch 'check/next-cc'
needs buildfixing... Conflicts: src/eitd/sectionsd.cpp src/gui/audioplayer.cpp src/gui/bedit/bouqueteditor_channels.cpp src/gui/infoclock.cpp src/gui/infoviewer.cpp src/gui/motorcontrol.cpp src/gui/osd_setup.cpp src/gui/scan.cpp src/gui/scan_setup.cpp src/gui/streaminfo2.cpp src/gui/update.cpp src/gui/widget/progresswindow.cpp src/gui/widget/textbox.cpp src/neutrino.cpp src/zapit/include/zapit/femanager.h
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Based up Neutrino-GUI - Tuxbox-Project
|
||||
Based up Neutrino-GUI - Tuxbox-Project
|
||||
Copyright (C) 2001 by Steffen Hehn 'McClean'
|
||||
|
||||
Classes for generic GUI-related components.
|
||||
@@ -88,14 +88,14 @@ void CComponentsForm::clearCCItems()
|
||||
return;
|
||||
#ifdef DEBUG_CC
|
||||
printf(" [CComponentsForm] %s... delete %d cc-item(s) \n", __FUNCTION__, v_cc_items.size());
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
for(size_t i=0; i<v_cc_items.size(); i++) {
|
||||
if (v_cc_items[i]){
|
||||
#ifdef DEBUG_CC
|
||||
printf(" [CComponentsForm] %s... delete form cc-item %d of %d (type=%d)\n", __FUNCTION__, i+1, v_cc_items.size(), v_cc_items[i]->getItemType());
|
||||
#endif
|
||||
delete v_cc_items[i];
|
||||
delete v_cc_items[i];
|
||||
v_cc_items[i] = NULL;
|
||||
}
|
||||
}
|
||||
@@ -107,8 +107,8 @@ void CComponentsForm::initVarForm()
|
||||
{
|
||||
//CComponentsItem
|
||||
initVarItem();
|
||||
|
||||
|
||||
|
||||
|
||||
//simple default dimensions
|
||||
x = 0;
|
||||
y = 0;
|
||||
@@ -147,7 +147,7 @@ void CComponentsForm::addCCItem(CComponentsItem* cc_Item)
|
||||
cc_Item->setIndex(new_index);
|
||||
#ifdef DEBUG_CC
|
||||
printf(" %s-%d parent index = %d, assigned index ======> %d\n", __FUNCTION__, __LINE__, cc_item_index, new_index);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#ifdef DEBUG_CC
|
||||
else
|
||||
@@ -160,7 +160,7 @@ int CComponentsForm::getCCItemId(CComponentsItem* cc_Item)
|
||||
if (cc_Item){
|
||||
for (size_t i= 0; i< v_cc_items.size(); i++)
|
||||
if (v_cc_items[i] == cc_Item)
|
||||
return i;
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -224,7 +224,7 @@ void CComponentsForm::insertCCItem(const uint& cc_item_id, CComponentsItem* cc_I
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (v_cc_items.empty()){
|
||||
addCCItem(cc_Item);
|
||||
#ifdef DEBUG_CC
|
||||
@@ -306,13 +306,13 @@ void CComponentsForm::paintCCItems()
|
||||
//set required x-position to item
|
||||
if (xpos == CC_APPEND){
|
||||
auto_x += append_h_offset;
|
||||
cc_item->setRealXPos(auto_x + xpos + 1);
|
||||
cc_item->setRealXPos(auto_x + xpos + 1);
|
||||
auto_x += w_item;
|
||||
}
|
||||
else{
|
||||
else{
|
||||
cc_item->setRealXPos(this_x + xpos);
|
||||
auto_x = (cc_item->getRealXPos() + w_item);
|
||||
}
|
||||
}
|
||||
|
||||
//set required y-position to item
|
||||
if (ypos == CC_APPEND){
|
||||
@@ -320,17 +320,17 @@ void CComponentsForm::paintCCItems()
|
||||
cc_item->setRealYPos(auto_y + ypos + 1);
|
||||
auto_y += h_item;
|
||||
}
|
||||
else{
|
||||
else{
|
||||
cc_item->setRealYPos(this_y + ypos);
|
||||
auto_y = (cc_item->getRealYPos() + h_item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//These steps check whether the element can be painted into the container.
|
||||
//These steps check whether the element can be painted into the container.
|
||||
//Is it too wide or too high, it will be shortened and displayed in the log.
|
||||
//This should be avoid!
|
||||
//checkwidth and adapt if required
|
||||
int right_frm = (cc_parent ? cc_xr : x) + width - 2*fr_thickness;
|
||||
//checkwidth and adapt if required
|
||||
int right_frm = (cc_parent ? cc_xr : x) + width - fr_thickness;
|
||||
int right_item = cc_item->getRealXPos() + w_item;
|
||||
int w_diff = right_item - right_frm;
|
||||
int new_w = w_item - w_diff;
|
||||
@@ -341,7 +341,7 @@ void CComponentsForm::paintCCItems()
|
||||
}
|
||||
|
||||
//check height and adapt if required
|
||||
int bottom_frm = (cc_parent ? cc_yr : y) + height - 2*fr_thickness;
|
||||
int bottom_frm = (cc_parent ? cc_yr : y) + height - fr_thickness;
|
||||
int bottom_item = cc_item->getRealYPos() + h_item;
|
||||
int h_diff = bottom_item - bottom_frm;
|
||||
int new_h = h_item - h_diff;
|
||||
@@ -367,7 +367,7 @@ void CComponentsForm::hide(bool no_restore)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//hide body
|
||||
hideCCItem(no_restore);
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ CComponentsButton::CComponentsButton( const int x_pos, const int y_pos, const i
|
||||
initVarButton();
|
||||
cc_btn_icon = icon_name;
|
||||
cc_btn_capt = caption;
|
||||
cc_btn_capt_col = COL_MENUCONTENT;
|
||||
cc_btn_capt_col = COL_MENUCONTENT_TEXT;
|
||||
cc_btn_text_w = cc_btn_font->getRenderWidth(cc_btn_capt, true);
|
||||
cc_btn_text_h = cc_btn_font->getHeight();
|
||||
|
||||
@@ -132,7 +132,7 @@ void CComponentsButton::initCaption()
|
||||
//set properties to label object
|
||||
if (cc_btn_capt_obj){
|
||||
cc_btn_capt_obj->setDimensionsAll(cap_x, cap_y, width-cap_x, height);
|
||||
cc_btn_capt_obj->setTextColor(this->cc_item_enabled ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE);
|
||||
cc_btn_capt_obj->setTextColor(this->cc_item_enabled ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT);
|
||||
cc_btn_capt_obj->setText(cc_btn_capt, CTextBox::NO_AUTO_LINEBREAK, cc_btn_font);
|
||||
cc_btn_capt_obj->forceTextPaint(); //here required;
|
||||
cc_btn_capt_obj->doPaintBg(false);
|
||||
|
@@ -70,7 +70,7 @@ void CComponentsFrmClock::initVarClock()
|
||||
corner_rad = RADIUS_SMALL;
|
||||
|
||||
cl_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO];
|
||||
cl_col_text = COL_MENUCONTENT;
|
||||
cl_col_text = COL_MENUCONTENT_TEXT;
|
||||
cl_format_str = "%H:%M";
|
||||
cl_align = CC_ALIGN_VER_CENTER | CC_ALIGN_HOR_CENTER;
|
||||
|
||||
@@ -140,7 +140,7 @@ void CComponentsFrmClock::initCCLockItems()
|
||||
lbl->setCornerType(corner_type);
|
||||
|
||||
//set text border to 0
|
||||
lbl->setTextBorderWidth(0);
|
||||
lbl->setTextBorderWidth(0,0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -107,7 +107,7 @@ void CComponentsHeader::initVarHeader()
|
||||
cch_icon_name = NULL;
|
||||
cch_btn_obj = NULL;
|
||||
cch_text = "";
|
||||
cch_col_text = COL_MENUHEAD;
|
||||
cch_col_text = COL_MENUHEAD_TEXT;
|
||||
cch_items_y = 0;
|
||||
cch_offset = 8;
|
||||
cch_icon_x = cch_offset;
|
||||
|
@@ -67,7 +67,7 @@ class CComponentsInfoBox : public CComponentsText
|
||||
CComponentsInfoBox( const int x_pos, const int y_pos, const int w, const int h,
|
||||
std::string info_text = "", const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL,
|
||||
bool has_shadow = CC_SHADOW_OFF,
|
||||
fb_pixel_t color_text = COL_MENUCONTENT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
|
||||
fb_pixel_t color_text = COL_MENUCONTENT_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
|
||||
|
||||
~CComponentsInfoBox();
|
||||
|
||||
|
@@ -202,7 +202,7 @@ void CProgressBar::paintAdvanced()
|
||||
if (pb_active_width > pb_last_width) {
|
||||
int step, off;
|
||||
int b = 0;
|
||||
uint8_t diff = 0;
|
||||
uint32_t diff = 0;
|
||||
for (i = 0; (i < rd) && (i < maxi); i++) {
|
||||
diff = i * 255 / rd;
|
||||
if (pb_invert)
|
||||
@@ -252,7 +252,7 @@ void CProgressBar::paintAdvanced()
|
||||
}
|
||||
}
|
||||
for(i = maxi; i < total; i++) {
|
||||
for (j = 0; j < hcnt; j++) {//TODO: use shape cc-item
|
||||
for (j = 0; j < hcnt; j++) {
|
||||
int sh_x = pb_x + i * itemw;
|
||||
int sh_y = py + j * itemh;
|
||||
paintShapes(sh_x, sh_y, pointx, pointy, pb_passive_col); //fill passive
|
||||
@@ -288,5 +288,6 @@ void CProgressBar::paintProgress(bool do_save_bg)
|
||||
|
||||
void CProgressBar::paint(bool do_save_bg)
|
||||
{
|
||||
|
||||
paintProgress(do_save_bg);
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
Based up Neutrino-GUI - Tuxbox-Project
|
||||
Copyright (C) 2001 by Steffen Hehn 'McClean'
|
||||
|
||||
|
||||
(C) 2008, 2013 by Thilo Graf
|
||||
(C) 2009,2010,2013 Stefan Seyfried
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
///
|
||||
///
|
||||
/*!
|
||||
description of parameters:
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
paintZero > optional, if set to true and value = 0, then paints a diagonal line instead of active bar as symbolic for a zero value
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __CC_PROGRESSBAR_H__
|
||||
#define __CC_PROGRESSBAR_H__
|
||||
|
||||
@@ -57,28 +57,28 @@ class CProgressBar : public CComponentsItem
|
||||
{
|
||||
protected:
|
||||
void initVarProgressbar();
|
||||
|
||||
|
||||
private:
|
||||
///colors of active and passive bar area, active means the displayed value, passive the neutral area
|
||||
fb_pixel_t pb_active_col, pb_passive_col;
|
||||
|
||||
|
||||
int pb_last_width;
|
||||
|
||||
///width of progress
|
||||
int pb_active_width, pb_passive_width;
|
||||
|
||||
|
||||
///maximal width,heigth of progress
|
||||
int pb_max_width, pb_height;
|
||||
|
||||
///start position of bars
|
||||
int pb_start_x_passive;
|
||||
|
||||
|
||||
///color values
|
||||
int pb_red, pb_green, pb_yellow;
|
||||
|
||||
///start position of activ/passiv area
|
||||
int pb_x, pb_y;
|
||||
|
||||
|
||||
bool pb_blink, pb_invert, pb_bl_changed;
|
||||
|
||||
///causes a diagonal line as a sign for 0 value instead of an empty bar
|
||||
@@ -92,13 +92,13 @@ class CProgressBar : public CComponentsItem
|
||||
///paint version of progressbar with color and advanced display modifications
|
||||
void paintAdvanced();
|
||||
///painting of activ/passive bars via shape object
|
||||
void paintShapes(int &shx, int ­, int &shw, int &shh, fb_pixel_t &col);
|
||||
|
||||
static void paintShapes(int &shx, int ­, int &shw, int &shh, fb_pixel_t &col);
|
||||
|
||||
void initDimensions();
|
||||
|
||||
///paints graph
|
||||
void paintProgress(bool do_save_bg = CC_SAVE_SCREEN_NO);
|
||||
|
||||
|
||||
static inline unsigned int make16color(__u32 rgb){return 0xFF000000 | rgb;};
|
||||
|
||||
public:
|
||||
@@ -128,7 +128,7 @@ class CProgressBar : public CComponentsItem
|
||||
|
||||
///causes painting a diagonal line if value = 0, Note: ineffective in colored mode
|
||||
void setZeroLine(bool paint_zero_line = true){pb_paint_zero = paint_zero_line;};
|
||||
|
||||
|
||||
///setters for status colors
|
||||
void setActiveColor(fb_pixel_t active_color) {pb_active_col = active_color;};
|
||||
void setPassiveColor(fb_pixel_t passive_color) {pb_passive_col = passive_color;};
|
||||
@@ -149,7 +149,7 @@ class CProgressBar : public CComponentsItem
|
||||
const int val, const int max_val){x=x_pos; y=y_pos; width=w; height=h; pb_value=val; pb_max_value=max_val;};
|
||||
|
||||
///force update on next paint
|
||||
void reset() { pb_last_width = -1; }
|
||||
void reset() { pb_last_width = -1; }
|
||||
void paint(bool do_save_bg = CC_SAVE_SCREEN_NO);
|
||||
|
||||
enum pb_color_t {
|
||||
@@ -160,5 +160,5 @@ class CProgressBar : public CComponentsItem
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* __CC_PROGRESSBAR_H__ */
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Based up Neutrino-GUI - Tuxbox-Project
|
||||
Based up Neutrino-GUI - Tuxbox-Project
|
||||
Copyright (C) 2001 by Steffen Hehn 'McClean'
|
||||
|
||||
Classes for generic GUI-related components.
|
||||
@@ -49,7 +49,7 @@ class CComponentsShapeCircle : public CComponentsItem
|
||||
///set property: diam
|
||||
inline void setDiam(const int& diam){d=width=height=diam, corner_rad=d/2;};
|
||||
///get property: diam
|
||||
inline int getDiam(){return d;};
|
||||
inline int getDiam() const {return d;};
|
||||
|
||||
///paint item
|
||||
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||
@@ -60,7 +60,7 @@ class CComponentsShapeSquare : public CComponentsItem
|
||||
public:
|
||||
CComponentsShapeSquare( const int x_pos, const int y_pos, const int w, const int h, bool has_shadow = CC_SHADOW_ON,
|
||||
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
|
||||
|
||||
|
||||
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||
};
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Based up Neutrino-GUI - Tuxbox-Project
|
||||
Based up Neutrino-GUI - Tuxbox-Project
|
||||
Copyright (C) 2001 by Steffen Hehn 'McClean'
|
||||
|
||||
Classes for generic GUI-related components.
|
||||
@@ -42,6 +42,8 @@ CComponentsText::CComponentsText()
|
||||
{
|
||||
//CComponentsText
|
||||
initVarText();
|
||||
|
||||
initCCText();
|
||||
}
|
||||
|
||||
CComponentsText::CComponentsText( const int x_pos, const int y_pos, const int w, const int h,
|
||||
@@ -57,17 +59,17 @@ CComponentsText::CComponentsText( const int x_pos, const int y_pos, const int w,
|
||||
y = y_pos,
|
||||
width = w;
|
||||
height = h;
|
||||
|
||||
|
||||
col_frame = color_frame;
|
||||
col_body = color_body;
|
||||
col_shadow = color_shadow;
|
||||
shadow = has_shadow;
|
||||
|
||||
|
||||
ct_font = font_text;
|
||||
ct_text = text;
|
||||
ct_text_mode = mode;
|
||||
ct_col_text = color_text;
|
||||
|
||||
|
||||
initCCText();
|
||||
}
|
||||
|
||||
@@ -90,18 +92,24 @@ void CComponentsText::initVarText()
|
||||
|
||||
//CComponentsText
|
||||
ct_font = NULL;
|
||||
ct_box = NULL;
|
||||
ct_textbox = NULL;
|
||||
ct_text = "";
|
||||
ct_old_text = ct_text;
|
||||
ct_text_mode = CTextBox::AUTO_WIDTH;
|
||||
|
||||
pX = &x;
|
||||
pY = &y;
|
||||
pHeight = &height;
|
||||
pWidth = &width;
|
||||
|
||||
/* we need a minimal borderwith of 1px because the edge-smoothing
|
||||
(or fontrenderer?) otherwise will paint single pixels outside the
|
||||
defined area. e.g. 'j' is leaving such residues */
|
||||
ct_text_border = 1;
|
||||
ct_text_Hborder = 1;
|
||||
ct_text_Vborder = 0;
|
||||
|
||||
ct_col_text = COL_MENUCONTENT;
|
||||
ct_col_text = COL_MENUCONTENT_TEXT;
|
||||
ct_old_col_text = ct_col_text;
|
||||
ct_text_sent = false;
|
||||
ct_paint_textbg = false;
|
||||
ct_force_text_paint = false;
|
||||
@@ -117,24 +125,17 @@ void CComponentsText::initCCText()
|
||||
//define height from font size
|
||||
height = max(height, ct_font->getHeight());
|
||||
|
||||
//text box dimensions
|
||||
if (ct_box== NULL){
|
||||
//ensure that we have a new instance
|
||||
delete ct_box;
|
||||
ct_box = NULL;
|
||||
}
|
||||
|
||||
//using of real x/y values to paint images if this text object is bound in a parent form
|
||||
int tx = x, ty = y;
|
||||
if (cc_parent){
|
||||
tx = cc_xr;
|
||||
ty = cc_yr;
|
||||
}
|
||||
ct_box = new CBox();
|
||||
ct_box->iX = tx+fr_thickness;
|
||||
ct_box->iY = ty+fr_thickness;
|
||||
ct_box->iWidth = width-2*fr_thickness;
|
||||
ct_box->iHeight = height-2*fr_thickness;
|
||||
//init text box dimensions
|
||||
this->iX/*x*/ = tx+fr_thickness;
|
||||
this->iY/*y*/ = ty+fr_thickness;
|
||||
this->iWidth/*width*/ = width-2*fr_thickness;
|
||||
this->iHeight/*height*/ = height-2*fr_thickness;
|
||||
|
||||
//init textbox
|
||||
if (ct_textbox == NULL)
|
||||
@@ -143,30 +144,27 @@ void CComponentsText::initCCText()
|
||||
//set text box properties
|
||||
ct_textbox->setTextFont(ct_font);
|
||||
ct_textbox->setTextMode(ct_text_mode);
|
||||
ct_textbox->setWindowPos(ct_box);
|
||||
ct_textbox->setTextBorderWidth(ct_text_border);
|
||||
ct_textbox->setWindowPos(this);
|
||||
ct_textbox->setTextBorderWidth(ct_text_Hborder, ct_text_Vborder);
|
||||
ct_textbox->enableBackgroundPaint(ct_paint_textbg);
|
||||
ct_textbox->setBackGroundColor(col_body);
|
||||
ct_textbox->setBackGroundRadius(corner_rad-fr_thickness, corner_type);
|
||||
ct_textbox->setTextColor(ct_col_text);
|
||||
ct_textbox->setWindowMaxDimensions(ct_box->iWidth, ct_box->iHeight);
|
||||
ct_textbox->setWindowMinDimensions(ct_box->iWidth, ct_box->iHeight);
|
||||
ct_textbox->setWindowMaxDimensions(width, height);
|
||||
ct_textbox->setWindowMinDimensions(width, height);
|
||||
|
||||
//send text to CTextBox object, but paint text only if text has changed or force option is enabled
|
||||
if ((ct_old_text != ct_text) || ct_force_text_paint)
|
||||
ct_text_sent = ct_textbox->setText(&ct_text, ct_box->iWidth);
|
||||
ct_old_text = ct_text;
|
||||
//send text to CTextBox object, but paint text only if text or text coloer has changed or force option is enabled
|
||||
if ((ct_old_text != ct_text) || ct_old_col_text != ct_col_text || ct_force_text_paint)
|
||||
ct_text_sent = ct_textbox->setText(&ct_text, this->iWidth);
|
||||
ct_old_text = ct_text;
|
||||
ct_old_col_text = ct_col_text;
|
||||
#ifdef DEBUG_CC
|
||||
printf(" [CComponentsText] [%s - %d] init text: %s [x %d, y %d, w %d, h %d]\n", __FUNCTION__, __LINE__, ct_text.c_str(), ct_box->iX, ct_box->iY, ct_box->iWidth, ct_box->iHeight);
|
||||
printf(" [CComponentsText] [%s - %d] init text: %s [x %d, y %d, w %d, h %d]\n", __FUNCTION__, __LINE__, ct_text.c_str(), this->iX, this->iY, this->iWidth, this->iHeight);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CComponentsText::clearCCText()
|
||||
{
|
||||
if (ct_box)
|
||||
delete ct_box;
|
||||
ct_box = NULL;
|
||||
|
||||
if (ct_textbox)
|
||||
delete ct_textbox;
|
||||
ct_textbox = NULL;
|
||||
@@ -206,21 +204,21 @@ bool CComponentsText::setTextFromFile(const string& path_to_textfile, const int
|
||||
{
|
||||
string file = path_to_textfile;
|
||||
string txt = "";
|
||||
|
||||
|
||||
ifstream in (file.c_str(), ios::in);
|
||||
if (!in){
|
||||
printf("[CComponentsText] [%s - %d] error while open %s -> %s\n", __FUNCTION__, __LINE__, file.c_str(), strerror(errno));
|
||||
return false;
|
||||
}
|
||||
string line;
|
||||
|
||||
|
||||
while(getline(in, line)){
|
||||
txt += line + '\n';
|
||||
}
|
||||
in.close();
|
||||
|
||||
setText(txt, mode, font_text);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Based up Neutrino-GUI - Tuxbox-Project
|
||||
Based up Neutrino-GUI - Tuxbox-Project
|
||||
Copyright (C) 2001 by Steffen Hehn 'McClean'
|
||||
|
||||
Classes for generic GUI-related components.
|
||||
@@ -38,22 +38,24 @@ Handling of text parts based up CTextBox attributes and methodes.
|
||||
CComponentsText provides a interface to the embedded CTextBox object.
|
||||
*/
|
||||
|
||||
class CComponentsText : public CComponentsItem
|
||||
class CComponentsText : public CComponentsItem, public CBox
|
||||
{
|
||||
protected:
|
||||
///object: CTextBox object
|
||||
CTextBox * ct_textbox;
|
||||
///object: CBox object
|
||||
CBox * ct_box;
|
||||
///object: Fontrenderer object
|
||||
Font * ct_font;
|
||||
|
||||
///property: CTextBox object
|
||||
///property: text color
|
||||
fb_pixel_t ct_col_text;
|
||||
///property: cached text color
|
||||
fb_pixel_t ct_old_col_text;
|
||||
///property: text display modes, see textbox.h for possible modes
|
||||
int ct_text_mode;
|
||||
///property: text border width
|
||||
int ct_text_border;
|
||||
///property: horizontal text border width (left and right)
|
||||
int ct_text_Hborder;
|
||||
///property: vertical text border width (top and buttom)
|
||||
int ct_text_Vborder;
|
||||
///property: current text string
|
||||
std::string ct_text;
|
||||
///status: cached text string, mainly required to compare with current text
|
||||
@@ -63,7 +65,7 @@ class CComponentsText : public CComponentsItem
|
||||
bool ct_text_sent;
|
||||
///property: send to CTextBox object enableBackgroundPaint(true)
|
||||
bool ct_paint_textbg;
|
||||
|
||||
|
||||
///property: force sending text to the CTextBox object, false= text only sended, if text was changed, see also textChanged()
|
||||
bool ct_force_text_paint;
|
||||
|
||||
@@ -75,7 +77,7 @@ class CComponentsText : public CComponentsItem
|
||||
|
||||
///destroy current CTextBox and CBox objects
|
||||
void clearCCText();
|
||||
|
||||
|
||||
///initialize all required attributes for text and send to the CTextBox object
|
||||
void initCCText();
|
||||
///paint CCItem backckrond (if paint_bg=true), apply initCCText() and send paint() to the CTextBox object
|
||||
@@ -85,14 +87,14 @@ class CComponentsText : public CComponentsItem
|
||||
CComponentsText( const int x_pos, const int y_pos, const int w, const int h,
|
||||
std::string text = "", const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL,
|
||||
bool has_shadow = CC_SHADOW_OFF,
|
||||
fb_pixel_t color_text = COL_MENUCONTENT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
|
||||
fb_pixel_t color_text = COL_MENUCONTENT_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
|
||||
virtual ~CComponentsText();
|
||||
|
||||
///default members to paint a text box and hide painted text
|
||||
///hide textbox
|
||||
void hide(bool no_restore = false);
|
||||
void hide(bool no_restore = false);
|
||||
///paint text box, parameter do_save_bg: default = true, causes fill of backckrond pixel buffer
|
||||
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||
|
||||
///send options for text font (size and type), color and mode (allignment)
|
||||
virtual inline void setTextFont(Font* font_text){ct_font = font_text;};
|
||||
@@ -101,7 +103,7 @@ class CComponentsText : public CComponentsItem
|
||||
///set text alignment, also see textbox.h for possible alignment modes
|
||||
virtual inline void setTextMode(const int mode){ct_text_mode = mode;};
|
||||
///set text border width
|
||||
virtual inline void setTextBorderWidth(const int border){ct_text_border = border;};
|
||||
virtual inline void setTextBorderWidth(const int Hborder, const int Vborder = 0){ct_text_Hborder = Hborder; ct_text_Vborder = Vborder;};
|
||||
|
||||
///send option to CTextBox object to paint background box behind text or not
|
||||
virtual inline void doPaintTextBoxBg(bool do_paintbox_bg){ ct_paint_textbg = do_paintbox_bg;};
|
||||
@@ -119,7 +121,7 @@ class CComponentsText : public CComponentsItem
|
||||
|
||||
///helper to remove linebreak chars from a string if needed
|
||||
virtual void removeLineBreaks(std::string& str);
|
||||
|
||||
|
||||
///returns true, if text was changed
|
||||
virtual bool textChanged(){return ct_old_text != ct_text;};
|
||||
///force paint of text even if text was changed or not
|
||||
@@ -144,7 +146,7 @@ class CComponentsLabel : public CComponentsText
|
||||
CComponentsLabel( const int x_pos, const int y_pos, const int w, const int h,
|
||||
std::string text = "", const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL,
|
||||
bool has_shadow = CC_SHADOW_OFF,
|
||||
fb_pixel_t color_text = COL_MENUCONTENTINACTIVE, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0)
|
||||
fb_pixel_t color_text = COL_MENUCONTENTINACTIVE_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0)
|
||||
:CComponentsText(x_pos, y_pos, w, h, text, mode, font_text, has_shadow, color_text, color_frame, color_body, color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_LABEL;
|
||||
@@ -153,7 +155,7 @@ class CComponentsLabel : public CComponentsText
|
||||
{
|
||||
initVarText();
|
||||
cc_item_type = CC_ITEMTYPE_LABEL;
|
||||
ct_col_text = COL_MENUCONTENTINACTIVE;
|
||||
ct_col_text = COL_MENUCONTENTINACTIVE_TEXT;
|
||||
};
|
||||
};
|
||||
|
||||
|
@@ -55,7 +55,7 @@ void CComponentsItemBox::initVarItemBox()
|
||||
initVarItem();
|
||||
|
||||
//CComponentsItemBox
|
||||
it_col_text = COL_MENUCONTENT;
|
||||
it_col_text = COL_MENUCONTENT_TEXT;
|
||||
hSpacer = 2;
|
||||
hOffset = 4;
|
||||
vOffset = 1;
|
||||
@@ -295,7 +295,7 @@ void CComponentsItemBox::paintText(size_t index, bool newElement)
|
||||
v_element_data[index].handler2 = (void*)textbox;
|
||||
}
|
||||
|
||||
textbox->setTextBorderWidth(0);
|
||||
textbox->setTextBorderWidth(0,0);
|
||||
textbox->enableBackgroundPaint(false);
|
||||
textbox->setTextFont(font_text);
|
||||
textbox->movePosition(box->iX, box->iY);
|
||||
@@ -498,7 +498,7 @@ void CComponentsTitleBar::initVarTitleBar()
|
||||
onlyOneTextElement = true;
|
||||
|
||||
font_text = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
|
||||
it_col_text = COL_MENUHEAD;
|
||||
it_col_text = COL_MENUHEAD_TEXT;
|
||||
|
||||
//CComponents
|
||||
x = 0;
|
||||
|
@@ -100,11 +100,11 @@ class CComponentsTitleBar : public CComponentsItemBox
|
||||
public:
|
||||
CComponentsTitleBar();
|
||||
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, const char* c_text = NULL, const std::string& s_icon ="",
|
||||
fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
|
||||
fb_pixel_t color_text = COL_MENUHEAD_TEXT, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
|
||||
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, const std::string& s_text ="", const std::string& s_icon ="",
|
||||
fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
|
||||
fb_pixel_t color_text = COL_MENUHEAD_TEXT, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
|
||||
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, neutrino_locale_t locale_text = NONEXISTANT_LOCALE, const std::string& s_icon ="",
|
||||
fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
|
||||
fb_pixel_t color_text = COL_MENUHEAD_TEXT, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
|
||||
|
||||
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||
|
||||
|
Reference in New Issue
Block a user