DateTimePicker Class

DateTimePicker Class

This Package | All Packages

Component
  |
  +--Control
    |
    +--DateTimePicker
public class DateTimePicker
extends Control

Implements a date and time picker control.

Constructors
Name Description
DateTimePicker() Creates a DateTimePicker.

Methods
Name Description
addOnCloseUp(EventHandler value) Adds a new listener to the CloseUp event.
addOnDropDown(EventHandler value) Adds a new listener to the DropDown event.
addOnFormat(DateTimeFormatEventHandler value) Adds a new listener to the Format event.
addOnFormatQuery( DateTimeFormatQueryEventHandler value) Adds a new listener to the FormatQuery event.
addOnUserString(DateTimeUserStringEventHandler value) Adds a new listener to the UserString event.
addOnValueChange(DateTimeChangeEventHandler value) Adds a new listener to the DateTimeChange event.
addOnWmKeyDown(DateTimeWmKeyDownEventHandler value) Adds a new listener to the WmKeyDown event.
createHandle() Creates the physical window handle.
destroyHandle() Destroys the physical window handle.
getAppCanParse() Returns the current value of the AppCanParse property.
getCalendarBackColor() Returns the current value of the CalendarBackColor property.
getCalendarFont() Returns the current value of the CalendarFont property.
getCalendarForeColor() Returns the current value of the CalendarForeColor property.
getCalendarMonthBackground() Returns the current value of the CalendarMonthBackground property.
getCalendarTitleBackColor() Returns the current value of the CalendarTitleBackColor property.
getCalendarTitleForeColor() Returns the current value of the CalendarTitleForeColor property.
getCalendarTrailingForeColor() Returns the current value of the CalendarTrailingForeColor property.
getCreateParams() Returns the CreateParams used to create this window.
getCustomFormat() Returns the custom format.
getFormat() Returns the current value of the format property.
getMaxDate() Returns the maximum date selectable in the control.
getMinDate() Returns the minimum date selectable in the control.
getRightAlign() Returns the current value of the RightAlign property.
getShowNone() Returns the current value of the ShowNone property.
getUpDown() Returns the current value of the UpDown property.
getValue() Return the current value displayed in the control.
hasDefaultText() Determines if the control contains the default text.
onCloseUp(Event event) Occurs when the drop-down calendar is dismissed and disappears.
onDropDown(Event event) Occurs when the drop-down calendar is shown.
onFormat(DateTimeFormatEvent event) Occurs when the DateTimePicker needs to convert the time value to a string format.
onFormatQuery(DateTimeFormatQueryEvent event) Occurs when the DateTimePicker needs to determine the dimensions of the string that would be displayed for a given value.
onUserString(DateTimeUserStringEvent event) Occurs when the user has finished entering a string in the control.
onValueChange(DateTimeChangeEvent event) Occurs when the value for the control changes.
onWmKeyDown(DateTimeWmKeyDownEvent event) Occurs when the user presses a key in a custom format field.
removeOnCloseUp(EventHandler value) Removes a listener of the CloseUp event.
removeOnDropDown(EventHandler value) Removes a listener of the DropDown event.
removeOnFormat(DateTimeFormatEventHandler value) Removes a listener of the Format event.
removeOnFormatQuery( DateTimeFormatQueryEventHandler value) Removes a listener of the FormatQuery event.
removeOnUserString( DateTimeUserStringEventHandler value) Removes a listener of the UserString event.
removeOnValueChange(DateTimeChangeEventHandler value) Removes a listener of the ValueChange event.
removeOnWmKeyDown( DateTimeWmKeyDownEventHandler value) Removes a listener of the WmKeyDown event.
setAppCanParse(boolean b) Sets the AppCanParse property.
setCalendarBackColor(Color value) Sets the CalendarBackColor property.
setCalendarFont(Font font) Sets the CalendarFont.
setCalendarForeColor(Color value) Sets the CalendarForeColor property.
setCalendarMonthBackground(Color value) Sets the CalendarMonthBackground.
setCalendarTitleBackColor(Color value) Sets the CalendarTitleBackColor property.
setCalendarTitleForeColor(Color value) Sets the CalendarTitleForeColor property.
setCalendarTrailingForeColor(Color value) Sets the CalendarTrailingForeColor.
setCustomFormat(String sz) Sets the custom format used when the format mode for the control is CUSTOM.
setFormat(int format) Sets the format mode for the control.
setMaxDate(long date) Sets the Maximum displayable date for the control.
setMinDate(long date) Sets the Minimum displayable date for the control.
setRightAlign(boolean b) Sets the RightAlign property.
setShowNone(boolean b) Sets the ShowNone property.
setUpDown(boolean b) Sets the UpDown property.
setValue(long time) Sets the value displayed in the control.

