38 #ifndef DOXYGEN_SHOULD_SKIP_THIS
111 using UIScroll =
Vector<
unsigned short, 2>;
343 UI(
const UI&) =
delete;
386 bool begin(
const std::string& title,
const RectF& bounds, UIWindowFlags flags =
None);
495 bool groupBegin(
const std::string& title, UIWindowFlags flags =
None);
789 bool sliderFloat(
float min,
float& val,
float max,
float step);
802 bool sliderInt(
int min,
int& val,
int max,
int step);
861 void propertyInt(
const std::string& name,
int min,
int& val,
int max,
int step,
float incPerPixel);
875 void propertyFloat(
const std::string& name,
float min,
float& val,
float max,
float step,
float incPerPixel);
889 void propertyDouble(
const std::string& name,
double min,
double& val,
double max,
double step,
float incPerPixel);
911 bool popupBegin(
UIPopup type,
const std::string& title, UIWindowFlags flags,
const RectF& bounds);
946 void combobox(
const std::vector<std::string>& items,
int& selected,
int itemHeight, Vector2f size);
959 void comboboxSeparator(
const std::string& itemsSeparatedBySeparator,
char separator,
int& selected,
int itemHeight, Vector2f size);
1058 bool contextualBegin(UIWindowFlags flags, Vector2f size,
const RectF& triggerBounds);
1107 void tooltip(
const std::string& text);
1276 void setState(State state);
1281 std::unique_ptr<UIImpl> m_impl;
1285 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1289 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1291 struct EnableBitmaskOperators<
UIWindow> {
1292 static constexpr bool value =
true;
The window's scrollbar can hide automatically.
void setPredefinedStyle(UIPredefinedStyle style)
Set a predefined style for all the windows and the widgets.
void popupClose()
Close a popup window.
The window can be moved by the user.
The row has a dynamic layout.
UI(const UI &)=delete
Deleted copy constructor.
The tree is a node, generally an internal node of the tree.
The row has a static layout.
void labelColored(const Color4f &color, StringRef title, UIAlignment align=UIAlignment::Left)
A label with colored text.
bool isWidgetHovered()
Check if the widget is hovered by the mouse.
UILayout
Layout property for rows.
Definition: UI.h:81
void tooltipEnd()
Finish a tooltip.
void comboEnd()
Finish a combo box.
The button is active once.
bool groupScrolledBegin(UIScroll &scroll, const std::string &title, UIWindowFlags flags=None)
Start a scrolled group.
void label(StringRef title, UIAlignment align=UIAlignment::Left)
A simple label with text.
static constexpr unsigned DefaultCharacterSize
The default size for the font.
Definition: UI.h:325
bool menuBeginSymbolLabel(UISymbol symbol, StringRef title, UIAlignment align, Vector2f size)
Start a menu with a symbol and a label.
bool comboBeginSymbol(UISymbol symbol, Vector2f size)
Start a combo box with a symbol.
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:65
UIPopup
Type of popup.
Definition: UI.h:155
bool contextualBegin(UIWindowFlags flags, Vector2f size, const RectF &triggerBounds)
Start a contextual window.
Define the states used for drawing to a RenderTarget.
Definition: RenderStates.h:82
void menubarBegin()
Start a menu bar.
Bitfield relying on an enumeration.
Definition: Flags.h:68
UIProgress
State of the progress bar.
Definition: UI.h:126
bool buttonLabel(StringRef title)
A button with a centered label.
The button is active as long as it is pressed.
UI(Font &font, unsigned characterSize=DefaultCharacterSize)
Constructor.
UIPredefinedStyle
A predefined style.
Definition: UI.h:164
void menuEnd()
Finish a menu.
Context for an immediate mode graphical interface.
Definition: UI.h:320
bool buttonColor(const Color4f &color)
A button with a color.
void processEvent(const Event &event)
Update the internal state with an event.
void layoutRow(UILayout format, float height, ArrayRef< float > ratio)
Array-based custom column layout.
bool buttonSymbol(UISymbol symbol)
A button with a symbol.
bool checkbox(StringRef title, bool &active)
A checkbox with a title.
The window is scalable by the user.
bool menuItemLabel(StringRef title, UIAlignment align=UIAlignment::Left)
A label inside the menu.
bool popupBegin(UIPopup type, const std::string &title, UIWindowFlags flags, const RectF &bounds)
Start a popup window.
void combobox(const std::vector< std::string > &items, int &selected, int itemHeight, Vector2f size)
A simple combo box with a list of item.
void buttonSetBehavior(UIButtonBehavior behavior)
Change the behavior of buttons.
bool colorPicker(Color4f &color)
A color picker.
bool radio(StringRef title, bool &active)
A radio button with a reference state.
void layoutRowStatic(float height, int itemWidth, int cols)
Static row with fixed column layout.
bool comboBeginLabel(StringRef selected, Vector2f size)
Start a combo box with a label.
Abstract base class for objects that can be drawn to a render window.
Definition: Drawable.h:79
void groupEnd()
Finish a group.
bool contextualItemLabel(StringRef title, UIAlignment align=UIAlignment::Left)
A label inside the contextual window.
bool sliderInt(int min, int &val, int max, int step)
A slider for an int value.
void labelWrapColored(const Color4f &color, StringRef title)
A label with colored text that can wrap.
The tree is a tabulation, generally the root of the tree.
bool comboBeginColor(const Color4f &color, Vector2f size)
Start a combo box with a color.
void separator(float height)
An empty separator.
UIAlignment
The alignment of the text.
Definition: UI.h:101
void contextualEnd()
Finish the contextual window.
UI & operator=(const UI &)=delete
Deleted copy assignment.
void menubarEnd()
Finish a menu bar.
void comboClose()
Close a combo box.
bool progress(std::size_t ¤t, std::size_t max, UIProgress modifyable=UIProgress::Modifyable)
A progress bar.
UIButtonBehavior
Behavior for buttons.
Definition: UI.h:117
bool treePush(UITree type, const std::string &title, UICollapse &state)
Start a tree layout.
bool groupBegin(const std::string &title, UIWindowFlags flags=None)
Start a group.
bool buttonSymbolLabel(UISymbol symbol, StringRef title, UIAlignment align=UIAlignment::Left)
A button with a symbol and a centered label.
The window can be closed with an icon in the header.
void layoutRowBegin(UILayout format, float height, int cols)
Start an immediate mode custom column layout.
void propertyFloat(const std::string &name, float min, float &val, float max, float step, float incPerPixel)
A property for a float.
A blue and light gray style.
A constant reference to an array and its size.
Definition: ArrayRef.h:41
bool menuBeginSymbol(const std::string &id, UISymbol symbol, Vector2f size)
Start a menu with a symbol.
A character font.
Definition: Font.h:130
virtual void draw(RenderTarget &target, RenderStates states) override
Draw the object to a render target.
The progress bar can be modified.
void menuClose()
Close a menu.
bool menuItemSymbolLabel(UISymbol symbol, StringRef title, UIAlignment align=UIAlignment::Left)
A symbol and a label inside the menu.
bool comboItemSymbolLabel(UISymbol symbol, StringRef title, UIAlignment align=UIAlignment::Left)
A symbol and a label inside the combo box.
UI & operator=(UI &&other)
Move assignment.
RectF getWidgetBounds()
Get the current widget bounds.
void labelWrap(StringRef title)
A simple label that can wrap.
void propertyDouble(const std::string &name, double min, double &val, double max, double step, float incPerPixel)
A property for a double.
void groupScrolledEnd()
Finish a scrolled group.
UICollapse
Collapse property of a tree.
Definition: UI.h:72
void layoutRowPush(float width)
Specify the width of the next column.
void layoutRowEnd()
Finish an immediate mode custom column layout.
UI(UI &&other)
Move constructor.
bool menuBeginLabel(StringRef title, UIAlignment align, Vector2f size)
Start a menu with a label.
bool sliderFloat(float min, float &val, float max, float step)
A slider for a float value.
The progress bar is fixed.
void comboboxSeparator(const std::string &itemsSeparatedBySeparator, char separator, int &selected, int itemHeight, Vector2f size)
A simple combo box with a string and a separator.
bool comboBeginSymbolLabel(UISymbol symbol, StringRef selected, Vector2f size)
Start a combo box with a symbol and a label.
bool buttonPushBehavior(UIButtonBehavior behavior)
Push a new behavior of buttons.
A constant reference to a string and its size.
Definition: StringRef.h:41
UISymbol
A representative symbol.
Definition: UI.h:135
The window is in the background.
constexpr NoneType None
Constant to represent "none".
Definition: Types.h:45
The window has no scrollbar.
bool buttonPopBehavior()
Pop the previous behavior of buttons.
void popupEnd()
Finish a popup window.
void treePop()
Finish a tree layout.
UITree
The type of tree.
Definition: UI.h:90
bool tooltipBegin(float width)
Start a tooltip.
void layoutRowDynamic(float height, int cols)
Dynamic row with fixed column layout.
bool selectableLabel(StringRef title, UIAlignment align, bool &value)
A selectable label.
bool begin(const std::string &title, const RectF &bounds, UIWindowFlags flags=None)
Create a window.
void contextualClose()
Close the contextual window.
Defines a system event and its parameters.
Definition: Event.h:115
#define GF_API
Definition: Portability.h:35
General purpose math vector.
Definition: Vector.h:60
void tooltip(const std::string &text)
A simple tooltip with a text.
UIWindow
Properties for windows and window-like elements.
Definition: UI.h:48
A dark gray and dark blue style.
bool checkboxFlags(StringRef title, unsigned &flags, unsigned value)
A checkbox with a title for flags.
bool comboItemLabel(StringRef title, UIAlignment align=UIAlignment::Left)
A label inside the combo box.
The window can be minimized with an icon in the header.
void end()
Finish a window.
void propertyInt(const std::string &name, int min, int &val, int max, int step, float incPerPixel)
A property for an integer.
bool contextualItemSymbolLabel(UISymbol symbol, StringRef title, UIAlignment align=UIAlignment::Left)
A symbol and a label inside the contextual window.
The window has a title in the header.
bool option(StringRef title, bool active)
A radio button without state.