[Gambas-user] Toolbar buttons

Christopher Brian Jack brian at ...1334...
Tue Oct 17 05:22:15 CEST 2006


I'm trying to make a toolbar for use on an existing form for my project.

I have a few problems.

Toolbar buttons aren't creatable in the form designer with the toolbox
panel as the parent.  So I've had to use in Form_Open something like:

DIM toolButtons AS Variant[]
DIM tbItem AS ToolButton

...
...

PUBLIC SUB Form_Open()

...
...

' and using code like
newButton=NEW ToolButton(theToolBarObject)
'set properties like picture and tag
tbItem.W = 30
tbItem.H = 30
'24x24 icon image
tbItem.Picture = Picture.Load("SaveIcon.png")
tbItem.Tag = "save"
tbItem.ToolTip = "Commit Record"
toolButtons.Add(tbItem)

...
...

End

...
...

What I don't know is how to intercept the events these buttons will
produce from the code.  The form designer allows controls to be placed in
groups but there does not seem to be any grouping properties available at
runtime that I know of (or if there are the documentation is not easily
found with normal browsing).

So how do I set up (at runtime) to get events from the buttons on the
toolbar and, if required, how do I assign them a group (and use
Select...Case...End on the tags) for use in a single event handler?

.=================================================.
|  Christopher BRIAN Jack aka "Gau of the Veldt"  |
+================================================='
| oevna at ...1544...
`=================================================-
Hi Spambots, my email address is sputnik at ...1334...
Hi Humans, my email address uses rot13 cipher





More information about the User mailing list