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

@@ -168,6 +168,22 @@ public:
*/
virtual wxDateTime GetValue() const;
/**
Set the text to show when there is no valid value.
For the controls with @c 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.
Notably, @a text can be empty to completely hide the date if no valid
date is specified.
@since 3.1.5
*/
void SetNullText(const wxString& text);
/**
Sets the valid range for the date selection. If @a dt1 is valid, it
becomes the earliest date (inclusive) accepted by the control. If