AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AScrollArea Class Reference

A scrollable container with vertical and horizontal scrollbars. More...

#include <AUI/View/AScrollArea.h>

Detailed Description

AScrollArea should have expanding, or fixed size, or max size to be set in order to define it's sizing rules, as it's size cannot be defined by it's contents for obvious reasons.

FixedSize and Expanding stylesheet properties would work as expected. If neither of them is set, AScrollArea would occupy size by minimum size of it's contents, as a AViewContainer would do. In such case, you may restrict maximum size of AScrollArea with MaxSize property. AScrollArea will not exceed MaxSize, but also become actual scroll area, involving displaying scroll bars and handling scroll events. This behaviour is similar to Text.

Expanding is enabled by default. It can be disabled with ass::Expanding(0) property.

Note
Behaviour of vertical and horizontal axes are independent from each other. This behaviour is similar to Text.

Member Function Documentation

> All members, including inherited

◆ getContentMinimumHeight()

int AScrollArea::getContentMinimumHeight ( )
overridevirtual
Returns
minimal content-area height.

Reimplemented from AView.

◆ getContentMinimumWidth()

int AScrollArea::getContentMinimumWidth ( )
overridevirtual
Returns
minimal content-area width.

Reimplemented from AView.

◆ onGesture()

bool AScrollArea::onGesture ( const glm::ivec2 & origin,
const AGestureEvent & event )
overridevirtual

Handles touch screen gesture event.

Parameters
originposition where the event(s) started to occur from.
eventgesture event.
Note
The standard implementation AView::onGesture emulates desktop events such as right click and scroll.
See also
transformGestureEventsToDesktop
Returns
true, if consumed (handled). True value prevents click.

Reimplemented from AView.

◆ onPointerPressed()

void AScrollArea::onPointerPressed ( const APointerPressedEvent & event)
overridevirtual
Parameters
eventevent

Reimplemented from AView.

◆ onPointerReleased()

void AScrollArea::onPointerReleased ( const APointerReleasedEvent & event)
overridevirtual
Parameters
eventevent
Note
To handle clicks, you should use AView::clicked signal instead. View still receives pointer move and released events even if cursor goes outside the view boundaries, or other exclusive event appeared (i.e. scrollarea scroll). AView::clicked emitted only if release event occurred inside view and no other event has prevented click gesture. See APointerReleasedEvent::triggerClick.

Reimplemented from AView.

◆ onScroll()

void AScrollArea::onScroll ( const AScrollEvent & event)
overridevirtual

Handles mouse wheel events.

Parameters
eventevent info.

Reimplemented from AView.

◆ scrollTo() [1/2]

void AScrollArea::scrollTo ( ARect< int > target,
bool nearestBorder = true )
Parameters
targettarget rectangle area in coordinate space of the window.
nearestBorderif true, the scroll is performed up to the nearest border of scroll area, and if the target is already fully visible, then scrollTo does not take effect. If false, the scroll is performed up to the top border of the target view.

◆ scrollTo() [2/2]

void AScrollArea::scrollTo ( const _< AView > & target,
bool nearestBorder = true )
inline
Parameters
targettarget view to scroll to. Must be direct or indirect child.
nearestBorderif true, the scroll is performed up to the nearest border of scroll area, and if the target is already fully visible, then scrollTo does not take effect. If false, the scroll is performed up to the top border of the target view.

◆ setSize()

void AScrollArea::setSize ( glm::ivec2 size)
overridevirtual

Reimplemented from AView.

◆ setStickToEnd()

void AScrollArea::setStickToEnd ( bool stickToEnd)
inline

◆ setWheelScrollable()

void AScrollArea::setWheelScrollable ( bool value)
inline
See also
mIsWheelScrollable