Class PopupButton¶
- Defined in File popupbutton.h
Page Contents
Inheritance Relationships¶
Base Type¶
public nanogui::Button
(Class Button)
Derived Types¶
public nanogui::ColorPicker
(Class ColorPicker)public nanogui::ComboBox
(Class ComboBox)
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
parent
: The nanogui::Widget this PopupButton will be attached to.caption
: The name of the button (default"Untitled"
).buttonIcon
: The icon to display with this Button. See nanogui::Button::mIcon.font
: The font face to use (default""
implies Theme::mDefaultBoldFont, which will typically be"sans-bold"
).
-
virtual
~PopupButton
()¶
-
void
setChevronIcon
(int icon)¶
-
int
chevronIcon
() const¶
-
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.