Skip to content
Browse files

Added the patch file to disable wxwidgets accelerator handling, but, …

…still display the accel string in the menu and still prove the ParseAccel function.
  • Loading branch information...
1 parent 1cdf0d9 commit a5f4023a0afc3e9222437f699285cda3fc7f1c56 @ajpalkovic ajpalkovic committed Oct 21, 2010
Showing with 62 additions and 0 deletions.
  1. +1 −0 external/get_externals_win.sh
  2. +61 −0 external/patches/wxWidgetsDisableAccel.patch
View
1 external/get_externals_win.sh
@@ -79,6 +79,7 @@ _extract_and_patch()
patch -Np1 -d metakit < patches/metakit.patch
patch tinyxml/tinyxml.cpp < patches/tinyxml/tinyxml.cpp.patch
patch tinyxml/tinyxml.h < patches/tinyxml/tinyxml.h.patch
+ patch -p0 -d wxwidgets < patches/wxWidgetsDisableAccel.patch
# Copy msvc specific project files
echo "Copying msvc specific project files..."
View
61 external/patches/wxWidgetsDisableAccel.patch
@@ -0,0 +1,61 @@
+diff -crB src/common/menucmn.cpp src/common/menucmn.cpp
+*** src/common/menucmn.cpp 2010-02-12 00:05:09.505159000 -0500
+--- src/common/menucmn.cpp 2010-09-18 00:52:08.285646800 -0400
+***************
+*** 190,197 ****
+--- 190,203 ----
+ // parse the accelerator string
+ int accelFlags = wxACCEL_NORMAL;
+ wxString current;
++ int size = label.length();
+ for ( size_t n = (size_t)posTab + 1; n < label.length(); n++ )
+ {
++ char c1 = label[n];
++
++ // ignore chords
++ if(label[n] == ' ') return false;
++
+ if ( (label[n] == '+') || (label[n] == '-') )
+ {
+ // differentiate between a ctrl that will be translated to cmd on mac
+diff -crB src/msw/menu.cpp src/msw/menu.cpp
+*** src/msw/menu.cpp 2010-02-12 00:05:18.754688000 -0500
+--- src/msw/menu.cpp 2010-09-18 15:48:21.112913700 -0400
+***************
+*** 289,294 ****
+--- 289,295 ----
+
+ void wxMenu::UpdateAccel(wxMenuItem *item)
+ {
++ return;
+ if ( item->IsSubMenu() )
+ {
+ wxMenu *submenu = item->GetSubMenu();
+diff -crB include/wx/accel.h include/wx/accel.h
+*** include/wx/accel.h 2010-02-12 00:04:49.566018500 -0500
+--- include/wx/accel.h 2010-09-17 12:19:28.018812500 -0400
+***************
+*** 124,134 ****
+ bool FromString(const wxString& str);
+
+
+- private:
+ // common part of Create() and FromString()
+ static bool ParseAccel(const wxString& str, int *flags, int *keycode);
+
+
+ int m_flags; // combination of wxACCEL_XXX constants
+ int m_keyCode; // ASCII or virtual keycode
+ int m_command; // Command id to generate
+--- 124,134 ----
+ bool FromString(const wxString& str);
+
+
+ // common part of Create() and FromString()
+ static bool ParseAccel(const wxString& str, int *flags, int *keycode);
+
+
++ private:
+ int m_flags; // combination of wxACCEL_XXX constants
+ int m_keyCode; // ASCII or virtual keycode
+ int m_command; // Command id to generate

0 comments on commit a5f4023

Please sign in to comment.
Something went wrong with that request. Please try again.