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);};