Patch #1620 2006-11-03 12:12

stahta01

Patch to help codeblock compile against wxWidgets 2.7
Download
1620-Patch_to_help.patch (4.8 KB)
Category
Application::FeatureAdd
Status
Closed
Close date
2006-12-19 21:21
Assigned to
killerbot
Index: src/sdk/propgrid/include/wx/propgrid/odcombo.h
===================================================================
--- src/sdk/propgrid/include/wx/propgrid/odcombo.h    (revision 3173)
+++ src/sdk/propgrid/include/wx/propgrid/odcombo.h    (working copy)
@@ -474,10 +474,17 @@
 
     // wxControlWithItems methods
     virtual void Clear();
+#if wxCHECK_VERSION(2, 7, 0)
+    virtual void Delete(unsigned int n);
+    virtual unsigned int GetCount() const;
+    virtual wxString GetString(unsigned int n) const;
+    virtual void SetString(unsigned int n, const wxString& s);
+#else    
     virtual void Delete(int n);
     virtual int GetCount() const;
     virtual wxString GetString(int n) const;
     virtual void SetString(int n, const wxString& s);
+#endif    
     virtual int FindString(const wxString& s) const;
     virtual void Select(int n);
     virtual int GetSelection() const;
@@ -508,11 +515,19 @@
     void ClearClientDatas();
 
     virtual int DoAppend(const wxString& item);
+#if wxCHECK_VERSION(2, 7, 0)   
+    virtual int DoInsert(const wxString& item, unsigned int pos);
+    virtual void DoSetItemClientData(unsigned int n, void* clientData);
+    virtual void* DoGetItemClientData(unsigned int n) const;
+    virtual void DoSetItemClientObject(unsigned int n, wxClientData* clientData);
+    virtual wxClientData* DoGetItemClientObject(unsigned int n) const;
+#else    
     virtual int DoInsert(const wxString& item, int pos);
     virtual void DoSetItemClientData(int n, void* clientData);
     virtual void* DoGetItemClientData(int n) const;
     virtual void DoSetItemClientObject(int n, wxClientData* clientData);
     virtual wxClientData* DoGetItemClientObject(int n) const;
+#endif
 
     // popup interface
     wxComboPopupInterface*  m_popupInterface;
Index: src/sdk/propgrid/src/propgrid/odcombo.cpp
===================================================================
--- src/sdk/propgrid/src/propgrid/odcombo.cpp    (revision 3173)
+++ src/sdk/propgrid/src/propgrid/odcombo.cpp    (working copy)
@@ -2795,7 +2795,11 @@
     GetTextCtrl()->SetValue(wxEmptyString);
 }
 
+#if wxCHECK_VERSION(2, 7, 0)
+void wxPGOwnerDrawnComboBox::Delete(unsigned int n)
+#else
 void wxPGOwnerDrawnComboBox::Delete(int n)
+#endif
 {
     if ( m_hasIntValue )
     {
@@ -2817,13 +2821,20 @@
     }
 }
 
+#if wxCHECK_VERSION(2, 7, 0)
+unsigned int wxPGOwnerDrawnComboBox::GetCount() const
+#else
 int wxPGOwnerDrawnComboBox::GetCount() const
+#endif
 {
     wxASSERT ( m_popupInterface );
     return m_popupInterface->GetCount();
 }
-
+#if wxCHECK_VERSION(2, 7, 0)
+wxString wxPGOwnerDrawnComboBox::GetString(unsigned int n) const
+#else
 wxString wxPGOwnerDrawnComboBox::GetString(int n) const
+#endif
 {
     wxCHECK_MSG( (n >= 0) && (n < GetCount()), wxEmptyString, _T("invalid index in wxPGOwnerDrawnComboBox::GetString") );
     return m_popupInterface->GetString(n);
@@ -2833,7 +2844,11 @@
     return wxEmptyString;*/
 }
 
+#if wxCHECK_VERSION(2, 7, 0)
+void wxPGOwnerDrawnComboBox::SetString(unsigned int n, const wxString& s)
+#else
 void wxPGOwnerDrawnComboBox::SetString(int n, const wxString& s)
