X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/569c7d8ccb0c3f350b50f0f8435b6c6ac3d78cc8..9e9574fe45b176ee74bba8fad7574cf9906145d1:/interface/wx/timectrl.h?ds=sidebyside diff --git a/interface/wx/timectrl.h b/interface/wx/timectrl.h index 41bbc54217..5b25143048 100644 --- a/interface/wx/timectrl.h +++ b/interface/wx/timectrl.h @@ -3,11 +3,25 @@ // Purpose: interface of wxTimePickerCtrl // Author: Vadim Zeitlin // Created: 2011-09-22 -// RCS-ID: $Id$ // Copyright: (c) 2011 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +/** + Styles used with wxTimePickerCtrl. + + Currently no special styles are defined for this object. + + @library{wxadv} + @category{pickers} + + @since 2.9.3 + */ +enum +{ + wxTP_DEFAULT = 0 +}; + /** @class wxTimePickerCtrl @@ -30,7 +44,7 @@ @library{wxadv} @category{pickers} - @appearance{timepickerctrl.png} + @appearance{timepickerctrl} @see wxDatePickerCtrl, wxDateEvent @@ -39,6 +53,11 @@ class wxTimePickerCtrl : public wxControl { public: + /** + Default constructor. + */ + wxTimePickerCtrl(); + /** Initializes the object and calls Create() with all the parameters. */ @@ -88,13 +107,42 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = "timectrl"); + /** + Returns the currently entered time as hours, minutes and seconds. + + All the arguments must be non-@NULL, @false is returned otherwise and + none of them is modified. + + @see SetTime() + + @since 2.9.4 + */ + bool GetTime(int* hour, int* min, int* sec) const; + /** Returns the currently entered time. The date part of the returned wxDateTime object is always set to today and should be ignored, only the time part is relevant. */ - virtual wxDateTime GetValue() const = 0; + virtual wxDateTime GetValue() const; + + /** + Changes the current time of the control. + + Calling this method does not result in a time change event. + + @param hour The new hour value in 0..23 interval. + @param min The new minute value in 0..59 interval. + @param sec The new second value in 0..59 interval. + @return @true if the time was changed or @false on failure, e.g. if the + time components were invalid. + + @see GetTime() + + @since 2.9.4 + */ + bool SetTime(int hour, int min, int sec); /** Changes the current value of the control. @@ -102,7 +150,16 @@ public: The date part of @a dt is ignored, only the time part is displayed in the control. The @a dt object must however be valid. + In particular notice that it is a bad idea to use default wxDateTime + constructor from hour, minute and second values as it uses the today + date for the date part which means that some times can be invalid if + today happens to be the day of DST change. For example, when switching + to summer time the time 2:00 typically doesn't exist as the clocks jump + directly to 3:00. To avoid this problem, use a fixed date on which DST + is known not to change (e.g. Jan 1, 2012) for the date part of the + argument or use SetTime(). + Calling this method does not result in a time change event. */ - virtual void SetValue(const wxDateTime& dt) = 0; + virtual void SetValue(const wxDateTime& dt); };