]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/dataview.h
moved wxUSE_CRASHREPORT checks to wx/msw/chkconf.h; added it to setup.h.in so that...
[wxWidgets.git] / include / wx / generic / dataview.h
index b62bc9eee6c3158fdf05cfea200924b5a3a9db48..86f380353495b36d3ab3399312e8b4f1736b8720 100644 (file)
 // classes
 // ---------------------------------------------------------
 
-class WXDLLIMPEXP_ADV wxDataViewCtrl;
-class WXDLLIMPEXP_ADV wxDataViewMainWindow;
-class WXDLLIMPEXP_ADV wxDataViewHeaderWindow;
-
-//-----------------------------------------------------------------------------
-// wxDataViewEditorCtrlEvtHandler
-//-----------------------------------------------------------------------------
-
-class wxDataViewEditorCtrlEvtHandler: public wxEvtHandler
-{
-public:
-    wxDataViewEditorCtrlEvtHandler( wxControl *editor, wxDataViewRenderer *owner );
-                         
-    void AcceptChangesAndFinish();
-
-protected:
-    void OnChar( wxKeyEvent &event );
-    void OnKillFocus( wxFocusEvent &event );
-
-private:
-    wxDataViewRenderer     *m_owner;
-    wxControl              *m_editorCtrl;
-    bool                    m_finished;
-
-private:
-    DECLARE_EVENT_TABLE()
-};
+class WXDLLIMPEXP_FWD_ADV wxDataViewCtrl;
+class WXDLLIMPEXP_FWD_ADV wxDataViewMainWindow;
+class WXDLLIMPEXP_FWD_ADV wxDataViewHeaderWindow;
 
 // ---------------------------------------------------------
 // wxDataViewRenderer
@@ -75,51 +51,37 @@ public:
         { return m_mode; }
 
     virtual bool Activate( wxRect WXUNUSED(cell),
-                           wxDataViewListModel *WXUNUSED(model),
-                           unsigned int WXUNUSED(col),
-                           unsigned int WXUNUSED(row) )
+                           wxDataViewModel *WXUNUSED(model),
+                           const wxDataViewItem & WXUNUSED(item), 
+                           unsigned int WXUNUSED(col) )
                            { return false; }
 
     virtual bool LeftClick( wxPoint WXUNUSED(cursor),
                             wxRect WXUNUSED(cell),
-                            wxDataViewListModel *WXUNUSED(model),
-                            unsigned int WXUNUSED(col),
-                            unsigned int WXUNUSED(row) )
+                            wxDataViewModel *WXUNUSED(model),
+                            const wxDataViewItem & WXUNUSED(item), 
+                            unsigned int WXUNUSED(col) )
                             { return false; }
     virtual bool RightClick( wxPoint WXUNUSED(cursor),
                              wxRect WXUNUSED(cell),
-                             wxDataViewListModel *WXUNUSED(model),
-                             unsigned int WXUNUSED(col),
-                             unsigned int WXUNUSED(row) )
+                             wxDataViewModel *WXUNUSED(model),
+                             const wxDataViewItem & WXUNUSED(item), 
+                             unsigned int WXUNUSED(col) )
                              { return false; }
     virtual bool StartDrag( wxPoint WXUNUSED(cursor),
                             wxRect WXUNUSED(cell),
-                            wxDataViewListModel *WXUNUSED(model),
-                            unsigned int WXUNUSED(col),
-                            unsigned int WXUNUSED(row) )
+                            wxDataViewModel *WXUNUSED(model),
+                            const wxDataViewItem & WXUNUSED(item), 
+                            unsigned int WXUNUSED(col) )
                             { return false; }
 
     // Create DC on request
     virtual wxDC *GetDC();
 
-    // in-place editing
-    virtual bool HasEditorCtrl()
-        { return false; }
-    virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value )
-        { return NULL; }
-    virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value )
-        { return false; }
-        
-    virtual bool StartEditing( unsigned int row, wxRect labelRect );
-    virtual void CancelEditing();
-    virtual bool FinishEditing();
-    
 private:
     wxDC                        *m_dc;
     int                          m_align;
     wxDataViewCellMode           m_mode;
-    wxControl                   *m_editorCtrl;
-    unsigned int                 m_row; // for m_editorCtrl
 
 protected:
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRenderer)
@@ -210,8 +172,8 @@ public:
     bool GetValue( wxVariant &value ) const;
 
     bool Render( wxRect cell, wxDC *dc, int state );
-    bool Activate( wxRect cell, wxDataViewListModel *model, unsigned int col
-                   unsigned int row );
+    bool Activate( wxRect cell, wxDataViewModel *model, const wxDataViewItem & item
+                            unsigned int col );
     wxSize GetSize() const;
 
 private:
@@ -265,7 +227,7 @@ public:
     virtual bool Render( wxRect cell, wxDC *dc, int state );
     virtual wxSize GetSize() const;
     virtual bool Activate( wxRect cell,
-                           wxDataViewListModel *model, unsigned int col, unsigned int row );
+                           wxDataViewModel *model, const wxDataViewItem & item, unsigned int col );
 
 private:
     wxDateTime    m_date;
@@ -335,6 +297,7 @@ private:
     int                      m_flags;
     wxAlignment              m_align;
     wxString                 m_title;
+    bool                     m_ascending;
 
     void Init(int width);
 
@@ -383,9 +346,15 @@ public:
            const wxSize& size = wxDefaultSize, long style = 0,
            const wxValidator& validator = wxDefaultValidator );
 
-    virtual bool AssociateModel( wxDataViewListModel *model );
+    virtual bool AssociateModel( wxDataViewModel *model );
     virtual bool AppendColumn( wxDataViewColumn *col );
 
+    virtual void DoSetExpanderColumn();
+    virtual void DoSetIndent();
+
+    virtual wxDataViewItem GetSelection() ;
+
+/********************selection code*********************
     virtual void SetSelection( int row ); // -1 for unselect
     virtual void SetSelectionRange( unsigned int from, unsigned int to );
     virtual void SetSelections( const wxArrayInt& aSelections);
@@ -394,6 +363,7 @@ public:
     virtual bool IsSelected( unsigned int row ) const;
     virtual int GetSelection() const;
     virtual int GetSelections(wxArrayInt& aSelections) const;
+*****************************************************/
 
 public:     // utility functions not part of the API
 
@@ -406,10 +376,10 @@ public:     // utility functions not part of the API
     // updates the header window after a change in a column setting
     void OnColumnChange();
 
-    wxDataViewMainWindow* GetMainWindow() { return m_clientArea; }
+    wxWindow *GetMainWindow() { return (wxWindow*) m_clientArea; }
 
 private:
-    wxDataViewListModelNotifier *m_notifier;
+    wxDataViewModelNotifier *m_notifier;
     wxDataViewMainWindow        *m_clientArea;
     wxDataViewHeaderWindow      *m_headerArea;