X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d350fbec220fb134b9bf82a7e442d0accd4f95c1..6fe8830e92ebc79d17b357f487ba671183bc8167:/include/wx/gtk/dataview.h diff --git a/include/wx/gtk/dataview.h b/include/wx/gtk/dataview.h index 8a3ac99e48..4011143485 100644 --- a/include/wx/gtk/dataview.h +++ b/include/wx/gtk/dataview.h @@ -43,6 +43,7 @@ public: // implementation GtkCellRenderer* GetGtkHandle() { return m_renderer; } void GtkInitHandlers(); + virtual bool GtkHasAttributes() { return false; } protected: GtkCellRenderer *m_renderer; @@ -71,6 +72,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 // --------------------------------------------------------- @@ -122,20 +141,23 @@ public: virtual bool Render( wxRect cell, wxDC *dc, int state ) = 0; + + void RenderText( const wxString &text, int xoffset, wxRect cell, wxDC *dc, int state ); + 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 @@ -148,7 +170,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) }; @@ -339,6 +371,7 @@ public: virtual bool AssociateModel( wxDataViewModel *model ); + virtual bool PrependColumn( wxDataViewColumn *col ); virtual bool AppendColumn( wxDataViewColumn *col ); virtual unsigned int GetColumnCount() const; virtual wxDataViewColumn* GetColumn( unsigned int pos ) const;