CComponentsHeader: add possibility to modify text alignment

usable in header and its derived classes and in class CComponentsWindow


Origin commit data
------------------
Commit: 64c6eb5945
Author: Thilo Graf <dbt@novatux.de>
Date: 2013-10-23 (Wed, 23 Oct 2013)
This commit is contained in:
2013-10-23 15:46:11 +02:00
parent 25c3bc51db
commit cf38a73a3a
3 changed files with 30 additions and 17 deletions

View File

@@ -123,6 +123,7 @@ class CComponentsHeader : public CComponentsForm
int cch_items_y, cch_icon_x, cch_icon_w, cch_text_x, cch_buttons, cch_buttons_w, cch_buttons_h, cch_buttons_space, cch_offset;
std::vector<std::string> v_cch_btn;
int cch_size_mode;
int cch_caption_align;
void initIcon();
void initCaption();
@@ -162,8 +163,9 @@ class CComponentsHeader : public CComponentsForm
virtual ~CComponentsHeader();
virtual void setCaption(const std::string& caption);
virtual void setCaption(neutrino_locale_t caption_locale);
virtual void setCaption(const std::string& caption, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK);
virtual void setCaption(neutrino_locale_t caption_locale, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK);
virtual void setCaptionAlignment(const int& align_mode){cch_caption_align = align_mode;};
virtual void setCaptionFont(Font* font_name);
virtual void setCaptionColor(fb_pixel_t text_color){cch_col_text = text_color;};
virtual void setOffset(const int offset){cch_offset = offset;};
@@ -225,6 +227,8 @@ class CComponentsWindow : public CComponentsForm
CComponentsFooter * ccw_footer;
///property: caption in header, see also getHeaderObject()
std::string ccw_caption;
///property: alignment mode for header caption
int ccw_align_mode;
///property: icon name in header, see also getHeaderObject()
const char* ccw_icon_name;
///property: assigned default icon buttons in header, see also getHeaderObject()
@@ -293,10 +297,12 @@ class CComponentsWindow : public CComponentsForm
void showHeader(bool show = true){ccw_show_header = show;};
///set caption in header with string, see also getHeaderObject()
void setWindowCaption(const std::string& text){ccw_caption = text;};
void setWindowCaption(const std::string& text, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK){ccw_caption = text; ccw_align_mode = align_mode;};
///set caption in header from locales, see also getHeaderObject()
void setWindowCaption(neutrino_locale_t locale_text);
void setWindowCaption(neutrino_locale_t locale_text, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK);
///set caption alignment
void setWindowCaptionAlignment(const int& align_mode){ccw_align_mode = align_mode;};
///set icon name in header, see also getHeaderObject()
void setWindowIcon(const char* iconname){ccw_icon_name = iconname;};
@@ -309,7 +315,6 @@ class CComponentsWindow : public CComponentsForm
///returns a pointer to the internal body object, use this to get access to body properities
CComponentsForm* getBodyObject(){return ccw_body;};
///returns a pointer to the internal footer object, use this to get access to footer properities
CComponentsFooter* getFooterObject(){return ccw_footer;};