Popup

Popup window for combo boxes, popup buttons, nested dialogs etc.

Usually the Popup instance is constructed by another widget (e.g. PopupButton) and does not need to be created by hand.

Constructors

this
this(Widget parent, Window parentWindow)

Create a new popup parented to a screen (first argument) and a parent window

Members

Enums

Side
enum Side
Undocumented in source.

Functions

anchorHeight
void anchorHeight(int anchorHeight)

Set the anchor height; this determines the vertical shift relative to the anchor position

anchorHeight
int anchorHeight()

Return the anchor height; this determines the vertical shift relative to the anchor position

anchorPos
void anchorPos(Vector2i anchorPos)

Return the anchor position in the parent window; the placement of the popup is relative to it

anchorPos
Vector2i anchorPos()

Set the anchor position in the parent window; the placement of the popup is relative to it

draw
void draw(NanoContext ctx)

Draw the popup window

parentWindow
Window parentWindow()

Return the parent window of the popup

parentWindow
parentWindow()

Return the parent window of the popup

performLayout
void performLayout(NanoContext ctx)

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

refreshRelativePlacement
void refreshRelativePlacement()

Internal helper function to maintain nested window position values

setSide
void setSide(Side popupSide)

Set the side of the parent window at which popup will appear

side
Side side()

Return the side of the parent window at which popup will appear

Variables

mAnchorHeight
int mAnchorHeight;
Undocumented in source.
mAnchorPos
Vector2i mAnchorPos;
Undocumented in source.
mParentWindow
Window mParentWindow;
Undocumented in source.
mSide
Side mSide;
Undocumented in source.

Inherited Members

From Window

title
string title()

Return the window title

title
void title(string title)

Set the window title

modal
bool modal()

Is this a model dialog?

modal
void modal(bool modal)

Set whether or not this is a modal dialog

resizable
bool resizable()

Is this a resizable window?

resizable
void resizable(bool value)

Set whether or not this window is resizable

buttonPanel
Widget buttonPanel()

Return the panel used to house window buttons

dispose
void dispose()

Dispose the window

center
void center()

Center the window in the current Screen

draw
void draw(NanoContext ctx)

Draw the window

mouseDragEvent
bool mouseDragEvent(Vector2i p, Vector2i rel, MouseButton button, int modifiers)

Handle window drag events

mouseMotionEvent
bool mouseMotionEvent(Vector2i p, Vector2i rel, MouseButton button, int modifiers)

Handle a mouse motion event (default implementation: propagate to children)

mouseButtonEvent
bool mouseButtonEvent(Vector2i p, MouseButton button, bool down, int modifiers)

Handle mouse events recursively and bring the current window to the top

scrollEvent
bool scrollEvent(Vector2i p, Vector2f rel)

Accept scroll events and propagate them to the widget under the mouse cursor

preferredSize
Vector2i preferredSize(NanoContext ctx)

Compute the preferred size of the widget

performLayout
void performLayout(NanoContext ctx)

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

refreshRelativePlacement
void refreshRelativePlacement()

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

checkHorizontalResize
int checkHorizontalResize(Vector2i mousePos)
Undocumented in source. Be warned that the author may not have intended to support it.
checkVerticalResize
int checkVerticalResize(Vector2i mousePos)
Undocumented in source. Be warned that the author may not have intended to support it.
mTitle
string mTitle;
Undocumented in source.
mButtonPanel
Widget mButtonPanel;
Undocumented in source.
mModal
bool mModal;
Undocumented in source.
mDrag
bool mDrag;
Undocumented in source.
mResize
bool mResize;
Undocumented in source.
mResizeDir
Vector2i mResizeDir;
Undocumented in source.
mMinSize
Vector2i mMinSize;
Undocumented in source.
mResizable
bool mResizable;
Undocumented in source.

Meta