FormHelper

\class FormHelper formhelper.h nanogui/formhelper.h

\brief Convenience class to create simple AntTweakBar-style layouts that expose variables of various types using NanoGUI widgets

Constructors

this
this(Screen screen)

Create a helper class to construct NanoGUI widgets on the given screen

Members

Functions

addButton
Button addButton(string label, void delegate() cb)

Add a button with a custom callback

addGroup
Label addGroup(string caption)

Add a new group that may contain several sub-widgets

addVariable
auto addVariable(string label, void delegate(Type) setter, Type delegate() getter, bool editable)
Undocumented in source. Be warned that the author may not have intended to support it.
addVariable
auto addVariable(string label, Type value, bool editable)
Undocumented in source. Be warned that the author may not have intended to support it.
addWidget
void addWidget(string label, Widget widget)

Add an arbitrary (optionally labeled) widget to the layout

addWindow
Window addWindow(Vector2i pos, string title)

Add a new top-level window

fixedSize
Vector2i fixedSize()

The current fixed size being used for newly added widgets.

groupFontName
string groupFontName()

The font name being used for group headers.

groupFontSize
int groupFontSize()

The size of the font being used for group headers.

labelFontName
string labelFontName()

The font name being used for labels.

labelFontSize
int labelFontSize()

The size of the font being used for labels.

refresh
void refresh()

Cause all widgets to re-synchronize with the underlying variable state

setFixedSize
void setFixedSize(Vector2i fw)

Specify a fixed size for newly added widgets.

setGroupFontName
void setGroupFontName(string name)

Sets the font name to be used for group headers.

setGroupFontSize
void setGroupFontSize(int value)

Sets the size of the font being used for group headers.

setLabelFontName
void setLabelFontName(string name)

Sets the font name being used for labels.

setLabelFontSize
void setLabelFontSize(int value)

Sets the size of the font being used for labels.

setWidgetFontSize
void setWidgetFontSize(int value)

Sets the size of the font being used for non-group / non-label widgets.

setWindow
void setWindow(Window window)

Set the active \ref Window instance.

widgetFontSize
int widgetFontSize()

The size of the font being used for non-group / non-label widgets.

window
Window window()

Access the currently active \ref Window instance

Variables

mFixedSize
Vector2i mFixedSize;

The fixed size for newly added widgets.

mGroupFontName
string mGroupFontName;

The group header font name.

mGroupFontSize
int mGroupFontSize;

The font size for group headers.

mLabelFontName
string mLabelFontName;

The label font name.

mLabelFontSize
int mLabelFontSize;

The font size for labels.

mLayout
AdvancedGridLayout mLayout;

A reference to the \ref nanogui::AdvancedGridLayout this FormHelper is using.

mPostGroupSpacing
int mPostGroupSpacing;

The spacing used **after** each group.

mPreGroupSpacing
int mPreGroupSpacing;

The spacing used **before** new groups.

mRefreshCallbacks
Array!(void delegate()) mRefreshCallbacks;

The callbacks associated with all widgets this FormHelper is managing.

mScreen
Screen mScreen;

A reference to the \ref nanogui::Screen this FormHelper is assisting.

mVariableSpacing
int mVariableSpacing;

The spacing between all other widgets.

mWidgetFontSize
int mWidgetFontSize;

The font size for non-group / non-label widgets.

mWindow
Window mWindow;

A reference to the \ref nanogui::Window this FormHelper is controlling.

Meta