[Gambas-user] What is the 'Action' e.g when constructing a menu

Benoit Minisini gambas at ...1...
Sun Sep 28 20:06:23 CEST 2008


On dimanche 28 septembre 2008, Doriano Blengino wrote:
> richard terry ha scritto:
> > I've often wondered what/how this is used.
> >
> > For example in the menu editor one gives the names, group, tag, and then
> > there is an action textbox ? what for
> >
> > Any info/example appreciated, and thanks in advance.
> >
> > Richard
>
> You can use an "Action" to group together items (like menu items or
> buttons) which can throw "actions". For example, you can have a button
> and menu item which both save the file currently edited. You can
> associate them together by assigning to them the action "SaveFile".
> Then, you can enable or disable they together by executing:
>
>   action["SaveFile"].Enabled = FALSE
>
>
> In a complex application, where you can have many items related to a
> single state, this can help to simplfy the work.
> It is planned to extend this, and add more functionalities.
>

Moreover, each time a control related to an action is clicked, or activated, a 
public procedure named "Action_Activate" is called in the form, with the 
action name as argument. This way, you can centralize the management of all 
actions in a same form.

Regards,

-- 
Benoit Minisini




More information about the User mailing list