User forums > General (but related to Code::Blocks)

[Work In Progress] Patches to Compile C::B against wxWidgets 2.9.0

<< < (7/9) > >>

stahta01:
Patch for profiler; I did not add wx version guards do you want me to? Tim S



--- Code: ---Index: src/plugins/contrib/profiler/cbprofilerexec.cpp
===================================================================
--- src/plugins/contrib/profiler/cbprofilerexec.cpp (revision 5588)
+++ src/plugins/contrib/profiler/cbprofilerexec.cpp (working copy)
@@ -165,7 +165,7 @@
     // Parsing Call Graph
     for (n = begin ; n < msg.GetCount(); ++n )
     {
-        if ((msg[n].IsEmpty())||(msg[n].Find(0x0C) != -1))
+        if ((msg[n].IsEmpty())||(msg[n].Find(wxChar(0x0C)) != -1))
             break;
         outputCallGraphArea->InsertItem(next,_T(""));
         char first_char = msg[n].GetChar(0);
@@ -209,7 +209,7 @@
     wxString output_help;
     for ( ; n < msg.GetCount(); ++n )
     {
-        if (msg[n].Find(0x0C) != -1)
+        if (msg[n].Find(wxChar(0x0C)) != -1)
             break;
         output_help << msg[n] << _T("\n");
         progress.Update((100*n)/(msg.GetCount()-1));
@@ -247,7 +247,7 @@
     // Parsing Call Graph
     for (n = begin ; n < msg.GetCount(); ++n )
     {
-        if ((msg[n].IsEmpty())||(msg[n].Find(0x0C) != -1))
+        if ((msg[n].IsEmpty())||(msg[n].Find(wxChar(0x0C)) != -1))
             break;
         long item = outputFlatProfileArea->InsertItem(next,_T(""));
         outputFlatProfileArea->SetItemData(item, next);
@@ -312,7 +312,7 @@
     // Printing Flat Profile Help
     for ( ; n < msg.GetCount(); ++n )
     {
-        if (msg[n].Find(0x0C) != -1)
+        if (msg[n].Find(wxChar(0x0C)) != -1)
             break;
         output_help << msg[n] << _T("\n");
         progress.Update((100*n)/(msg.GetCount()-1));

--- End code ---

stahta01:
Partial patch for CodeSnippets


--- Code: ---Index: src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp
===================================================================
--- src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp (revision 5588)
+++ src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp (working copy)
@@ -1850,7 +1850,11 @@
            #endif
 
             delete filetype;
+            #if wxCHECK_VERSION(2, 9, 0)
+            if ( !open.IsEmpty() )
+            #else
             if ( open )
+            #endif
                 ::wxExecute( open, wxEXEC_ASYNC);
         }
     }
@@ -2154,7 +2158,11 @@
             {
                 SetAssociatedItemID( treeItemID );
                 wxCommandEvent editEvt( wxEVT_COMMAND_MENU_SELECTED , idMnuEditSnippet);
+                #if wxCHECK_VERSION(2, 9, 0)
+                GetConfig()->GetSnippetsWindow()->GetEventHandler()->AddPendingEvent( editEvt);
+                #else
                 GetConfig()->GetSnippetsWindow()->AddPendingEvent( editEvt);
+                #endif
             }
         }
     }//if id
Index: src/plugins/contrib/codesnippets/snippetsconfig.cpp
===================================================================
--- src/plugins/contrib/codesnippets/snippetsconfig.cpp (revision 5588)
+++ src/plugins/contrib/codesnippets/snippetsconfig.cpp (working copy)
@@ -232,7 +232,11 @@
  cfgFile.Write( wxT("SnippetFolder"),   SettingsSnippetsFolder ) ;
  cfgFile.Write( wxT("ViewSearchBox"),   SettingsSearchBox ) ;
  cfgFile.Write( wxT("casesensitive"),   m_SearchConfig.caseSensitive ) ;