Constructors

DateTimePicker.DateTimePicker

Syntax
public DateTimePicker();
Description

Creates a DateTimePicker.

Methods

DateTimePicker.addOnCloseUp

Syntax
public void addOnCloseUp( EventHandler value );
Parameters
value
Delegate to call when event is fired.
Description

Adds a new listener to the CloseUp event.

DateTimePicker.addOnDropDown

Syntax
public void addOnDropDown( EventHandler value );
Parameters
value
Delegate to call when event is fired.
Description

Adds a new listener to the DropDown event.

DateTimePicker.addOnFormat

Syntax
public void addOnFormat( DateTimeFormatEventHandler value );
Parameters
value
Delegate to call when event is fired.
Description

Adds a new listener to the Format event.

DateTimePicker.addOnFormatQuery

Syntax
public void addOnFormatQuery( DateTimeFormatQueryEventHandler value );
Parameters
value
Delegate to call when event is fired.
Description

Adds a new listener to the FormatQuery event.

DateTimePicker.addOnUserString

Syntax
public void addOnUserString( DateTimeUserStringEventHandler value );
Parameters
value
Delegate to call when event is fired.
Description

Adds a new listener to the UserString event.

DateTimePicker.addOnValueChange

Syntax
public void addOnValueChange( DateTimeChangeEventHandler value );
Parameters
value
Delegate to call when event is fired.
Description

Adds a new listener to the DateTimeChange event.

DateTimePicker.addOnWmKeyDown

Syntax
public void addOnWmKeyDown( DateTimeWmKeyDownEventHandler value );
Parameters
value
Delegate to call when event is fired.
Description

Adds a new listener to the WmKeyDown event.

DateTimePicker.createHandle

Syntax
protected void createHandle();
Description

Creates the physical window handle.

Overrides

createHandle() in Control.

See Also
Control.createHandle

DateTimePicker.destroyHandle

Syntax
protected void destroyHandle();
Description

Destroys the physical window handle.

Overrides

destroyHandle() in Control.

See Also
Control.destroyHandle

DateTimePicker.getAppCanParse

Syntax
public boolean getAppCanParse();
Return Value

Returns the current AppCanParse value.

Description

Returns the current value of the AppCanParse property.

See Also
setAppCanParse

DateTimePicker.getCalendarBackColor

Syntax
public Color getCalendarBackColor();
Return Value

Returns the Current CalendarBackColor.

Description

Returns the current value of the CalendarBackColor property.

See Also
setCalendarBackColor

DateTimePicker.getCalendarFont

Syntax
public Font getCalendarFont();
Return Value

Returns the current CalendarFont.

Description

Returns the current value of the CalendarFont property.

See Also
setCalendarFont

DateTimePicker.getCalendarForeColor

Syntax
public Color getCalendarForeColor();
Return Value

Returns the current CalendarForeColor.

Description

Returns the current value of the CalendarForeColor property.

See Also
setCalendarForeColor

DateTimePicker.getCalendarMonthBackground

