1. repainting all windows in rectangle
- Posted by =?iso-8859-2?B?qWtvZGE=?= <tone.skoda at SIOL.NET> Nov 05, 2000
- 486 views
------=_NextPart_000_0007_01C0472B.44571F20 charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable Can anybody write a procedure which will repaint all windows which lie = under/in given rectangle? Like when you minimize a window and all windows under it are repainted. --arg. rect has screen coordinates {left, top, right, bottom} procedure RepaintWindowsInRect(sequence rect) -- ... here's job for you end procedure ------=_NextPart_000_0007_01C0472B.44571F20 charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Diso-8859-2" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2614.3401" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>Can anybody write a procedure which = will repaint=20 all windows which lie under/in given rectangle?</FONT></DIV> <DIV><FONT face=3DArial size=3D2>Like when you minimize a window and all = windows=20 under it are repainted.</FONT></DIV> <DIV> </DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>--arg. rect has screen = coordinates</FONT><FONT=20 face=3DArial size=3D2> {left, top, right, bottom}</FONT></DIV> <DIV><FONT face=3DArial size=3D2>procedure RepaintWindowsInRect(sequence = rect)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>-- ... here's job for you</FONT><FONT = face=3DArial=20 size=3D2></FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>end = ------=_NextPart_000_0007_01C0472B.44571F20--
2. Re: repainting all windows in rectangle
- Posted by Brian Broker <bkb at CNW.COM> Nov 07, 2000
- 472 views
On Sun, 5 Nov 2000 13:21:12 +0100, <tone.skoda at SIOL.NET> wrote: >Can anybody write a procedure which will repaint all windows which lie >under/in given rectangle? >Like when you minimize a window and all windows under it are repainted. > > >--arg. rect has screen coordinates {left, top, right, bottom} >procedure RepaintWindowsInRect(sequence rect) > >-- ... here's job for you > >end procedure If you are using Win32Lib, why not just create a Pixmap buffer for your windows? Then you just do something like this for each window: constant SomeWin = create( Window, ... ) Buffer = create( Pixmap, ... ) -- when you want to update your window, you make corresponding changes to -- your Pixmap 'Buffer' --------------------------------------------- -- then you can repaint your window by copying Buffer to Window procedure onPaint_SomeWin( integer x1, integer y1, integer x2, integer y2 ) copyBlt( SomeWin, 0, 0, Buffer ) end procedure onPaint[SomeWin] = routine_id( "onPaint_SomeWin" ) -- I hope this helps (and I hope I didn't miss your point) -- See my RGBview demo in Wolf's tutorial for a simple example -- Brian
3. Re: repainting all windows in rectangle
- Posted by =?iso-8859-2?B?qWtvZGE=?= <tone.skoda at SIOL.NET> Nov 07, 2000
- 503 views
>From: Brian Broker <bkb at CNW.COM> > On Sun, 5 Nov 2000 13:21:12 +0100, <tone.skoda at SIOL.NET> wrote: > > >Can anybody write a procedure which will repaint all windows which lie > >under/in given rectangle? > >Like when you minimize a window and all windows under it are repainted. > > > > > >--arg. rect has screen coordinates {left, top, right, bottom} > >procedure RepaintWindowsInRect(sequence rect) > > > >-- ... here's job for you > > > >end procedure > > If you are using Win32Lib, why not just create a Pixmap buffer for your > windows? Then you just do something like this for each window: > > constant > SomeWin = create( Window, ... ) > Buffer = create( Pixmap, ... ) > > -- when you want to update your window, you make corresponding changes to > -- your Pixmap 'Buffer' > > --------------------------------------------- > -- then you can repaint your window by copying Buffer to Window > procedure onPaint_SomeWin( integer x1, integer y1, integer x2, integer y2 ) > copyBlt( SomeWin, 0, 0, Buffer ) > end procedure > onPaint[SomeWin] = routine_id( "onPaint_SomeWin" ) Window doesn't neccessarey need to be child of my progam, it can be any window in the system. So i don't know how can i get onPaint for a window from another program. > > -- I hope this helps (and I hope I didn't miss your point) > -- See my RGBview demo in Wolf's tutorial for a simple example > -- Brian I was thinking of doing it like this: In loop I would get handle of every Window that is in rectangle, with some WindowFromPoint() function, if it exists. Then i would send WM_PAINT message to this window. The problem is that i can't get those windows, it's complicated. I could get window for every point in rectangle, that would work, but it would be very slow. The function GetWindowHandlesInRect(sequence rect) would be equaly good, and it's equaly difficult to write. This would also work: When i want to repint windows in rect, I would show and hide a temporary popup window, but it wouldn't look too good.
4. Re: repainting all windows in rectangle
- Posted by Brian Broker <bkb at CNW.COM> Nov 07, 2000
- 481 views
On Tue, 7 Nov 2000 13:59:11 +0100, <tone.skoda at SIOL.NET> wrote: >Window doesn't neccessarey need to be child of my progam, it can be any >window in the system. So i don't know how can i get onPaint for a window >from another program. > > >> >> -- I hope this helps (and I hope I didn't miss your point) >> -- See my RGBview demo in Wolf's tutorial for a simple example >> -- Brian > > >I was thinking of doing it like this: >In loop I would get handle of every Window that is in rectangle, with some >WindowFromPoint() function, if it exists. Then i would send WM_PAINT >message to this window. >The problem is that i can't get those windows, it's complicated. I could >get window for every point in rectangle, that would work, but it would be >very slow. > >The function GetWindowHandlesInRect(sequence rect) would be equaly good, >and it's equaly difficult to write. > >This would also work: When i want to repint windows in rect, I would show >and hide a temporary popup window, but it wouldn't look too good. I guess I'm confused... why should you need to repaint windows that are not your own? (You shouldn't have to worry about repainting windows that are not your own, unless you are writing your own OS or something.) Can you give me an example of why you need to do this? -- Brian
5. Re: repainting all windows in rectangle
- Posted by =?iso-8859-2?B?qWtvZGE=?= <tone.skoda at SIOL.NET> Nov 07, 2000
- 467 views
- Last edited Nov 08, 2000
>Brian Broker <bkb at CNW.COM> wrote: > I guess I'm confused... why should you need to repaint windows that are > not your own? (You shouldn't have to worry about repainting windows that > are not your own, unless you are writing your own OS or something.) > > Can you give me an example of why you need to do this? > > -- Brian I am plaaninig to write my own windows menu. I could use popup window, but it's not the same feeling as the real menu. So i thought just to draw drop down to desktop hdc (hdc=GetDC(0)). Do you have any idea how real menus do it? Do you know of any other window i could use for menu dropdown? For combo box i used popup and it works fine, except that active application's window title is greyed when dropped down - that bothers me.
6. Re: repainting all windows in rectangle
- Posted by Derek Parnell <derekp at SOLACE.COM.AU> Nov 08, 2000
- 479 views
Assuming you are using win32lib, try this ... result = c_func(xInvalidateRect, {0, 0, 1}) This is supposed to tell every window to repaint itself. ----- cheers, Derek Parnell