Class

ScrollView

On this page
aurore/cadran/view/scroll_view.hpp
#include <aurore/cadran/view/scroll_view.hpp>

class ScrollView : public aurore::ScrollingFrame

Description

The scrolling frame of Cadran's screens (<ScrollView>): each press moves to the next line and scrolls just enough to show it with its header and notes.

Constructors 1

ScrollView()

Functions 6

virtual void draw(NVGcontext *vg,float x,float y,float width,float height,aurore::Style style,aurore::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::ScrollingFrame::draw

scroll_view.hpp:25
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::ScrollingFrame::willAppear

scroll_view.hpp:27
virtual void onChildFocusGained(aurore::View *directChild,aurore::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::ScrollingFrame::onChildFocusGained

scroll_view.hpp:28
virtual aurore::View * getNextFocus(aurore::FocusDirection direction,aurore::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::ScrollingFrame::getNextFocus

scroll_view.hpp:29
virtual aurore::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::ScrollingFrame::getDefaultFocus

scroll_view.hpp:30
virtual void onFocusLost() override

Fired when focus is lost.

Overrides aurore::Box::onFocusLost

scroll_view.hpp:31

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

Static functions 2

static aurore::View * create()
static void reveal_focused()

The focused line shown again at the next frame, once laid out anew: a layout moved it (the rail's width changed, cadran::apply_rail).

scroll_view.hpp:37

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