Patch #1908 2007-03-01 00:36

stahta01

Patch SDK files for wxW28 with disable_compat26
Download
1908-Patch_SDK_file.patch (4.0 KB)
Category
Application::Refinement
Status
Closed
Close date
2007-06-09 04:57
Assigned to
 
Index: src/sdk/wxFlatNotebook/src/wxFlatNotebook/wxFlatNotebook.cpp
===================================================================
--- src/sdk/wxFlatNotebook/src/wxFlatNotebook/wxFlatNotebook.cpp    (revision 4032)
+++ src/sdk/wxFlatNotebook/src/wxFlatNotebook/wxFlatNotebook.cpp    (working copy)
@@ -1017,7 +1017,11 @@
     }
 
     rect = wxRect(btnXPos, 8, 16, 16);
+#if wxCHECK_VERSION(2, 8, 0)
+    if(rect.Contains(pt))
+#else
     if(rect.Inside(pt))
+#endif
     {
         return (style & wxFNB_NO_X_BUTTON) ? wxFNB_NOWHERE : wxFNB_X;
     }
@@ -1026,18 +1030,30 @@
     if( style & wxFNB_DROPDOWN_TABS_LIST )
     {
         rect = wxRect(render->GetDropArrowButtonPos( this ), 8, 16, 16);
+#if wxCHECK_VERSION(2, 8, 0)
+        if( rect.Contains(pt) )
+#else
         if( rect.Inside(pt) )
+#endif
             return wxFNB_DROP_DOWN_ARROW;
     }
 
+#if wxCHECK_VERSION(2, 8, 0)
+    if(rect.Contains(pt))
+#else
     if(rect.Inside(pt))
+#endif
     {
         return (style & wxFNB_NO_NAV_BUTTONS) ? wxFNB_NOWHERE : wxFNB_RIGHT_ARROW;
     }
 
 
     rect = wxRect(btnLeftPos, 8, 16, 16);
+#if wxCHECK_VERSION(2, 8, 0)
+    if(rect.Contains(pt))
+#else
     if(rect.Inside(pt))
+#endif
     {
         return (style & wxFNB_NO_NAV_BUTTONS) ? wxFNB_NOWHERE : wxFNB_LEFT_ARROW;
     }
@@ -1054,7 +1070,11 @@
         if(style & wxFNB_X_ON_TAB && (int)cur == GetSelection())
         {
             // 'x' button exists on a tab
+#if wxCHECK_VERSION(2, 8, 0)
+            if(m_pagesInfoVec[cur].GetXRect().Contains(pt))
+#else
             if(m_pagesInfoVec[cur].GetXRect().Inside(pt))
+#endif
             {
                 pageInfo = pgInfo;
                 tabIdx = (int)cur;
@@ -1082,7 +1102,11 @@
 
             wxRect tabRect = wxRect(pgInfo.GetPosition().x, pgInfo.GetPosition().y, 
                 pgInfo.GetSize().x, pgInfo.GetSize().y);
+#if wxCHECK_VERSION(2, 8, 0)
+            if(tabRect.Contains(pt))
+#else
             if(tabRect.Inside(pt))
+#endif
             {
                 // We have a match
                 pageInfo = pgInfo;
Index: src/sdk/wxscintilla/src/PlatWX.cpp
===================================================================
--- src/sdk/wxscintilla/src/PlatWX.cpp    (revision 4032)
+++ src/sdk/wxscintilla/src/PlatWX.cpp    (working copy)
@@ -1382,11 +1382,28 @@
 //----------------------------------------------------------------------
 
 ElapsedTime::ElapsedTime() {
+#if !wxCHECK_VERSION(2, 6, 2)
     wxStartTimer();
+#else
+    wxLongLong localTime = wxGetLocalTimeMillis();
+    littleBit = localTime.GetLo();
+    bigBit = localTime.GetHi();
+#endif
 }
 
 double ElapsedTime::Duration(bool reset) {
+#if !wxCHECK_VERSION(2, 6, 2)
     double result = wxGetElapsedTime(reset);
+#else
+    wxLongLong prevTime(bigBit, littleBit);
+    wxLongLong localTime = wxGetLocalTimeMillis();
+    if(reset) {
+        littleBit = localTime.GetLo();
+        bigBit = localTime.GetHi();
+    }
+    wxLongLong duration = localTime - prevTime;
+    double result = duration.ToDouble();
+#endif
     result /= 1000.0;
     return result;
 }
Index: src/sdk/wxscintilla/src/ScintillaWX.cpp
===================================================================
--- src/sdk/wxscintilla/src/ScintillaWX.cpp    (revision 4032)
+++ src/sdk/wxscintilla/src/ScintillaWX.cpp    (working copy)
@@ -684,7 +684,6 @@
     PRectangle rcClient = GetClientRectangle();
     paintingAllText = rcPaint.Contains(rcClient);
 
-    dc->BeginDrawing();
     ClipChildren(*dc, rcPaint);
     Paint(surfaceWindow, rcPaint);
 
@@ -695,7 +694,6 @@
         FullPaint();
     }
     paintState = notPainting;
-    dc->EndDrawing();
 }
 
 
Index: src/include/globals.h
===================================================================
--- src/include/globals.h    (revision 4032)
+++ src/include/globals.h    (working copy)
@@ -309,4 +309,15 @@
     extern DLLIMPORT windows_version_t WindowsVersion();
 };
 
