----- Original Message -----
From: "Steve Loughran" <[EMAIL PROTECTED]>
To: "Win32 GUI Users Mailing List" <perl-win32-gui-users@lists.sourceforge.net>
Sent: Thursday, December 21, 2006 10:07 AM
Subject: Re: [perl-win32-gui-users] Need help placing controls on top ofgraphics

*note* I have never used a Graphic object, so I may be wildly off target
here :)

I had a similar problem when I started looking at layering overlapping
buttons. The first "object" to be drawn is the one the system sees
first, but the last one to be drawn is the one that is "on top" with the
graphics.

I ended up having to use the Window_Paint routine to draw my "button"
images directly into the background, in the order I wanted them in (and
create hotspots with mousedown/mouseup).

In your case, you may need to draw your graphics directly into the
window DC (So use "window_paint" rather than "graphic_paint", if you see
what I mean), then validate the window DC. Dont forget to add this to
your window definition:

-addstyle => WS_CLIPCHILDREN,
-onPaint => \&window_paint,

then add your objects (buttons, text boxes, etc) to the window as normal.

This might be helpful for you (I hope)....

Steve

Perl Rob wrote:
Hi,

I'm attempting to place a scrollable text field on top of the background
image of my window. Unfortunately, if I add the text field to the window
first (i.e. before adding the graphic to the window), then the text
field gets "swallowed up" by the graphic, and the only way to see the
text field is to mouse over it or click it. If, on the other hand, I add
the graphic first, (i.e. before adding the text field), then the text
field is properly displayed but frozen--I can't click inside it or
scroll it down.

I've been searching the Win32-GUI archives and reading the Win32-GUI
documentation for several days to no avail, and I've concluded that I
just don't understand how to work with graphics. Any
advice/education/assistance would be greatly appreciated. Below is an
example of my code thus far, which illustrates the "swallowing up"
probem. If you move lines 34-49 to line 19, you can see the freezing
problem.
[[ code snipped ]]
Thanks in advance,
Rob

Steve's method is what I used with Win32::GUI::Skin. Draw the graphic on the DC, and then the objects (with WS_CLIPCHILDREN). Feel free to download Win32::GUI::Skin (at http://win32-gui-skin.sourceforge.net) for ideas. You may even be able to make use in your app of Win32::GUI::Skin (I'd love to find out that someone is actually making use of it!)


Brian Millham
This message traveled at least 44,000 miles to reach you!
Brian, Tommy, Helen and Paka
[EMAIL PROTECTED]

Reply via email to