CTextBox: rework return control of value of setText() function

value was not clearly, hope i'ts now
This commit is contained in:
2017-01-17 08:53:12 +01:00
committed by M. Liebmann
parent d31deac545
commit 1120e3a37d

View File

@@ -789,23 +789,26 @@ void CTextBox::refresh(void)
bool CTextBox::setText(const std::string* newText, int max_width, bool force_repaint) bool CTextBox::setText(const std::string* newText, int max_width, bool force_repaint)
{ {
//TRACE("[CTextBox]->SetText \r\n"); //TRACE("[CTextBox]->SetText \r\n");
bool result = false;
m_nMaxTextWidth = max_width; m_nMaxTextWidth = max_width;
//reset text to force repaint the text, managed in hasChanged() //reset text to force repaint the text, managed in hasChanged()
if (force_repaint) if (force_repaint)
m_old_cText = ""; m_old_cText = "";
//printf("setText: _max_width %d max_width %d\n", _max_width, max_width); //printf("setText: _max_width %d max_width %d\n", _max_width, max_width);
if (newText != NULL) if (newText){
{
m_cText = *newText; m_cText = *newText;
if (m_old_cText != m_cText){
//m_cText = *newText + "\n"; //FIXME test //m_cText = *newText + "\n"; //FIXME test
reSizeMainFrameHeight(m_cFrame.iHeight); reSizeMainFrameHeight(m_cFrame.iHeight);
//refresh text line array //refresh text line array
refreshTextLineArray(); refreshTextLineArray();
refresh(); refresh();
result = true; return true;
} }
return(result); return false;
}else
return false;
return true;
} }
void CTextBox::paint (void) void CTextBox::paint (void)