May 02, 2024, 07:52:12 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Toolbar Quirk

Started by LarryMc, May 14, 2010, 06:49:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

While working on the toolbar editor for the Visual Designer I could not get the size of the buttons to change as requested.

After you load a toolbar in EB there are 2 commands you use to change the size of the buttons and the bitmaps.
CONTROLCMD window | dialog, toolbarID, @TBSETBITMAPSIZE, width, height
CONTROLCMD window | dialog, toolbarID, @TBSETBUTTONSIZE, width, height

And there are 2 commands to read what the sizes are set to.
width = CONTROLCMD ( window | dialog, toolbarID, @TBGETBUTTONWIDTH )
height = CONTROLCMD ( window | dialog, toolbarID, @TBGETBUTTONHEIGHT )


I spent several hours trying to juggle things around to get it to work correctly.
To see what was going on I:
printed the desired size
issued the command with those sizes
then issued the command to read the sizes back.
No matter what values I entered for button size it would not change.

Then I accidently found what the problem was; it has to do with order.

This order will result in the button size remaining unchanged:
CONTROLCMD window | dialog, toolbarID, @TBSETBUTTONSIZE, width, height
CONTROLCMD window | dialog, toolbarID, @TBSETBITMAPSIZE, width, height


This order will result in the button size changing as requested.
CONTROLCMD window | dialog, toolbarID, @TBSETBITMAPSIZE, width, height
CONTROLCMD window | dialog, toolbarID, @TBSETBUTTONSIZE, width, height


Using the command by itself will result in the button size changing as requested.
CONTROLCMD window | dialog, toolbarID, @TBSETBUTTONSIZE, width, height

Hope this saves someone some grief.

LarryMc


LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

aurelCB

Thanks Larry,i dont know that...
It is usefull of course.