Patch #1734 2006-12-18 23:17

stahta01

ScintillaWX patch for wxWidgets 2.8
Download
1734-ScintillaWX_pa.patch (1.4 KB)
Category
Application::Refinement
Status
Closed
Close date
2006-12-27 11:14
Assigned to
killerbot
Index: src/sdk/wxscintilla/src/ScintillaWX.cpp
===================================================================
--- src/sdk/wxscintilla/src/ScintillaWX.cpp    (revision 3367)
+++ src/sdk/wxscintilla/src/ScintillaWX.cpp    (working copy)
@@ -885,14 +885,18 @@
     case WXK_HOME:              key = SCK_HOME;     break;
     case WXK_NUMPAD_END:        // fall through
     case WXK_END:               key = SCK_END;      break;
-    case WXK_NUMPAD_PAGEUP:     // fall through
+#if !wxCHECK_VERSION(2, 8, 0)
+    case WXK_PRIOR:             // fall through
+    case WXK_NUMPAD_PRIOR:      // fall through
+#endif
     case WXK_PAGEUP:            // fall through
-    case WXK_NUMPAD_PRIOR:      // fall through
-    case WXK_PRIOR:             key = SCK_PRIOR;    break;
-    case WXK_NUMPAD_PAGEDOWN:   // fall through
+    case WXK_NUMPAD_PAGEUP:     key = SCK_PRIOR;    break;
+#if !wxCHECK_VERSION(2, 8, 0)
+    case WXK_NEXT:              // fall through
+    case WXK_NUMPAD_NEXT:       // fall through
+#endif 
     case WXK_PAGEDOWN:          // fall through
-    case WXK_NUMPAD_NEXT:       // fall through
-    case WXK_NEXT:              key = SCK_NEXT;     break;
+    case WXK_NUMPAD_PAGEDOWN:   key = SCK_NEXT;     break;       
     case WXK_NUMPAD_DELETE:     // fall through
     case WXK_DELETE:            key = SCK_DELETE;   break;
     case WXK_NUMPAD_INSERT:     // fall through
stahta01 2006-12-18 23:21

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

killerbot 2006-12-27 11:14

applied rev 3429