40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
115 using UIScroll =
Vector<
unsigned short, 2>;
191 static const UIEditFlags
Box;
432 UI(
const UI&) =
delete;
475 bool begin(
const std::string& title,
const RectF& bounds, UIWindowFlags flags =
None);
587 bool groupBegin(
const std::string& title, UIWindowFlags flags =
None);
707 void image(
const Texture& texture,
const RectF& textureRect);
889 bool sliderFloat(
float min,
float& val,
float max,
float step);
902 bool sliderInt(
int min,
int& val,
int max,
int step);
961 void propertyInt(
const std::string& name,
int min,
int& val,
int max,
int step,
float incPerPixel);
975 void propertyFloat(
const std::string& name,
float min,
float& val,
float max,
float step,
float incPerPixel);
989 void propertyDouble(
const std::string& name,
double min,
double& val,
double max,
double step,
float incPerPixel);
1041 bool popupBegin(
UIPopup type,
const std::string& title, UIWindowFlags flags,
const RectF& bounds);
1076 void combobox(
const std::vector<std::string>& items,
int& selected,
int itemHeight, Vector2f size);
1089 void comboboxSeparator(
const std::string& itemsSeparatedBySeparator,
char separator,
int& selected,
int itemHeight, Vector2f size);
1188 bool contextualBegin(UIWindowFlags flags, Vector2f size,
const RectF& triggerBounds);
1237 void tooltip(
const std::string& text);
1406 void setState(State state);
1411 std::unique_ptr<UIImpl> m_impl;
1415 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1419 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1421 struct EnableBitmaskOperators<
UIWindow> {
1422 static constexpr bool value =
true;
1426 struct EnableBitmaskOperators<
UIEdit> {
1427 static constexpr bool value =
true;
1432 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:85
bool fileSelector(UIBrowser &browser, const std::string &title, const RectF &bounds)
File selector.
void tooltipEnd()
Finish a tooltip.
Edit widget is not active and is not being modified.
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:414
Edit widget is currently being modified.
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.
UIEditEvent
Properties for edit events.
Definition: UI.h:199
void image(const Texture &texture, const RectF &textureRect)
An image.
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:65
UIPopup
Type of popup.
Definition: UI.h:244
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
UIEditFilter
Filters for edit.
Definition: UI.h:219
UIProgress
State of the progress bar.
Definition: UI.h:130
bool buttonLabel(StringRef title)
A button with a centered label.
static const UIEditFlags Field
Definition: UI.h:190
The button is active as long as it is pressed.
UI(Font &font, unsigned characterSize=DefaultCharacterSize)
Constructor.
UIPredefinedStyle
A predefined style.
Definition: UI.h:253
void menuEnd()
Finish a menu.
Context for an immediate mode graphical interface.
Definition: UI.h:409
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.
Path currentPath
The current path for searching.
Definition: UI.h:236
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.
A reference to a modifiable buffer and its size.
Definition: BufferRef.h:43
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.
Edit widget has received an enter and lost focus.
void separator(float height)
An empty separator.
UIAlignment
The alignment of the text.
Definition: UI.h:105
A texture for colored images.
Definition: Texture.h:339
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.
static const UIEditFlags Box
Definition: UI.h:191
bool progress(std::size_t ¤t, std::size_t max, UIProgress modifyable=UIProgress::Modifyable)
A progress bar.
UIButtonBehavior
Behavior for buttons.
Definition: UI.h:121
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.
Data for file selector.
Definition: UI.h:235
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.
The namespace for gf classes.
Definition: Action.h:34
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:42
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.
static const UIEditFlags Simple
Definition: UI.h:189
static const UIEditFlags Editor
Definition: UI.h:192
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.
UIEditEventFlags edit(UIEditFlags flags, BufferRef< char > buffer, std::size_t &length, UIEditFilter filter=UIEditFilter::Default)
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:76
void layoutRowPush(float width)
Specify the width of the next column.
void layoutRowEnd()
Finish an immediate mode custom column layout.
UIEdit
Properties for edit widgets.
Definition: UI.h:159
UI(UI &&other)
Move constructor.
bool menuBeginLabel(StringRef title, UIAlignment align, Vector2f size)
Start a menu with a label.
Edit widget went from state inactive to state active.
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.
Predefined flags for edit.
Definition: UI.h:188
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:139
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:94
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:118
#define GF_API
Definition: Portability.h:35
void windowSetBounds(const RectF &bounds)
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:52
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.
Edit widget went from state active to state inactive.
Path selectedPath
The selected path.
Definition: UI.h:237
The window has a title in the header.
bool option(StringRef title, bool active)
A radio button without state.