diff --git a/docs/changes.txt b/docs/changes.txt index f070c13662..193a1fb0e5 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -639,6 +639,7 @@ All (GUI): - Add wxEVT_GRID_COL_AUTO_SIZE event (Igor Korot). - Add chainable wxWizardPageSimple::Chain() overload. - Add wxTextEntryDialog::SetMaxLength() (derEine). +- Fix maximum width support in wxGridCellTextEditor (derEine). - Add more convenient wxFont(wxFontInfo) ctor. wxGTK: diff --git a/include/wx/generic/grideditors.h b/include/wx/generic/grideditors.h index aa0fd7af43..7fc563b427 100644 --- a/include/wx/generic/grideditors.h +++ b/include/wx/generic/grideditors.h @@ -52,7 +52,7 @@ private: class WXDLLIMPEXP_ADV wxGridCellTextEditor : public wxGridCellEditor { public: - wxGridCellTextEditor(); + wxEXPLICIT wxGridCellTextEditor(size_t maxChars = 0); virtual void Create(wxWindow* parent, wxWindowID id, @@ -77,7 +77,7 @@ public: virtual void SetParameters(const wxString& params); virtual wxGridCellEditor *Clone() const - { return new wxGridCellTextEditor; } + { return new wxGridCellTextEditor(m_maxChars); } // added GetValue so we can get the value which is in the control virtual wxString GetValue() const; diff --git a/interface/wx/grid.h b/interface/wx/grid.h index 8f4c93c81d..e55affd187 100644 --- a/interface/wx/grid.h +++ b/interface/wx/grid.h @@ -625,9 +625,13 @@ class wxGridCellTextEditor : public wxGridCellEditor { public: /** - Default constructor. + Text cell editor constructor. + + @param maxChars + Maximum width of text (this parameter is supported starting since + wxWidgets 2.9.5). */ - wxGridCellTextEditor(); + explicit wxGridCellTextEditor(size_t maxChars = 0); /** The parameters string format is "n" where n is a number representing diff --git a/src/generic/grideditors.cpp b/src/generic/grideditors.cpp index 93095852e8..aee78e2fe8 100644 --- a/src/generic/grideditors.cpp +++ b/src/generic/grideditors.cpp @@ -382,9 +382,9 @@ void wxGridCellEditor::StartingClick() // wxGridCellTextEditor // ---------------------------------------------------------------------------- -wxGridCellTextEditor::wxGridCellTextEditor() +wxGridCellTextEditor::wxGridCellTextEditor(size_t maxChars) { - m_maxChars = 0; + m_maxChars = maxChars; } void wxGridCellTextEditor::Create(wxWindow* parent,