Add wxDateTimePickerCtrl::SetNullText()

This allows to customize the string shown when there is no valid date
under MSW (only, for now) and can be notably used to suppress the
unused date completely, which can be useful to lighten up the display
when there are many controls.

Add UI elements to the widgets sample allowing to test the new function.
This commit is contained in:
Vadim Zeitlin
2020-11-05 01:21:26 +01:00
parent 6d4ce92c20
commit 02f1ee3987
5 changed files with 120 additions and 1 deletions

View File

@@ -32,6 +32,13 @@ public:
// Set/get the date or time (in the latter case, time part is ignored).
virtual void SetValue(const wxDateTime& dt) = 0;
virtual wxDateTime GetValue() const = 0;
// For the controls with wxDP_ALLOWNONE style, set the string displayed
// when the control doesn't have any valid value. Currently this is only
// actually used under MSW, where it can be used to override the previous
// value which is still displayed by the control in this case, and ignored
// elsewhere.
virtual void SetNullText(const wxString& WXUNUSED(text)) { }
};
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)