class WXDLLIMPEXP_ADV wxGridCellTextEditor : public wxGridCellEditor
{
public:
- wxGridCellTextEditor();
+ wxEXPLICIT wxGridCellTextEditor(size_t maxChars = 0);
virtual void Create(wxWindow* parent,
wxWindowID id,
wxEvtHandler* evtHandler);
virtual void SetSize(const wxRect& rect);
- virtual void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr);
+ virtual void PaintBackground(wxDC& dc,
+ const wxRect& rectCell,
+ const wxGridCellAttr& attr);
virtual bool IsAcceptedKey(wxKeyEvent& event);
virtual void BeginEdit(int row, int col, wxGrid* grid);
// parameters string format is "max_width"
virtual void SetParameters(const wxString& params);
+ virtual void SetValidator(const wxValidator& validator);
- virtual wxGridCellEditor *Clone() const
- { return new wxGridCellTextEditor; }
+ virtual wxGridCellEditor *Clone() const;
// added GetValue so we can get the value which is in the control
virtual wxString GetValue() const;
void DoReset(const wxString& startValue);
private:
- size_t m_maxChars; // max number of chars allowed
- wxString m_value;
+ size_t m_maxChars; // max number of chars allowed
+ wxScopedPtr<wxValidator> m_validator;
+ wxString m_value;
wxDECLARE_NO_COPY_CLASS(wxGridCellTextEditor);
};
virtual void SetSize(const wxRect& rect);
- virtual void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr);
+ virtual void PaintBackground(wxDC& dc,
+ const wxRect& rectCell,
+ const wxGridCellAttr& attr);
virtual void BeginEdit(int row, int col, wxGrid* grid);
virtual bool EndEdit(int row, int col, const wxGrid* grid,