Syntax
public Color getCalendarMonthBackground();
Return Value

Returns the current CalendarMonthBackground.

Description

Returns the current value of the CalendarMonthBackground property.

See Also
setCalendarMonthBackground

DateTimePicker.getCalendarTitleBackColor

Syntax
public Color getCalendarTitleBackColor();
Return Value

Returns the current CalendarTitleBackColor.

Description

Returns the current value of the CalendarTitleBackColor property.

See Also
setCalendarTitleBackColor

DateTimePicker.getCalendarTitleForeColor

Syntax
public Color getCalendarTitleForeColor();
Return Value

Returns the current CalendarTitleForeColor.

Description

Returns the current value of the CalendarTitleForeColor property.

See Also
setCalendarTitleForeColor

DateTimePicker.getCalendarTrailingForeColor

Syntax
public Color getCalendarTrailingForeColor();
Return Value

Returns the current CalendarTrailingForeColor.

Description

Returns the current value of the CalendarTrailingForeColor property.

See Also
setCalendarTrailingForeColor

DateTimePicker.getCreateParams

Syntax
protected CreateParams getCreateParams();
Return Value

Returns the CreateParams.

Description

Returns the CreateParams used to create this window.

Overrides

getCreateParams() in Control.

DateTimePicker.getCustomFormat

Syntax
public String getCustomFormat();
Return Value

Returns the custom format string.

Description

Returns the custom format.

See Also
setCustomFormat, setFormat

DateTimePicker.getFormat

Syntax
public int getFormat();
Description

Returns the current value of the format property. This determines the style of format the date is displayed in.

See Also
DataTimePicker.Formats

DateTimePicker.getMaxDate

Syntax
public long getMaxDate();
Return Value

Returns the maximum allowed date.

Description

Returns the maximum date selectable in the control. A -1 is returned if there is no maximum value.

See Also
setMaxDate, setMinDate

DateTimePicker.getMinDate

Syntax
public long getMinDate();
Return Value

Returns the minimum allowed date.

Description

Returns the minimum date selectable in the control. A -1 is returned if there is no minimum value.

See Also
setMinDate, setMaxDate

DateTimePicker.getRightAlign

Syntax
public boolean getRightAlign();
Return Value

Returns the current value of the RightAlign property.

Description

Returns the current value of the RightAlign property.

See Also
setRightAlign

DateTimePicker.getShowNone

Syntax
public boolean getShowNone();
Return Value

Returns the current value of the ShowNone property.

Description

Returns the current value of the ShowNone property.

See Also
setShowNone

DateTimePicker.getUpDown

Syntax
public boolean getUpDown();
Return Value

Returns the current value of the UpDown property.

Description

Returns the current value of the UpDown property.

See Also
setUpDown

DateTimePicker.getValue

Syntax
public long getValue();
Return Value

Returns the current value.

Description

Return the current value displayed in the control. A -1 is returned if there is no value selected.

See Also
setValue

DateTimePicker.hasDefaultText

Syntax
public boolean hasDefaultText();
Description

Determines if the control contains the default text.

DateTimePicker.onCloseUp

Syntax
protected void onCloseUp( Event event );
Parameters
event
The event data.
Description

Occurs when the drop-down calendar is dismissed and disappears.

See Also
addOnCloseUp, removeOnCloseUp, ms.com.wfc.core.Event

DateTimePicker.onDropDown

Syntax
protected void onDropDown( Event event );
Parameters
event
The event data.
Description

Occurs when the drop-down calendar is shown.

See Also
addOnDropDown, removeOnDropDown, cor.Event

DateTimePicker.onFormat

Syntax
protected void onFormat( DateTimeFormatEvent event );
Parameters
event
The event data.
Description

Occurs when the DateTimePicker needs to convert the time value to a string format.

See Also
addOnFormat, removeOnFormat, cor.comctl.DateTimeFormatEvent

DateTimePicker.onFormatQuery

