[Gambas-user] Question of shortcut keys position

Gianluigi bagonergi at gmail.com
Tue Apr 24 18:30:53 CEST 2018


2018-04-24 18:16 GMT+02:00 Benoît Minisini <g4mba5 at gmail.com>:

> Le 24/04/2018 à 18:06, Gianluigi a écrit :
>
>>
>>
>> 2018-04-24 17:33 GMT+02:00 Benoît Minisini <g4mba5 at gmail.com <mailto:
>> g4mba5 at gmail.com>>:
>>
>>     Le 24/04/2018 à 17:18, Gianluigi a écrit :
>>
>>         Hi Benoit,
>>         I have not completely understood this suggestion:
>>         "You should not decide for the user of your library which
>>         shortcut he wants to use."
>>         But is not it always the programmer who decides what the
>>         shortcut keys of his application will be?
>>         Is not it normal to reserve F1 and F2 for help?
>>         This application is a utility if the shortcut keys are in the
>>         main module is not easier for the programmer to intervene and
>>         change them?
>>
>>         Regards
>>         Gianluigi
>>
>>
>>     No, shortcuts should be configurable.
>>
>>     In Gambas, this is done through :
>>
>>     - The "Action" property of a control.
>>
>>     - The "Shortcut" associated with a menu entry having its Action
>>     property set.
>>
>>     - the gb.form.mdi component that adds support for configuring these
>>     shortcuts.
>>
>>     At the moment, this is not possible to have an action with a
>>     shortcut outside of a menu entry.
>>
>>     I suggest that you don't try to handle the shortcut. Just offer a
>>     method to show your help browser, and let the user of your library
>>     manage the shortcuts as he likes.
>>
>>     --     Benoît Minisini
>>
>>
>> What you have just given me is a great teaching.
>> Thank you so much
>>
>> Regards
>> Gianluigi
>>
>>
> Well, if you didn't know, gb.form.mdi (which is not just a component for
> multi-document interface) provides you a Toolbar container:
>
> - Every control put in it with the Action property set will be
> configurable.
>
> - If the action of a control (which is just a string) starts with a point,
> then this action is assumed local to the form of the control. Otherwise it
> is a global action.
>
> - The Action class allows you to enable, disable actions. All controls
> having the same action are handled in one shot.
>
> Just use the IDE toolbars and menus, and you see how it works.
>
> Regards,
>
> --
> Benoît Minisini
>
>
Yes Benoit,
in seHelpBuider I used gb.form.mdi with the toolbar container.
I used Action_Activate by copying your code, but obviously I did not
completely understand it :-(

Regards
Gianluigi


> --------------------------------------------------
>
> This is the Gambas Mailing List:
> https://lists.gambas-basic.org/listinfo/user
>
> Search the list:
> https://lists.gambas-basic.org/cgi-bin/search.cgi
>
> Hosted by https://www.hostsharing.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180424/4a273e1f/attachment-0001.html>


More information about the User mailing list