Class · aurore

aurore::ScrollingFrame

On this page
aurore/views/scrolling_frame.hpp
#include <aurore/views/scrolling_frame.hpp>

class aurore::ScrollingFrame : public aurore::Box

Description

A vertical-only frame that can scroll if its content overflows. This frame can only contain one child view. The content view is detached from the rest of the tree so that its height can grow as much as possible.

Constructors 2

ScrollingFrame()

An empty frame, NATURAL scrolling.

scrolling_frame.hpp:48
~ScrollingFrame()

Functions 24

virtual void draw(NVGcontext *vg,float x,float y,float width,float height,Style style,FrameContext *ctx) override

Called by frame() to draw the view onscreen. Views should not draw outside of their bounds (they may be clipped if they do so).

Overrides aurore::Box::draw

scrolling_frame.hpp:51
virtual void onFocusGained() override

Fired when focus is gained.

Overrides aurore::Box::onFocusGained

scrolling_frame.hpp:52
virtual void onChildFocusGained(View *directChild, View *focusedView) override

Fired when focus is gained on one of this view's children, or one of the children of the children...

directChild is guaranteed to be one of your children. It may not be the view that has been focused.

If focusedView == directChild, then the child of yours has been focused. Otherwise, focusedView is a child of directChild.

Overrides aurore::Box::onChildFocusGained

scrolling_frame.hpp:53
virtual void onChildFocusLost(View *directChild, View *focusedView) override

Fired when focus is lost on one of this view's children. Works similarly to onChildFocusGained().

Overrides aurore::Box::onChildFocusLost

scrolling_frame.hpp:54
virtual void willAppear(bool resetState) override

Called when the view will appear on screen, before or after layout().

Can be called if the view has already appeared, so be careful.

Overrides aurore::Box::willAppear

scrolling_frame.hpp:55
virtual void addView(View *view) override

Adds a view to this Box. Returns the position the view was added at.

Overrides aurore::Box::addView

scrolling_frame.hpp:56
virtual void removeView(View *view, bool free = true) override

Removes the given view from the Box. It will be freed.

Overrides aurore::Box::removeView

scrolling_frame.hpp:57
virtual void onLayout() override

Called when a layout pass ends on that view.

Overrides aurore::View::onLayout

scrolling_frame.hpp:58
virtual void setPadding(float top,float right,float bottom,float left) override

Sets the padding of the view, aka the internal space to give between this view boundaries and its children.

Only does one layout pass instead of four when using the four methods separately.

Overrides aurore::Box::setPadding

scrolling_frame.hpp:59
virtual void setPaddingTop(float top) override

Sets the padding of the view, aka the internal space to give between this view boundaries and its children.

Overrides aurore::Box::setPaddingTop

scrolling_frame.hpp:60
virtual void setPaddingRight(float right) override

Sets the padding of the view, aka the internal space to give between this view boundaries and its children.

Overrides aurore::Box::setPaddingRight

scrolling_frame.hpp:61
virtual void setPaddingBottom(float bottom) override

Sets the padding of the view, aka the internal space to give between this view boundaries and its children.

Overrides aurore::Box::setPaddingBottom

scrolling_frame.hpp:62
virtual void setPaddingLeft(float left) override

Sets the padding of the view, aka the internal space to give between this view boundaries and its children.

Overrides aurore::Box::setPaddingLeft

scrolling_frame.hpp:63
virtual View * getParentNavigationDecision(View *from,View *newFocus,FocusDirection direction) override

The focus about to move from from to newFocus: a box may give another view instead. Asked of every parent up the tree; returns newFocus by default.

Overrides aurore::Box::getParentNavigationDecision

scrolling_frame.hpp:64
virtual View * getNextFocus(FocusDirection direction,View *currentView) override

Returns the next view to focus given the requested direction and the currently focused view (as parent user data)

Returning nullptr means that there is no next view to focus in that direction - getNextFocus will then be called on our parent if any

Overrides aurore::Box::getNextFocus

scrolling_frame.hpp:65
virtual View * getDefaultFocus() override

Returns the default view to focus when focusing this view Typically the view itself or one of its children.

Returning nullptr means that the view is not focusable (and neither are its children)

By default, a view is focusable if the flag is set to true with setFocusable() and if the view is visible.

When pressing a key, the flow is :

  1. starting from the currently focused view's parent, traverse the tree upwards and repeatedly call getNextFocus() on every view until we find a next view to focus or meet the end of the tree
  2. if a view is found, getNextFocus() will internally call getDefaultFocus() for the selected child
  3. give focus to the result, if it exists

Overrides aurore::Box::getDefaultFocus

scrolling_frame.hpp:66
virtual enum Sound getFocusSound() override
Rect getVisibleFrame()

The part of the content in view: the local frame moved down by the scroll offset.

scrolling_frame.hpp:69
void setContentView(View *view)

Sets the content view of this scrolling box. There can only be one content view per scrolling box at a time.

scrolling_frame.hpp:75
void setScrollingBehavior(ScrollingBehavior behavior)

Sets the scrolling behavior of this scrolling frame. Default is NATURAL.

scrolling_frame.hpp:81
float getContentOffsetY() const

The point at which the origin of the content view is offset from the origin of the scroll view.

scrolling_frame.hpp:86
void setContentOffsetY(float value, bool animated)

Sets the offset from the content view’s origin that corresponds to the receiver’s origin.

scrolling_frame.hpp:94
void setScrollingIndicatorAutoHide(bool autoHide)

On by default: the indicator shows while scrolling, then fades.

scrolling_frame.hpp:97
void setScrollingIndicatorVisible(bool visible)

Whether the scroll bar on the right is drawn at all.

scrolling_frame.hpp:103

Also the functions of aurore::Box (53), aurore::View (221).

Static functions 1

static View * create()

Makes a frame for XML (<aurore:ScrollingFrame>, one child: its content).

scrolling_frame.hpp:109

Protected functions 13

void prebakeScrolling()
bool updateScrolling(bool animated)
void startScrolling(bool animated, float newScroll)
void animateScrolling(float newScroll, float time)
void scrollAnimationTick()
float getScrollingAreaTopBoundary()
float getScrollingAreaHeight()
float getContentHeight()
void naturalScrollingBehaviour()
void naturalScrollingButtonProcessing(FocusDirection focusDirection,bool *repeat)
View * findTopMostFocusableView()
void setupScrollingIndicator()
void updateScrollingIndicatior()

Protected attributes 16

View * contentView = nullptr
Rectangle * scrollingIndicator = nullptr
bool updateScrollingOnNextFrame = false
bool childFocused = false
bool showScrollingIndicator = true
bool autoHideScrollingIndicator = true

The indicator shows while the content scrolls, then fades away (or stays, as before, when off)

scrolling_frame.hpp:120
float lastIndicatorOffset = -1
bool indicatorShowsFocus = false

The focus waits on the frame itself: the indicator stands for it.

scrolling_frame.hpp:123
Time lastScrollTime = 0
float middleY = 0
float bottomY = 0
Animatable contentOffsetY = 0.0f
bool naturalScrollingCanScroll = false
bool isRubberBanding = false

true while finger is dragging past a scroll boundary

scrolling_frame.hpp:144
Event< InputType >::Subscription inputTypeSubscription

Read from Aurore's headers by Doxygen at each build · library/include