From: M2U G. <m2u...@un...> - 2008-02-13 13:47:07
|
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. |
From: Jeremy W. <jez...@ho...> - 2008-02-13 20:36:35
|
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: m2u...@un... > To: per...@li... > 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 > Per...@li... > 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 |
From: Robert M. <ro...@th...> - 2008-02-14 17:27:30
|
On 14/02/2008, Jeremy White <jez...@ho...> wrote: > 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. I'd be interested in the solution to this! I thought that the problem was going to be the fact that the code got the toolbar height before calling Autosize(), but changing that didn't fix it for me. With the code below I see the toolbar jumping from 1 to 3 rows, despite the fact that the buttons only appear on 2 rows, and except for when there is only one row, the number of rows is always one too big. The problem goes away if I make the seperator a real button. WTF? Regards, Rob. #!/usr/bin/perl -w use strict; use warnings; use Win32::GUI qw(TBSTYLE_BUTTON TBSTATE_ENABLED TBSTYLE_SEP I_IMAGENONE); my $mw = Win32::GUI::Window->new( -size => [640,480], -onResize => \&resizeMW, ); my $tb = $mw->AddToolbar( -multiline => 1, ); $tb->AddString('Dummy button'); $tb->AddButtons(8, I_IMAGENONE, 0, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, I_IMAGENONE, 0, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, I_IMAGENONE, 0, TBSTATE_ENABLED, TBSTYLE_SEP , 0, I_IMAGENONE, 0, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, I_IMAGENONE, 0, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, I_IMAGENONE, 0, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, I_IMAGENONE, 0, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, I_IMAGENONE, 0, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, ); $tb->AutoSize(); my $tv = $mw->AddTreeView( -width => 200, ); $mw->Show(); Win32::GUI::Dialog(); $mw->Hide(); exit(0); sub resizeMW { my ($self) = @_; $tb->AutoSize(); $tv->Top($tb->Height); $tv->Height($self->ScaleHeight - $tv->Top); print "TB height: ", $tb->Height(), " Rows: ", $tb->GetRows(), "\n"; return; } __END__ |
From: M2U G. <m2u...@un...> - 2008-02-15 12:27:23
|
From: "Jeremy White" <jez...@ho...> Sent: Wednesday, February 13, 2008 9:36 PM > > 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. Thanks a lot for this helpful link, Jez! I played around with the coolbar control a little and it might be a good alternative indeed! But my problem persists: I'm still not sure how to merge my toolbar into the rebar / coolbar. As I said: If I assign a complete window with a toolbar to the re-/coolbar the (manifest-)layout gets disturbed by the window background (gray overlay over bluish theme) and if I assign the toolbar straight to it the grippers and chevrons disappear... Of course I could use "normal" buttons but I still had to utilize a background window and I would miss the advantages of a genuine toolbar like button autosizing, inserting separators etc. >From the coolbar demo script I learned how to make parts of a window transparent with regions - not a solution again because the toolbar buttons have rounded corners and it looks strange anyway if the buttons still have gray background... Well ... I'm still open for suggestions :-) So far thanks for looking at my code and helping me out with the link! Best regards, Matthias. |
From: Robert M. <ro...@th...> - 2008-02-16 10:21:26
|
On 15/02/2008, M2U Germany <m2u...@un...> wrote: > From: "Jeremy White" <jez...@ho...> > Sent: Wednesday, February 13, 2008 9:36 PM > > > > 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. > > Thanks a lot for this helpful link, Jez! I played around with the coolbar > control a little and it might be a good alternative indeed! > But my problem persists: I'm still not sure how to merge my toolbar into the > rebar / coolbar. As I said: If I assign a complete window with a toolbar to > the re-/coolbar the (manifest-)layout gets disturbed by the window > background (gray overlay over bluish theme) and if I assign the toolbar > straight to it the grippers and chevrons disappear... Try something like the code that I'll attach at the end. There's some styles that need adding to a toolbar before it can be put in a rebar so that the toolbar stops trying to resize itself across the top of it's parent window, and allows the rebar to correctly size it. I don't have Vista, so I can't check if I got the styles right to see the theme background through the toolbar, but I've don it according to MS docs which say: "If you want your application to match the Microsoft Windows interface, use the flat transparent style toolbar." Regards, Rob. # Author: Robert May - rm...@po... # # Copyright (C) 2005 Robert May # # This script is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # Demonstration of experimental Coolbar class for drawing a CoolMenu bar. # Demonstration of other rebar features use strict; use warnings; use Win32::GUI qw(WS_BORDER WS_CAPTION WS_SIZEBOX WS_CLIPCHILDREN WS_CHILD RBBS_CHILDEDGE RBBS_FIXEDBMP RBBS_BREAK TBSTATE_ENABLED TBSTYLE_AUTOSIZE TBSTYLE_BUTTON BTNS_SHOWTEXT I_IMAGENONE ); # constants sub RBBS_USECHEVRON() {512}; sub CCS_NOPARENTALIGN() {8}; sub CCS_NORESIZE() {4}; # Create a main window my $mw = Win32::GUI::Window->new( -title => "Transparent toolbar Demo", -pos => [100,100], -size => [500,300], -onResize => \&mwResize, # resize the rebar, so that chevrons appear when window is too narrow ); # Create a Rebar my $rb = $mw->AddRebar( -pushstyle => WS_BORDER, -bandborders => 1, ); # Create a Toolbar, ready to insert into the Rebar my $tb1 = Win32::GUI::Toolbar->new( -parent => $rb, -nodivider => 1, -flat => 1, -list => 1, -transparent => 1, -pushstyle => CCS_NORESIZE | CCS_NOPARENTALIGN, # these style mandatory if you want it to look right ); $tb1->AddString("Button 1"); $tb1->AddString("Button 2"); $tb1->AddButtons( 2, I_IMAGENONE, 5, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE|TBSTYLE_BUTTON|BTNS_SHOWTEXT, 0, I_IMAGENONE, 6, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE|TBSTYLE_BUTTON|BTNS_SHOWTEXT, 1, ); $rb->InsertBand( -child => $tb1, -width => ($tb1->GetMaxSize())[0], -minwidth => ($tb1->GetItemRect(0))[2], -minheight => ($tb1->GetMaxSize())[1], -style => RBBS_CHILDEDGE | RBBS_FIXEDBMP, -idealwidth => ($tb1->GetItemRect($tb1->ButtonCount()-1))[2], ); # And a second toolbar so we have 2 bands my $tb2 = Win32::GUI::Toolbar->new( -parent => $rb, -nodivider => 1, -flat => 1, -list => 1, -transparent => 1, -pushstyle => CCS_NORESIZE | CCS_NOPARENTALIGN, # these style mandatory if you want it to look right ); $tb2->AddString("Button 1"); $tb2->AddString("Button 2"); $tb2->AddButtons( 2, I_IMAGENONE, 5, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE|TBSTYLE_BUTTON|BTNS_SHOWTEXT, 0, I_IMAGENONE, 6, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE|TBSTYLE_BUTTON|BTNS_SHOWTEXT, 1, ); $rb->InsertBand( -child => $tb2, -width => ($tb2->GetMaxSize())[0], -minwidth => ($tb2->GetItemRect(0))[2], -minheight => ($tb2->GetMaxSize())[1], -style => RBBS_CHILDEDGE | RBBS_FIXEDBMP, -idealwidth => ($tb2->GetItemRect($tb2->ButtonCount()-1))[2], ); # show the main window ... $mw->Show(); # ... and enter the dialog phase. Win32::GUI::Dialog(); exit(0); # Resize the rebar to be the width of the window. sub mwResize { my $self = shift; $rb->Width($self->ScaleWidth); return 1; } |
From: M2U G. <m2u...@un...> - 2008-02-18 13:55:24
|
> Try something like the code that I'll attach at the end. There's some > styles that > need adding to a toolbar before it can be put in a rebar so that the > toolbar stops > trying to resize itself across the top of it's parent window, and > allows the rebar > to correctly size it. You were perfectly right with that, I think especially the CCS_NORESIZE and CCS_NOPARENTALIGN constants did the trick! > I don't have Vista, so I can't check if I got the styles right to see the > theme > background through the toolbar, but I've don it according to MS docs which > say: It now looks like I intended: http://www.uni-bonn.de/~mwetter1/screenshot.jpg Thanks for time and work you put into the sample script! Best regards, Matthias |
From: M2U G. <m2u...@un...> - 2008-02-25 15:07:17
|
On Thursday, February 14, 2008 6:27 PM Robert May wrote: > I'd be interested in the solution to this! I thought that the > problem was going > to be the fact that the code got the toolbar height before calling > Autosize(), but > changing that didn't fix it for me. > > With the code below I see the toolbar jumping from 1 to 3 rows, > despite the fact that > the buttons only appear on 2 rows, and except for when there is only > one row, the number > of rows is always one too big. > > The problem goes away if I make the seperator a real button. WTF? This problem didn't affect my program any longer because its rebars have only one row of toolbar buttons and they aren't allowed to wrap anyway. Nevertheless I reconsidered your example code, Rob. I finally found the problem causing the wrong dimensions and row counts: we had set the state constant for the seperator to "TBSTATE_ENABLED" but in fact this doesn't make much sense because a "TBSTYLE_SEP" button can't be disabled, right? So I just replaced "TBSTATE_ENABLED" with "0" and all strange behaviour disappeared. This is probably not a really neat solution and I think there might be a constant specified for this purpose. "TBSTATE_INDETERMINATE" is a good candidate, isn't it? It works, too. Of course I'm not as nearly into Win32::GUI programming internals as you and probably most other members of this list are... so I can only guess that using "TBSTATE_ENABLED" on a separator button causes the toolbar sizing routines to *think* of it as a normal button with comparable dimension needs and therefore to wrap this (imaginary and obviosly not displayed) space into the next line. Whatever the exact reason may be, the solution shown above seems to work. Main conclusion: no bug to be eliminated... hooray! Best regards, Matthias |
From: Robert M. <rob...@us...> - 2008-03-03 18:22:56
|
On 24/02/2008, M2U Germany <m2u...@un...> wrote: > On Thursday, February 14, 2008 6:27 PM Robert May wrote: > > I'd be interested in the solution to this! > > > > With the code below I see the toolbar jumping from 1 to 3 rows, > > despite the fact that > > the buttons only appear on 2 rows, and except for when there is only > > one row, the number > > of rows is always one too big. > > > > Nevertheless I reconsidered your example code, Rob. I finally found the > problem causing the wrong dimensions and row counts: we had set the state > constant for the seperator to "TBSTATE_ENABLED" but in fact this doesn't > make much sense because a "TBSTYLE_SEP" button can't be disabled, right? So > I just replaced "TBSTATE_ENABLED" with "0" and all strange behaviour > disappeared. This is probably not a really neat solution and I think there > might be a constant specified for this purpose. "TBSTATE_INDETERMINATE" is a > good candidate, isn't it? It works, too. Interesting. That change doesn't fix the problem for me. can you post the exact code you are using so I can confirm that I'm understanding what you say exactly. > > Of course I'm not as nearly into Win32::GUI programming > internals as you and probably most other members of this list are... so I > can only guess that using "TBSTATE_ENABLED" on a separator button causes the > toolbar sizing routines to *think* of it as a normal button with comparable > dimension needs and therefore to wrap this (imaginary and obviously not > displayed) space into the next line. As far as I am aware a 'button' of type TB_SEP should completely ignore the state, and it shouldn't make any difference what state you set. I can't see any difference myself. > Whatever the exact reason may be, the solution shown above seems to work. > Main conclusion: no bug to be eliminated... hooray! I don't think this is a bug in Win32::GUI - my gut feeling is that it is the behaviour of the underlying Win32 toolbar control, but I'd be interested in seeing a working solution. Cheers, Rob. |