Goubier Thierry wrote:
Le 18/02/2014 09:36, Hilaire Fernandes a écrit :
Le 18/02/2014 09:26, Goubier Thierry a écrit :
Now I want to try something: populate the menu bar with all possible
menu/shortcuts commands defined in my app (i.e. tree node contextual
menu, code pane contextual menu, smart-suggestions type commands) to
ensure discoverability, in as few lines as possible.
I guess it should be a mission for Spec.
Probably ;)
For DrGeo, I have to hand write it and it is no a few lines. Not to
mention I did not set up the keyboard short cut.
Well, I lifted the Command framework of the OmniBrowser for my own
needs, and building automatically the menu and the shortcuts is just a
few lines (and the shortcuts are allways in sync with the menu).
I just have to change a bit the isActive/isEnabled for the menu bar;
it should do the trick. Longuest will probably be rebuilding the
layout of the window to accomodate the menu bar.
Oh, and some menu commands names depend on the name of the ast node at
the cursor point in the text (such as 'create accessors on requestor'
when selecting the 'requestor' instance variable name in the
#subclass: class description), so I should have a way to handle that
(have a default name when nothing is selected?)
Thierry
Pharolauncher doesn't have a menu but it does have a an command icon
toolbar at the top which is similar. It provide a very good example of
a Spec application to learn from.
cheers -ben