The cool bar control: http://www.robmay.me.uk/win32gui
There is an issue in your code - just ran out of time to fix it! If you can't find it let me know - should have time tomorrow. Cheers, jez. > From: [EMAIL PROTECTED] > To: perl-win32-gui-users@lists.sourceforge.net > Date: Wed, 13 Feb 2008 03:49:16 +0100 > Subject: [perl-win32-gui-users] How to combine tool- and rebars properly? > > Hello everyone, > > I'm currently developing a rather complex application that contains a broad > variety of the Win32::GUI controls, among them the toolbar control which > causes problems in my case. > I have coded a little sample that demonstrates the issue (the script tries > to load a 16x16 px 2 bit bitmap and a 16x16 px 24 bit bitmap but it will > work the same without them, so just ignore the initial warnings for now): > > > ##### START OF SAMPLE CODE ##### > > #!/usr/bin/perl -w > > use strict; > use warnings; > > use Win32; > use Win32::GUI qw(TBSTYLE_BUTTON TBSTATE_ENABLED TBSTYLE_AUTOSIZE > TBSTYLE_SEP); > > my $window_main = Win32::GUI::Window->new( > -name => 'Window', > -text => 'Code sample "toolbar problem"', > -width => 640, > -height => 480, > -onResize => \&resizeWindowMain, > -onTerminate => \&quitApplication, > ); > > my $imagelist_buttons = new Win32::GUI::ImageList(16, 16, 0|24|1, 1, 0); > $imagelist_buttons->Add('dummy.bmp', 'dummy_mask.bmp'); > > $window_main->AddToolbar( > -imagelist => $imagelist_buttons, > -name => 'Toolbar', > -flat => 1, > -multiline => 1, > -flat => 1, > ); > > $window_main->{'Toolbar'}->AddString('Dummy button'); > > $window_main->{'Toolbar'}->AddButtons( > 14, > 0, 1, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, 0, > 0, 2, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, 0, > 0, 3, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, 0, > 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, > 0, 4, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, 0, > 0, 5, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, 0, > 0, 6, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, 0, > 0, 7, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, 0, > 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, > 0, 8, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, 0, > 0, 9, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, 0, > 0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, > 0, 10, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, 0, > 0, 11, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE, 0, > ); > > $window_main->AddTreeView( > -name => 'Treeview', > -width => 200, > ); > > $window_main->Center(); > $window_main->Show(); > > Win32::GUI::Dialog(); > > $window_main->Hide(); > > exit(0); > > sub quitApplication { > return -1; > } > > sub resizeWindowMain { > my $windowMain_height = $window_main->ScaleHeight(); > my $windowMain_width = $window_main->ScaleWidth(); > my $toolbar_height = $window_main->{'Toolbar'}->Height(); > > $window_main->{'Toolbar'}->AutoSize(); > > $window_main->{'Treeview'}->Change( > -pos => [0, $toolbar_height], > ); > > $window_main->{'Treeview'}->Height($windowMain_height - $toolbar_height); > > print $window_main->{'Toolbar'}->GetRows()." rows retrieved.\n"; > } > > ##### END OF SAMPLE CODE ##### > > > This sample creates a simple window with a toolbar containing a lot of dummy > buttons and a treeview. I expected that the treeview control would appear > just below the toolbar. But when I run this script on my machine (Active > Perl 5.10.0.1001, Win32::GUI 1.05.90, Windows Vista 6.0.6000) and resize the > window there appears some space between the two items that increases with > the number of toolbar lines. If the window is wide enough for just one line > of toolbuttons there is no space but as soon as the buttons begin to wrap > due to smaller window dimensions the upper border of the treeview is placed > wrong. Maybe this is a simple mistake in my resizing subroutine but I can't > find any explanation for this behaviour. > > As a next step to achieve optimal Windows look and feel under XP / Vista I > decided to use the rebar control, too. The documentation that comes with the > PPM distribution has leaks on this topic and left me with a lot of > questions... I found another version of the rebar help in the sourceforge > documentation project but still I'm not quite sure how to deal with this > control. > There it said that any rebar band can only contain one single child control > so you had to create a window (with "popstyle => WS_CAPTION | WS_SIZEBOX" > and "-pushstyle => WS_CHILD") which contains the controls first and then > assign it to a rebar band as a child. But how can I integrate my former > toolbar into the band? My first thought was to assign the toolbar to the > child window. It kind of worked but in my case looked really weird because > I'm using a manifest file (like the one Rob posted some days ago). The rebar > band uses the correct style (this bluish / glassy optic) but the child > window is simply embedded and appears as an ugly gray overlay... Am I > missing any required style constants here that could help? (I already tried > everything like "WS_CLIP..." and "..._TRANSPARENT" without success.) > Anyway I'm not sure at all if this is the right way to do it because it > seems a little too complicated. I also tried to assign the toolbar directly > to the rebar band. This produced the desired look but now the toolbar > covered the grippers and chevrons of the band. Aaaarghh!!! I think there > must be another way to combine these two controls, right? In the > documentation it even says that "TBSTYLE_EX_HIDECLIPPEDBUTTONS" could be > used for toolbars displayed in rebars to hide partially clipped buttons that > are covered by an adjacent band and show them on the chevron's dropdown menu > instead. I couldn't get that one to work either... :'-( > > I guess this is a lot of question marks at once :-) but I'm grateful for > every little hint that could help me to get on the right track. Has anyone > made any experiences with this stuff? > > Thanks in advance, best regards from Bonn, Germany, > Matthias. > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > 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/ _________________________________________________________________ Telly addicts unite! http://www.searchgamesbox.com/tvtown.shtml ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ 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/