+#endif
 {
     wxCHECK_RET( (n >= 0) && (n < GetCount()), _T("invalid index in wxPGOwnerDrawnComboBox::SetString") );
     m_popupInterface->SetString(n,s);
@@ -2899,8 +2914,11 @@
 
     return pos;
 }
-
+#if wxCHECK_VERSION(2, 7, 0)
+int wxPGOwnerDrawnComboBox::DoInsert(const wxString& item, unsigned int pos)
+#else
 int wxPGOwnerDrawnComboBox::DoInsert(const wxString& item, int pos)
+#endif
 {
     wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list"));
     wxCHECK_MSG((pos>=0) && (pos<=GetCount()), -1, wxT("invalid index"));
@@ -2910,13 +2928,20 @@
     return pos;
 }
 
+#if wxCHECK_VERSION(2, 7, 0)
+void wxPGOwnerDrawnComboBox::DoSetItemClientData(unsigned int n, void* clientData)
+#else
 void wxPGOwnerDrawnComboBox::DoSetItemClientData(int n, void* clientData)
+#endif
 {
     m_clientDatas.SetCount(n+1,NULL);
     m_clientDatas[n] = clientData;
 }
-
+#if wxCHECK_VERSION(2, 7, 0)
+void *wxPGOwnerDrawnComboBox::DoGetItemClientData(unsigned int n) const
+#else
 void *wxPGOwnerDrawnComboBox::DoGetItemClientData(int n) const
+#endif
 {
     if ( (int)m_clientDatas.GetCount() > n )
         return m_clientDatas[n];
@@ -2924,12 +2949,19 @@
     return NULL;
 }
 
+#if wxCHECK_VERSION(2, 7, 0)
+void wxPGOwnerDrawnComboBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
+#else
 void wxPGOwnerDrawnComboBox::DoSetItemClientObject(int n, wxClientData* clientData)
+#endif
 {
     DoSetItemClientData(n, (void*) clientData);
 }
-
+#if wxCHECK_VERSION(2, 7, 0)
+wxClientData* wxPGOwnerDrawnComboBox::DoGetItemClientObject(unsigned int n) const
+#else
 wxClientData* wxPGOwnerDrawnComboBox::DoGetItemClientObject(int n) const
+#endif
 {
     return (wxClientData*) DoGetItemClientData(n);
 }
stahta01 2006-11-03 12:12

Attached Patch file is 4 of 4 for patching CodeBlocks to compile against wxWidgets 2.7.0

Note, these patches do NOT have to be applied in any set order or at the same time.

The patch file is named propgrid-odcombo-wx270_4-unix.patch; the -unix means it has unix line ending.

See header wx/ctrlsub.h

Multiple wxItemContainer methods had signature changed from using "int" to "unsigned int" in wxWidgets 2.7.0

Note: I have NOT tested this patch but I see no way it can break 2.6.3.

(I did do a re-build of codeblocks which might have tested this patch.)

Thank You for a great IDE

Tim Stahlhut

mispunt 2006-11-07 21:16

It is easier to update the version of this 3th party lib, the newer versions (1.2.2 and later) already support 2.7

stahta01 2006-11-08 21:06

I am working on a updated patch to merge code changes from newer version 1.2.3 needed to compile C:B with wxWidgets 2.7

Tim S

stahta01 2006-12-03 00:30

I am almost done with the updated patch to wxPropertyGrid. I need to verify I am patching just the needed areas from the newer versions of wxPropertyGrid.

Tim S

stahta01 2006-12-12 06:23

I am waiting till wxPropertyGrid 1.2.5 is released to update my patch to using it. See thread http://forums.codeblocks.org/index.php?topic=4638.0

Tim S

stahta01 2006-12-19 02:21

CLOSE Patch;

Submitted updated patch [ Patch #1739 ] wxPropertyGrid patch for wxWidgets 2.8 Tim S

https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=1739&group_id=5358