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

A resizeable horizontal or vertical layout. More...

#include <AUI/View/ASplitter.h>

Detailed Description

ASplitter lets the user control the size of child views by dragging the boundary between them. Any number of views may be controlled by a single splitter.

Generally, ASplitter mimics behaviour of linear layouts (i.e., Vertical and Horizontal):

  1. if there's no expanding view, both linear layouts and ASplitter leave blank space at the end
  2. expanding views use all available space.

ASplitter is applying geometry via min size-like logic by custom ALayout implementation.

ASplitter tends to reclaim space from non-expanding views in favour to expanding views. As such, there should be at least 1 view with expanding. If there's no such view, ASplitter adds ASpacerFixed to the end.

Note
Valid expandings should be applied before constructing ASplitter. ASplitter does not support changing expanding on the fly.

ASplitter is constructed by builder. Use ASplitter::Horizontal() and ASplitter::Vertical().

Member Function Documentation

> All members, including inherited

◆ onClickPrevented()

void ASplitter::onClickPrevented ( )
overridevirtual

Reimplemented from AView.

◆ onPointerMove()

void ASplitter::onPointerMove ( glm::vec2 pos,
const APointerMoveEvent & event )
overridevirtual
Parameters
posevent position
eventevent description
Note
If the view is pressed, it would still received move events. Use AView::isMouseHover to check is the pointer actually over view or not. See AView::onPointerReleased for more info.

Reimplemented from AView.

◆ onPointerPressed()

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

Reimplemented from AView.

◆ onPointerReleased()

void ASplitter::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.

◆ setSize()

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

Reimplemented from AView.