Bug #9942 2007-01-12 09:43

johanekdahl

Alt-F, O does not activate "Open File"

Alt-F, O does not activate "Open File":

Alt-F activates the File menu, where "O" in Open is underlined, indicating that you can use it as an accelerator.

This is not what happends. When pressing "O" the project is closed. (Arggghhhh...., it takes two minutes to open again).

Category
Application::WrongBehaviour
Group
 
Status
Closed
Close date
2007-01-20 18:13
Assigned to
 
artoj 2007-01-16 20:31

I can't reproduce this. The open file dialog opens as expected and the currently open project remains open.

I tested it on Windows XP (wxW 2.6.3p2, C::B revision 3444) and Ubuntu Edgy (wxW 2.6.3p2, C::B revision 3481).

What OS / wxWidgets version / Code::Blocks revision you're using?

johanekdahl 2007-01-18 07:56

Windows XP Professional, Version 2002, SP2

C::B is the nightly build with rev 3202

wx2.6.3(Windows, unicode)

I'll install the latest nightly on a test machine ASAP (a few days...) to see if I get the same behaviour

pecan 2007-01-18 21:07

I have the same problem running SVN 3482 XP2.

The Close accelerator does not work either. Using the C on the File menu skips to every menu item beginning with C except the Close item.

I changed the &Open main_menu.xrc item to Op&en and it works.

I change it to O&pen and it fails just like using O.

pecan 2007-01-18 21:11

I placed a trap in MainFrame::OnFileOpen. But the Alt-F Open event never invoke the routine.

pecan 2007-01-18 21:46

Noticing that using C on the file menu skipped the &Close item, I trapped "Open Default Workspace". Sure enought Alt-F O is send the event there.

I then changed "Open Default Workspace to Xpen Default Workspace". Low and behold Alt-F 0pen actually work.

The moral of this story seems to be that you cannot have multiple items on a menu that begin with the same letter and use one of those letters as an accelerator. It wont work as an accelerator.

pecan 2007-01-18 22:29

In the wxWidgets FAQ it contains an item about duplicate mnemonics:

Avoid duplicates

* Don't use the same mnemonic letter is twice in the same window.

pecan 2007-01-18 23:50

I tried to duplicate this theory via the wxWidgets menu same. But could not. The sample works fine when multiple fist letter items are on the menu.

artoj 2007-01-19 16:32

Use the patched wxWidgets DLL from:

http://prdownload.berlios.de/codeblocks/wxmsw26u_gcc_cb_wx2.6.3p2AndCbPatch.7z

and the shortcuts should work.

pecan 2007-01-20 18:12

Confirmed. Fixed by nightly builds and for svn users the menu.cpp and ownerdrw.cpp built by applying http://forums.codeblocks.org/index.php?topic=4809.msg38778#msg38778

pecan 2007-01-20 18:13

Please try with a nightly build and reopen this bug report, if

needed.

See http://www.codeblocks.org/nightly