]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/dataview.h
make wxSocketImplUnix inherit from wxFDIOHandler as they're used for almost the same...
[wxWidgets.git] / include / wx / dataview.h
index 6f3d54db185bd66805010f79c7842e50d8f1f92a..efc9f45a71af0410550eebfb9cc0bf8481a7a95c 100644 (file)
 
 class WXDLLIMPEXP_FWD_CORE wxDataFormat;
 
-#if defined(__WXGTK20__)
-    // for testing
-    // #define wxUSE_GENERICDATAVIEWCTRL 1
-#elif defined(__WXMAC__)
-#else
-    #define wxUSE_GENERICDATAVIEWCTRL 1
-#endif
-
 // ----------------------------------------------------------------------------
 // wxDataViewCtrl flags
 // ----------------------------------------------------------------------------
@@ -50,7 +42,7 @@ class WXDLLIMPEXP_FWD_ADV wxDataViewColumn;
 class WXDLLIMPEXP_FWD_ADV wxDataViewRenderer;
 class WXDLLIMPEXP_FWD_ADV wxDataViewModelNotifier;
 
-extern WXDLLIMPEXP_DATA_ADV(const wxChar) wxDataViewCtrlNameStr[];
+extern WXDLLIMPEXP_DATA_ADV(const char) wxDataViewCtrlNameStr[];
 
 // the default width of new (text) columns:
 #define wxDVC_DEFAULT_WIDTH             80
@@ -375,6 +367,7 @@ public:
 
 protected:
     void OnChar( wxKeyEvent &event );
+    void OnTextEnter( wxCommandEvent &event );
     void OnKillFocus( wxFocusEvent &event );
     void OnIdle( wxIdleEvent &event );
 
@@ -714,7 +707,7 @@ public:
         { return m_expander_column; }
 
     virtual wxDataViewColumn *GetSortingColumn() const = 0;
-    
+
     void SetIndent( int indent )
         { m_indent = indent ; DoSetIndent(); }
     int GetIndent() const
@@ -856,13 +849,13 @@ typedef void (wxEvtHandler::*wxDataViewEventFunction)(wxDataViewEvent&);
 #define EVT_DATAVIEW_COLUMN_SORTED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_SORTED, id, fn)
 #define EVT_DATAVIEW_COLUMN_REORDERED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_REORDERED, id, fn)
 
-#if defined(wxUSE_GENERICDATAVIEWCTRL)
-    #include "wx/generic/dataview.h"
-#elif defined(__WXGTK20__)
+
+#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
     #include "wx/gtk/dataview.h"
-#elif defined(__WXMAC__)
+#elif defined(__WXMAC__) && !defined(__WXUNIVERSAL__)
     #include "wx/osx/dataview.h"
 #else
+    #define wxUSE_GENERICDATAVIEWCTRL
     #include "wx/generic/dataview.h"
 #endif
 
@@ -889,6 +882,33 @@ private:
     long    m_min,m_max;
 };
 
+#ifndef __WXGTK20__
+
+// -------------------------------------
+// wxDataViewChoiceRenderer
+// -------------------------------------
+
+class WXDLLIMPEXP_ADV wxDataViewChoiceRenderer: public wxDataViewCustomRenderer
+{
+public:
+    wxDataViewChoiceRenderer( const wxArrayString &choices,
+                            wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE,
+                            int alignment = wxDVR_DEFAULT_ALIGNMENT );
+    virtual bool HasEditorCtrl() { return true; }
+    virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value );
+    virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value );
+    virtual bool Render( wxRect rect, wxDC *dc, int state );
+    virtual wxSize GetSize() const;
+    virtual bool SetValue( const wxVariant &value );
+    virtual bool GetValue( wxVariant &value ) const;
+
+private:
+    wxArrayString m_choices;
+    wxString      m_data;
+};
+
+#endif
+
 //-----------------------------------------------------------------------------
 // wxDataViewTreeStore
 //-----------------------------------------------------------------------------