Class · aurore
aurore::ScrollingFrame
#include <aurore/views/scrolling_frame.hpp>
class aurore::ScrollingFrame : public aurore::BoxDescription
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
An empty frame, NATURAL scrolling.
scrolling_frame.hpp:48Functions 24
virtual void draw( NVGcontext *vg,float x,float y,float width,float height,Style style,FrameContext *ctx) overrideCalled 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
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
Fired when focus is lost on one of this view's children. Works similarly to onChildFocusGained().
Overrides aurore::Box::onChildFocusLost
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
virtual void addView(View *view) override Adds a view to this Box. Returns the position the view was added at.
Overrides aurore::Box::addView
virtual void removeView(View *view, bool free = true) override Removes the given view from the Box. It will be freed.
Overrides aurore::Box::removeView
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
Sets the padding of the view, aka the internal space to give between this view boundaries and its children.
Overrides aurore::Box::setPaddingTop
Sets the padding of the view, aka the internal space to give between this view boundaries and its children.
Overrides aurore::Box::setPaddingRight
Sets the padding of the view, aka the internal space to give between this view boundaries and its children.
Overrides aurore::Box::setPaddingBottom
Sets the padding of the view, aka the internal space to give between this view boundaries and its children.
Overrides aurore::Box::setPaddingLeft
virtual View * getNextFocus( FocusDirection direction,View *currentView) overrideReturns 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
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 :
- 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
- if a view is found, getNextFocus() will internally call getDefaultFocus() for the selected child
- give focus to the result, if it exists
Overrides aurore::Box::getDefaultFocus
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:69void 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:75void setScrollingBehavior(ScrollingBehavior behavior) Sets the scrolling behavior of this scrolling frame. Default is NATURAL.
scrolling_frame.hpp:81The point at which the origin of the content view is offset from the origin of the scroll view.
scrolling_frame.hpp:86Sets the offset from the content view’s origin that corresponds to the receiver’s origin.
scrolling_frame.hpp:94On by default: the indicator shows while scrolling, then fades.
scrolling_frame.hpp:97Whether the scroll bar on the right is drawn at all.
scrolling_frame.hpp:103Also 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).
Protected functions 13
Protected attributes 16
The indicator shows while the content scrolls, then fades away (or stays, as before, when off)
scrolling_frame.hpp:120The focus waits on the frame itself: the indicator stands for it.
scrolling_frame.hpp:123y + height/2
scrolling_frame.hpp:126y + height
scrolling_frame.hpp:127true while finger is dragging past a scroll boundary
scrolling_frame.hpp:144Read from Aurore's headers by Doxygen at each build · library/include