Package wx :: Class DatePickerCtrl
[frames | no frames]

Type DatePickerCtrl

object --+                
         |                
    Object --+            
             |            
    EvtHandler --+        
                 |        
            Window --+    
                     |    
               Control --+
                         |
                        DatePickerCtrl


This control allows the user to select a date. Unlike wx.calendar.CalendarCtrl, which is a relatively big control, wx.DatePickerCtrl is implemented as a small window showing the currently selected date. The control can be edited using the keyboard, and can also display a popup window for more user-friendly date selection, depending on the styles used and the platform.

Styles

wx.DP_SPIN Creates a control without month calendar drop down but with spin control-like arrows to change individual date components. This style is not supported by the generic version.
wx.DP_DROPDOWN Creates a control with a month calendar drop down part from which the user can select a date.
wx.DP_DEFAULT Creates a control with default style which is the best supported for the current platform (currently wx.DP_SPIN under Windows and wx.DP_DROPDOWN elsewhere).
wx.DP_ALLOWNONE With this style, the control allows the user to not enter any valid date at all. Without it -- which is by default -- the control always has some valid date.
wx.DP_SHOWCENTURY Forces display of the century in the default date format. Without this flas the century could be displayed or not depending on the default date representation in the system.

Events

EVT_DATE_CHANGED This event fires when the user changes the current selection in the control.

See Also:

wx.calendar.CalendarCtrl, wx.DateEvent

Method Summary
DatePickerCtrl __init__(self, parent, id, dt, pos, size, style, validator, name)
Create a new DatePickerCtrl.
bool Create(self, parent, id, dt, pos, size, style, validator, name)
Create the GUI parts of the DatePickerCtrl, for use in 2-phase creation.
DateTime GetLowerLimit(self)
Get the lower limit of the valid range for the date selection, if any.
DateTime GetUpperLimit(self)
Get the upper limit of the valid range for the date selection, if any.
DateTime GetValue(self)
Returns the currently selected date.
  SetRange(self, dt1, dt2)
Sets the valid range for the date selection.
  SetValue(self, dt)
Changes the current value of the control.

Property Summary
  LowerLimit: See GetLowerLimit
  thisown: The membership flag
  UpperLimit: See GetUpperLimit
  Value: See GetValue and SetValue

Instance Method Details

__init__(self, parent, id=-1, dt=wxDefaultDateTime, pos=DefaultPosition, size=DefaultSize, style=wxDP_DEFAULT|wxDP_SHOWCENTURY, validator=DefaultValidator, name=DatePickerCtrlNameStr)
(Constructor)

Create a new DatePickerCtrl.

Parameters:
parent
           (type=Window)

id
           (type=int)

dt
           (type=DateTime)

pos
           (type=Point)

size
           (type=Size)

style
           (type=long)

validator
           (type=Validator)

name
           (type=String)

Returns:
DatePickerCtrl
Overrides:
wx.Control.__init__

Create(self, parent, id=-1, dt=wxDefaultDateTime, pos=DefaultPosition, size=DefaultSize, style=wxDP_DEFAULT|wxDP_SHOWCENTURY, validator=DefaultValidator, name=DatePickerCtrlNameStr)

Create the GUI parts of the DatePickerCtrl, for use in 2-phase creation.

Parameters:
parent
           (type=Window)

id
           (type=int)

dt
           (type=DateTime)

pos
           (type=Point)

size
           (type=Size)

style
           (type=long)

validator
           (type=Validator)

name
           (type=String)

Returns:
bool
Overrides:
wx.Control.Create

GetLowerLimit(self)

Get the lower limit of the valid range for the date selection, if any. If there is no range or there is no lower limit, then the wx.DateTime value returned will be invalid.

Returns:
DateTime

GetUpperLimit(self)

Get the upper limit of the valid range for the date selection, if any. If there is no range or there is no upper limit, then the wx.DateTime value returned will be invalid.

Returns:
DateTime

GetValue(self)

Returns the currently selected date. If there is no selection or the selection is outside of the current range, an invalid wx.DateTime object is returned.

Returns:
DateTime

SetRange(self, dt1, dt2)

Sets the valid range for the date selection. If dt1 is valid, it becomes the earliest date (inclusive) accepted by the control. If dt2 is valid, it becomes the latest possible date.

If the current value of the control is outside of the newly set range bounds, the behaviour is undefined.

Parameters:
dt1
           (type=DateTime)

dt2
           (type=DateTime)

SetValue(self, dt)

Changes the current value of the control. The date should be valid and included in the currently selected range, if any.

Calling this method does not result in a date change event.

Parameters:
dt
           (type=DateTime)


Property Details

LowerLimit

See GetLowerLimit

Get Method:
GetLowerLimit(self)

thisown

The membership flag

UpperLimit

See GetUpperLimit

Get Method:
GetUpperLimit(self)

Value

See GetValue and SetValue

Get Method:
GetValue(self)
Set Method:
SetValue(self, dt)

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:10:03 2007 http://epydoc.sf.net