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 ------------------------------------------------------------------------- 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/