add wxDataViewIconText
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -22,10 +22,11 @@
|
|||||||
#include "wx/variant.h"
|
#include "wx/variant.h"
|
||||||
#include "wx/listctrl.h"
|
#include "wx/listctrl.h"
|
||||||
#include "wx/dynarray.h"
|
#include "wx/dynarray.h"
|
||||||
|
#include "wx/icon.h"
|
||||||
|
|
||||||
#if defined(__WXGTK20__)
|
#if defined(__WXGTK20__)
|
||||||
// for testing
|
// for testing
|
||||||
// #define wxUSE_GENERICDATAVIEWCTRL 1
|
#define wxUSE_GENERICDATAVIEWCTRL 1
|
||||||
#elif defined(__WXMAC__)
|
#elif defined(__WXMAC__)
|
||||||
#else
|
#else
|
||||||
#define wxUSE_GENERICDATAVIEWCTRL 1
|
#define wxUSE_GENERICDATAVIEWCTRL 1
|
||||||
@@ -322,6 +323,35 @@ protected:
|
|||||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRendererBase)
|
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
|
// wxDataViewColumnBase
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
|
@@ -332,6 +332,21 @@ wxDataViewItem wxDataViewIndexListModel::GetNextSibling( const wxDataViewItem &i
|
|||||||
return wxDataViewItem( m_hash[pos+1] );
|
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
|
// wxDataViewRendererBase
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user