# TimePicker

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/date_time_pickers/struct-timepicker/

**struct** · [`ferroui-controls`](/docs/0.5.0/api/ferroui-controls/) · v0.5.0

```rust
struct TimePicker
```

A control to allow the user to select a time.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L29)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`on_selected_time_changed`](#function-on_selected_time_changed)
- [`minute_increment_property`](#function-minute_increment_property)
- [`second_increment_property`](#function-second_increment_property)
- [`clock_identifier_property`](#function-clock_identifier_property)
- [`vertical_content_alignment_property`](#function-vertical_content_alignment_property)
- [`use_seconds_property`](#function-use_seconds_property)
- [`selected_time_property`](#function-selected_time_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`vertical_content_alignment`](#function-vertical_content_alignment)
- [`set_vertical_content_alignment`](#function-set_vertical_content_alignment)
- [`minute_increment`](#function-minute_increment)
- [`set_minute_increment`](#function-set_minute_increment)
- [`second_increment`](#function-second_increment)
- [`set_second_increment`](#function-set_second_increment)
- [`clock_identifier`](#function-clock_identifier)
- [`set_clock_identifier`](#function-set_clock_identifier)
- [`use_seconds`](#function-use_seconds)
- [`set_use_seconds`](#function-set_use_seconds)
- [`selected_time`](#function-selected_time)
- [`set_selected_time`](#function-set_selected_time)
- [`selected_time_changed`](#function-selected_time_changed)
- [`clear`](#function-clear)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L58)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<TimePicker>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L58)

<a id="function-on_selected_time_changed"></a>

### on_selected_time_changed

```rust
fn on_selected_time_changed(self: &Self, old_time: Option<SignedDuration>, new_time: Option<SignedDuration>)
```

Raises the `SelectedTimeChanged` event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L58)

<a id="function-minute_increment_property"></a>

### minute_increment_property

```rust
fn minute_increment_property() -> &'static StyledProperty<i32>
```

Defines the `MinuteIncrement` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L233)

<a id="function-second_increment_property"></a>

### second_increment_property

```rust
fn second_increment_property() -> &'static StyledProperty<i32>
```

Defines the `SecondIncrement` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L233)

<a id="function-clock_identifier_property"></a>

### clock_identifier_property

```rust
fn clock_identifier_property() -> &'static StyledProperty<String>
```

Defines the `ClockIdentifier` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L233)

<a id="function-vertical_content_alignment_property"></a>

### vertical_content_alignment_property

```rust
fn vertical_content_alignment_property() -> &'static StyledProperty<VerticalAlignment>
```

Defines the `VerticalContentAlignment` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L233)

<a id="function-use_seconds_property"></a>

### use_seconds_property

```rust
fn use_seconds_property() -> &'static StyledProperty<bool>
```

Defines the `UseSeconds` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L233)

<a id="function-selected_time_property"></a>

### selected_time_property

```rust
fn selected_time_property() -> &'static StyledProperty<Option<SignedDuration>>
```

Defines the `SelectedTime` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L233)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L286)

<a id="function-new"></a>

### new

```rust
fn new() -> Ref<Self>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L310)

<a id="function-vertical_content_alignment"></a>

### vertical_content_alignment

```rust
fn vertical_content_alignment(self: &Self) -> VerticalAlignment
```

The vertical alignment of the content within the control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L315)

<a id="function-set_vertical_content_alignment"></a>

### set_vertical_content_alignment

```rust
fn set_vertical_content_alignment(self: &Self, value: VerticalAlignment)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L319)

<a id="function-minute_increment"></a>

### minute_increment

```rust
fn minute_increment(self: &Self) -> i32
```

The minute increment in the picker.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L324)

<a id="function-set_minute_increment"></a>

### set_minute_increment

```rust
fn set_minute_increment(self: &Self, value: i32)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L328)

<a id="function-second_increment"></a>

### second_increment

```rust
fn second_increment(self: &Self) -> i32
```

The second increment in the picker.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L341)

<a id="function-set_second_increment"></a>

### set_second_increment

```rust
fn set_second_increment(self: &Self, value: i32)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L345)

<a id="function-clock_identifier"></a>

### clock_identifier

```rust
fn clock_identifier(self: &Self) -> String
```

The clock identifier, either `12HourClock` or `24HourClock`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L358)

<a id="function-set_clock_identifier"></a>

### set_clock_identifier

```rust
fn set_clock_identifier(self: &Self, value: &str)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L362)

<a id="function-use_seconds"></a>

### use_seconds

```rust
fn use_seconds(self: &Self) -> bool
```

The use seconds switch.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L375)

<a id="function-set_use_seconds"></a>

### set_use_seconds

```rust
fn set_use_seconds(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L379)

<a id="function-selected_time"></a>

### selected_time

```rust
fn selected_time(self: &Self) -> Option<SignedDuration>
```

The selected time; can be `None`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L390)

<a id="function-set_selected_time"></a>

### set_selected_time

```rust
fn set_selected_time(self: &Self, value: Option<SignedDuration>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L394)

<a id="function-selected_time_changed"></a>

### selected_time_changed

```rust
fn selected_time_changed(self: &Self, handler: impl Fn(&TimePickerSelectedValueChangedEventArgs) -> () + 'static) -> Subscription
```

Raised when the selected time changes. Dropping the returned guard removes the handler;
`Subscription::detach` keeps it for the life of the picker.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L400)

<a id="function-clear"></a>

### clear

```rust
fn clear(self: &Self)
```

Clears the selected time.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/date_time_pickers/time_picker.rs#L578)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TemplatedControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- [`TimePickerImplExt`](/docs/0.5.0/api/ferroui-controls/date_time_pickers/trait-timepickerimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<TimePicker>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`TimePickerImpl`](/docs/0.5.0/api/ferroui-controls/date_time_pickers/trait-timepickerimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
