From: <edz...@ve...> - 2007-08-27 18:29:05
|
I'm not sure if I understand correctly, but let's see if this helps. Basically, I think you want to create an imagelist object. Alterations to the code below. ----- Original Message ----- From: "Waldemar Biernacki" <wb...@sa...> To: <per...@li...> Sent: Wednesday, August 22, 2007 2:15 PM Subject: [perl-win32-gui-users] How to dynamically combine bitmaps in toolbar > Hello everyone! > > I've found usefull notes on toolbar. However I have not found how to > combine > different images to get one toolbar. Later on is my code. I have three > bitmaps: one, two and both. If you call the script as follows: > > perl script.pl both > > then you get two-images toolbar. But if you call > > perl script.pl whatever > > then you dont get proper toolbar bitmap (Perl complains that it needs a > list > and the second addbitmap: $TB->AddBitmap($two, 2); is incorrect. > > Is someone able to help me and show how to combine inline bitmaps > dynamically > in toolbar? > > Regards > > Waldemar > > > ########################################################### > #!/usr/bin/perl > > use strict; > use warnings; > use Win32::GUI qw(); > use Win32::GUI::BitmapInline (); > > my $one = new Win32::GUI::BitmapInline( q( > Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAADAAATCwAAEwsAAAAAAAAAAAAA//// > //////////////////////////////////////////////////////////////////////////// > //////////////////////////////////////////////////////////////////////////// > ////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAA > AAAA////////////////////////////////////////////////AAAAAAAA//////////////// > ////////////////////////////////////////AAAAAAAA//////////////////////////// > ////////////////////////////AAAAAAAA//////////////////////////////////////// > ////////////////AAAAAAAA//////////////////////////////////////////////////// > ////AAAAAAAA////////////////////////////////////////////////////////AAAAAAAA > ////////////////////////////////////////////////////////AAAAAAAA//////////// > ////////////////////////////////////////////AAAAAAAA//////////////////////// > ////////////////////////AAAAAAAAAAAAAAAA//////////////////////////////////// > ////////////////////AAAAAAAA//////////////////////////////////////////////// > //////////////////////////////////////////////////////////////////////////// > //////////////////////////////// > ) ); > my $two = new Win32::GUI::BitmapInline( q( > Qk02AwAAAAAAADYAAAAoAAAAEAAAABAAAAABABgAAAAAAAADAAATCwAAEwsAAAAAAAAAAAAA//// > //////////////////////////////////////////////////////////////////////////// > //////////////////////////////////////////////////////////////////////////// > ////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAAAAAAAA > AAAAAAAA////////////////////////////////AAAAAAAA//////////////////////////// > ////////////////////////////////AAAAAAAA//////////////////////////////////// > ////////////////////////AAAAAAAAAAAA//////////////////////////////////////// > ////////////////////AAAAAAAA//////////////////////////////////////////////// > ////////////AAAAAAAA//////////////////////////////////////////////////////// > ////AAAAAAAA////////////////////////////////////////////////////////AAAAAAAA > ////////////////////////////AAAAAAAA////////////////////AAAAAAAA//////////// > ////////////////AAAAAAAA////////////////AAAAAAAA//////////////////////////// > ////////AAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////////// > //////////////////////////////////////////////////////////////////////////// > //////////////////////////////// > ) ); > my $both = new Win32::GUI::BitmapInline( q( > Qk02BgAAAAAAADYAAAAoAAAAIAAAABAAAAABABgAAAAAAAAGAAATCwAAEwsAAAAAAAAAAAAA//// > //////////////////////////////////////////////////////////////////////////// > //////////////////////////////////////////////////////////////////////////// > //////////////////////////////////////////////////////////////////////////// > //////////////////////////////////////////////////////////////////////////// > //////////////////////////////////////////////////////////////////////////// > ////////////////////AAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////// > AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////////////////////////////////// > ////AAAAAAAA////////////////////////////////////////////AAAAAAAA//////////// > ////////////////////////////////////////////////////////AAAAAAAA//////////// > ////////////////////////////////////AAAAAAAA//////////////////////////////// > ////////////////////////////////AAAAAAAA//////////////////////////////////// > ////////////////AAAAAAAAAAAA//////////////////////////////////////////////// > ////////AAAAAAAA//////////////////////////////////////////////////////////// > AAAAAAAA////////////////////////////////////////////////////AAAAAAAA//////// > ////////////////////////////////////////////////////////AAAAAAAA//////////// > ////////////////////////////////////AAAAAAAA//////////////////////////////// > ////////////////////////////////////AAAAAAAA//////////////////////////////// > ////////////AAAAAAAA//////////////////////////////////////////////////////// > ////////////AAAAAAAA////////////////////////////////////////////AAAAAAAA//// > ////////////////////////////////////AAAAAAAA////////////////////AAAAAAAA//// > ////////////////////////////////AAAAAAAAAAAAAAAA//////////////////////////// > ////////////AAAAAAAA////////////////AAAAAAAA//////////////////////////////// > ////////////////AAAAAAAA////////////////////////////////////////////AAAAAAAA > AAAAAAAAAAAAAAAA//////////////////////////////////////////////////////////// > //////////////////////////////////////////////////////////////////////////// > //////////////////////////////////////////////////////////////////////////// > //////////////////////////////////////////////////////////////////// > ) ); > > my $W = Win32::GUI::Window->new(-name=>'W',-size=>[400,400],); > my $images = Win32::GUI::ImageList->new( 16, 16, 1, 2, 2 ); #added > my $TB = $W->AddToolbar(-name=>"Toolbar",); my $TB = $W->AddToolbar(-name=>"Toolbar",-imagelist=>$images);#changed > > $TB->SetBitmapSize(16, 16); #extraneous #already taken care of, in the imagelist declaration > > if (( $ARGV[0] ) && ( $ARGV[0] eq 'both' )) { > $TB->AddBitmap($both, 1); $images->AddBitmap($both,1); #changed > } else { > $TB->AddBitmap($one, 1); > $TB->AddBitmap($two, 2); $images->AddBitmap($one,1); #changed $images->AddBitmap($two,2); #changed > } > > $TB->AddButtons( 2, 0,0,4,0,0, 1,1,4,0,1, ); > > $W->Show(); > Win32::GUI::Dialog(); > exit(0); > Does that help? Ed Zarger AG Aegis Company, Inc. |
From: <a98...@gm...> - 2007-08-28 13:57:56
|
Hi, I want to create a window with some buttons, labels, and textfields. but the window is too small - how can I realize working scrollbars? I already can the scrollbars but they aren't working ... see my code-snipplet below. thx juergen [snip] $main = Win32::GUI::Window->new( -name => 'Main', -left => CW_USEDEFAULT, -width => 100, -height => 100, -text => $cfg{title_string}, -menu => $cfg{mainmenu}, -vscroll => 1, -hscroll => 1, -size => [800,550], -helpbutton => 0, -maximizebox => 0, -resizable => 1, -background => {0x00FF00}, -foreground => {0x33AABB}, -dialogui => 1, -accel => $cfg{accelerator}, -noflicker => 1, -onMinimize => \&toggle_show_state, -eventmodel => both, ); [/snip] -- Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten Browser-Versionen downloaden: http://www.gmx.net/de/go/browser |
From: Robert M. <rob...@us...> - 2007-08-29 17:16:31
|
On 28/08/2007, a98...@gm... <a98...@gm...> wrote: > I want to create a window with some buttons, labels, and textfields. > but the window is too small - how can I realize working scrollbars? Scrollbars are quite a complex topic, and I can't do them justice in a quick response to your email. I've been thinking about writing a series of articles explaining them, and how they work ... this seems like a good opportunity to cross one thing off my todo list. The first article (which only starts to set the scene) can be found at: http://blog.robmay.me.uk/2007/08/scrolbars-part-1-scratch-program.html I'll post more over the next days. The series will probably run to 12 or so short articles. Regards, Rob. |
From: Robert M. <rob...@us...> - 2007-08-29 18:13:08
|
On 29/08/2007, Robert May <rob...@us...> wrote: > > The first article (which only starts to set the scene) can be found at: > http://blog.robmay.me.uk/2007/08/scrolbars-part-1-scratch-program.html > > I'll post more over the next days. The series will probably run to 12 > or so short articles. Part 2 is now available at: http://blog.robmay.me.uk/2007/08/scrolbars-part-2-adding-large-control.html That finishes setting up the framework. In the next article we'll add some scrollbars. regards, Rob. |