1 ///////////////////////////////////////////////////////////////////////////
2 // Name: generic/gridctrl.h
3 // Purpose: wxGrid controls
4 // Author: Paul Gammans, Roger Gammans
8 // Copyright: (c) The Computer Surgery (paul@compsurg.co.uk)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_GENERIC_GRIDCTRL_H_
13 #define _WX_GENERIC_GRIDCTRL_H_
19 #define wxGRID_VALUE_CHOICEINT _T("choiceint")
20 #define wxGRID_VALUE_DATETIME _T("datetime")
24 #include "wx/datetime.h"
26 // the default renderer for the cells containing Time and dates..
27 class WXDLLIMPEXP_ADV wxGridCellDateTimeRenderer
: public wxGridCellStringRenderer
30 wxGridCellDateTimeRenderer(const wxString
& outformat
= wxDefaultDateTimeFormat
,
31 const wxString
& informat
= wxDefaultDateTimeFormat
);
33 // draw the string right aligned
34 virtual void Draw(wxGrid
& grid
,
41 virtual wxSize
GetBestSize(wxGrid
& grid
,
46 virtual wxGridCellRenderer
*Clone() const;
48 // parameters string format is "width[,precision]"
49 virtual void SetParameters(const wxString
& params
);
52 wxString
GetString(const wxGrid
& grid
, int row
, int col
);
57 wxDateTime::TimeZone m_tz
;
60 #endif // wxUSE_DATETIME
62 // the default renderer for the cells containing Time and dates..
63 class WXDLLIMPEXP_ADV wxGridCellEnumRenderer
: public wxGridCellStringRenderer
66 wxGridCellEnumRenderer( const wxString
& choices
= wxEmptyString
);
68 // draw the string right aligned
69 virtual void Draw(wxGrid
& grid
,
76 virtual wxSize
GetBestSize(wxGrid
& grid
,
81 virtual wxGridCellRenderer
*Clone() const;
83 // parameters string format is "item1[,item2[...,itemN]]"
84 virtual void SetParameters(const wxString
& params
);
87 wxString
GetString(const wxGrid
& grid
, int row
, int col
);
89 wxArrayString m_choices
;
95 class WXDLLIMPEXP_ADV wxGridCellEnumEditor
: public wxGridCellChoiceEditor
98 wxGridCellEnumEditor( const wxString
& choices
= wxEmptyString
);
99 virtual ~wxGridCellEnumEditor() {}
101 virtual wxGridCellEditor
* Clone() const;
103 virtual bool EndEdit(int row
, int col
, wxGrid
* grid
);
104 virtual void BeginEdit(int row
, int col
, wxGrid
* grid
);
109 DECLARE_NO_COPY_CLASS(wxGridCellEnumEditor
)
112 #endif // wxUSE_COMBOBOX
114 class WXDLLIMPEXP_ADV wxGridCellAutoWrapStringEditor
: public wxGridCellTextEditor
117 wxGridCellAutoWrapStringEditor() : wxGridCellTextEditor() { }
118 virtual void Create(wxWindow
* parent
,
120 wxEvtHandler
* evtHandler
);
122 virtual wxGridCellEditor
*Clone() const
123 { return new wxGridCellAutoWrapStringEditor
; }
125 DECLARE_NO_COPY_CLASS(wxGridCellAutoWrapStringEditor
)
128 class WXDLLIMPEXP_ADV wxGridCellAutoWrapStringRenderer
: public wxGridCellStringRenderer
131 wxGridCellAutoWrapStringRenderer() : wxGridCellStringRenderer() { }
133 virtual void Draw(wxGrid
& grid
,
134 wxGridCellAttr
& attr
,
140 virtual wxSize
GetBestSize(wxGrid
& grid
,
141 wxGridCellAttr
& attr
,
145 virtual wxGridCellRenderer
*Clone() const
146 { return new wxGridCellAutoWrapStringRenderer
; }
149 wxArrayString
GetTextLines( wxGrid
& grid
,
151 const wxGridCellAttr
& attr
,
158 #endif // _WX_GENERIC_GRIDCTRL_H_