Skip to content

Commit

Permalink
Added the patch file to disable wxwidgets accelerator handling, but, …
Browse files Browse the repository at this point in the history
…still display the accel string in the menu and still prove the ParseAccel function.
  • Loading branch information
ajpalkovic committed Oct 21, 2010
1 parent 1cdf0d9 commit a5f4023
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions external/get_externals_win.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down
61 changes: 61 additions & 0 deletions external/patches/wxWidgetsDisableAccel.patch
Original file line number Diff line number Diff line change
@@ -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.