Class VScrollPanel

Inheritance Relationships

Base Type

Class Documentation

class VScrollPanel : public nanogui::Widget

Adds a vertical scrollbar around a widget that is too big to fit into a certain area.

Public Functions

VScrollPanel(Widget *parent)
float scroll() const

Return the current scroll amount as a value between 0 and 1. 0 means scrolled to the top and 1 to the bottom.

void setScroll(float scroll)

Set the scroll amount to a value between 0 and 1. 0 means scrolled to the top and 1 to the bottom.

virtual void performLayout(NVGcontext *ctx)

Invoke the associated layout generator to properly place child widgets, if any.

virtual Vector2i preferredSize(NVGcontext *ctx) const

Compute the preferred size of the widget.

virtual bool mouseDragEvent(const Vector2i &p, const Vector2i &rel, int button, int modifiers)

Handle a mouse drag event (default implementation: do nothing)

virtual bool scrollEvent(const Vector2i &p, const Vector2f &rel)

Handle a mouse scroll event (default implementation: propagate to children)

virtual void draw(NVGcontext *ctx)

Draw the widget (and all child widgets)

virtual void save(Serializer &s) const

Save the state of the widget into the given Serializer instance.

virtual bool load(Serializer &s)

Restore the state of the widget from the given Serializer instance.

Protected Attributes

int mChildPreferredHeight
float mScroll
bool mUpdateLayout