Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Append line into LineEdit or DocEdit
Append line into LineEdit or DocEdit [message #47078] |
Tue, 29 November 2016 11:58 |
|
Hi,
i have problem, i want just to add line into LineEdit or DocEdit.
I try (lignes is a LineEdit object and texte a Upp::String)
serveur.lignes <<= texte << "\n";
or
client.lignes.Insert(-1, ~(texte << "\n"));
but without succes.
How i can create simple text area, with vertical scrollbar, and write line into this ?
Thank you for your help !
|
|
|
|
Re: Append line into LineEdit or DocEdit [message #47082 is a reply to message #47080] |
Tue, 29 November 2016 21:50 |
Zbych
Messages: 327 Registered: July 2009
|
Senior Member |
|
|
I usually use LineEdit and this code from TheIDE to implement log window:
void XXX::Log(const String& txt)
{
int l, h;
log.GetSelection(l, h);
log.SetEditable();
log.MoveTextEnd();
Vector<String> v = Split(txt, '\n');
auto t = GetSysTime();
for (int i = 0; i < v.GetCount(); i++){
log.Paste(WString(Format("\n%02d:%02d:%02d: %s", t.hour, t.minute, t.second, v[i])));
}
log.SetReadOnly();
log.SetSelection(l, h);
log.ScrollEnd();
}
[Updated on: Tue, 29 November 2016 21:52] Report message to a moderator
|
|
|
|
|
Re: Append line into LineEdit or DocEdit [message #47091 is a reply to message #47088] |
Thu, 01 December 2016 14:31 |
|
deep
Messages: 265 Registered: July 2011 Location: Bangalore
|
Experienced Member |
|
|
Hi,
If you want to keep appending new lines to LineEdit following will work.
LineEdit lineedit;
for ( int i = 0; i < 10; i++ )
{
s.Clear();
s << "String >> " << i << "\n";
lineedit.Paste ( s.ToWString() );
}
Warm Regards
Deepak
|
|
|
Goto Forum:
Current Time: Fri Dec 13 22:52:14 CET 2024
Total time taken to generate the page: 0.03511 seconds
|