Help on use of Wimp_ForceRedraw
François Vanzeveren (2221) 241 posts |
Hi all I have a question regarding the use of Wimp_ForceRedraw.
Where: so as to invallidate the extent of the workarea… And a subsidiary question: Thank you for your help. Regards François |
Chris Johnson (125) 825 posts |
If you set bit 0 of R1 (pointer to block to contain the info), then only the window header is returned, i.e. the first 88 bytes, without the icon info. You can still recover the number of icons from block!84, and if necessary alloc the required memory before making the full info call. |
Chris Johnson (125) 825 posts |
Remember that y0 is at the bottom of the window and is negative. Therefore I think (without checking) it should be SYS “Wimp_ForceRedraw”, !b%,0,b%!44 – b%!52,b%!48 – b%!40,0 |
Fred Graute (114) 645 posts |
You cannot clear the entire workarea of your window using Wimp_ForceRedraw only the visible area. To reset the scroll offsets you need to call Wimp_OpenWindow with an updated window block. To alter the extent of the work area you use Wimp_SetExtent. It sounds to me though as if it might be easier to simply open a new instance of your window exactly on top of the old one and then silently delete the old one. |
François Vanzeveren (2221) 241 posts |
@Chris @Fred This call forces an area of a window or the screen to be marked as invalid, and to be redrawn later using My understanding of the last bit is that, if using a window handle, you invalidate any part of the work area, being visible or not. I take good note of your remark on Wimp_SetExtent and Wimp_OpenWindow. Regards |
Rick Murray (539) 13840 posts |
Obvious question – how is ForceRedraw supposed to invalidate something that isn’t visible? |
Fred Graute (114) 645 posts |
Yes, you can invalidate an area bigger than the visible area but it’s what happens next that matters. The Wimp will send you a redraw event as your window falls inside the area invalidated. You can then redraw the window but the Wimp will have set up a clipping rectangle the size of your window’s visible area and anything drawn outside of it will be clipped. Hence you cannot update anything outside the visible area. It would be useful to know what the window is displaying. If it’s something you redraw yourself then you simply don’t redraw it (the Wimp will have cleared the area to the background colour of the window). If it’s icons then they will need to be removed explicitly by calling Wimp_DeleteIcon. |
François Vanzeveren (2221) 241 posts |
The main window aims at displaying results from simulations of brownian motion processes. Every time you run a simulation, this invalidates previously displayed results of the whole workarea, not only the visible part of the window. This is why I was thinking to invalidate the whole work area, in order to avoid inconsistent display. But, if i understand well, i can just reset the offset et call Wimp_OpenWindow… |
Fred Graute (114) 645 posts |
Yes, that’s okay if you’ve turned off the autoredraw bit in the window flags otherwise you won’t get a redraw event. |