CComponentsText: add switch for utf8 disable/enable

This commit is contained in:
2015-07-12 18:38:32 +02:00
committed by Jacek Jendrzej
parent 37c863d141
commit ccdaacb0a0
3 changed files with 8 additions and 1 deletions

View File

@@ -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;

View File

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

View File

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