Class PopupButton

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class PopupButton : public nanogui::Button

Button which launches a popup widget.

Remark

This class overrides nanogui::Widget::mIconExtraScale to be 0.8f, which affects all subclasses of this Widget. Subclasses must explicitly set a different value if needed (e.g., in their constructor).

Subclassed by nanogui::ColorPicker, nanogui::ComboBox

Public Functions

PopupButton(Widget *parent, const std::string &caption = "Untitled", int buttonIcon = 0)
virtual ~PopupButton()
void setChevronIcon(int icon)
int chevronIcon() const
void setSide(Popup::Side popupSide)
Popup::Side side() const
Popup *popup()
const Popup *popup() const
virtual void draw(NVGcontext *ctx)

Responsible for drawing the Button.

virtual Vector2i preferredSize(NVGcontext *ctx) const

The preferred size of this Button.

virtual void performLayout(NVGcontext *ctx)

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

virtual void save(Serializer &s) const

Saves the state of this Button provided the given Serializer.

virtual bool load(Serializer &s)

Sets the state of this Button provided the given Serializer.

Protected Attributes

Popup *mPopup
int mChevronIcon