Patch #1617 2006-11-03 09:29

stahta01

Patch to help codeblock compile against wxWidgets 2.7
Download
1617-Patch_to_help.patch (1.4 KB)
Category
Application::FeatureAdd
Status
Closed
Close date
2006-12-19 21:21
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, 7, 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, 7, 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-11-03 09:31
Attached Patch file is 1 of 4 for patching CodeBlocks to compile against wxWidgets 2.7.0
The patch file is named wxscintilla-wx270_1-unix.patch; the -unix means it has unix line ending.

The Constants WXK_NUMPAD_PRIOR, WXK_NUMPAD_NEXT, WXK_PRIOR and WXK_NEXT are depreciated under wxWidgets 2.7.0.
The file ScintillaWX.cpp uses them in a switch statement which errors out because of duplicate values.

My patch prevents duplicate values from causing errors.

Code from wx/defs.h follows:

#if WXWIN_COMPATIBILITY_2_6
    WXK_NUMPAD_PRIOR = WXK_NUMPAD_PAGEUP,
    WXK_NUMPAD_NEXT  = WXK_NUMPAD_PAGEDOWN,
#endif
#if WXWIN_COMPATIBILITY_2_6
    WXK_PRIOR = WXK_PAGEUP,
    WXK_NEXT  = WXK_PAGEDOWN,
#endif

Unpatched section:

    case WXK_NUMPAD_PAGEUP:     // fall through
    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_PAGEDOWN:          // fall through
    case WXK_NUMPAD_NEXT:       // fall through
    case WXK_NEXT:              key = SCK_NEXT;     break;
    case WXK_NUMPAD_DELETE:     // fall through

Patched section:

    case WXK_NUMPAD_PAGEUP:     // fall through
#if WXK_NUMPAD_PRIOR != WXK_NUMPAD_PAGEUP
    case WXK_NUMPAD_PRIOR:      // fall through
#endif
#if WXK_PRIOR != WXK_PAGEUP     // fall through
    case WXK_PRIOR:
#endif
    case WXK_PAGEUP:            key = SCK_PRIOR;    break;
    case WXK_NUMPAD_PAGEDOWN:   // fall through
#if WXK_NUMPAD_NEXT  != WXK_NUMPAD_PAGEDOWN
    case WXK_NUMPAD_NEXT:       // fall through
#endif
#if WXK_NEXT  != WXK_PAGEDOWN
    case WXK_NEXT:              // fall through
#endif
    case WXK_PAGEDOWN:          key = SCK_NEXT;     break;
    case WXK_NUMPAD_DELETE:     // fall through

Thank You for a great IDE

Tim Stahlhut
mispunt 2006-11-07 21:14

Patch is send to the developer of wxScintilla (not really the same) Hopefully there will be a new release soon (patch works with 2.7.2)

stahta01 2006-12-12 06:18

Updated patch to match what wxScintilla is using in CVS/SVN.

Tim S

stahta01 2006-12-18 23:44

Please close; I have submitted 001734 ScintillaWX patch for wxWidgets 2.8 as a replcement. Tim S https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=1734&group_id=5358