Alt key problem in Menus

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Alt key problem in Menus

Janos Kazsoki
Hi,

I created a simple menubar in a shell Default View like &File, &Help.
under Help there is another &Help menuitem with Accelerator key H.

When I open the shell the Alt-F does not open the File menu, nor Alt-H
opens the Help Menu.
But if I push h, then the Help command of the Help menuitem is
executed.

The expected behaviour should be: I open Help menu with Alt-H and then
the Help menuitem with H.

The behavior is the same in deployed application.

I checked and compared the aspects to some other views/menus, which
work fine (basically any other menu in the system), but I cannot find
the difference.

What could I have forgotten to set?

Thank you,
Janos


Reply | Threaded
Open this post in threaded view
|

Re: Alt key problem in Menus

Chris Uppal-3
Janos,

> I created a simple menubar in a shell Default View like &File, &Help.
> under Help there is another &Help menuitem with Accelerator key H.
>
> When I open the shell the Alt-F does not open the File menu, nor Alt-H
> opens the Help Menu.

That's odd.  Does Alt-F bring up the File menu in the IDE tools?  If not then
it might be another Windows configuration problem.

> But if I push h, then the Help command of the Help menuitem is
> executed.
>
> The expected behaviour should be: I open Help menu with Alt-H and then
> the Help menuitem with H.

I think that's the way it's supposed to work.  The accelerator key is used to
access the command independently of the menu system.  E.g. if F1 is the
accelerator key for help (as is standard), then pressing F1 will bring up help
no matter how deeply that option is buried in menus within menus.

To make h select the Help item when the outer Help menu is dropped down, it
should be sufficient for it to set to &Help -- which you already have.

