![]() |
Gorgon Game Engine
|
This namespace contains User interface related functionality. More...
Namespaces | |
internal | |
Organizers | |
This namespace contains organizers that manage the location of the widgets in a container automatically. | |
Classes | |
class | Component |
This class is an instance of a component. More... | |
class | ComponentStack |
Component stack is the backbone of a widget. More... | |
class | ComponentStackWidget |
This class acts as a widget base that uses component stack to handle rendering, resizing and other operations. More... | |
class | ComponentStorage |
This class stores component related data. More... | |
class | ComponentTemplate |
Defines an object according to the Box Model. More... | |
class | ContainerTemplate |
Container class that defines an area according to the Box Model. More... | |
class | ConversionValidator |
Accepts all input and tries to convert using in-library functions. More... | |
class | Dimension |
Dimension data for components. Allows relative position and sizing. More... | |
struct | ExtenderRequestResponse |
This structure is used to transfer extender request response. More... | |
class | GraphicsTemplate |
Defines a visual component. More... | |
class | IgnoredTemplate |
This component type will be ignored by ComponentStack, effectively erasing Always when necessary. More... | |
class | LayerAdapter |
This class turns a layer into a widget container. More... | |
class | PlaceholderTemplate |
Defines a placeholder according to the Box Model. More... | |
class | RadioControl |
This class is designed to turn any group of two state widgets to a radio button group, only allowing one of them to be checked at the same time. More... | |
class | Template |
This class stores visual information about a widget template. More... | |
class | TextholderTemplate |
Textholder is designed to hold text data. More... | |
class | TwoStateControl |
This class is designed to be the interface class for all checkbox like UI elements. More... | |
class | VisualProvider |
class | Widget |
This class is the base for all widgets. More... | |
class | WidgetContainer |
This class is the base class for all widget containers. More... | |
class | Window |
UI window allows programmers to create an OS window that will accept widgets and has the ability to run by its own. More... | |
Typedefs | |
using | Margin = Geometry::basic_Margin< Dimension > |
This class stores the margin information for a box object. More... | |
using | Point = Geometry::basic_Point< Dimension > |
This class stores the location information for a box object. More... | |
using | Size = Geometry::basic_Size< Dimension > |
This class stores the size information for a box object. More... | |
Functions | |
int | calculatemargin (int l, int r) |
Geometry::Margin | Convert (const Margin &m, const Geometry::Size &parent, int emwidth=10) |
Converts a dimension based margin to pixel based margin. More... | |
Geometry::Point | Convert (const Point &p, const Geometry::Size &parent, int emwidth=10) |
Converts a dimension based point to pixel based point. More... | |
Geometry::Size | Convert (const Size &s, const Geometry::Size &parent, int emwidth=10) |
Converts a dimension based size to pixel based size. More... | |
void | Initialize (float density, int min=9) |
Initializes the UI system. More... | |
void | Initialize (std::string fontname="", float density=7.5, int min=9) |
Initializes the UI system. More... | |
bool | IsBottom (Anchor a) |
Returns if the given anchor is at bottom. More... | |
bool | IsCenter (Anchor a) |
Returns if an anchor is centered horizontally. More... | |
bool | IsIn (Anchor left, Anchor right) |
bool | IsLeft (Anchor a) |
Returns if an anchor is on the left. More... | |
bool | IsMiddle (Anchor a) |
Returns if the given anchor is at middle vertically. More... | |
bool | IsMouseRelated (ComponentCondition condition) |
Returns if the given condition is related to mouse events. More... | |
bool | IsRight (Anchor a) |
Returns if an anchor is on the right. More... | |
bool | IsTop (Anchor a) |
Returns if the given anchor is at top. More... | |
ComponentTemplate::ValueSource | operator| (ComponentTemplate::ValueSource l, ComponentTemplate::ValueSource r) |
Variables | |
Widgets::Generator * | generator |
This namespace contains User interface related functionality.
This namespace does not contain the actual widgets that can be used. For that purpose, use Gorgon::Widgets namespace.
using Margin = Geometry::basic_Margin<Dimension> |
This class stores the margin information for a box object.
using Point = Geometry::basic_Point<Dimension> |
This class stores the location information for a box object.
using Size = Geometry::basic_Size<Dimension> |
This class stores the size information for a box object.
enum Anchor |
Anchor position.
enum ComponentCondition |
Controls the condition when the components are visible.
Components with the same ID will replace a previous one. If there is a condition that is satisfied, the component at the specific index will be replaced with that one, otherwise, if a component with condition always exists, it will be used.
Enumerator | |
---|---|
Always | Component is always active. |
Never | Component is always disabled. |
None | This anchor position should is only used to denote object will not be anchored to a previous object, only to its parent. If used as parent anchor it will be ignored and default anchor will be used instead. This should be paired with absolute positioning. |
Disabled | Component is visible when the widget is disabled. |
Readonly | Component is visible when the widget is readonly. |
Focused | Widget has the focus. |
Hover | Mouse is over the widget, or over a particular repeat. |
Down | This is activated when the mouse is pressed on the component stack. However, it can be activated in cases when activation key is pressed. |
State2 | Second state of the widget, first state is Always. |
State3 | Third state of the widget, first state is Always. |
State4 | Fourth state of the widget, first state is Always. |
Opened | This condition is triggered when the widget is opened like a combobox showing its list part. For widgets which are "opened" by default like window, this condition will never be satisfied. Instead of this condition, use Always for the base state. |
Closed | This condition is triggered when the widget is closed like a tree view item that is folded, or a window that is rolled. For widgets which are "closed" by default, like combobox, this condition will never be satisfied. Instead of this condition, use Always for the base state. |
Reversed | For widgets that can have reversed state. When dropdown will open above, this will be set. |
Odd | In lists denotes the item is in odd position. |
Even | In lists denotes the item is in even position. |
First | In a list this denotes the item is at the first place. |
Middle | In a list this denotes the item is somewhere in the middle. |
Last | In a list this denotes the item is at the last place. |
Alone | In a list this denotes the item alone. |
Active | This is for widgets that can be activated, like a count down timer. |
HScroll | There is space horizontally to be scrolled. |
VScroll | There is space vertically to be scrolled. |
HVScroll | There is space both horizontally and vertically to be scrolled. |
Ch1V0 | Channel 1 value is 0, the value will be rounded to 4 decimal points before comparison. |
Ch1V05 | Channel 1 value is 0.5, the value will be rounded to 4 decimal points before comparison. |
Ch1V1 | Channel 1 value is 1, the value will be rounded to 4 decimal points before comparison. |
Ch2V0 | Channel 2 value is 0, the value will be rounded to 4 decimal points before comparison. |
Ch2V05 | Channel 2 value is 0.5, the value will be rounded to 4 decimal points before comparison. |
Ch2V1 | Channel 2 value is 1, the value will be rounded to 4 decimal points before comparison. |
Ch3V0 | Channel 3 value is 0, the value will be rounded to 4 decimal points before comparison. |
Ch3V05 | Channel 3 value is 0.5, the value will be rounded to 4 decimal points before comparison. |
Ch3V1 | Channel 3 value is 1, the value will be rounded to 4 decimal points before comparison. |
Ch4V0 | Channel 4 value is 0, the value will be rounded to 4 decimal points before comparison. |
Ch4V05 | Channel 4 value is 0.5, the value will be rounded to 4 decimal points before comparison. |
Ch4V1 | Channel 4 value is 1, the value will be rounded to 4 decimal points before comparison. |
Default | This widget is the default widget of its container. |
Cancel | This widget is the cancel widget of its container. |
DataEffectStart | Do not use this value. |
TextIsSet | Data effect of the component is set. |
TitleIsSet | Data effect of the component is set. |
LabelIsSet | Data effect of the component is set. |
ValueText1IsSet | Data effect of the component is set. |
ValueText2IsSet | Data effect of the component is set. |
ValueText3IsSet | Data effect of the component is set. |
ValueText4IsSet | Data effect of the component is set. |
State1TextIsSet | Data effect of the component is set. |
State2TextIsSet | Data effect of the component is set. |
State3TextIsSet | Data effect of the component is set. |
State4TextIsSet | Data effect of the component is set. |
Icon1IsSet | Data effect of the component is set. |
Icon2IsSet | Data effect of the component is set. |
StateIcon1IsSet | Data effect of the component is set. |
StateIcon2IsSet | Data effect of the component is set. |
StateIcon3IsSet | Data effect of the component is set. |
StateIcon4IsSet | Data effect of the component is set. |
Max | Do not use this condition, this is to size the arrays. |
enum ComponentType |
int Gorgon::UI::calculatemargin | ( | int | l, |
int | r | ||
) |
Geometry::Margin Gorgon::UI::Convert | ( | const Margin & | m, |
const Geometry::Size & | parent, | ||
int | emwidth = 10 |
||
) |
Converts a dimension based margin to pixel based margin.
References basic_Margin< T_ >::Bottom, basic_Size< T_ >::Height, basic_Margin< T_ >::Left, basic_Margin< T_ >::Right, basic_Margin< T_ >::Top, and basic_Size< T_ >::Width.
Geometry::Point Gorgon::UI::Convert | ( | const Point & | p, |
const Geometry::Size & | parent, | ||
int | emwidth = 10 |
||
) |
Converts a dimension based point to pixel based point.
References basic_Size< T_ >::Height, basic_Size< T_ >::Width, basic_Point< T_ >::X, and basic_Point< T_ >::Y.
Geometry::Size Gorgon::UI::Convert | ( | const Size & | s, |
const Geometry::Size & | parent, | ||
int | emwidth = 10 |
||
) |
Converts a dimension based size to pixel based size.
References basic_Size< T_ >::Height, and basic_Size< T_ >::Width.
void Gorgon::UI::Initialize | ( | float | density, |
int | min = 9 |
||
) |
Initializes the UI system.
Creates a simple widget template generator based on the primary monitor resolution. Density controls the size of the widgets. Increased density leads to smaller widgets. 7.5 leads to 12pt/16px on a FullHD monitor. This is a very relaxed and easy to use and read size. 10 is more or less standard density.
References Initialize().
void Initialize | ( | std::string | fontname = "" , |
float | density = 7.5 , |
||
int | min = 9 |
||
) |
Initializes the UI system.
Creates a simple widget template generator based on the primary monitor resolution. Density controls the size of the widgets. Increased density leads to smaller widgets. 7.5 leads to 12pt/16px on a FullHD monitor. This is a very relaxed and easy to use and read size. 10 is more or less standard density.
References generator, and Monitor::Primary().
bool Gorgon::UI::IsBottom | ( | Anchor | a | ) |
Returns if the given anchor is at bottom.
References BottomCenter, BottomLeft, BottomRight, LastBaselineLeft, and LastBaselineRight.
bool Gorgon::UI::IsCenter | ( | Anchor | a | ) |
Returns if an anchor is centered horizontally.
References BottomCenter, MiddleCenter, and TopCenter.
References IsBottom(), IsCenter(), IsLeft(), IsMiddle(), IsRight(), and IsTop().
bool Gorgon::UI::IsLeft | ( | Anchor | a | ) |
Returns if an anchor is on the left.
References BottomLeft, FirstBaselineLeft, LastBaselineLeft, MiddleLeft, and TopLeft.
bool Gorgon::UI::IsMiddle | ( | Anchor | a | ) |
Returns if the given anchor is at middle vertically.
References MiddleCenter, MiddleLeft, and MiddleRight.
bool Gorgon::UI::IsMouseRelated | ( | ComponentCondition | condition | ) |
bool Gorgon::UI::IsRight | ( | Anchor | a | ) |
Returns if an anchor is on the right.
References BottomRight, FirstBaselineRight, LastBaselineRight, MiddleRight, and TopRight.
bool Gorgon::UI::IsTop | ( | Anchor | a | ) |
Returns if the given anchor is at top.
References FirstBaselineLeft, FirstBaselineRight, TopCenter, TopLeft, and TopRight.
ComponentTemplate::ValueSource Gorgon::UI::operator| | ( | ComponentTemplate::ValueSource | l, |
ComponentTemplate::ValueSource | r | ||
) |
Widgets::Generator* generator |