[Gambas-user] How to use a toolbar

Benoît Minisini gambas at ...1...
Thu Jun 4 02:19:20 CEST 2015


Le 04/06/2015 01:56, Martin McGlensey a écrit :
> Hello,
>
>
>
> I'm trying to use a toolbar on a form. Have added gb.form.mdi to project and
> added toolbar to form. Placed two tool buttons within the toolbar. I
> understand that the toolbar is a container so the buttons should be within
> it.
>
>
>
> The problem is that no matter where I put the buttons (horizontally along
> the toolbar) they seem to align themselves where they want to go rather than
> where I place them in the tool bar. They want to crowd over to the left
> margin on top of each other and then not in the order or position  I placed
> them.
>
>
>
> The Gambas Doc site appears to be down so I cannot get to the docs. So what
> am I doing wrong and where can I find the docs on the toolbar? An example
> would be helpful.
>
>
>
> As always your responses are appreciated.
>
>
>
> Regards,
>
> Marty
>

The wiki is at http://gambaswiki.org, and it works.

The toolbar lays its children horizontally, like a HPanel. You don't 
decide where they go.

You should define the Action property of all controls you put inside the 
toolbar.

Then if you define the Toolbar Key property, it gains a popup menu that 
allows to configure the toolbar.

Moreover, if you have menu entries somewhere having the same Action, 
they will synchronize, and then triggered, the Action_Activate() 
function of your Form will be called with the action as argument. That 
way, you can manage your actions at one place, even if the same action 
is defined in many different controls.

Morever, you gain an automatic shortcut configuration for your menu 
entries too (with the Action.Configure method).

You can examine the source code of the FMain.form form of the IDE to 
have a good example of that.

-- 
Benoît Minisini




More information about the User mailing list