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 // the default renderer for the cells containing Time and dates..
25 class WXDLLIMPEXP_ADV wxGridCellDateTimeRenderer
: public wxGridCellStringRenderer
28 wxGridCellDateTimeRenderer(const wxString
& outformat
= wxDefaultDateTimeFormat
,
29 const wxString
& informat
= wxDefaultDateTimeFormat
);
31 // draw the string right aligned
32 virtual void Draw(wxGrid
& grid
,
39 virtual wxSize
GetBestSize(wxGrid
& grid
,
44 virtual wxGridCellRenderer
*Clone() const;
46 // parameters string format is "width[,precision]"
47 virtual void SetParameters(const wxString
& params
);
50 wxString
GetString(const wxGrid
& grid
, int row
, int col
);
55 wxDateTime::TimeZone m_tz
;
58 #endif // wxUSE_DATETIME
60 // the default renderer for the cells containing Time and dates..
61 class WXDLLIMPEXP_ADV wxGridCellEnumRenderer
: public wxGridCellStringRenderer
64 wxGridCellEnumRenderer( const wxString
& choices
= wxEmptyString
);
66 // draw the string right aligned
67 virtual void Draw(wxGrid
& grid
,
74 virtual wxSize
GetBestSize(wxGrid
& grid
,
79 virtual wxGridCellRenderer
*Clone() const;
81 // parameters string format is "item1[,item2[...,itemN]]"
82 virtual void SetParameters(const wxString
& params
);
85 wxString
GetString(const wxGrid
& grid
, int row
, int col
);
87 wxArrayString m_choices
;
93 class WXDLLIMPEXP_ADV wxGridCellEnumEditor
: public wxGridCellChoiceEditor
96 wxGridCellEnumEditor( const wxString
& choices
= wxEmptyString
);
97 virtual ~wxGridCellEnumEditor() {}
99 virtual wxGridCellEditor
* Clone() const;
101 virtual bool EndEdit(int row
, int col
, wxGrid
* grid
);
102 virtual void BeginEdit(int row
, int col
, wxGrid
* grid
);
107 DECLARE_NO_COPY_CLASS(wxGridCellEnumEditor
)
110 #endif // wxUSE_COMBOBOX
112 class WXDLLIMPEXP_ADV wxGridCellAutoWrapStringEditor
: public wxGridCellTextEditor
115 wxGridCellAutoWrapStringEditor() : wxGridCellTextEditor() { }
116 virtual void Create(wxWindow
* parent
,
118 wxEvtHandler
* evtHandler
);
120 virtual wxGridCellEditor
*Clone() const
121 { return new wxGridCellAutoWrapStringEditor
; }
123 DECLARE_NO_COPY_CLASS(wxGridCellAutoWrapStringEditor
)
126 class WXDLLIMPEXP_ADV wxGridCellAutoWrapStringRenderer
: public wxGridCellStringRenderer
129 wxGridCellAutoWrapStringRenderer() : wxGridCellStringRenderer() { }
131 virtual void Draw(wxGrid
& grid
,
132 wxGridCellAttr
& attr
,
138 virtual wxSize
GetBestSize(wxGrid
& grid
,
139 wxGridCellAttr
& attr
,
143 virtual wxGridCellRenderer
*Clone() const
144 { return new wxGridCellAutoWrapStringRenderer
; }
147 wxArrayString
GetTextLines( wxGrid
& grid
,
149 const wxGridCellAttr
& attr
,
156 #endif // _WX_GENERIC_GRIDCTRL_H_