From b8c4a6438548641c8b1e8ed462c656af6ff7b9e3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 12 Jul 2015 18:38:32 +0200 Subject: [PATCH] CComponentsText: add switch for utf8 disable/enable Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ccdaacb0a0025a1894705bf34844953289066419 Author: Thilo Graf Date: 2015-07-12 (Sun, 12 Jul 2015) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_item_text.cpp | 2 ++ src/gui/components/cc_item_text.h | 5 +++++ src/gui/widget/textbox.h | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index c24e255e0..dd6bec049 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -104,6 +104,7 @@ void CComponentsText::initVarText( const int x_pos, const int y_pos, const int w ct_text_sent = false; ct_paint_textbg = false; ct_force_text_paint = false; + ct_utf8_encoded = true; initCCText(); initParent(parent); @@ -148,6 +149,7 @@ void CComponentsText::initCCText() ct_textbox->setWindowMaxDimensions(iWidth, iHeight); ct_textbox->setWindowMinDimensions(iWidth, iHeight); ct_textbox->enableSaveScreen(save_tbox_screen); + ct_textbox->enableUTF8(ct_utf8_encoded); //observe behavior of parent form if available bool force_text_paint = ct_force_text_paint; diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index 0b89f2b1a..c781be040 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -63,6 +63,8 @@ class CComponentsText : public CComponentsItem, public CBox ///status: cached text string, mainly required to compare with current text std::string ct_old_text; + bool ct_utf8_encoded; + ///status: current text string is sent to CTextBox object bool ct_text_sent; ///property: send to CTextBox object enableBackgroundPaint(true) @@ -170,6 +172,9 @@ class CComponentsText : public CComponentsItem, public CBox if (ct_textbox) ct_textbox->enableSaveScreen(mode); } + ///enable/disable utf8 encoding + void enableUTF8(bool enable = true){ct_utf8_encoded = enable;} + void disableUTF8(bool enable = false){enableUTF8(enable);} }; diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index e65bb1e96..7ba687443 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -194,7 +194,7 @@ class CTextBox void setWindowMinDimensions(const int width, const int height); void setFontUseDigitHeight(bool set=true); void enableUTF8(bool enable = true){m_utf8_encoded = enable;} - void disableUTF8(bool enable = false){enableUTF8(false);} + void disableUTF8(bool enable = false){enableUTF8(enable);} inline bool isPainted(void) {if( frameBuffer == NULL) return (false); else return (true);}; inline CBox getWindowsPos(void) {return(m_cFrame);};