From 2e8f4d1b616e14fdbe5f09fc843ddc045d000032 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 5 Dec 2016 10:00:51 +0100 Subject: [PATCH 1/4] Helpbox: add doc Doc was missed. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/05bbf4d9b5705d2b8eb6d706ce1ee354941f504e Author: Thilo Graf Date: 2016-12-05 (Mon, 05 Dec 2016) ------------------ This commit was generated by Migit --- src/gui/widget/helpbox.h | 89 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 82 insertions(+), 7 deletions(-) diff --git a/src/gui/widget/helpbox.h b/src/gui/widget/helpbox.h index ba42cbf44..ed173f7fa 100644 --- a/src/gui/widget/helpbox.h +++ b/src/gui/widget/helpbox.h @@ -31,6 +31,7 @@ #define HELPBOX_DEFAULT_LINE_HEIGHT 0 // use font height as default #define HELPBOX_DEFAULT_LINE_INDENT OFFSET_INNER_MID +#define HELPBOX_DEFAULT_TEXT_MODE CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH class Helpbox : public CComponentsWindowMax { @@ -44,9 +45,30 @@ private: ///default font Font* hbox_font; public: + /** + * Creates a window with pre defined items added with addLine() or + * inhertited addWindowItem() methods. This allows to add any compatible cc-items types + * e.g. Text, label, infobox, images ... + * NOTE: addLine() members are used only for compatibilty with older implementation + * of lines. + * @param[in] Title + * @li exepts type std::string, defines caption of window + * @param[in] Default_Text + * @li optional: exepts type std::string, defines a pre defined help text + * @param[in] text_mode + * @li optional: exepts type int, defines text modes, see /gui/widget/textbox.h for possible modes + * @param[in] line_height + * @li optional: exepts type int, defines height of line + * @param[in] line_indent + * @li optional: exepts type int, defines lenght of indent from left + * @param[in] font_text + * @li optional: exepts type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used + * @param[in] Icon + * @li exepts type const char*, defins the title bar icon and can be name (see /gui/icons.h) or path to an image file + */ Helpbox( const std::string& Title, const std::string& Default_Text = std::string(), - const int& text_mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, + const int& text_mode = HELPBOX_DEFAULT_TEXT_MODE, const int& line_height = HELPBOX_DEFAULT_LINE_HEIGHT, Font* font_text = NULL, const char* Icon = NEUTRINO_ICON_INFO); @@ -54,35 +76,88 @@ public: ///show = paint, for compatibility void show(bool do_save_bg = true){ paint(do_save_bg) ;} + + /**Adds an item with pre defined text + * @param[in] text + * @li exepts type std::string + * @param[in] text_mode + * @li optional: exepts type int, defines text modes, see /gui/widget/textbox.h for possible modes + * @param[in] line_height + * @li optional: exepts type int, defines height of line + * @param[in] line_indent + * @li optional: exepts type int, defines lenght of indent from left + * @param[in] font_text + * @li optional: exepts type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used + */ void addLine( const std::string& text, - const int& text_mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, + const int& text_mode = HELPBOX_DEFAULT_TEXT_MODE, const int& line_height = HELPBOX_DEFAULT_LINE_HEIGHT, const int& line_indent = HELPBOX_DEFAULT_LINE_INDENT, Font* font_text = NULL); + /**Adds an item with pre defined text + * @param[in] text + * @li exepts type const char * + * @param[in] text_mode + * @li optional: exepts type int, defines text modes, see /gui/widget/textbox.h for possible modes + * @param[in] line_height + * @li optional: exepts type int, defines height of line + * @param[in] line_indent + * @li optional: exepts type int, defines lenght of indent from left + * @param[in] font_text + * @li optional: exepts type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used + */ void addLine( const char *text, - const int& text_mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, + const int& text_mode = HELPBOX_DEFAULT_TEXT_MODE, const int& line_height = HELPBOX_DEFAULT_LINE_HEIGHT, const int& line_indent = HELPBOX_DEFAULT_LINE_INDENT, Font* font_text = NULL); + /**Adds an item with pre defined icon and text + * @param[in] icon + * @li exepts type std::string, icon can be name (see /gui/icons.h) or path to an image file + * @param[in] text + * @li exepts type std::string + * @param[in] text_mode + * @li optional: exepts type int, defines text modes, see /gui/widget/textbox.h for possible modes + * @param[in] line_height + * @li optional: exepts type int, defines height of line + * @param[in] line_indent + * @li optional: exepts type int, defines lenght of indent from left + * @param[in] font_text + * @li optional: exepts type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used + */ void addLine( const std::string& icon, const std::string& text, - const int& text_mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, + const int& text_mode = HELPBOX_DEFAULT_TEXT_MODE, const int& line_height = HELPBOX_DEFAULT_LINE_HEIGHT, const int& line_indent = HELPBOX_DEFAULT_LINE_INDENT, Font* font_text = NULL); + /**Adds an item with pre defined icon and text + * @param[in] icon + * @li exepts type const char *, icon can be name (see /gui/icons.h) or path to an image file + * @param[in] text + * @li exepts type const char * + * @param[in] text_mode + * @li optional: exepts type int, defines text modes, see /gui/widget/textbox.h for possible modes + * @param[in] line_height + * @li optional: exepts type int, defines height of line + * @param[in] line_indent + * @li optional: exepts type int, defines lenght of indent from left + * @param[in] font_text + * @li optional: exepts type Font*, default = NULL, this means SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO is used + */ void addLine( const char *icon, const char *text, - const int& text_mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, + const int& text_mode = HELPBOX_DEFAULT_TEXT_MODE, const int& line_height = HELPBOX_DEFAULT_LINE_HEIGHT, const int& line_indent = HELPBOX_DEFAULT_LINE_INDENT, Font* font_text = NULL); - + ///adds a separator as horizontal line, arg 'line_height' defines the space of full separator height, the separator line itself has a defined height of 2px and is centered within line space. ///arg 'line_indent' defines begin of line from left border within body object. - ///arg 'enable_gradient' enable/disable gradient, Note: default = true, but gradient is only effected, if global/theme gradient settings are enabled! + ///gradient is only effected, if global/theme gradient settings are enabled! void addSeparatorLine( const int& line_height = HELPBOX_DEFAULT_LINE_HEIGHT, const int& line_indent = HELPBOX_DEFAULT_LINE_INDENT); ///adds a simple empty separator as horizontal space, arg 'line_height' defines the space of full separator height From 8ede581ef757a721f4997f9134990a7bd025ff32 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 5 Dec 2016 12:46:01 +0100 Subject: [PATCH 2/4] helpbox: allow multi-line lines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1b42318a2a935f8d7c31260b36ebd10d157ef992 Author: vanhofen Date: 2016-12-05 (Mon, 05 Dec 2016) Origin message was: ------------------ - helpbox: allow multi-line lines ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/helpbox.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/gui/widget/helpbox.cpp b/src/gui/widget/helpbox.cpp index f3f707038..fc0839d4f 100644 --- a/src/gui/widget/helpbox.cpp +++ b/src/gui/widget/helpbox.cpp @@ -75,11 +75,6 @@ void Helpbox::addLine(const std::string& icon, const std::string& text, const in int h_line = getLineHeight(line_height, font); CComponentsFrmChain *line = new CComponentsFrmChain(line_indent, hbox_y, 0, h_line); - if ((hbox_y + h_line)>ccw_body->getHeight()){ - addPagebreak(); - line->setYPos(hbox_y); - } - line->setPageNumber(page); int w_body = ccw_body->getWidth(); line->setWidth(w_body - 2*line_indent); @@ -99,15 +94,31 @@ void Helpbox::addLine(const std::string& icon, const std::string& text, const in line->addCCItem(picon); } + int txt_height = 0; if (!text.empty()){ int x_text = w_picon + (picon ? OFFSET_INNER_MID : 0); - CComponentsText * txt = new CComponentsText(x_text, 0, line->getWidth()-x_text, line->getHeight(), text, text_mode, font); + CComponentsText * txt = new CComponentsText(x_text, 0, line->getWidth()-x_text, 0, text, text_mode, font); #if 0 //"contrast agent", if you want to see where the text items are drawn. txt->setColorBody(COL_RED); txt->doPaintBg(true); #endif + int lines = txt->getCTextBoxObject()->getLines(); + txt_height = std::max(lines*font->getHeight(), h_line); + txt->setHeight(txt_height); + line->addCCItem(txt); } + + if (txt_height > line->getHeight()) + line->setHeight(txt_height); + + if ((hbox_y + line->getHeight()) > ccw_body->getHeight()) + { + addPagebreak(); + line->setYPos(hbox_y); + } + line->setPageNumber(page); + addWindowItem(line); } From 8e4b9462f273734e9846d267d73573d4a65df0c6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 5 Dec 2016 12:46:01 +0100 Subject: [PATCH 3/4] locale: more movieplayer additional help text Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/69e34a302023f12f18d5a29239530230986de988 Author: vanhofen Date: 2016-12-05 (Mon, 05 Dec 2016) Origin message was: ------------------ - locale: more movieplayer additional help text ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 4e5cf202c..b7c469fdc 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1828,7 +1828,7 @@ movieplayer.bookmarkname_hint2 movieplayer.chapters Kapitel movieplayer.fileplayback Abspielen (Multiformat) movieplayer.head Movieplayer -movieplayer.help_additional Weitere benutzerdefinierte Tastenbelegungen sind unter "Hauptmenü" > "Einstellungen" > "Tasten" > "Bearbeiten" > "Movieplayer" zu finden. +movieplayer.help_additional Weitere benutzerdefinierte Tastenbelegungen sind unter "Hauptmenü" > "Einstellungen" > "Tasten" > "Bearbeiten" > "Movieplayer" zu finden.\n\nWährend der Wiedergabe von Filmen sind im Hauptmenü einige Menüpunkte deaktiviert. movieplayer.help_button_1 1 Minute zurück movieplayer.help_button_2 Zum Filmanfang springen movieplayer.help_button_3 1 Minute vor diff --git a/data/locale/english.locale b/data/locale/english.locale index 0a5d1aff7..a432aedb7 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1828,7 +1828,7 @@ movieplayer.bookmarkname_hint2 movieplayer.chapters Chapters movieplayer.fileplayback File play movieplayer.head Movieplayer -movieplayer.help_additional To find more user definable key bindings, see "Mainmenu" > "Settings" > "Keys" > "Edit" > "Movieplayer". +movieplayer.help_additional To find more user definable key bindings, see "Mainmenu" > "Settings" > "Keys" > "Edit" > "Movieplayer".\n\nWhile movie playback some menuitems in mainmenu are deactivated. movieplayer.help_button_1 1 minute backward movieplayer.help_button_2 Jump to movie's start movieplayer.help_button_3 1 minute forward From 1f9ff7236595e19fe755a4b76da1e298be4f16cf Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 5 Dec 2016 12:46:01 +0100 Subject: [PATCH 4/4] locale: typo; we shouldn't open Manu XD Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ca53cbeb531d7c093f34ad32cf79edcdb69a006d Author: vanhofen Date: 2016-12-05 (Mon, 05 Dec 2016) Origin message was: ------------------ - locale: typo; we shouldn't open Manu XD ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/english.locale | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index a432aedb7..ac562fa40 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1840,7 +1840,7 @@ movieplayer.help_button_8 Jump to movie's end movieplayer.help_button_9 10 minutes forward movieplayer.help_button_backward Fast rewind movieplayer.help_button_forward Fast forward -movieplayer.help_button_menu Open main manu +movieplayer.help_button_menu Open main menu movieplayer.help_button_pause Pause / Continue movieplayer.help_button_stop Stop movieplayer.plugin Movieplayer plugin