+    #if wxCHECK_VERSION(2, 9, 0)
+ cfgFile.Write( wxT("scope"),           int(m_SearchConfig.scope ));
+    #else
  cfgFile.Write( wxT("scope"),           m_SearchConfig.scope );
+    #endif
  cfgFile.Write( wxT("EditorsStayOnTop"),SettingsEditorsStayOnTop );
  if ( IsPlugin() )
  {   // Write ExternalPersistent for plugin use only
Index: src/plugins/contrib/codesnippets/codesnippetsevent.cpp
===================================================================
--- src/plugins/contrib/codesnippets/codesnippetsevent.cpp (revision 5588)
+++ src/plugins/contrib/codesnippets/codesnippetsevent.cpp (working copy)
@@ -95,8 +95,13 @@
     // Propagate the event to ThreadSearchFrame
     if ( pSearchPath && pCodeSnippetsTreeCtrl)
     {
+        #if wxCHECK_VERSION(2, 9, 0)
+        pSearchPath->GetEventHandler()->AddPendingEvent( (wxEvent&)event );
+        pCodeSnippetsTreeCtrl->GetEventHandler()->AddPendingEvent( (wxEvent&)event );
+        #else
         pSearchPath->AddPendingEvent( (wxEvent&)event );
         pCodeSnippetsTreeCtrl->AddPendingEvent( (wxEvent&)event );
+        #endif
     }
     else
     {
@@ -143,8 +148,13 @@
     // Propagate the event to ThreadSearchFrame
     if ( pSearchPath && pCodeSnippetsTreeCtrl)
     {
+        #if wxCHECK_VERSION(2, 9, 0)
+        pSearchPath->GetEventHandler()->ProcessEvent( (wxEvent&)event );
+        pCodeSnippetsTreeCtrl->GetEventHandler()->ProcessEvent( (wxEvent&)event );
+        #else
         pSearchPath->ProcessEvent( (wxEvent&)event );
         pCodeSnippetsTreeCtrl->ProcessEvent( (wxEvent&)event );
+        #endif
     }
     else
     {
Index: src/plugins/contrib/codesnippets/editor/seditorcolourset.cpp
===================================================================
--- src/plugins/contrib/codesnippets/editor/seditorcolourset.cpp (revision 5588)
+++ src/plugins/contrib/codesnippets/editor/seditorcolourset.cpp (working copy)
@@ -112,7 +112,11 @@
     wxString path = ConfigManager::GetFolder(sdDataUser) + _T("/lexers/");
     if (dir.Open(path))
     {
+        #if wxCHECK_VERSION(2, 9, 0)
+        Manager::Get()->GetLogManager()->Log(F(_("Scanning for lexers in %s..."), path.wx_str()));
+        #else
         Manager::Get()->GetLogManager()->Log(F(_("Scanning for lexers in %s..."), path.c_str()));
+        #endif
         bool ok = dir.GetFirst(&filename, _T("lexer_*.xml"), wxDIR_FILES);
         while(ok)
         {
@@ -128,7 +132,11 @@
     path = ConfigManager::GetFolder(sdDataGlobal) + _T("/lexers/");
     if (dir.Open(path))
     {
+        #if wxCHECK_VERSION(2, 9, 0)
+        Manager::Get()->GetLogManager()->Log(F(_("Scanning for lexers in %s..."), path.wx_str()));
+        #else
         Manager::Get()->GetLogManager()->Log(F(_("Scanning for lexers in %s..."), path.c_str()));
+        #endif
         bool ok = dir.GetFirst(&filename, _T("lexer_*.xml"), wxDIR_FILES);
         while(ok)
         {
@@ -724,7 +732,11 @@
         wxString tmp(_T(' '), keywords.length()); // faster than using Alloc()
 
         const wxChar *src = keywords.c_str();
+        #if wxCHECK_VERSION(2, 9, 0)
+        wxChar *dst = (wxChar *) tmp.wx_str();
+        #else
         wxChar *dst = (wxChar *) tmp.c_str();
+        #endif
         wxChar c;
         size_t len = 0;
 
Index: src/plugins/contrib/codesnippets/editor/scbeditor.cpp
===================================================================
--- src/plugins/contrib/codesnippets/editor/scbeditor.cpp (revision 5588)
+++ src/plugins/contrib/codesnippets/editor/scbeditor.cpp (working copy)
@@ -524,7 +524,11 @@
     event.SetY(yArg);
     //-wxPostEvent(Manager::Get()->GetAppWindow(), event);
     //-Manager::Get()->GetPluginManager()->NotifyPlugins(event);
+    #if wxCHECK_VERSION(2, 9, 0)
+    parent->GetEventHandler()->ProcessEvent(event);
+    #else
     parent->ProcessEvent(event);
+    #endif
 }
 
 void ScbEditor::DestroySplitView()
Index: src/plugins/contrib/codesnippets/editor/dragscroll.cpp
===================================================================
--- src/plugins/contrib/codesnippets/editor/dragscroll.cpp (revision 5588)
+++ src/plugins/contrib/codesnippets/editor/dragscroll.cpp (working copy)
@@ -1056,7 +1056,11 @@
                 wheelEvt.SetEventObject(pWindow);
                 wheelEvt.m_controlDown = true;
                 wheelEvt.m_wheelRotation = 0;
+                #if wxCHECK_VERSION(2, 9, 0)
+                pWindow->GetEventHandler()->AddPendingEvent(wheelEvt);
+                #else
                 pWindow->AddPendingEvent(wheelEvt);
+                #endif
                 #if defined(LOGGING)
                 LOGIT( _T("OnAppStartupDoneInit Issued Wheel Zoom event [%p][%d][%s]size[%d]"),pWindow, pWindow->GetId(), pWindow->GetName().c_str(),fontSize);
                 #endif
Index: src/plugins/contrib/codesnippets/Search/ThreadSearchView.cpp
===================================================================
--- src/plugins/contrib/codesnippets/Search/ThreadSearchView.cpp (revision 5588)
+++ src/plugins/contrib/codesnippets/Search/ThreadSearchView.cpp (working copy)
@@ -572,7 +572,11 @@
 
                 wxFocusEvent ev(wxEVT_SET_FOCUS);
                 ev.SetWindow(this);
+                #if wxCHECK_VERSION(2, 9, 0)
+                control->GetEventHandler()->AddPendingEvent(ev);
+                #else
                 control->AddPendingEvent(ev);
+                #endif
             }
             return;
         }//if IsOpen

--- End code ---

stahta01:
Patch to export; do you wish me to guard this one?


--- Code: ---Index: src/plugins/contrib/source_exporter/wxPdfDocument/src/pdffont.cpp
===================================================================
--- src/plugins/contrib/source_exporter/wxPdfDocument/src/pdffont.cpp (revision 5588)
+++ src/plugins/contrib/source_exporter/wxPdfDocument/src/pdffont.cpp (working copy)
@@ -1054,7 +1054,7 @@
     charIter = (*m_gn).find(s[i]);
     if (charIter != (*m_gn).end())
     {
-      t.Append(charIter->second);
+      t.Append(wxChar(charIter->second));
     }
     else
     {

--- End code ---

stahta01:
Patch to wxSmithContribItems attached as file. Tim S

Deleted Patch to save website resources

stahta01:
Patches to wxSmith for wxWidgets 2.9.0

File wx290_wxSmith_wxAPI-unix.patch patches the wxWidgets 2.9.0 changes
that are not related to wxPropertyGrid or POD warnings.

File wx290_wxSmith_pgAPI-unix.patch patches the wxPropertyGrid changes in wxWidgets 2.9.0.

File wx290_wxSmith_wxAPI_POD-unix.patch patches the cause of POD warnings.

Tim S

Deleted Patches to save website resources

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version