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_
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "gridctrl.h"
22 #include "wx/string.h"
23 #include "wx/arrstr.h"
24 #include "wx/datetime.h"
26 #define wxGRID_VALUE_CHOICEINT _T("choiceint")
27 #define wxGRID_VALUE_DATETIME _T("datetime")
31 // the default renderer for the cells containing Time and dates..
32 class WXDLLEXPORT wxGridCellDateTimeRenderer
: public wxGridCellStringRenderer
35 wxGridCellDateTimeRenderer(wxString outformat
= _T("%c"),
36 wxString informat
= _T("%c"));
38 // draw the string right aligned
39 virtual void Draw(wxGrid
& grid
,
46 virtual wxSize
GetBestSize(wxGrid
& grid
,
51 virtual wxGridCellRenderer
*Clone() const;
53 // parameters string format is "width[,precision]"
54 virtual void SetParameters(const wxString
& params
);
57 wxString
GetString(wxGrid
& grid
, int row
, int col
);
62 wxDateTime::TimeZone m_tz
;
65 #endif // wxUSE_DATETIME
67 // the default renderer for the cells containing Time and dates..
68 class WXDLLEXPORT wxGridCellEnumRenderer
: public wxGridCellStringRenderer
71 wxGridCellEnumRenderer( const wxString
& choices
= wxEmptyString
);
73 // draw the string right aligned
74 virtual void Draw(wxGrid
& grid
,
81 virtual wxSize
GetBestSize(wxGrid
& grid
,
86 virtual wxGridCellRenderer
*Clone() const;
88 // parameters string format is "item1[,item2[...,itemN]]"
89 virtual void SetParameters(const wxString
& params
);
92 wxString
GetString(wxGrid
& grid
, int row
, int col
);
94 wxArrayString m_choices
;
100 class WXDLLEXPORT wxGridCellEnumEditor
: public wxGridCellChoiceEditor
103 wxGridCellEnumEditor( const wxString
& choices
= wxEmptyString
);
104 virtual ~wxGridCellEnumEditor() {};
106 virtual wxGridCellEditor
* Clone() const;
108 virtual bool EndEdit(int row
, int col
, wxGrid
* grid
);
109 virtual void BeginEdit(int row
, int col
, wxGrid
* grid
);
115 #endif // wxUSE_COMBOBOX
117 class WXDLLEXPORT wxGridCellAutoWrapStringEditor
: public wxGridCellTextEditor
120 wxGridCellAutoWrapStringEditor() : wxGridCellTextEditor() { }
121 virtual void Create(wxWindow
* parent
,
123 wxEvtHandler
* evtHandler
);
125 virtual wxGridCellEditor
*Clone() const
126 { return new wxGridCellAutoWrapStringEditor
; }
129 class WXDLLEXPORT wxGridCellAutoWrapStringRenderer
: public wxGridCellStringRenderer
132 wxGridCellAutoWrapStringRenderer() : wxGridCellStringRenderer() { }
134 virtual void Draw(wxGrid
& grid
,
135 wxGridCellAttr
& attr
,
141 virtual wxSize
GetBestSize(wxGrid
& grid
,
142 wxGridCellAttr
& attr
,
146 virtual wxGridCellRenderer
*Clone() const
147 { return new wxGridCellAutoWrapStringRenderer
; }
150 wxArrayString
GetTextLines( wxGrid
& grid
,
152 wxGridCellAttr
& attr
,
158 #endif // #if wxUSE_GRID
160 #endif //_WX_GENERIC_GRIDCTRL_H_