1. repainting all windows in rectangle

------=_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&nbsp;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>&nbsp;</DIV>
<DIV>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>end =

------=_NextPart_000_0007_01C0472B.44571F20--

new topic     » topic index » view message » categorize

2. Re: repainting all windows in rectangle

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: repainting all windows in rectangle

>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.

new topic     » goto parent     » topic index » view message » categorize

4. Re: repainting all windows in rectangle

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: repainting all windows in rectangle

>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.

new topic     » goto parent     » topic index » view message » categorize

6. Re: repainting all windows in rectangle

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu