Patch #1732 2006-12-18 19:13

stahta01

keybinder plugin patches for wxWidgets 2.8
Download
1732-keybinder_plug.patch (1.1 KB)
Category
Plugin::Refinement
Status
Closed
Close date
2006-12-27 10:50
Assigned to
pecan
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;
stahta01 2006-12-18 19:14

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

killerbot 2006-12-18 19:54

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 ;-) )

stahta01 2006-12-18 23:09

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

pecan 2006-12-19 14:43

I would rather not make any 2.7.0 or 2.8.0 changes to keybinder until RC3 is out.

pecan

killerbot 2006-12-27 10:50

applied : rev 3428