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_
16 #pragma interface "gridctrl.h"
20 #include "wx/string.h"
21 #include "wx/datetime.h"
23 #define wxGRID_VALUE_CHOICEINT _T("choiceint")
24 #define wxGRID_VALUE_DATETIME _T("datetime")
26 // the default renderer for the cells containing Time and dates..
27 class WXDLLEXPORT wxGridCellDateTimeRenderer
: public wxGridCellStringRenderer
30 wxGridCellDateTimeRenderer(wxString outformat
= _T("%c"),
31 wxString informat
= _T("%c"));
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(wxGrid
& grid
, int row
, int col
);
57 wxDateTime::TimeZone m_tz
;
61 // the default renderer for the cells containing Time and dates..
62 class WXDLLEXPORT wxGridCellEnumRenderer
: public wxGridCellStringRenderer
65 wxGridCellEnumRenderer( const wxString
& choices
= wxEmptyString
);
67 // draw the string right aligned
68 virtual void Draw(wxGrid
& grid
,
75 virtual wxSize
GetBestSize(wxGrid
& grid
,
80 virtual wxGridCellRenderer
*Clone() const;
82 // parameters string format is "item1[,item2[...,itemN]]"
83 virtual void SetParameters(const wxString
& params
);
86 wxString
GetString(wxGrid
& grid
, int row
, int col
);
88 wxArrayString m_choices
;
92 class WXDLLEXPORT wxGridCellEnumEditor
: public wxGridCellChoiceEditor
95 wxGridCellEnumEditor( const wxString
& choices
= wxEmptyString
);
96 virtual ~wxGridCellEnumEditor() {};
98 virtual wxGridCellEditor
* Clone() const;
100 virtual bool EndEdit(int row
, int col
, wxGrid
* grid
);
101 virtual void BeginEdit(int row
, int col
, wxGrid
* grid
);
108 class wxGridCellAutoWrapStringEditor
: public wxGridCellTextEditor
111 wxGridCellAutoWrapStringEditor() : wxGridCellTextEditor() { }
112 virtual void Create(wxWindow
* parent
,
114 wxEvtHandler
* evtHandler
);
116 virtual wxGridCellEditor
*Clone() const
117 { return new wxGridCellAutoWrapStringEditor
; }
120 class wxGridCellAutoWrapStringRenderer
: public wxGridCellStringRenderer
123 wxGridCellAutoWrapStringRenderer() : wxGridCellStringRenderer() { }
125 virtual void Draw(wxGrid
& grid
,
126 wxGridCellAttr
& attr
,
132 virtual wxSize
GetBestSize(wxGrid
& grid
,
133 wxGridCellAttr
& attr
,
137 virtual wxGridCellRenderer
*Clone() const
138 { return new wxGridCellAutoWrapStringRenderer
; }
141 wxArrayString
GetTextLines( wxGrid
& grid
,
143 wxGridCellAttr
& attr
,
149 #endif //_WX_GENERIC_GRIDCTRL_H_