Click here to Skip to main content
16,005,178 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Is there any facility for C++ to design GUI using XML? Pin
Chris Losinger27-Dec-08 5:31
professionalChris Losinger27-Dec-08 5:31 
QuestionReferencing methods via iterators Pin
mjackson1126-Dec-08 15:45
mjackson1126-Dec-08 15:45 
AnswerRe: Referencing methods via iterators Pin
Cedric Moonen26-Dec-08 22:12
Cedric Moonen26-Dec-08 22:12 
GeneralRe: Referencing methods via iterators Pin
mjackson1127-Dec-08 7:07
mjackson1127-Dec-08 7:07 
QuestionRepaointing the Window Pin
BobInNJ26-Dec-08 12:37
BobInNJ26-Dec-08 12:37 
GeneralRe: Repaointing the Window Pin
Luc Pattyn26-Dec-08 13:20
sitebuilderLuc Pattyn26-Dec-08 13:20 
GeneralRe: Repainting the Window Pin
BobInNJ27-Dec-08 10:31
BobInNJ27-Dec-08 10:31 
GeneralRe: Repainting the Window Pin
Luc Pattyn27-Dec-08 11:30
sitebuilderLuc Pattyn27-Dec-08 11:30 
Hi Bob,

I don't believe what you suggest would result in correct behavior under all circumstances.

You can't just go and change the semantics of GetUpdateRect[^]; it will return the rectangle (in logical coordinates) that needs updating. It is provided by Windows; e.g. if another window partially obscures your window, then gets moved away, I expect GetUpdateRect to return the area you should repaint, using coordinates, not line numbers.

I suggest you try and look at the normal return values of GetUpdateRect when moving around the window, or moving something else on top and away again.

This is what I would try: whenever you modify a line of text, calculate its rectangular outline; in a first approximation you only need to calculate its vertical position, I would simplify and set the left and right to the entire window's left (=0) and right (=width). In a simple case, when no vertical scrolling is involved, all text lines use the same font and line distance, etc, that would be very simple. Then call InvalidateRect with that rectangle. I expect this normally will cause GetUpdateRect to return the rectangle you just invalidated, and hence OnPaint should now act on that information. One exception would be when several invalidates are still unprocessed in the message queue, Windows may and should optimize them by turning them into a single, possible larger,
invalidation.

BTW: I am a .NET programmer, I did only limited Win32 GUI stuff long ago, that is why I am not
completely sure about the above. However I think the logic behind it all is basically always the same.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Fixturized forever. Confused | :confused:


GeneralRe: Repainting the Window Pin
BobInNJ27-Dec-08 13:49
BobInNJ27-Dec-08 13:49 
GeneralRe: Repainting the Window Pin
Luc Pattyn27-Dec-08 15:15
sitebuilderLuc Pattyn27-Dec-08 15:15 
GeneralRe: Repainting the Window Pin
BobInNJ28-Dec-08 6:43
BobInNJ28-Dec-08 6:43 
GeneralRe: Repainting the Window Pin
Luc Pattyn28-Dec-08 14:15
sitebuilderLuc Pattyn28-Dec-08 14:15 
GeneralRe: Repainting the Window Pin
BobInNJ29-Dec-08 6:58
BobInNJ29-Dec-08 6:58 
GeneralRe: Repainting the Window Pin
Luc Pattyn29-Dec-08 7:13
sitebuilderLuc Pattyn29-Dec-08 7:13 
GeneralRe: Repainting the Window Pin
BobInNJ29-Dec-08 9:08
BobInNJ29-Dec-08 9:08 
GeneralRe: Repainting the Window Pin
Luc Pattyn29-Dec-08 9:55
sitebuilderLuc Pattyn29-Dec-08 9:55 
GeneralRe: Repainting the Window Pin
BobInNJ29-Dec-08 11:28
BobInNJ29-Dec-08 11:28 
GeneralRe: Repainting the Window Pin
Luc Pattyn29-Dec-08 14:58
sitebuilderLuc Pattyn29-Dec-08 14:58 
GeneralRe: Repainting the Window Pin
BobInNJ30-Dec-08 4:37
BobInNJ30-Dec-08 4:37 
AnswerRe: Repainting the Window [modified] Pin
BobInNJ29-Dec-08 9:03
BobInNJ29-Dec-08 9:03 
Questioncan you help me a recursion project with c++? Pin
silversword8626-Dec-08 8:58
silversword8626-Dec-08 8:58 
GeneralRe: can you help me a recursion project with c++? Pin
Luc Pattyn26-Dec-08 9:20
sitebuilderLuc Pattyn26-Dec-08 9:20 
Questionhtml res files don't seem to work anymore. Pin
Jim Crafton26-Dec-08 4:55
Jim Crafton26-Dec-08 4:55 
AnswerRe: html res files don't seem to work anymore. Pin
Richard Andrew x6426-Dec-08 5:10
professionalRichard Andrew x6426-Dec-08 5:10 
GeneralRe: html res files don't seem to work anymore. Pin
Jim Crafton26-Dec-08 5:13
Jim Crafton26-Dec-08 5:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.