]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/gtk/dataview.h
added WX_ASSERT_MESSAGE macro to simply using CPPUNIT_ASSERT_MESSAGE with wxString...
[wxWidgets.git] / include / wx / gtk / dataview.h
index 0c29d984683d2ee877f773c01a60ff8a005acb22..d20ee24a770c1814b1eacfc8b1b1b95c1024381d 100644 (file)
@@ -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,6 +40,7 @@ public:
     // implementation
     GtkCellRenderer* GetGtkHandle() { return m_renderer; }
     void GtkInitHandlers();
+    virtual bool GtkHasAttributes() { return false; }
 
 protected:
     GtkCellRenderer   *m_renderer;
@@ -71,6 +69,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 +143,18 @@ 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 )   
+    virtual bool LeftClick( wxPoint WXUNUSED(cursor), wxRect WXUNUSED(cell)
+                           wxDataViewModel *WXUNUSED(model), const wxDataViewItem &WXUNUSED(item), unsigned int WXUNUSED(col) )   
                            { return false; }
-    virtual bool RightClick( wxPoint cursor, wxRect cell,
-                           wxDataViewModel *model, const wxDataViewItem &item, unsigned int col )   
+    virtual bool RightClick( 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
@@ -151,7 +167,17 @@ protected:
 
 private:
     wxDC        *m_dc;
-    
+
+public:    
+    // Internal, temporay for RenderText.
+    GtkCellRenderer      *m_text_renderer;
+    GdkWindow            *window;
+    GtkWidget            *widget;
+    void                 *background_area;
+    void                 *cell_area;
+    void                 *expose_area;
+    int                   flags;
+
 protected:
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer)
 };
@@ -275,6 +301,7 @@ public:
     virtual void SetMinWidth( int minWidth );
     virtual void SetWidth( int width );
 
+    virtual void SetReorderable( bool reorderable );
 
     // getters:
 
@@ -288,6 +315,8 @@ public:
 
     virtual int GetWidth() const;
     virtual int GetMinWidth() const;
+    
+    virtual bool IsReorderable() const;
 
     // implementation
     GtkWidget* GetGtkHandle() { return m_column; }
@@ -380,29 +409,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_