Syntax
protected void onFormatQuery( DateTimeFormatQueryEvent event );
Parameters
event
The event data.
Description

Occurs when the DateTimePicker needs to determine the dimensions of the string that would be displayed for a given value.

See Also
addOnFormatQuery, removeOnFormatQuery, cor.comctl.DateTimeFormatQueryEvent

DateTimePicker.onUserString

Syntax
protected void onUserString( DateTimeUserStringEvent event );
Parameters
event
The event data.
Description

Occurs when the user has finished entering a string in the control. This event will be fired only if AppCanParse is set to true.

See Also
addOnUserString, removeOnUserString, setAppCanParse, cor.comctl.DateTimeUserStringEvent

DateTimePicker.onValueChange

Syntax
protected void onValueChange( DateTimeChangeEvent event );
Parameters
event
The event data.
Description

Occurs when the value for the control changes.

See Also
addOnValueChange, removeOnValueChange, cor.comctl.DateTimeChangeEvent

DateTimePicker.onWmKeyDown

Syntax
protected void onWmKeyDown( DateTimeWmKeyDownEvent event );
Parameters
event
The event data.
Description

Occurs when the user presses a key in a custom format field.

See Also
addOnWmKeyDown, removeOnWmKeyDown, cor.comctl.DateTimeWmKeyDownEvent

DateTimePicker.removeOnCloseUp

Syntax
public void removeOnCloseUp( EventHandler value );
Parameters
value
Delegate not to fire on when the event is fired.
Description

Removes a listener of the CloseUp event.

DateTimePicker.removeOnDropDown

Syntax
public void removeOnDropDown( EventHandler value );
Parameters
value
Delegate not to fire on when the event is fired.
Description

Removes a listener of the DropDown event.

DateTimePicker.removeOnFormat

Syntax
public void removeOnFormat( DateTimeFormatEventHandler value );
Parameters
value
Delegate not to fire on when the event is fired.
Description

Removes a listener of the Format event.

DateTimePicker.removeOnFormatQuery

Syntax
public void removeOnFormatQuery( DateTimeFormatQueryEventHandler value );
Parameters
value
Delegate not to fire on when the event is fired.
Description

Removes a listener of the FormatQuery event.

DateTimePicker.removeOnUserString

Syntax
public void removeOnUserString( DateTimeUserStringEventHandler value );
Parameters
value
Delegate not to fire on when the event is fired.
Description

Removes a listener of the UserString event.

DateTimePicker.removeOnValueChange

Syntax
public void removeOnValueChange( DateTimeChangeEventHandler value );
Parameters
value
Delegate not to fire on when the event is fired.
Description

Removes a listener of the ValueChange event.

DateTimePicker.removeOnWmKeyDown

Syntax
public void removeOnWmKeyDown( DateTimeWmKeyDownEventHandler value );
Parameters
value
Delegate not to fire on when the event is fired.
Description

Removes a listener of the WmKeyDown event.

DateTimePicker.setAppCanParse

Syntax
public void setAppCanParse( boolean b );
Parameters
b
The new value.
Description

Sets the AppCanParse property. When set to true, the user can edit the value in the control by pressing F2. When the user has finished editing, the UserString event occurs, and the control user can interpret the userstring.

See Also
getAppCanParse, OnUserString

DateTimePicker.setCalendarBackColor

Syntax
public void setCalendarBackColor( Color value );
Parameters
value
Color to set the CalendarBackColor to.
Description

Sets the CalendarBackColor property. This color is displayed between the months on the calendar.

See Also
getCalendarBackColor

DateTimePicker.setCalendarFont

Syntax
public void setCalendarFont( Font font );
Parameters
font
Font to set the CalendarFont to.
Description

Sets the CalendarFont. The calendar font is used to display text on the pop-up calendar.

See Also
getCalendarFont

DateTimePicker.setCalendarForeColor

