# ILogicalScrollable

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/primitives/trait-ilogicalscrollable/

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

```rust
trait ILogicalScrollable: IScrollable
```

Interface implemented by controls that handle their own scrolling when
placed inside a `ScrollViewer`.

Controls that implement this interface, when placed inside a
`ScrollViewer`, can override the physical scrolling behavior of the
scroll viewer with logical scrolling. Physical scrolling means that the
scroll viewer is a simple viewport onto a larger canvas whereas logical
scrolling means that the scrolling is handled by the child control itself
and it can choose to do handle the scroll information as it sees fit.

A class implementing the trait is made known with
[`register_logical_scrollable`](/docs/0.5.0/api/ferroui-controls/primitives/function-register_logical_scrollable/), normally from its class initialization;
[`as_logical_scrollable`](/docs/0.5.0/api/ferroui-controls/primitives/function-as_logical_scrollable/) then views an object of the class (or of a
class derived from it) as the interface.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/i_logical_scrollable.rs#L22)

## Members

- [`set_can_horizontally_scroll`](#function-set_can_horizontally_scroll)
- [`set_can_vertically_scroll`](#function-set_can_vertically_scroll)
- [`is_logical_scroll_enabled`](#function-is_logical_scroll_enabled)
- [`scroll_size`](#function-scroll_size)
- [`page_scroll_size`](#function-page_scroll_size)
- [`scroll_invalidated`](#function-scroll_invalidated)
- [`bring_into_view`](#function-bring_into_view)
- [`get_control_in_direction`](#function-get_control_in_direction)
- [`raise_scroll_invalidated`](#function-raise_scroll_invalidated)

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

### set_can_horizontally_scroll

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

Sets a value indicating whether the content can be scrolled
horizontally.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/i_logical_scrollable.rs#L25)

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

### set_can_vertically_scroll

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

Sets a value indicating whether the content can be scrolled
vertically.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/i_logical_scrollable.rs#L29)

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

### is_logical_scroll_enabled

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

Gets a value indicating whether logical scrolling is enabled on the
control.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/i_logical_scrollable.rs#L33)

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

### scroll_size

```rust
fn scroll_size(self: &Self) -> Size
```

Gets the size to scroll by, in logical units.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/i_logical_scrollable.rs#L36)

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

### page_scroll_size

```rust
fn page_scroll_size(self: &Self) -> Size
```

Gets the size to page by, in logical units.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/i_logical_scrollable.rs#L39)

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

### scroll_invalidated

```rust
fn scroll_invalidated(self: &Self, handler: Rc<dyn Fn() -> ()>) -> Rc<dyn IDisposable>
```

Raised when the scroll is invalidated.

This event notifies an attached `ScrollViewer` of a change in one of
the scroll properties. Disposing the returned handle removes the
handler.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/i_logical_scrollable.rs#L46)

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

### bring_into_view

```rust
fn bring_into_view(self: &Self, target: &Ref<Control>, target_rect: Rect) -> bool
```

Attempts to bring a portion of the target visual into view by
scrolling the content.

`target` is the target visual and `target_rect` the portion of the
target visual to bring into view. Returns true if the scroll offset
was changed; otherwise false.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/i_logical_scrollable.rs#L54)

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

### get_control_in_direction

```rust
fn get_control_in_direction(self: &Self, direction: NavigationDirection, from: Option<&Ref<Control>>) -> Option<Ref<Control>>
```

Gets the next control in the specified direction.

`direction` is the movement direction and `from` the control from
which movement begins.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/i_logical_scrollable.rs#L60)

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

### raise_scroll_invalidated

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

Raises the `scroll_invalidated` event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/i_logical_scrollable.rs#L67)

## Trait implementations

- [`ILogicalScrollable`](/docs/0.5.0/api/ferroui-controls/primitives/trait-ilogicalscrollable/)

## Availability

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