Class Window¶
- Defined in File window.h
Page Contents
Inheritance Relationships¶
Base Type¶
public nanogui::Widget
(Class Widget)
Derived Types¶
public nanogui::MessageDialog
(Class MessageDialog)public nanogui::Popup
(Class Popup)
Class Documentation¶
-
class
Window
: public nanogui::Widget¶ Top-level window widget.
Subclassed by nanogui::MessageDialog, nanogui::Popup
Public Functions
-
Window
(Widget *parent, const std::string &title = "Untitled", const std::string &font = "")¶ Creates a Window with the specified parent.
- Parameters
parent
: The parent of this Window (typically a nanogui::Screen class).title
: The title of the this Window.font
: The font face to use (default""
implies Theme::mDefaultBoldFont, which will typically be"sans-bold"
).
-
virtual std::string
defaultFont
() const¶ Windows use a bold font face by default.
When Widget::mFont is not set, this will result in Theme::mDefaultBoldFont.
-
const std::string &
title
() const¶ Return the window title.
-
void
setTitle
(const std::string &title)¶ Set the window title.
-
bool
modal
() const¶ Is this a model dialog?
-
void
setModal
(bool modal)¶ Set whether or not this is a modal dialog.
Return the panel used to house window buttons.
-
void
dispose
()¶ Dispose the window.
-
virtual void
draw
(NVGcontext *ctx)¶ Draw the window.
-
virtual bool
mouseDragEvent
(const Vector2i &p, const Vector2i &rel, int button, int modifiers)¶ Handle window drag events.
-
virtual bool
mouseButtonEvent
(const Vector2i &p, int button, bool down, int modifiers)¶ Handle mouse events recursively and bring the current window to the top.
-
virtual bool
scrollEvent
(const Vector2i &p, const Vector2f &rel)¶ Accept scroll events and propagate them to the widget under the mouse cursor.
-
virtual Vector2i
preferredSize
(NVGcontext *ctx) const¶ Compute the preferred size of the widget.
-
virtual void
performLayout
(NVGcontext *ctx)¶ Invoke the associated layout generator to properly place child widgets, if any.
-
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 Functions
Friends
-
friend
nanogui::Window::Popup
-