X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e59e670c9b5021304c4beb02ec726f3a879ad63f..661698e54f2bc599dc1a961ffbae08ccdd6b9b97:/include/wx/generic/grideditors.h?ds=sidebyside diff --git a/include/wx/generic/grideditors.h b/include/wx/generic/grideditors.h index 4a7b9270dd..1167589012 100644 --- a/include/wx/generic/grideditors.h +++ b/include/wx/generic/grideditors.h @@ -52,14 +52,16 @@ private: 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); @@ -73,9 +75,9 @@ public: // 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; @@ -90,8 +92,9 @@ protected: 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 m_validator; + wxString m_value; wxDECLARE_NO_COPY_CLASS(wxGridCellTextEditor); }; @@ -297,7 +300,9 @@ public: 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,