Page 1 of 1
Redraw a window
Posted: Sat Feb 22, 2003 7:41 pm
by BackupUser
Code updated for 5.20+
Restored from previous forum. Originally posted by GPI.
Sometimes the window must be redraw. For Example, if the window size has changed and the programm change the positions of gadgets. Win98SE destroy the gadged in this case.
so easy redraw the window after the resizegadget():
Code: Select all
rec.rect
getclientrect_(WindowID(0),@rec) ;Get the window-Size
invalidaterect_(WindowID(0),@rec,#true) ;add the complete size to the update-list (#True=earse the background)
updatewindow_(WindowID(0)) ;and update
PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
Posted: Sat Feb 22, 2003 8:45 pm
by BackupUser
Restored from previous forum. Originally posted by ebs.
GPI,
I think this is an easier away:
RedrawWindow_(WindowID(), 0, 0, #RDW_INVALIDATE)
You can use #RDW_ERASE | #RDW_INVALIDATE if you want to erase the background too.
Eric
Originally posted by GPI
Sometimes the window must be redraw. For Example, if the window size has changed and the programm change the positions of gadgets. Win98SE destroy the gadged in this case.
so easy redraw the window after the resizegadget():
rec.rect
getclientrect_(WindowID(),@rec) ;Get the window-Size
invalidaterect_(WindowID(),@rec,#true) ;add the complete size to the update-list (#True=earse the background)
updatewindow_(WindowID()) ;and update
PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
Posted: Sat Feb 22, 2003 9:40 pm
by BackupUser
Restored from previous forum. Originally posted by GPI.
>RedrawWindow_(WindowID(), 0, 0, #RDW_INVALIDATE)
Doesn't work! The Gadgets and the background are destroyed.
PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
Posted: Sun Feb 23, 2003 5:41 pm
by BackupUser
Restored from previous forum. Originally posted by ebs.
GPI,
It works correctly on a standard window - all the gadgets are redrawn, which is what should happen. Are you using a different style window?
Eric
Originally posted by GPI
>RedrawWindow_(WindowID(), 0, 0, #RDW_INVALIDATE)
Doesn't work! The Gadgets and the background are destroyed.
PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
Posted: Sun Feb 23, 2003 10:34 pm
by BackupUser
Restored from previous forum. Originally posted by GPI.
@ebs
standard WIN98SE.
I only change the Window-color, Fonts, size, etc. No special software.
Your solution does nothing on WIN98SE.
PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
Posted: Mon Feb 24, 2003 12:54 am
by BackupUser
Restored from previous forum. Originally posted by ebs.
GPI,
That's odd! The description of RedrawWindow() in the AllAPI API-Guide says Windows 95 or later, but it might be wrong. If you can, please try one more version and let me know the result:
Code: Select all
RedrawWindow_(WindowID(), 0, 0, 7)
Eric
Originally posted by GPI
@ebs
standard WIN98SE.
I only change the Window-color, Fonts, size, etc. No special software.
Your solution does nothing on WIN98SE.
PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
Posted: Mon Feb 24, 2003 8:57 pm
by BackupUser
Restored from previous forum. Originally posted by GPI.
RedrawWindow_(WindowID(), 0, 0, 7)
work! Thanks.
Btw: 7 (4+2+1) is the combination of which constants?
PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB
Posted: Mon Feb 24, 2003 11:24 pm
by BackupUser
Restored from previous forum. Originally posted by ebs.
GPI,
Code: Select all
#RDW_ERASE = 4
#RDW_INTERNALPAINT = 2
#RDW_INVALIDATE = 1
Eric
Originally posted by GPI
RedrawWindow_(WindowID(), 0, 0, 7)
work! Thanks.
Btw: 7 (4+2+1) is the combination of which constants?
PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB