mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-17 04:51:52 +00:00
Changed: Use addSlashR to replace \n by \r\n
This commit is contained in:
parent
08071b75dd
commit
7a270ff9c0
2 changed files with 3 additions and 15 deletions
|
@ -230,21 +230,9 @@ BOOL CBaseDialog::PreTranslateMessage(MSG* pMsg)
|
||||||
return CDialog::PreTranslateMessage(pMsg);
|
return CDialog::PreTranslateMessage(pMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBaseDialog::setEditTextMultiLine (CEdit &edit, const char *text)
|
void CBaseDialog::setEditTextMultiLine (CEdit &edit, const std::string &text)
|
||||||
{
|
{
|
||||||
string temp;
|
edit.SetWindowText (utf8ToTStr(addSlashR(text)));
|
||||||
uint size = strlen (text);
|
|
||||||
temp.reserve (2*size);
|
|
||||||
bool previousR=false;
|
|
||||||
for (uint c=0; c<size; c++)
|
|
||||||
{
|
|
||||||
if ((text[c] == '\n') && (!previousR))
|
|
||||||
temp += "\r\n";
|
|
||||||
else
|
|
||||||
temp += text[c];
|
|
||||||
previousR = (text[c] == '\r');
|
|
||||||
}
|
|
||||||
edit.SetWindowText (temp.c_str ());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBaseDialog::onOpenSelected()
|
void CBaseDialog::onOpenSelected()
|
||||||
|
|
|
@ -126,7 +126,7 @@ public:
|
||||||
void registerLastControl ();
|
void registerLastControl ();
|
||||||
void unRegisterLastControl ();
|
void unRegisterLastControl ();
|
||||||
|
|
||||||
static void setEditTextMultiLine (CEdit &edit, const char *text);
|
static void setEditTextMultiLine(CEdit &edit, const std::string &text);
|
||||||
|
|
||||||
virtual void onOpenSelected ();
|
virtual void onOpenSelected ();
|
||||||
virtual void setFocusLastWidget ();
|
virtual void setFocusLastWidget ();
|
||||||
|
|
Loading…
Reference in a new issue