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
// ----------------------------------------------------------------------------
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
protected:
void OnChar( wxKeyEvent &event );
+ void OnTextEnter( wxCommandEvent &event );
void OnKillFocus( wxFocusEvent &event );
void OnIdle( wxIdleEvent &event );
{ return m_expander_column; }
virtual wxDataViewColumn *GetSortingColumn() const = 0;
-
+
void SetIndent( int indent )
{ m_indent = indent ; DoSetIndent(); }
int GetIndent() const
#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
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
//-----------------------------------------------------------------------------