# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # # TP_DEFAULT = 0 # This control allows the user to enter time. # It is similar to {Wx::DatePickerCtrl} but is used for time, and not date, selection. While {Wx::TimePickerCtrl#get_value} and {Wx::TimePickerCtrl#set_value} still work with values of type {Wx::DateTime} (because wxWidgets doesn't provide a time-only class), their date part is ignored by this control. # It is only available if {Wx::Setup::USE_TIMEPICKCTRL} is set to 1. # This control currently doesn't have any specific flags. # === Events emitted by this class # # The following event-handler methods redirect the events to member method or handler blocks for {Wx::DateEvent} events. # Event handler methods for events emitted by this class: # - {Wx::EvtHandler#evt_time_changed}(id, meth = nil, &block): Process a {Wx::EVT_TIME_CHANGED} event, which fires when the user changes the current selection in the control. # # === # # Category: Picker Controls
Appearance:
{Wx::MSW} Appearance # {Wx::GTK} Appearance # {Wx::OSX} Appearance #
# @see Wx::DatePickerCtrl # @see Wx::CalendarCtrl # @see Wx::DateEvent # # class TimePickerCtrl < Control # @overload initialize() # Default constructor. # @return [TimePickerCtrl] # @overload initialize(parent, id, dt=Wx::DefaultDateTime, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::TP_DEFAULT, validator=Wx::DEFAULT_VALIDATOR, name=Wx::TimePickerCtrlNameStr) # Initializes the object and calls {Wx::TimePickerCtrl#create} with all the parameters. # @param parent [Wx::Window] # @param id [Integer] # @param dt [Time,Date,DateTime] # @param pos [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param style [Integer] # @param validator [Wx::Validator] # @param name [String] # @return [TimePickerCtrl] def initialize(*args) end # Create the control window. # This method should only be used for objects created using default constructor. # # true if the control was successfully created or false if creation failed. # @param parent [Wx::Window] Parent window, must not be non-NULL. # @param id [Integer] The identifier for the control. # @param dt [Time,Date,DateTime] The initial value of the control, if an invalid date (such as the default value) is used, the control is set to current time. # @param pos [Array(Integer, Integer), Wx::Point] Initial position. # @param size [Array(Integer, Integer), Wx::Size] Initial size. If left at default value, the control chooses its own best size by using the height approximately equal to a text control and width large enough to show the time fully. # @param style [Integer] The window style, should be left at 0 as there are no special styles for this control in this version. # @param validator [Wx::Validator] Validator which can be used for additional checks. # @param name [String] Control name. # @return [true,false] def create(parent, id, dt=Wx::DefaultDateTime, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=Wx::TP_DEFAULT, validator=Wx::DEFAULT_VALIDATOR, name=Wx::TimePickerCtrlNameStr) end # 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 Wx::TimePickerCtrl#set_time # @return [Array(true,false,Integer,Integer,Integer)] def get_time; end alias_method :time, :get_time # Returns the currently entered time. # The date part of the returned {Wx::DateTime} object is always set to today and should be ignored, only the time part is relevant. # @return [Time,Date,DateTime] def get_value; end alias_method :value, :get_value # Changes the current time of the control. # Calling this method does not result in a time change event. # # true if the time was changed or false on failure, e.g. if the time components were invalid. # @see Wx::TimePickerCtrl#get_time # @param hour [Integer] The new hour value in 0..23 interval. # @param min [Integer] The new minute value in 0..59 interval. # @param sec [Integer] The new second value in 0..59 interval. # @return [true,false] def set_time(hour, min, sec) end # Changes the current value of the control. # The date part of dt is ignored, only the time part is displayed in the control. The dt object must however be valid. # In particular, notice that it is a bad idea to use default {Wx::DateTime} constructor from hour, minute and second values as it uses the today date for the date part, which means that some values 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 {Wx::TimePickerCtrl#set_time}. # Calling this method does not result in a time change event. # @param dt [Time,Date,DateTime] # @return [void] def set_value(dt) end alias_method :value=, :set_value end # TimePickerCtrl end