]> git.saurik.com Git - wxWidgets.git/commitdiff
add wxDataViewIconText
authorRobert Roebling <robert@roebling.de>
Wed, 29 Aug 2007 11:12:12 +0000 (11:12 +0000)
committerRobert Roebling <robert@roebling.de>
Wed, 29 Aug 2007 11:12:12 +0000 (11:12 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/dataview.h
src/common/datavcmn.cpp

index 3f9309bcb51555e5e38b7496f50108bc54c87aff..5a1ee8b9d9ee1eb757ff57144981c3a1f0dd2c13 100644 (file)
 #include "wx/variant.h"
 #include "wx/listctrl.h"
 #include "wx/dynarray.h"
+#include "wx/icon.h"
 
 #if defined(__WXGTK20__)
     // for testing
-    // #define wxUSE_GENERICDATAVIEWCTRL 1
+    #define wxUSE_GENERICDATAVIEWCTRL 1
 #elif defined(__WXMAC__)
 #else
     #define wxUSE_GENERICDATAVIEWCTRL 1
@@ -322,6 +323,35 @@ protected:
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRendererBase)
 };
 
+//-----------------------------------------------------------------------------
+// wxDataViewIconText
+//-----------------------------------------------------------------------------
+
+class wxDataViewIconText: public wxObject
+{
+public:
+    wxDataViewIconText( const wxString &text = wxEmptyString, const wxIcon& icon = wxNullIcon )
+    { m_icon = icon; m_text = text; }
+    wxDataViewIconText( const wxDataViewIconText &other )
+    { m_icon = other.m_icon; m_text = other.m_text; }
+
+    void SetText( const wxString &text ) { m_text = text; }
+    wxString GetText() const             { return m_text; }
+    void SetIcon( const wxIcon &icon )   { m_icon = icon; }
+    const wxIcon &GetIcon() const        { return m_icon; }
+
+private:
+    wxString    m_text;
+    wxIcon      m_icon;
+
+private:
+    DECLARE_DYNAMIC_CLASS(wxDataViewIconText)
+};
+
+bool operator == (const wxDataViewIconText &one, const wxDataViewIconText &two);
+
+DECLARE_VARIANT_OBJECT(wxDataViewIconText)
+
 // ---------------------------------------------------------
 // wxDataViewColumnBase
 // ---------------------------------------------------------
index 7fbe7957d8d40166582a43c4afed1b0706681acd..b82a73f598db1f6e3c7d51e87ed24637e248063e 100644 (file)
@@ -332,6 +332,21 @@ wxDataViewItem wxDataViewIndexListModel::GetNextSibling( const wxDataViewItem &i
     return wxDataViewItem( m_hash[pos+1] );
 }
 
+//-----------------------------------------------------------------------------
+// wxDataViewIconText
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxDataViewIconText,wxObject)
+
+IMPLEMENT_VARIANT_OBJECT(wxDataViewIconText)
+
+bool operator == (const wxDataViewIconText &one, const wxDataViewIconText &two)
+{
+    if (one.GetText() != two.GetText()) return false;
+    if (one.IsSameAs(two)) return false;
+    return true;
+}
+
 // ---------------------------------------------------------
 // wxDataViewRendererBase
 // ---------------------------------------------------------