Class Window

Inheritance Relationships

Base Type

Derived Types

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 &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.

Widget *buttonPanel()

Return the panel used to house window buttons.

void dispose()

Dispose the window.

void center()

Center the window in the current Screen.

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

virtual void refreshRelativePlacement()

Internal helper function to maintain nested window position values; overridden in Popup.

Protected Attributes

std::string mTitle
Widget *mButtonPanel
bool mModal
bool mDrag