Keyboard shortcuts XP

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Sebastian Rose
Earned a small fee
Earned a small fee
Posts: 17
Joined: Mon Mar 28, 2005 8:17 pm
Location: Hannover, Germany
Contact:

Keyboard shortcuts XP

Post by Sebastian Rose »

I have a wxFrame subclass, containing a custom wxTreeCtrl class. both of them having there own eventtable, since I want to trigger actions and pop up contextmenus in the TreeCtrl on right mousebutton, without Frame and TreeCtrl depending on each other.
Ok. On Linux/Gtk, the menu shortcuts in the TreeCtrl like

Code: Select all

m_itemPopup->Append(ID_MNU_DELETE_ITEM, _T("Delete entry\tCTRL+d"), _T(""), wxITEM_NORMAL);
Didn't seem to work, so I wrote an accelerator table:

Code: Select all

  wxAcceleratorEntry entries[7];
  entries[0].Set(wxACCEL_ALT,    (int) 'a',  ID_MNU_GROUP_ADD_GROUP);
  ...
  entries[2].Set(wxACCEL_CTRL,   (int) 'c',  ID_MNU_CLIPBOARD_ITEM); 
  entries[3].Set(wxACCEL_CTRL,   (int) 'd',  ID_MNU_DELETE_ITEM); 
  ...
  wxAcceleratorTable accel(7, entries); 
I didn't change the menu items, since I want the Shortcuts to be displayed in menu buttons, so the user has chance to learn the shortcuts withaout reading the manual.

In the Frame class I did the same thing.
OnLinux/Gtk build these shortcuts work, Xp just rings the bell, when I I use enter a shortcut, defined in the TreeCtrl widget. The Shortcuts in the Frame work on both systems.

Is there a chance to display the shortcuts in the menubuttons AND use the acceleratortable?

Or do I have to move all of the eventhandling stuff into my Frame to run it on XP?[/code]
Last edited by Sebastian Rose on Sun Apr 03, 2005 2:52 am, edited 1 time in total.
XP prof: --- wxWidgets 2.6.2 --- Mingw Gcc
Debian testing: --- wxWidgets 2.6.2 --- gcc 4.0.2-2 --- Gtk2 2.6.10
Sebastian Rose
Earned a small fee
Earned a small fee
Posts: 17
Joined: Mon Mar 28, 2005 8:17 pm
Location: Hannover, Germany
Contact:

Post by Sebastian Rose »

Ok -Sorry my wx beginner fault.

just forgot 'DECLARE_DYNAMIC...'

Problem: some of the wx-msw sources in treectrl.cpp depend on these macros. In most cases (Dialog as an example and wxTreeCtrl on Gtk) works without those macros. A look in the sources solved the problem.

The second reason seems to be a bug in both wxWidgets versions I tried:
wxTreeCtrl::ItemHasChildren() does not work properly on XP.
XP prof: --- wxWidgets 2.6.2 --- Mingw Gcc
Debian testing: --- wxWidgets 2.6.2 --- gcc 4.0.2-2 --- Gtk2 2.6.10
Post Reply