It may be that setting the accelerator to h is confusing the menu system
(especially if you've done something similar for f), and that's why Alt-H
doesn't work correctly.

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Alt key problem in Menus

Janos Kazsoki
Chris Uppal wrote:
> That's odd.

yes, it is. Thanks for the suggestion. I have tried already what I
could, unsuccessfully.
As last I thought, some other packages have side effect, so I created a
testcase in the 6.02 clean image.

I opened an ideaspace, created a ShellTest package, opened a class
browser (everything within the idea space), created a MyShellTest
subclass of Shell, right click, vew, new, Default view (opened a VC in
the idea space), double clicked on the Menubar , set the Menu to &File,
and the menuitem to E&xit, command #exit, Accelerator key: Alt+F4.

Then in the ideaspace: Alt F (it opened the VC File menu), save, then
Test. My shell view opens, alt F does not work. Alt-F4 closes it. After
that the Alt F opens the file menu which is in the idea space...

As next I try to create the view out of an idea space (by the way: test
other views within the idea space show, that the Alt-F works fine for
those lucky ones...) It seems everywhere else works, but not in my
created view..

Later,
Janos


Reply | Threaded
Open this post in threaded view
|

Re: Alt key problem in Menus

Janos Kazsoki
In reply to this post by Chris Uppal-3
Chris,

> That's odd.


yes, it is. Thanks for the suggestions. I have tried what you proposed
among deleting and recreating the view, unfortunately unsuccessfully.
As last I thought, some other packages have side effect, so I created a

testcase in the 6.02 clean image.

I opened an ideaspace, created a ShellTest package, opened a class
browser (everything within the idea space), created a MyShellTest
subclass of Shell, right click, vew, new, Default view (opened a VC in
the idea space), double clicked on the Menubar , set the Menu to &File,

and the menuitem to E&xit, command #exit, Accelerator key: Alt+F4.


Then in the ideaspace: Alt F (it opened the VC File menu), save, then
Test. My shell view opens, alt F does not work. Alt-F4 closes it. After

that the Alt F opens the file menu which is in the idea space...


As next I try to create the view out of an idea space (by the way: test

other views within the idea space show, that the Alt-F works fine for
those lucky ones...) It seems everywhere else works, but not in my
created view..


Later,
Janos


Reply | Threaded
Open this post in threaded view
|

Re: Alt key problem in Menus

Janos Kazsoki
If I create a subclass of  PersonalMoneyShell, then the Alt F works for
this class. If I create a subclass of Shell, and create new view and
add menu to that then alt F does not work. hmmmmm..........


Reply | Threaded
Open this post in threaded view
|

Re: Alt key problem in Menus

Janos Kazsoki
Strange, strange...

I subclass the PersonalMoneyShell as PersonalMoneyShellMenuTest, right
click, views, new, Default view, File, Test, Alt F opens the File menu.


Then I edit the menubar: Delete the File menu, and create a new one
(after moving it to the first position, as: Menu: &File OK, Menuitem
E&xit, command #exit, OK.
File, Test Alt F works fine with this menu on the view.

Then I subclass Shell as ShellMenuTest, right click, views, New,
Default view, double click on the menubar to edit it, I do the "same"
as above: Menu: &File OK, Menuitem E&xit, command #exit, OK.
File, Test Alt F  DOES NOT work.

Now: the only difference I can see is that the first view resource had
already a menubar, but in the second case I started from Menubar nil,
i.e created (probably, as I imagine) a new instance of it.

Perhaps something is not initialized when I create a new Menubar
instance for my resource view (instead of using an already created one)
in the VC.

Well, but how can I catch it?

Regards,
Janos


Reply | Threaded
Open this post in threaded view
|

Re: Alt key problem in Menus

Ian Bartholomew-21
Janos,

> Then I subclass Shell as ShellMenuTest, right click, views, New,
> Default view, double click on the menubar to edit it, I do the "same"
> as above: Menu: &File OK, Menuitem E&xit, command #exit, OK.
> File, Test Alt F  DOES NOT work.

You may be leading yourself astray with that test.  If you drop a, for
example, TextPresenter.Multiline text view into your ShellMenuTest and try
it again then Alt-F should work.  It seems that something (Windows or
Dolphin) needs a subview to have focus before the menu works.

I haven't really been following the thread so I don't know if that is the
cause of  your original problem?

--
Ian

Use the Reply-To address to contact me (limited validity).
Mail sent to the From address is ignored.


Reply | Threaded
Open this post in threaded view
|

Re: Alt key problem in Menus

Janos Kazsoki
In reply to this post by Janos Kazsoki
Ian Bartholomew wrote:
If you drop a, for example, TextPresenter.Multiline text view into your
ShellMenuTest and try it again then Alt-F should work.  It seems that
something (Windows or Dolphin) needs a subview to have focus before the
menu works.

Ian,

yes!!!!!!!!! Exactly. after dropping something (as it seems: anything)
into that empty Shell, then the Alt F works as it should.

I trapped myself  into one step in the top-down planning: I thought I
create first an (empty) highest level shell, and when it works, then I
fill it with the application specific subpresenters... Oh well. On to
the next surprise!

Many thanks,
Janos


Reply | Threaded
Open this post in threaded view
|

Re: Alt key problem in Menus

Blair-2
"Janos" <[hidden email]> wrote in message
news:[hidden email]...

>
> Ian Bartholomew wrote:
> If you drop a, for example, TextPresenter.Multiline text view into your
> ShellMenuTest and try it again then Alt-F should work.  It seems that
> something (Windows or Dolphin) needs a subview to have focus before the
> menu works.
>
> Ian,
>
> yes!!!!!!!!! Exactly. after dropping something (as it seems: anything)
> into that empty Shell, then the Alt F works as it should.
>
> I trapped myself  into one step in the top-down planning: I thought I
> create first an (empty) highest level shell, and when it works, then I
> fill it with the application specific subpresenters... Oh well. On to
> the next surprise!

The menu short cut keys will not work unless focus has been set to a control
in the shell - Windows requires this for some reason. Actually you can
observe this in a freshly opened IdeaSpace where the menu shortcut keys
don't work either.

Normally a freshly opened shell will tab to the first subview with the
isTabStop attribute set. You can change this behaviour by overriding
#setInitialFocus in your shell presenter.

Regards

Blair