I have a CEdit window in my application which I use as a sort of output console for text generated by my program.
Each subsection writes to its own string buffer and every 2 seconds I update the window. for this I use the following code. this is code I found on the internet.
Expand|Select|Wrap|Line Numbers
- CEdit ctrlPad;
- Frame::update(){
- string all = output + searchOutput + nl + resultOutput + nl;
- ctrlPad.SetWindowText(Text::toT(all).c_str());
- UpdateLayout();
- }
- Frame::UpdateLayout()
- {
- CRect rc;
- GetClientRect(rc);
- rc.bottom -= 1;
- rc.top += 1;
- rc.left +=1;
- rc.right -=1;
- ctrlPad.MoveWindow(rc);
- }
the code works in the way that it indeed updates the window. the problem is that it also puts the current view of the document at the top. this is rather irritating if the output stretches a couple of pages and every 2 seconds you get booted back to the top of the first page.
the question is how do I modify this code so that additional text is added to the window without the view jumping to the top.
I hope the problem is clear, it is not easy to explean without actualy seeing it :)
anyway thanks in advance for helping :p,
stefaan