Patch #2778 2009-06-24 04:26
stahta01
wx 2.9 Migration Patch to wxSmith Plugin- Download
- 2778-wx_2_9_Migrati.patch (67.7 KB)
Index: src/plugins/contrib/wxSmithContribItems/wxchart/wxschart.cpp
===================================================================
--- src/plugins/contrib/wxSmithContribItems/wxchart/wxschart.cpp (revision 5710)
+++ src/plugins/contrib/wxSmithContribItems/wxchart/wxschart.cpp (working copy)
@@ -104,7 +104,11 @@
if ( StyleCode.IsEmpty() ) StyleCode = _T("0");
else StyleCode.RemoveLast();
+ #if wxCHECK_VERSION(2, 9, 0)
+ Codef(_T("%C(%W,%I,(STYLE)(%s),%P,%S,%T);\n"),StyleCode.wx_str());
+ #else
Codef(_T("%C(%W,%I,(STYLE)(%s),%P,%S,%T);\n"),StyleCode.c_str());
+ #endif
Codef(_T("{\n"));
for ( size_t i=0; i<m_ChartPointsDesc.Count(); i++ )
@@ -129,15 +133,27 @@
wxString VarStr = wxString::Format(_T("PointSet%d"),(int)i);
+ #if wxCHECK_VERSION(2, 9, 0)
+ Codef(_T("\twxChartPoints* %v = %s(%t);\n"),VarStr.wx_str(),GenStr.wx_str(),Desc->Name.wx_str());
+ #else
Codef(_T("\twxChartPoints* %v = %s(%t);\n"),VarStr.c_str(),GenStr.c_str(),Desc->Name.c_str());
+ #endif
for ( size_t j=0; j<Desc->Points.Count(); j++ )
{
wxString PointStr = wxString::Format(_T("%lf,%lf"),Desc->Points[j]->X,Desc->Points[j]->Y);
+ #if wxCHECK_VERSION(2, 9, 0)
+ Codef(_T("\t%v->Add(%t,%s);\n"),VarStr.wx_str(),Desc->Points[j]->Name.wx_str(),PointStr.wx_str());
+ #else
Codef(_T("\t%v->Add(%t,%s);\n"),VarStr.c_str(),Desc->Points[j]->Name.c_str(),PointStr.c_str());
+ #endif
}
+ #if wxCHECK_VERSION(2, 9, 0)
+ Codef(_T("\t%AAdd(%v);\n"),VarStr.wx_str());
+ #else
Codef(_T("\t%AAdd(%v);\n"),VarStr.c_str());
+ #endif
}
Codef(_T("}\n"));
Index: src/plugins/contrib/wxSmithContribItems/wxflatnotebook/wxFlatNotebook/src/wxFlatNotebook/wxFlatNotebook.cpp
===================================================================
--- src/plugins/contrib/wxSmithContribItems/wxflatnotebook/wxFlatNotebook/src/wxFlatNotebook/wxFlatNotebook.cpp (revision 5710)
+++ src/plugins/contrib/wxSmithContribItems/wxflatnotebook/wxFlatNotebook/src/wxFlatNotebook/wxFlatNotebook.cpp (working copy)
@@ -488,7 +488,11 @@
if ( GetParent() )
{
event.SetCurrentFocus(this);
+ #if wxCHECK_VERSION(2, 9, 0)
+ GetParent()->GetEventHandler()->ProcessEvent(event);
+ #else
GetParent()->ProcessEvent(event);
+ #endif
}
}
}
Index: src/plugins/contrib/wxSmithContribItems/wxflatnotebook/wxsFlatNotebook.cpp
===================================================================
--- src/plugins/contrib/wxSmithContribItems/wxflatnotebook/wxsFlatNotebook.cpp (revision 5710)
+++ src/plugins/contrib/wxSmithContribItems/wxflatnotebook/wxsFlatNotebook.cpp (working copy)
@@ -324,7 +324,11 @@
for ( int i=0; i<GetChildCount(); i++ )
{
wxsFlatNotebookExtra* Extra = (wxsFlatNotebookExtra*)GetChildExtra(i);
+ #if wxCHECK_VERSION(2, 9, 0)
+ Codef(_T("%AAddPage(%o, %t, %b);\n"),i,Extra->m_Label.wx_str(),Extra->m_Selected);
+ #else
Codef(_T("%AAddPage(%o, %t, %b);\n"),i,Extra->m_Label.c_str(),Extra->m_Selected);
+ #endif
}
break;
Index: src/plugins/contrib/wxSmithContribItems/wxthings/wxscustombutton.cpp
===================================================================
--- src/plugins/contrib/wxSmithContribItems/wxthings/wxscustombutton.cpp (revision 5710)
+++ src/plugins/contrib/wxSmithContribItems/wxthings/wxscustombutton.cpp (working copy)
@@ -123,7 +123,11 @@
Style = _T("0");
}
+ #if wxCHECK_VERSION(2, 9, 0)
+ Codef(_T("%C(%W,%I,%t,%i,%P,%S,%s,%V,%N);\n"),m_Label.wx_str(),&m_Bitmap,wxART_OTHER,Style.wx_str());
+ #else
Codef(_T("%C(%W,%I,%t,%i,%P,%S,%s,%V,%N);\n"),m_Label.c_str(),&m_Bitmap,wxART_OTHER,Style.c_str());
+ #endif
if ( !m_BitmapSelected.IsEmpty() )
{
Index: src/plugins/contrib/wxSmithAui/wxAuiToolBar/wxsAuiToolBar.cpp
===================================================================
--- src/plugins/contrib/wxSmithAui/wxAuiToolBar/wxsAuiToolBar.cpp (revision 5710)
+++ src/plugins/contrib/wxSmithAui/wxAuiToolBar/wxsAuiToolBar.cpp (working copy)
@@ -309,16 +309,31 @@
}
Codef(_T("%AAddTool(%s, %t, %i, %i, %s, %t, %t, NULL);\n"),
+ #if wxCHECK_VERSION(2, 9, 0)
+ Child->GetIdName().wx_str(),
+ Extra->m_
download for full patch...
History
I am rewriting this patch breaking it into two parts; part one to upgrade wxSmith to work with wxPropertyGrid 1.46 and part two upgrade wxSmith to work with wxWidgets 2.9.0. Tim S
Updated code by removing parts needed to upgrade wxPropertyGrid to version 1.46.
Major Changes in this patch are:
Changed wxString::c_str() to wxString::wx_str(); note guard added per CB Team request.
Added GetEventHandler()-> before ProcessEvent.
Rewrote Grid->GetPropertyChoices(Id).Set code (please check this if you can)
wx29 Changed the type of wxPropertyGridManagerNameStr from wxChar* to char*.
Changed method wxPropertyGrid::GetSelectedProperty to wxPropertyGridManager::GetSelection
Moved wxPropertyGrid 1.4X patches to [ Patch #2794 ] Patch to upgrade wxSmith to work with wxPropertyGrid 1.46.
Uploaded new version of my wx29_wxSmith.patch file.
Corrected wx_str() to c_str(). Tim S