Added wxChoice renderer to wxDataViewCtrl

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56725 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2008-11-10 14:08:38 +00:00
parent 2985d7b76c
commit 7448d67c49
5 changed files with 252 additions and 19 deletions

View File

@@ -882,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
//-----------------------------------------------------------------------------