+#if wxCHECK_VERSION(2, 8, 0) && !(WXWIN_COMPATIBILITY_2_6)
+    // Note the following defines need removed
+    // when CodeBlocks support for wxWidgets 2.6 is dropped
+    #define wxOPEN wxFD_OPEN
+    #define wxFILE_MUST_EXIST wxFD_FILE_MUST_EXIST
+    #define wxMULTIPLE wxFD_MULTIPLE
+    #define wxSAVE wxFD_SAVE
+    #define wxOVERWRITE_PROMPT wxFD_OVERWRITE_PROMPT
+    #define wxCHANGE_DIR wxFD_CHANGE_DIR
+#endif
+
 #endif // SDK_GLOBALS_H
stahta01 2007-03-01 00:37

Filename: disable_compat26_sdk-unix.patch

Purpose: Change CB SDK files to improve support for wxWidgets 2.8 with option disable_compat26.

Reference: wx/platinfo.h

Problem 1: Operating Systems Constants where renamed with wxOS_ prefix

Solution 1: Use new names in #if/else/endif blocks

Note 1: 2.6 value is wxWINDOWS_NT and 2.8 value is wxOS_WINDOWS_NT

Problem 2: Depreciated methods BeginDrawing and EndDrawing removed.

Reference: wx/dc.h

Solution 2: Removed Depreciated methods.

Problem 3: Contructor signature for class wxFontDialog has been changed.

Reference: wx/fontdlg.h

Solution 3: Use new signature in #if/else/endif block

Problem 4: Depreciated method wxRect::Inside replaced by wxRect::Contains.

Reference: wx/gdicmn.h

Solution 4: Replace method Inside with Contains

Problem 5: Depreciated methods wxStartTimer and wxGetElapsedTime

Reference: wx/stopwatch.h

Solution 5: Rewrote code to use method wxGetLocalTimeMillis.

Problem 6: File Constants where renamed with wxFD_ prefix

Reference: wx/filedlg.h

Solution 6: Added code to src/include/globals.h to define old constanst.

#if wxCHECK_VERSION(2, 8, 0) && !(WXWIN_COMPATIBILITY_2_6)

// Note the following defines need removed

// when CodeBlocks support for wxWidgets 2.6 is dropped

#define wxOPEN wxFD_OPEN

#define wxFILE_MUST_EXIST wxFD_FILE_MUST_EXIST

#define wxMULTIPLE wxFD_MULTIPLE

#define wxSAVE wxFD_SAVE

#define wxOVERWRITE_PROMPT wxFD_OVERWRITE_PROMPT

#define wxCHANGE_DIR wxFD_CHANGE_DIR

#endif

stahta01 2007-03-30 18:39

Updated to match current SVN 3797

Tim S

stahta01 2007-06-01 13:10

Updated to SVN 4032

stahta01 2007-06-09 04:48

Please close, all of this has been fixed to my knowledge except for the File Dialog stuff which I posted a new patch of https://developer.berlios.de/patch/?func=detailpatch&patch_id=2043&group_id=5358

Tim S

biplab 2007-06-09 04:57

Closed.