Patch #1732 2006-12-18 19:13
stahta01
keybinder plugin patches for wxWidgets 2.8- Download
- 1732-keybinder_plug.patch (1.1 KB)
Index: src/plugins/contrib/keybinder/keybinder.cpp
===================================================================
--- src/plugins/contrib/keybinder/keybinder.cpp (revision 3320)
+++ src/plugins/contrib/keybinder/keybinder.cpp (working copy)
@@ -197,12 +197,16 @@
case WXK_NUMPAD_HOME:
res << wxT("HOME"); break;
+#if !wxCHECK_VERSION(2, 8, 0)
case WXK_NUMPAD_PRIOR:
res << wxT("PgUp"); break;
+#endif
case WXK_NUMPAD_PAGEUP:
res << wxT("PAGEUP"); break;
+#if !wxCHECK_VERSION(2, 8, 0)
case WXK_NUMPAD_NEXT:
res << wxT("PgDn"); break;
+#endif
case WXK_NUMPAD_PAGEDOWN:
res << wxT("PAGEDOWN"); break;
case WXK_NUMPAD_END:
@@ -344,11 +348,15 @@
res << wxT("MENU"); break;
case WXK_CAPITAL:
res << wxT("CAPITAL"); break;
+#if !wxCHECK_VERSION(2, 8, 0)
case WXK_PRIOR:
res << wxT("PgUp"); break;
- case WXK_NEXT:
+#endif
+#if !wxCHECK_VERSION(2, 8, 0)
+ case WXK_NEXT:
res << wxT("PgDn"); break;
- case WXK_END:
+#endif
+case WXK_END:
res << wxT("END"); break;
case WXK_HOME:
res << wxT("HOME"); break;
History
This is a modified patch of afb https://developer.berlios.de/patch/?func=detailpatch&patch_id=1627&group_id=5358
I changed it to using wxCHECK_VERSION(2, 7, 0).
Tim S
could you explain a bit :
- why the changes
- what would not work when this would not be applied
(that makes it a bit easier for us to understand without doing the research, since you already did the research ;-) )
Change: WXK_NUMPAD_PRIOR, WXK_NUMPAD_NEXT, WXK_PRIOR and WXK_NEXT are deprecated and will go away in the future.
From include\wx\defs.h
WXK_NUMPAD_PRIOR = WXK_NUMPAD_PAGEUP,
WXK_NUMPAD_NEXT = WXK_NUMPAD_PAGEDOWN,
WXK_PRIOR = WXK_PAGEUP,
WXK_NEXT = WXK_PAGEDOWN,
Problem: Duplicate value errors happen in switch statements because of the defs.h.
Solution: Gate all values of WXK_NUMPAD_PRIOR, WXK_NUMPAD_NEXT, WXK_PRIOR and WXK_NEXT with !wxCHECK_VERSION(2, 8, 0) Tim S
I would rather not make any 2.7.0 or 2.8.0 changes to keybinder until RC3 is out.
pecan
applied : rev 3428