473,240 Members | 1,632 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,240 software developers and data experts.

CEdit window update problem

Hi all,

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
  1. CEdit ctrlPad;
  3. Frame::update(){
  4.         string all = output + searchOutput + nl + resultOutput + nl;
  5.         ctrlPad.SetWindowText(Text::toT(all).c_str());
  6.         UpdateLayout();
  7. }
  9. Frame::UpdateLayout()
  10. {
  11.     CRect rc;
  13.     GetClientRect(rc);
  15.     rc.bottom -= 1;
  16.     rc.top += 1;
  17.     rc.left +=1;
  18.     rc.right -=1;
  19.     ctrlPad.MoveWindow(rc);
  20. }

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,
Jul 17 '07 #1
2 2704
9,208 Expert Mod 8TB
The MoveWindow is inherited from CWnd. There are two overloads. The one you are using requires a struct and it calls Win32 MoveWindow with a repaint argumnet set to true. The repaint is most likely causing you windows to move on top.

Try the other overload:
Expand|Select|Wrap|Line Numbers
  1. Frame::UpdateLayout()
  2. {
  3.     CRect rc;
  5.     GetClientRect(rc);
  7.     rc.bottom -= 1;
  8.     rc.top += 1;
  9.     rc.left +=1;
  10.     rc.right -=1;
  11.     ctrlPad.MoveWindow(rc.left, rc.top, rc.right, rc.bottom, FALSE);
  12. }
You will need to redraw as necessary.

This is just a guess. Let me know what happens.
Jul 17 '07 #2
I have tried it, and it doesn't seem to make a difference :(

anymore idea's out there?

Jul 18 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

by: ragi | last post by:
I need put small animated gifs (like emoticons) into CEdit control in place of blinkinh caret. Thanks for help.
by: ced | last post by:
Hallo, I have some JS which creates a new 2-frame window. The new window (via onLoad) backfills a variable in the parent window so I'll know when it's safe to load the target frame. The...
by: garrry | last post by:
Here is the situation (in VisualC++6 environment): 1. some number is enterd into a CEdit window by user 2. the application has to obtain that number and do some calculations with it (just...
by: hamm.charlesw | last post by:
I have a small app that filters out illegal characters typed into a CEdit by doing a GetWindowText(), followed by the filtering, followed by a SetWindowText(), all within a routine fired from an...
by: rag84dec | last post by:
Hi, I am trying to write an MFC code which has the Dialog which has a menu option Edit which has an option "Copy File content"... Now i want to get the text entered in the Edit box.What function...
by: rag84dec | last post by:
HI, I have an MFC code which has a dialog and a menu.One menu option is Edit which has "Copy File content".There are 2 CEdit boxs.IDC_EDIT2 and IDC_EDIT3.I am reading the text in the Edit boxes. ...
by: xarzu | last post by:
How do you change the enabled state of an CEdit control? There does not seem to be any CEdit or CWnd member function that will do it. In MSDN, there mentions something about a Control Table. ...
by: abhishekjha22 | last post by:
Hi, I have a CEdit control. I can accept only 4 characters and that should be Numeric and no spaces allowed. I want to set the contents of the Editbox empty. But when i try to do edit.SetText("...
by: Hiep Nguyen | last post by:
Hello, i'm looking for a javascript solution to the following problem: I have two pages: list.php and update.php on list.php page, i have a hyperlink to update.php page (open a new window). ...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.