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 Widget::mIconExtraScale to what is specified by Theme::mPopupIconExtraScale, which affects all subclasses of this Widget. Subclasses must explicitly set a different value if needed (e.g., in their constructor). Note that setTheme also overwrites this value to that specified by the new Theme, so subclasses must also account for this if setting to a non-theme value.

Subclassed by nanogui::ColorPicker, nanogui::ComboBox

Public Functions

PopupButton(Widget *parent, const std::string &caption = "Untitled", int buttonIcon = 0, const std::string &font = "")

Creates a PopupButton attached to the specified parent.

Parameters

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 setTheme(Theme *theme)

Ensures that Widget::mIconExtraScale is updated.

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