Class

DBKit.DateTimePicker

DBKit.DateTimePicker


Description

Displays and edits the value of a single database column for the current row.

Set ColumnName to the column you want the control bound to. The user can change the value by selecting a date or time part and typing, using the arrow keys or clicking the up and down arrow buttons.

Only the members declared by DBKit.DateTimePicker itself are described here; for the inherited members, see the parent class.

Note

DBKit.DateTimePicker is desktop only. On web, use DBKit.DatePicker instead.

Properties

Name

Type

Read-Only

ColumnName

String

CopyMenuItemText

String

DisplayMode

DisplayModes

DisplayName

String

DisplaySeconds

Boolean

FontName

String

FontSize

Single

FourDigitYear

Boolean

HasArrowsButton

Boolean

HourMode

HourModes

InvalidValueMessage

String

Mandatory

Boolean

SelectedDate

DateTime

Methods

Name

Parameters

Returns

Decrease

Increase

TableName

String

Events

Name

Parameters

Returns

DateChanged

value As DateTime

RowChanged

row As DBKit.Row

RowCreated

row As DBKit.Row

RowDeleted

row As DBKit.Row

RowEditing

row As DBKit.Row

RowLoaded

row As DBKit.Row

RowNotSelected

RowSaved

row As DBKit.Row

RowSaving

row As DBKit.Row

RowUndone

row As DBKit.Row

Enumerations

DBKit.DateTimePicker.DisplayModes

DisplayModes

Specifies which portions of the date and time the control displays.

Modes

DateAndTime

DateOnly

TimeOnly

DateAndTime displays both the date and the time. DateOnly displays only the date. TimeOnly displays only the time.

DBKit.DateTimePicker.HourModes

HourModes

Specifies how the hour portion of the time is displayed.

Modes

System

Hours12

Hours24

System follows the system setting. Hours12 displays the hour in 12-hour format. Hours24 displays the hour in 24-hour format.

Property descriptions


DBKit.DateTimePicker.ColumnName

ColumnName As String

The name of the database column whose value this control displays and edits.

If blank, the control's name is used as the column name. The name may be qualified with a table name (for example "tablename.columnname") when the control shows a column from a related table.

Tip

Instead of setting this property, you can name the control the same as the database column. DBKit first looks at the ColumnName property; if it is blank, it then uses the name of the control itself.


DBKit.DateTimePicker.CopyMenuItemText

CopyMenuItemText As String

The text of the contextual menu item that copies the displayed date to the clipboard.

The default is "Copy Date".


DBKit.DateTimePicker.DisplayMode

DisplayMode As DisplayModes

Determines which portions of the date and time the control displays.

The default is DisplayModes.DateAndTime.


DBKit.DateTimePicker.DisplayName

DisplayName As String

A user-friendly name for the control, shown to the user in place of the column name (for example in the InvalidValueMessage).

If blank, the column name is de-camelcased automatically (for example "FirstName" becomes "First Name").


DBKit.DateTimePicker.DisplaySeconds

DisplaySeconds As Boolean

If True, the seconds are displayed as part of the time.

The default is False.


DBKit.DateTimePicker.FontName

FontName As String

The name of the font used to display the value.


DBKit.DateTimePicker.FontSize

FontSize As Single

The size of the font used to display the value.


DBKit.DateTimePicker.FourDigitYear

FourDigitYear As Boolean

If True, the year is displayed using four digits.

The default is True.


DBKit.DateTimePicker.HasArrowsButton

HasArrowsButton As Boolean

If True, up and down arrow buttons are displayed for changing the selected date or time part.

The default is True.


DBKit.DateTimePicker.HourMode

HourMode As HourModes

Determines whether the hour portion of the time is displayed in 12-hour or 24-hour format.

The default is HourModes.System.


DBKit.DateTimePicker.InvalidValueMessage

InvalidValueMessage As String

The message displayed when the field is mandatory but no date has been selected. Use <$1> as a placeholder for the control's display name.

The default is "<$1> must have a selected date."


DBKit.DateTimePicker.Mandatory

Mandatory As Boolean

If True, the field must contain a value before the row can be saved. When a row with an empty mandatory field is saved, the InvalidValueMessage is displayed and the save is cancelled.

The default is False.


DBKit.DateTimePicker.SelectedDate

SelectedDate As DateTime

The currently selected date and time.

Setting SelectedDate updates the displayed value. Assigning Nil clears the selection.

Method descriptions


DBKit.DateTimePicker.Decrease

Decrease()

Decreases the selected date or time part by one unit. For example, if the month part is selected, the month is decreased by one.


DBKit.DateTimePicker.Increase

Increase()

Increases the selected date or time part by one unit. For example, if the month part is selected, the month is increased by one.


DBKit.DateTimePicker.TableName

TableName() As String

Returns the name of the database table the control's column belongs to, resolved from the control's layout.

Event descriptions


DBKit.DateTimePicker.DateChanged

DateChanged(value As DateTime)

The selected date has changed. The new value is passed to the event.


DBKit.DateTimePicker.RowChanged

RowChanged(row As DBKit.Row)

The current row (passed to the event) has been changed.


DBKit.DateTimePicker.RowCreated

RowCreated(row As DBKit.Row)

A new row (passed to the event) was just created and is now the current row.


DBKit.DateTimePicker.RowDeleted

RowDeleted(row As DBKit.Row)

The current row (passed to the event) has been deleted.


DBKit.DateTimePicker.RowEditing

RowEditing(row As DBKit.Row)

The current row (passed to the event) is being edited by the user.


DBKit.DateTimePicker.RowLoaded

RowLoaded(row As DBKit.Row)

The current row (passed to the event) has been loaded.


DBKit.DateTimePicker.RowNotSelected

RowNotSelected

There is no row currently selected.


DBKit.DateTimePicker.RowSaved

RowSaved(row As DBKit.Row)

The current row (passed to the event) has been saved.


DBKit.DateTimePicker.RowSaving

RowSaving(row As DBKit.Row)

The current row (passed to this event) is about to be saved.


DBKit.DateTimePicker.RowUndone

RowUndone(row As DBKit.Row)

The changes made to the current row (passed to this event) have been undone.

Notes

Localize the control's user-facing text (InvalidValueMessage) the standard Xojo way: assign a dynamic constant to each property and provide translations for as many languages as you need, or localize the property values directly.

Compatibility

Project Types

Desktop

Operating Systems

All

See also

DesktopCanvas parent class; DBKit.Row class.