X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f69c03def99d3858de5506dbd433587b3dcad53e..4f2511d706e5274a34e1521e11c1b95fed735b42:/include/wx/gtk/dataview.h diff --git a/include/wx/gtk/dataview.h b/include/wx/gtk/dataview.h index 1b6ecf086c..402720cce9 100644 --- a/include/wx/gtk/dataview.h +++ b/include/wx/gtk/dataview.h @@ -7,13 +7,10 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __GTKDATAVIEWCTRLH__ -#define __GTKDATAVIEWCTRLH__ +#ifndef _WX_GTKDATAVIEWCTRL_H_ +#define _WX_GTKDATAVIEWCTRL_H_ -#include "wx/defs.h" -#include "wx/object.h" #include "wx/list.h" -#include "wx/control.h" // --------------------------------------------------------- // classes @@ -43,9 +40,12 @@ public: // implementation GtkCellRenderer* GetGtkHandle() { return m_renderer; } void GtkInitHandlers(); + virtual bool GtkHasAttributes() { return false; } + void GtkUpdateAlignment(); protected: GtkCellRenderer *m_renderer; + int m_alignment; protected: DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRenderer) @@ -71,6 +71,24 @@ protected: DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer) }; +// --------------------------------------------------------- +// wxDataViewTextRendererAttr +// --------------------------------------------------------- + +class WXDLLIMPEXP_ADV wxDataViewTextRendererAttr: public wxDataViewTextRenderer +{ +public: + wxDataViewTextRendererAttr( const wxString &varianttype = wxT("string"), + wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, + int align = wxDVR_DEFAULT_ALIGNMENT ); + + // implementation + bool GtkHasAttributes() { return true; } + +protected: + DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRendererAttr) +}; + // --------------------------------------------------------- // wxDataViewBitmapRenderer // --------------------------------------------------------- @@ -127,18 +145,15 @@ public: virtual wxSize GetSize() const = 0; - virtual bool Activate( wxRect cell, - wxDataViewModel *model, const wxDataViewItem &item, unsigned int col ) + virtual bool Activate( wxRect WXUNUSED(cell), + wxDataViewModel *WXUNUSED(model), const wxDataViewItem &WXUNUSED(item), unsigned int WXUNUSED(col) ) { return false; } - virtual bool LeftClick( wxPoint cursor, wxRect cell, - wxDataViewModel *model, const wxDataViewItem &item, unsigned int col ) - { return false; } - virtual bool RightClick( wxPoint cursor, wxRect cell, - wxDataViewModel *model, const wxDataViewItem &item, unsigned int col ) + virtual bool LeftClick( wxPoint WXUNUSED(cursor), wxRect WXUNUSED(cell), + wxDataViewModel *WXUNUSED(model), const wxDataViewItem &WXUNUSED(item), unsigned int WXUNUSED(col) ) { return false; } - virtual bool StartDrag( wxPoint cursor, wxRect cell, - wxDataViewModel *model, const wxDataViewItem &item, unsigned int col ) + virtual bool StartDrag( wxPoint WXUNUSED(cursor), wxRect WXUNUSED(cell), + wxDataViewModel *WXUNUSED(model), const wxDataViewItem &WXUNUSED(item), unsigned int WXUNUSED(col) ) { return false; } // Create DC on request @@ -285,6 +300,7 @@ public: virtual void SetMinWidth( int minWidth ); virtual void SetWidth( int width ); + virtual void SetReorderable( bool reorderable ); // getters: @@ -298,6 +314,8 @@ public: virtual int GetWidth() const; virtual int GetMinWidth() const; + + virtual bool IsReorderable() const; // implementation GtkWidget* GetGtkHandle() { return m_column; } @@ -307,6 +325,10 @@ private: // holds the GTK handle GtkWidget *m_column; + // holds GTK handles for title/bitmap in the header + GtkWidget *m_image; + GtkWidget *m_label; + // delayed connection to mouse events friend class wxDataViewCtrl; void OnInternalIdle(); @@ -354,6 +376,8 @@ public: virtual bool PrependColumn( wxDataViewColumn *col ); virtual bool AppendColumn( wxDataViewColumn *col ); + virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col ); + virtual unsigned int GetColumnCount() const; virtual wxDataViewColumn* GetColumn( unsigned int pos ) const; virtual bool DeleteColumn( wxDataViewColumn *column ); @@ -390,29 +414,29 @@ public: GtkWidget *GtkGetTreeView() { return m_treeview; } wxDataViewCtrlInternal* GtkGetInternal() { return m_internal; } + virtual void OnInternalIdle(); + protected: virtual void DoSetExpanderColumn(); virtual void DoSetIndent(); private: - friend class wxDataViewCtrlDC; + friend class wxDataViewCtrlDCImpl; friend class wxDataViewColumn; friend class wxGtkDataViewModelNotifier; + friend class wxDataViewCtrlInternal; + GtkWidget *m_treeview; wxDataViewModelNotifier *m_notifier; wxDataViewCtrlInternal *m_internal; wxDataViewColumnList m_cols; - - virtual void OnInternalIdle(); - void GtkEnableSelectionEvents(); void GtkDisableSelectionEvents(); -private: DECLARE_DYNAMIC_CLASS(wxDataViewCtrl) DECLARE_NO_COPY_CLASS(wxDataViewCtrl) }; -#endif // __GTKDATAVIEWCTRLH__ +#endif // _WX_GTKDATAVIEWCTRL_H_