Add support for date format to wxGridCellDateEditor too

This is needed to allow editing the cells using wxGridCellDateRenderer
with a custom format, otherwise the editor might parse the contents of
the cell differently from what is actually shown.

In particular, this ensures that using "date:%d.%m.%y" (or any other
custom format) as "cell type" works correctly, which wasn't the case
before.
This commit is contained in:
Vadim Zeitlin
2020-11-03 02:57:22 +01:00
parent 56ec476a3a
commit 705006615f
3 changed files with 26 additions and 4 deletions

View File

@@ -390,7 +390,9 @@ public:
class WXDLLIMPEXP_ADV wxGridCellDateEditor : public wxGridCellEditor
{
public:
wxGridCellDateEditor() { }
explicit wxGridCellDateEditor(const wxString& format = wxString());
virtual void SetParameters(const wxString& params) wxOVERRIDE;
virtual void Create(wxWindow* parent,
wxWindowID id,
@@ -414,6 +416,7 @@ protected:
private:
wxDateTime m_value;
wxString m_format;
wxDECLARE_NO_COPY_CLASS(wxGridCellDateEditor);
};