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"
19 #if wxUSE_GRID || wxUSE_NEW_GRID
22 #include "wx/string.h"
23 #include "wx/datetime.h"
25 #define wxGRID_VALUE_CHOICEINT _T("choiceint")
26 #define wxGRID_VALUE_DATETIME _T("datetime")
30 // the default renderer for the cells containing Time and dates..
31 class WXDLLEXPORT wxGridCellDateTimeRenderer
: public wxGridCellStringRenderer
34 wxGridCellDateTimeRenderer(wxString outformat
= _T("%c"),
35 wxString informat
= _T("%c"));
37 // draw the string right aligned
38 virtual void Draw(wxGrid
& grid
,
45 virtual wxSize
GetBestSize(wxGrid
& grid
,
50 virtual wxGridCellRenderer
*Clone() const;
52 // parameters string format is "width[,precision]"
53 virtual void SetParameters(const wxString
& params
);
56 wxString
GetString(wxGrid
& grid
, int row
, int col
);
61 wxDateTime::TimeZone m_tz
;
64 #endif // wxUSE_DATETIME
66 // the default renderer for the cells containing Time and dates..
67 class WXDLLEXPORT wxGridCellEnumRenderer
: public wxGridCellStringRenderer
70 wxGridCellEnumRenderer( const wxString
& choices
= wxEmptyString
);
72 // draw the string right aligned
73 virtual void Draw(wxGrid
& grid
,
80 virtual wxSize
GetBestSize(wxGrid
& grid
,
85 virtual wxGridCellRenderer
*Clone() const;
87 // parameters string format is "item1[,item2[...,itemN]]"
88 virtual void SetParameters(const wxString
& params
);
91 wxString
GetString(wxGrid
& grid
, int row
, int col
);
93 wxArrayString m_choices
;
99 class WXDLLEXPORT wxGridCellEnumEditor
: public wxGridCellChoiceEditor
102 wxGridCellEnumEditor( const wxString
& choices
= wxEmptyString
);
103 virtual ~wxGridCellEnumEditor() {};
105 virtual wxGridCellEditor
* Clone() const;
107 virtual bool EndEdit(int row
, int col
, wxGrid
* grid
);
108 virtual void BeginEdit(int row
, int col
, wxGrid
* grid
);
114 #endif // wxUSE_COMBOBOX
116 class WXDLLEXPORT wxGridCellAutoWrapStringEditor
: public wxGridCellTextEditor
119 wxGridCellAutoWrapStringEditor() : wxGridCellTextEditor() { }
120 virtual void Create(wxWindow
* parent
,
122 wxEvtHandler
* evtHandler
);
124 virtual wxGridCellEditor
*Clone() const
125 { return new wxGridCellAutoWrapStringEditor
; }
128 class WXDLLEXPORT 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 wxGridCellAttr
& attr
,
157 #endif // #if wxUSE_GRID || wxUSE_NEW_GRID
159 #endif //_WX_GENERIC_GRIDCTRL_H_