*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.
#############################################
#!c:\perl\bin\perl -w
use strict;
use Win32::GUI();
use Win32::GUI::DIBitmap();
my $DC;
my $main = Win32::GUI::Window->new(
-name => 'Main',
-width => 799,
-height => 577,
-text => 'Example... ',
-resizable => 0,
-hasmaximize => 0,
-dialogui => 1,
-topmost => 1,
);
my $license_agreement_field = $main->AddTextfield(
-readonly => 1,
-multiline => 1,
-name => 'LicenseTextField',
-width => 508,
-height => 347,
-top => 73,
-left => 15,
-background => [255, 255, 255],
-vscroll => 1,
);
my $license_agreement_text1 = $license_agreement_field->Append("License
agreement goes here...");
$main->AddGraphic (
-name => "Graphic",
-pos => [0, 0],
-size => [$main->ScaleWidth,$main->ScaleHeight],
-interactive => 1,
);
my $background = newFromFile Win32::GUI::DIBitmap
('Menu_License_Background.gif');
sub Graphic_Paint {
$DC = $main->Graphic->GetDC();
if (defined $background) {
$background->CopyToDC($DC);
}
$DC->Validate();
}
$main->Show();
Win32::GUI::Dialog();
#############################################
Thanks in advance,
Rob
------------------------------------------------------------------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
------------------------------------------------------------------------
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/