Syntax
public void setCalendarForeColor( Color value );
Parameters
value
Color to set the CalendarForeColor to.
Description

Sets the CalendarForeColor property. This color is used to display text within the month.

See Also
getCalendarForeColor

DateTimePicker.setCalendarMonthBackground

Syntax
public void setCalendarMonthBackground( Color value );
Parameters
value
Color to set the CalendarMonthBackground to.
Description

Sets the CalendarMonthBackground. This color is used to display the background within the month.

See Also
getCalendarMonthBackground

DateTimePicker.setCalendarTitleBackColor

Syntax
public void setCalendarTitleBackColor( Color value );
Parameters
value
Color to set the CalendarTitleBackColor to.
Description

Sets the CalendarTitleBackColor property. This color is used as the background for the calendar's title.

See Also
getCalendarTitleBackColor

DateTimePicker.setCalendarTitleForeColor

Syntax
public void setCalendarTitleForeColor( Color value );
Parameters
value
Color to set the CalendarTitleForeColor to.
Description

Sets the CalendarTitleForeColor property. This color is used to display the text in the calendar's title.

See Also
getCalendarTitleForeColor

DateTimePicker.setCalendarTrailingForeColor

Syntax
public void setCalendarTrailingForeColor( Color value );
Parameters
value
Color to set the CalendarTrailingForeColor to.
Description

Sets the CalendarTrailingForeColor. This color is used to display the text for the header and trailing day text. Header and trailing days are the days from the previous and following months that appear on the current month's calendar.

See Also
getCalendarTrailingForeColor

DateTimePicker.setCustomFormat

Syntax
public void setCustomFormat( String sz );
Parameters
sz
The custom format string.
Description

Sets the custom format used when the format mode for the control is CUSTOM.

See Also
getCustomFormat, setFormat

DateTimePicker.setFormat

Syntax
public void setFormat( int format );
Parameters
format
The new format
Description

Sets the format mode for the control. Valid values are:


cor.comctl.DateTimePicker.Formats.LONG
cor.comctl.DateTimePicker.Formats.SHORT
cor.comctl.DateTimePicker.Formats.TIME
cor.comctl.DateTimePicker.Formats.CUSTOM

See Also
getFormat, setCustomFormat, cor.comctl.DateTimePicker.Formats

DateTimePicker.setMaxDate

Syntax
public void setMaxDate( long date );
Parameters
date
The maximum date value.
Description

Sets the Maximum displayable date for the control. There is no maximum value if Maximum is set to -1.

See Also
getMaxDate, setMinDate

DateTimePicker.setMinDate

Syntax
public void setMinDate( long date );
Parameters
date
The minimum date value.
Description

Sets the Minimum displayable date for the control. There is no minimum value if Minimum is set to -1.

See Also
getMinDate, setMaxDate

DateTimePicker.setRightAlign

Syntax
public void setRightAlign( boolean b );
Parameters
b
New value for RightAlign.
Description

Sets the RightAlign property. When RightAlign is set to true, the text in the control is right aligned.

See Also
getRightAlign

DateTimePicker.setShowNone

Syntax
public void setShowNone( boolean b );
Parameters
b
New value for ShowNone.
Description

Sets the ShowNone property. When ShowNone is set to true a checkbox is displayed to the left of the date in the control. When the checkbox is unchecked the value of the control is -1 indicating no date is selected.

See Also
getShowNone

DateTimePicker.setUpDown

Syntax
public void setUpDown( boolean b );
Parameters
b
New value for UpDown.
Description

Sets the UpDown property. If UpDown is set to true, a spin control is used to adjust time values instead of the drop-down calendar.

See Also
getUpDown

DateTimePicker.setValue

Syntax
public void setValue( long time );
Parameters
time
Time to display.
Description

Sets the value displayed in the control. Setting the value to -1 has the effect of selecting a null date. Null dates are allowed only if ShowNone is set to true.

See Also
getValue, setShowNone