Gorgon Game Engine
ComponentTemplate Class Referenceabstract

Defines an object according to the Box Model. More...

Inheritance diagram for ComponentTemplate:
[legend]

Public Types

enum  DataEffect {
  None, Text, Title, Label,
  ValueText1, ValueText2, ValueText3, ValueText4,
  State1Text, State2Text, State3Text, State4Text,
  AutoStart, AutoEnd, Icon, Icon1,
  Icon2, State1Icon, State2Icon, State3Icon,
  State4Icon
}
 Which property will the data of the widget affect. More...
 
enum  PositionType { Relative, AbsoluteSliding, Absolute, PolarAbsolute }
 Controls where the component will be placed. More...
 
enum  RepeatMode {
  NoRepeat, Minor, Major, XGrid,
  YGrid, XTick, YTick, XMinorGrid,
  YMinorGrid, XMajorGrid, YMajorGrid, XMinorTick,
  YMinorTick, XMajorTick, YMajorTick
}
 Some components are repeated along some axis, this property controls how they will be repeated. More...
 
enum  SizingMode { Fixed, Automatic, GrowOnly, ShrinkOnly }
 Controls how the size is affected from the contents of the object. More...
 
enum  Tag {
  NoTag, UnknownTag, TickTag, HScrollTag,
  VScrollTag, DragTag, SecondDragTag, DragBarTag,
  XDragTag, YDragTag, MinimapTag, IncrementTag,
  DecrementTag, LeftTag, RightTag, TopTag,
  BottomTag, ExpandTag, ToggleTag, ContentsTag,
  ViewPortTag, SelectionTag, CaretTag, ItemTag,
  HeaderTag, SpacerTag, ListTag
}
 Tags mark a component to be modified in a way meaningful to specific widgets. More...
 
enum  ValueModification {
  NoModification, ModifyPosition, ModifyX, ModifyY,
  ModifyAlpha, ModifyColor, BlendColor, ModifyRotation,
  ModifyAnimation, ModifySize, ModifyWidth, ModifyHeight,
  ModifyPositionAndSize, ModifyXAndWidth, ModifyXAndHeight, ModifyYAndWidth,
  ModifyYAndHeight
}
 Which property will the value of the widget affect. More...
 
enum  ValueSource {
  UseFirst, UseX, UseWidth, UseR,
  UseSecond, UseY, UseHeight, UseG,
  UseT, UseThird, UseZ, UseB,
  UseFourth, UseA, UseW, UseGray,
  UseL, UseH, UseC, UseTransition,
  ValueSourceMaxPower, UseXY, UseSize, UseRG,
  UseYZ, UseGB, UseXZ, UseRB,
  UseXW, UseRA, UseBA, UseGA,
  UseXYZ, UseRGB, UseRGA, UseRBA,
  UseGBA, UseLH, UseLC, UseCH,
  UseGrayAlpha, UseLCH, UseLCHA, UseRGBA
}
 Which data channels should be used as the value, common combinations are listed, however, all combinations are valid except when they are used for mouse mapping. More...
 

Public Member Functions

virtual ~ComponentTemplate ()
 Destructor. More...
 
int GetBaseline () const
 Returns the baseline. If set to 0, it will be detected automatically. More...
 
Point GetCenter () const
 Returns the center point that would be used for rotation. More...
 
bool GetClip () const
 Returns whether currently clipping the contents. More...
 
ComponentCondition GetCondition () const
 Returns the current component condition. More...
 
Anchor GetContainerAnchor () const
 Returns the anchor point of the container that this component will attach to. More...
 
DataEffect GetDataEffect () const
 Returns how the data will affect this component. More...
 
SizingMode GetHorizontalSizing () const
 Returns the horizontal sizing mode of the component. More...
 
Margin GetIndent () const
 Returns the current indent. More...
 
int GetIndex () const
 Returns the component index. More...
 
Margin GetMargin () const
 Returns the margin. More...
 
Anchor GetMyAnchor () const
 Returns the anchor point of this component. More...
 
Point GetPosition () const
 Returns the current position of the component. More...
 
PositionType GetPositioning () const
 Returns the positioning method of the component. More...
 
Anchor GetPreviousAnchor () const
 Returns the anchor point of the previous component that this component will attach to. More...
 
RepeatMode GetRepeatMode () const
 Returns the repeat mode of this component. More...
 
Size GetSize () const
 Returns the size of the component. More...
 
Tag GetTag () const
 Returns the tag of the component. More...
 
ComponentCondition GetTargetCondition () const
 Returns the target component condition. More...
 
virtual ComponentType GetType () const noexcept=0
 Returns the type of the component. More...
 
std::array< float, 4 > GetValueMax () const
 Returns the value scale maximum. More...
 
float GetValueMax (int channel) const
 Returns the value scale maximum. More...
 
std::array< float, 4 > GetValueMin () const
 Returns the value scale minimum. More...
 
float GetValueMin (int channel) const
 Returns the value scale minimum. More...
 
ValueModification GetValueModification () const
 Returns which property of this component will be modified by the value. More...
 
std::array< int, 4 > GetValueOrdering () const
 Returns the ordering of value channels. More...
 
std::array< float, 4 > GetValueRange () const
 Returns the range of the value scale. More...
 
float GetValueRange (int channel) const
 Returns the range of the value scale. More...
 
ValueSource GetValueSource () const
 Returns the value source that will be used. More...
 
SizingMode GetVerticalSizing () const
 Returns the horizontal sizing mode of the component. More...
 
bool IsReversible () const
 Returns whether this component transition can be reversed. More...
 
bool IsTransition () const
 Returns whether this component is a transition component. More...
 
void SetAnchor (Anchor previous, Anchor container, Anchor my)
 Changes the anchor of the component to the given values. More...
 
void SetBaseline (int value)
 Changes the baseline of the current component. If set to 0, it will be determined automatically. More...
 
void SetCenter (Dimension x, Dimension y)
 Changes the center coordinate that will be used in rotation. More...
 
void SetCenter (Geometry::Point pos, Dimension::Unit unit=Dimension::Pixel)
 Changes the center coordinate that will be used in rotation. More...
 
void SetCenter (int x, int y, Dimension::Unit unit=Dimension::Pixel)
 Changes the center coordinate that will be used in rotation. More...
 
void SetCenter (Point value)
 Changes the center coordinate that will be used in rotation. More...
 
void SetClip (bool value)
 Whether to clip the contents of this container, default value is false. More...
 
void SetCondition (ComponentCondition from, ComponentCondition to)
 Sets the condition when this component will be visible. This variant will create a transition condition. More...
 
void SetCondition (ComponentCondition value)
 Sets the condition when this component will be visible. More...
 
void SetDataEffect (DataEffect effect)
 Sets the data effect for this component. Default is None. More...
 
void SetIndent (Dimension hor, Dimension ver)
 Changes the indent of the component. More...
 
void SetIndent (Dimension left, Dimension top, Dimension right, Dimension bottom)
 Changes the indent of the component. More...
 
void SetIndent (Dimension value)
 Changes the indent of the component. More...
 
void SetIndent (Geometry::Margin value, Dimension::Unit unit=Dimension::Pixel)
 Changes the indent of the component. More...
 
void SetIndent (int hor, int ver, Dimension::Unit unit=Dimension::Pixel)
 Changes the indent of the component. More...
 
void SetIndent (int left, int top, int right, int bottom, Dimension::Unit unit=Dimension::Pixel)
 Changes the indent of the component. More...
 
void SetIndent (int value, Dimension::Unit unit=Dimension::Pixel)
 Changes the indent of the component. More...
 
void SetIndent (Margin value)
 Changes the indent of the component. More...
 
void SetIndex (int value)
 Changes the index of the current component. More...
 
void SetMargin (Dimension hor, Dimension ver)
 Changes the margin of the component. More...
 
void SetMargin (Dimension left, Dimension top, Dimension right, Dimension bottom)
 Changes the margin of the component. More...
 
void SetMargin (Dimension value)
 Changes the margin of the component. More...
 
void SetMargin (Geometry::Margin value, Dimension::Unit unit=Dimension::Pixel)
 Changes the margin of the component. More...
 
void SetMargin (int hor, int ver, Dimension::Unit unit=Dimension::Pixel)
 Changes the margin of the component. More...
 
void SetMargin (int left, int top, int right, int bottom, Dimension::Unit unit=Dimension::Pixel)
 Changes the margin of the component. More...
 
void SetMargin (int value, Dimension::Unit unit=Dimension::Pixel)
 Changes the margin of the component. More...
 
void SetMargin (Margin value)
 Changes the margin of the component. More...
 
void SetPosition (Dimension x, Dimension y)
 Changes the coordinates of the component to the given position. More...
 
void SetPosition (Geometry::Point pos, Dimension::Unit unit=Dimension::Pixel)
 Changes the coordinates of the component to the given position. More...
 
void SetPosition (int x, int y, Dimension::Unit unit=Dimension::Pixel)
 Changes the coordinates of the component to the given position. More...
 
void SetPosition (Point value)
 Changes the coordinates of the component to the given position. More...
 
void SetPositioning (PositionType value)
 Changes the positioning method of the component. More...
 
void SetRepeatMode (RepeatMode value)
 Changes the repeat mode of this component. More...
 
void SetReversible (bool value)
 Sets whether the component transition can be reversed. Can be used to simplify from - to - from animations. More...
 
void SetSize (Dimension w, Dimension h)
 Changes the size of the component. If sizing mode is automatic, it will be set to fixed. More...
 
void SetSize (Geometry::Size size, Dimension::Unit unit=Dimension::Pixel)
 Changes the size of the component. The given values are ignored if the sizing mode is Automatic. More...
 
void SetSize (int w, int h, Dimension::Unit unit=Dimension::Pixel)
 Changes the size of the component. The given values are ignored if the sizing mode is Automatic. More...
 
void SetSize (Size size)
 Changes the size of the component. If sizing mode is automatic, it will be set to fixed. More...
 
void SetSizing (SizingMode hor, SizingMode vert)
 Changes the sizing mode of the component. More...
 
void SetSizing (SizingMode value)
 Changes the sizing mode of the component. More...
 
void SetTag (Tag value)
 Changes the tag of this component. More...
 
void SetValueModification (ValueModification mod, ValueSource source=UseFirst, std::array< float, 4 > min={{0, 0, 0, 0}}, std::array< float, 4 > max={{1, 1, 1, 1}})
 Sets the property that will be affected by the value of the widget. More...
 
void SetValueOrdering (int first, int second, int third, int fourth)
 Changes the ordering of the values. This allows swaps like X-Y. You should specify which channel will receive which value. More...
 
void SetValueRange (int channel, float min, float max)
 Changes the data range, which scales the data effect on the component. More...
 
void SetValueRange (std::array< float, 4 > min, std::array< float, 4 > max)
 Changes the data range, which scales the data effect on the component. More...
 
void SetValueSource (ValueSource value)
 Returns the value source that will be used. More...
 

Public Attributes

Event< ComponentTemplateChangedEvent
 This event will be fired whenever any property is changed. More...
 

Protected Attributes

int baseline
 Manually set baseline for this component. When 0, it will not be effective. More...
 
Point center
 Center point for rotation. More...
 
bool clip
 If set to true, will clip the contents of the component to the bounds. More...
 
ComponentCondition condition
 Condition when this component will be visible. More...
 
ComponentCondition condition_to
 Condition when this component will be visible, setting condition_to will create a transition component. More...
 
Anchor container
 Anchor point of the container that this component will be attached to, if it is attaching to its parent. More...
 
DataEffect dataeffect
 The effect that the data will have on this component. More...
 
Margin indent
 Indent is added to the margin and padding on the edge of the container. More...
 
int index
 Component index. More...
 
Margin margin
 Margin around the object, will be collapsed with other object margins and padding. More...
 
Anchor my
 Anchor point of the current component. More...
 
Point position
 Position of the component. More...
 
PositionType positioning
 Positioning mode. More...
 
Anchor previous
 Anchor point of the previous component that this component will be attached to. More...
 
RepeatMode repeat
 Whether the component will be repeated along an axis. More...
 
bool reversible
 
Size size
 Size of the object. More...
 
SizingMode sizingh
 
SizingMode sizingw
 Sizing mode. More...
 
ValueSource source
 The value that will be used for this component. More...
 
Tag tag
 Tag identifies a component for various modifications depending on the widget. More...
 
std::array< float, 4 > valuemax
 
std::array< float, 4 > valuemin
 If required, can be used to scale incoming data. More...
 
ValueModification valuemod
 The property of the component that will be affected by the value. More...
 
std::array< int, 4 > valueordering
 Changes the ordering of the value source. More...
 

Detailed Description

Defines an object according to the Box Model.

Member Enumeration Documentation

◆ DataEffect

enum DataEffect

Which property will the data of the widget affect.

Enumerator
None 

Nothing will be affected.

Text 

Works only for TextholderTemplate, data will affect the text that is displayed.

Title 
Label 
ValueText1 
ValueText2 
ValueText3 
ValueText4 
State1Text 
State2Text 
State3Text 
State4Text 
AutoStart 
AutoEnd 
Icon 

Data will effect the displayed graphics.

Icon1 
Icon2 
State1Icon 
State2Icon 
State3Icon 
State4Icon 

◆ PositionType

Controls where the component will be placed.

Enumerator
Relative 

Component will be placed relative to the previous component.

AbsoluteSliding 

Absolute positioning, coordinates will start from the container, percent based movement will move to stay within the container.

If the component is filling the container, it cannot be moved.

Absolute 

Absolute positioning, coordinates will start from the container.

Percent based movement is relative to the size of the component.

PolarAbsolute 

The given coordinates are polar coordinates, The radius is given in pixels and angle is specified in degrees.

Parent's center point is used as pole. X component is used as radius and Y component is used as angle.

◆ RepeatMode

enum RepeatMode

Some components are repeated along some axis, this property controls how they will be repeated.

Use X direction if there is no direction. Y is the angular direction on polar systems. Repeated components will have their values set to the values specified by their position.

Enumerator
NoRepeat 
Minor 
Major 
XGrid 
YGrid 
XTick 
YTick 
XMinorGrid 
YMinorGrid 
XMajorGrid 
YMajorGrid 
XMinorTick 
YMinorTick 
XMajorTick 
YMajorTick 

◆ SizingMode

enum SizingMode

Controls how the size is affected from the contents of the object.

Enumerator
Fixed 

The given size is absolute, it is not affected by the contents.

Automatic 

Given size is not used, object is sized to its contents.

GrowOnly 

Given size is the minimum, if the contents are bigger, the object be resized to fit.

ShrinkOnly 

Given size is the maximum, if the contents are smaller, the object be resized.

◆ Tag

enum Tag

Tags mark a component to be modified in a way meaningful to specific widgets.

Components can be queried for their size and positions from the component stack using their tag.

Enumerator
NoTag 
UnknownTag 

Do not use this tag for regular components, it is used to identify substacks without a tag.

TickTag 
HScrollTag 
VScrollTag 
DragTag 
SecondDragTag 
DragBarTag 
XDragTag 
YDragTag 
MinimapTag 
IncrementTag 
DecrementTag 
LeftTag 
RightTag 
TopTag 
BottomTag 
ExpandTag 
ToggleTag 
ContentsTag 
ViewPortTag 
SelectionTag 
CaretTag 
ItemTag 
HeaderTag 
SpacerTag 
ListTag 

◆ ValueModification

Which property will the value of the widget affect.

It will be scaled between valuemin and valuemax.

Enumerator
NoModification 

Nothing will be modified.

ModifyPosition 

Position of this component will be affected by the data.

Data will be given as a percent and will modify Position property. Useful for sliders, scrollbars and progress bars. The direction of the container is used to determine which axis will get affected if only one channel is used.

ModifyX 

Modifies the X coordinate of the component regardless of the container direction.

ModifyY 

Modifies the Y coordinate of the component regardless of the container direction.

ModifyAlpha 

Value modifies the opacity of the component.

If used on a container, it will effect all components in that container

ModifyColor 

Value modifies the color of the component.

If used on a container, it will tint all components in that container

BlendColor 

In text and graphics templates, this setting will blend the color to target color.

If there is only one value source, all channels will be blended using the given factor. Two value sources will have separate blending factor RGB and A. Three sources will cause R, G, and B to have separate blender factors. A of the original color will be used. Four channels will have four separate blending factors.

ModifyRotation 

Data affects the rotation of the component.

Rotation angle will start from 0 degrees for 0, 360 degrees for 1. You may use min and max to modify this. For instance, if max is set to 0.5, the degrees will go up to 180. For now, this effect is not in use.

ModifyAnimation 

Data will affect the progress of the animation.

Will only work for Objects with animations.

ModifySize 

Size of this component will be affected.

Data will be given as a percent and will modify Size property. Useful for sliders and progress bars. The direction of the container is used to determine which axis will get affected.

ModifyWidth 

Width of this component will be affected.

Data will be given as a percent and will modify Size property. Useful for sliders and progress bars. The direction of the container is used to determine which axis will get affected.

ModifyHeight 

Height of this component will be affected.

Data will be given as a percent and will modify Size property. Useful for sliders and progress bars. The direction of the container is used to determine which axis will get affected.

ModifyPositionAndSize 

This is a combined modification of position and size.

Single channel will control the position along the orientation. Two channels will control position and size along the orientation. Three channels will control xy position and size along the orientation. Finally four channels will control every aspect of the component.

ModifyXAndWidth 

Modifies X position and width.

ModifyXAndHeight 

Modifies X position and height.

ModifyYAndWidth 

Modifies Y position and width.

ModifyYAndHeight 

Modifies Y position and height.

◆ ValueSource

Which data channels should be used as the value, common combinations are listed, however, all combinations are valid except when they are used for mouse mapping.

Only the values listed here that use two channels will work fully with mouse mapping. LCh is for circular La*b* color system. Color can also be mapped to coordinate system. Particularly, CH can be mapped to polar coordinates to create a color map. LCh color system is not yet working

Enumerator
UseFirst 
UseX 
UseWidth 
UseR 

Red or radius for polar coordinates.

UseSecond 
UseY 
UseHeight 
UseG 
UseT 

Theta for polar coordinates.

UseThird 
UseZ 
UseB 
UseFourth 
UseA 
UseW 
UseGray 

Grayscale value of color.

UseL 

Lightness.

UseH 

Hue.

UseC 

Chromacity.

UseTransition 

This channel will give the progress of a transition.

It will be set to 1 for non-transitional components. Use this channel alone, do not combine it with others.

ValueSourceMaxPower 

Maximum power of two.

UseXY 
UseSize 
UseRG 
UseYZ 
UseGB 
UseXZ 
UseRB 
UseXW 
UseRA 
UseBA 
UseGA 
UseXYZ 
UseRGB 
UseRGA 
UseRBA 
UseGBA 
UseLH 
UseLC 
UseCH 
UseGrayAlpha 
UseLCH 
UseLCHA 
UseRGBA 

Constructor & Destructor Documentation

◆ ~ComponentTemplate()

virtual ~ComponentTemplate ( )
virtual

Destructor.

Member Function Documentation

◆ GetBaseline()

int GetBaseline ( ) const

Returns the baseline. If set to 0, it will be detected automatically.

References ComponentTemplate::baseline.

◆ GetCenter()

Point GetCenter ( ) const

Returns the center point that would be used for rotation.

References ComponentTemplate::center.

◆ GetClip()

bool GetClip ( ) const

Returns whether currently clipping the contents.

References ComponentTemplate::clip.

◆ GetCondition()

ComponentCondition GetCondition ( ) const

Returns the current component condition.

References ComponentTemplate::condition.

◆ GetContainerAnchor()

Anchor GetContainerAnchor ( ) const

Returns the anchor point of the container that this component will attach to.

This value will be used if this component attaches to its container.

References ComponentTemplate::container.

◆ GetDataEffect()

DataEffect GetDataEffect ( ) const

Returns how the data will affect this component.

References ComponentTemplate::dataeffect.

◆ GetHorizontalSizing()

SizingMode GetHorizontalSizing ( ) const

Returns the horizontal sizing mode of the component.

References ComponentTemplate::sizingw.

◆ GetIndent()

Margin GetIndent ( ) const

Returns the current indent.

References ComponentTemplate::indent.

◆ GetIndex()

int GetIndex ( ) const

Returns the component index.

References ComponentTemplate::index.

◆ GetMargin()

Margin GetMargin ( ) const

Returns the margin.

References ComponentTemplate::margin.

◆ GetMyAnchor()

Anchor GetMyAnchor ( ) const

Returns the anchor point of this component.

References ComponentTemplate::my.

◆ GetPosition()

Point GetPosition ( ) const

Returns the current position of the component.

This value is not absolute final position as it cannot be determined before the component is rendered in a widget.

References ComponentTemplate::position.

◆ GetPositioning()

PositionType GetPositioning ( ) const

Returns the positioning method of the component.

References ComponentTemplate::positioning.

◆ GetPreviousAnchor()

Anchor GetPreviousAnchor ( ) const

Returns the anchor point of the previous component that this component will attach to.

This value will be used if this component attaches to another of its siblings.

References ComponentTemplate::previous.

◆ GetRepeatMode()

RepeatMode GetRepeatMode ( ) const

Returns the repeat mode of this component.

References ComponentTemplate::repeat.

◆ GetSize()

Size GetSize ( ) const

Returns the size of the component.

This value is not absolute final size as it cannot be determined before the component is rendered in a widget.

References ComponentTemplate::size.

◆ GetTag()

Tag GetTag ( ) const

Returns the tag of the component.

References ComponentTemplate::tag.

◆ GetTargetCondition()

ComponentCondition GetTargetCondition ( ) const

Returns the target component condition.

References ComponentTemplate::condition_to.

◆ GetType()

virtual ComponentType GetType ( ) const
pure virtualnoexcept

Returns the type of the component.

Implemented in ContainerTemplate, GraphicsTemplate, TextholderTemplate, IgnoredTemplate, and PlaceholderTemplate.

◆ GetValueMax() [1/2]

std::array<float, 4> GetValueMax ( ) const

Returns the value scale maximum.

References ComponentTemplate::valuemax.

◆ GetValueMax() [2/2]

float GetValueMax ( int  channel) const

Returns the value scale maximum.

References ASSERT, and ComponentTemplate::valuemax.

◆ GetValueMin() [1/2]

std::array<float, 4> GetValueMin ( ) const

Returns the value scale minimum.

References ComponentTemplate::valuemin.

◆ GetValueMin() [2/2]

float GetValueMin ( int  channel) const

Returns the value scale minimum.

References ASSERT, and ComponentTemplate::valuemin.

◆ GetValueModification()

ValueModification GetValueModification ( ) const

Returns which property of this component will be modified by the value.

References ComponentTemplate::valuemod.

◆ GetValueOrdering()

std::array<int, 4> GetValueOrdering ( ) const

Returns the ordering of value channels.

References ComponentTemplate::valueordering.

◆ GetValueRange() [1/2]

std::array<float, 4> GetValueRange ( ) const

Returns the range of the value scale.

References ComponentTemplate::valuemax, and ComponentTemplate::valuemin.

◆ GetValueRange() [2/2]

float GetValueRange ( int  channel) const

Returns the range of the value scale.

References ASSERT, ComponentTemplate::valuemax, and ComponentTemplate::valuemin.

◆ GetValueSource()

ValueSource GetValueSource ( ) const

Returns the value source that will be used.

References ComponentTemplate::source.

◆ GetVerticalSizing()

SizingMode GetVerticalSizing ( ) const

Returns the horizontal sizing mode of the component.

References ComponentTemplate::sizingh.

◆ IsReversible()

bool IsReversible ( ) const

Returns whether this component transition can be reversed.

References ComponentTemplate::reversible.

◆ IsTransition()

bool IsTransition ( ) const

Returns whether this component is a transition component.

References ComponentTemplate::condition_to, and Gorgon::UI::None.

◆ SetAnchor()

void SetAnchor ( Anchor  previous,
Anchor  container,
Anchor  my 
)

Changes the anchor of the component to the given values.

References ComponentTemplate::ChangedEvent, ComponentTemplate::container, ComponentTemplate::my, and ComponentTemplate::previous.

◆ SetBaseline()

void SetBaseline ( int  value)

Changes the baseline of the current component. If set to 0, it will be determined automatically.

References ComponentTemplate::baseline, and ComponentTemplate::ChangedEvent.

◆ SetCenter() [1/4]

void SetCenter ( Dimension  x,
Dimension  y 
)

Changes the center coordinate that will be used in rotation.

References ComponentTemplate::center, and ComponentTemplate::ChangedEvent.

◆ SetCenter() [2/4]

void SetCenter ( Geometry::Point  pos,
Dimension::Unit  unit = Dimension::Pixel 
)

Changes the center coordinate that will be used in rotation.

References ComponentTemplate::center, ComponentTemplate::ChangedEvent, basic_Point< T_ >::X, and basic_Point< T_ >::Y.

◆ SetCenter() [3/4]

void SetCenter ( int  x,
int  y,
Dimension::Unit  unit = Dimension::Pixel 
)

Changes the center coordinate that will be used in rotation.

References ComponentTemplate::center, and ComponentTemplate::ChangedEvent.

◆ SetCenter() [4/4]

void SetCenter ( Point  value)

Changes the center coordinate that will be used in rotation.

References ComponentTemplate::center, and ComponentTemplate::ChangedEvent.

◆ SetClip()

void SetClip ( bool  value)

Whether to clip the contents of this container, default value is false.

Due to shadows, it is advicable not to set clipping on the outer most container. Activating clipping creates a new layer for the component, requiring additional memory. If clipping is on, a component cannot be drawn more than once in different containers.

References ComponentTemplate::clip.

◆ SetCondition() [1/2]

void SetCondition ( ComponentCondition  from,
ComponentCondition  to 
)

Sets the condition when this component will be visible. This variant will create a transition condition.

References ComponentTemplate::ChangedEvent, ComponentTemplate::condition, and ComponentTemplate::condition_to.

◆ SetCondition() [2/2]

void SetCondition ( ComponentCondition  value)

Sets the condition when this component will be visible.

The visibility also depens on whether there are other visible components at the same component index. If that is the case, most specific condition will be rendered.

References ComponentTemplate::ChangedEvent, ComponentTemplate::condition, ComponentTemplate::condition_to, and Gorgon::UI::None.

◆ SetDataEffect()

void SetDataEffect ( DataEffect  effect)

Sets the data effect for this component. Default is None.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::dataeffect.

◆ SetIndent() [1/8]

void SetIndent ( Dimension  hor,
Dimension  ver 
)

Changes the indent of the component.

Indent is added to the margin if the component is at the edge of the container.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::indent.

◆ SetIndent() [2/8]

void SetIndent ( Dimension  left,
Dimension  top,
Dimension  right,
Dimension  bottom 
)

Changes the indent of the component.

Indent is added to the margin if the component is at the edge of the container.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::indent.

◆ SetIndent() [3/8]

void SetIndent ( Dimension  value)

Changes the indent of the component.

Indent is added to the margin if the component is at the edge of the container.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::indent.

◆ SetIndent() [4/8]

void SetIndent ( Geometry::Margin  value,
Dimension::Unit  unit = Dimension::Pixel 
)

Changes the indent of the component.

Indent is added to the margin if the component is at the edge of the container.

References basic_Margin< T_ >::Bottom, ComponentTemplate::ChangedEvent, ComponentTemplate::indent, basic_Margin< T_ >::Left, basic_Margin< T_ >::Right, and basic_Margin< T_ >::Top.

◆ SetIndent() [5/8]

void SetIndent ( int  hor,
int  ver,
Dimension::Unit  unit = Dimension::Pixel 
)

Changes the indent of the component.

Indent is added to the margin if the component is at the edge of the container.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::indent.

◆ SetIndent() [6/8]

void SetIndent ( int  left,
int  top,
int  right,
int  bottom,
Dimension::Unit  unit = Dimension::Pixel 
)

Changes the indent of the component.

Indent is added to the margin if the component is at the edge of the container.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::indent.

◆ SetIndent() [7/8]

void SetIndent ( int  value,
Dimension::Unit  unit = Dimension::Pixel 
)

Changes the indent of the component.

Indent is added to the margin if the component is at the edge of the container.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::indent.

◆ SetIndent() [8/8]

void SetIndent ( Margin  value)

Changes the indent of the component.

Indent is added to the margin if the component is at the edge of the container.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::indent.

◆ SetIndex()

void SetIndex ( int  value)

Changes the index of the current component.

Only one component can be rendered at an index which is determined by the component condition. See component indexing for more information.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::index.

◆ SetMargin() [1/8]

void SetMargin ( Dimension  hor,
Dimension  ver 
)

Changes the margin of the component.

Margin is the minimum spacing around the component. Negative margin is possible and will always be subtracted from the other component's margin.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::margin.

◆ SetMargin() [2/8]

void SetMargin ( Dimension  left,
Dimension  top,
Dimension  right,
Dimension  bottom 
)

Changes the margin of the component.

Margin is the minimum spacing around the component. Negative margin is possible and will always be subtracted from the other component's margin.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::margin.

◆ SetMargin() [3/8]

void SetMargin ( Dimension  value)

Changes the margin of the component.

Margin is the minimum spacing around the component. Negative margin is possible and will always be subtracted from the other component's margin.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::margin.

◆ SetMargin() [4/8]

void SetMargin ( Geometry::Margin  value,
Dimension::Unit  unit = Dimension::Pixel 
)

Changes the margin of the component.

Margin is the minimum spacing around the component. Negative margin is possible and will always be subtracted from the other component's margin.

References basic_Margin< T_ >::Bottom, ComponentTemplate::ChangedEvent, basic_Margin< T_ >::Left, ComponentTemplate::margin, basic_Margin< T_ >::Right, and basic_Margin< T_ >::Top.

◆ SetMargin() [5/8]

void SetMargin ( int  hor,
int  ver,
Dimension::Unit  unit = Dimension::Pixel 
)

Changes the margin of the component.

Margin is the minimum spacing around the component. Negative margin is possible and will always be subtracted from the other component's margin.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::margin.

◆ SetMargin() [6/8]

void SetMargin ( int  left,
int  top,
int  right,
int  bottom,
Dimension::Unit  unit = Dimension::Pixel 
)

Changes the margin of the component.

Margin is the minimum spacing around the component. Negative margin is possible and will always be subtracted from the other component's margin.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::margin.

◆ SetMargin() [7/8]

void SetMargin ( int  value,
Dimension::Unit  unit = Dimension::Pixel 
)

Changes the margin of the component.

Margin is the minimum spacing around the component. Negative margin is possible and will always be subtracted from the other component's margin.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::margin.

◆ SetMargin() [8/8]

void SetMargin ( Margin  value)

Changes the margin of the component.

Margin is the minimum spacing around the component. Negative margin is possible and will always be subtracted from the other component's margin.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::margin.

◆ SetPosition() [1/4]

void SetPosition ( Dimension  x,
Dimension  y 
)

Changes the coordinates of the component to the given position.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::position.

◆ SetPosition() [2/4]

void SetPosition ( Geometry::Point  pos,
Dimension::Unit  unit = Dimension::Pixel 
)

Changes the coordinates of the component to the given position.

References ComponentTemplate::ChangedEvent, ComponentTemplate::position, basic_Point< T_ >::X, and basic_Point< T_ >::Y.

◆ SetPosition() [3/4]

void SetPosition ( int  x,
int  y,
Dimension::Unit  unit = Dimension::Pixel 
)

Changes the coordinates of the component to the given position.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::position.

◆ SetPosition() [4/4]

void SetPosition ( Point  value)

Changes the coordinates of the component to the given position.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::position.

◆ SetPositioning()

void SetPositioning ( PositionType  value)

Changes the positioning method of the component.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::positioning.

◆ SetRepeatMode()

void SetRepeatMode ( RepeatMode  value)

Changes the repeat mode of this component.

If the consumer of the component does not know about this repeat mode, this component will be ignored

References ComponentTemplate::ChangedEvent, and ComponentTemplate::repeat.

◆ SetReversible()

void SetReversible ( bool  value)

Sets whether the component transition can be reversed. Can be used to simplify from - to - from animations.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::reversible.

◆ SetSize() [1/4]

void SetSize ( Dimension  w,
Dimension  h 
)

Changes the size of the component. If sizing mode is automatic, it will be set to fixed.

References ComponentTemplate::SetSize().

◆ SetSize() [2/4]

void SetSize ( Geometry::Size  size,
Dimension::Unit  unit = Dimension::Pixel 
)

Changes the size of the component. The given values are ignored if the sizing mode is Automatic.

References basic_Size< T_ >::Height, ComponentTemplate::SetSize(), ComponentTemplate::size, and basic_Size< T_ >::Width.

◆ SetSize() [3/4]

void SetSize ( int  w,
int  h,
Dimension::Unit  unit = Dimension::Pixel 
)

Changes the size of the component. The given values are ignored if the sizing mode is Automatic.

References ComponentTemplate::SetSize().

◆ SetSize() [4/4]

void SetSize ( Size  size)

◆ SetSizing() [1/2]

void SetSizing ( SizingMode  hor,
SizingMode  vert 
)

Changes the sizing mode of the component.

References ComponentTemplate::ChangedEvent, ComponentTemplate::sizingh, and ComponentTemplate::sizingw.

◆ SetSizing() [2/2]

void SetSizing ( SizingMode  value)

Changes the sizing mode of the component.

References ComponentTemplate::ChangedEvent, ComponentTemplate::sizingh, and ComponentTemplate::sizingw.

◆ SetTag()

void SetTag ( Tag  value)

Changes the tag of this component.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::tag.

◆ SetValueModification()

void SetValueModification ( ValueModification  mod,
ValueSource  source = UseFirst,
std::array< float, 4 >  min = {{0, 0, 0, 0}},
std::array< float, 4 >  max = {{1, 1, 1, 1}} 
)

Sets the property that will be affected by the value of the widget.

Default is NoModification. If min and max is specified incoming value will be scaled accordingly.

◆ SetValueOrdering()

void SetValueOrdering ( int  first,
int  second,
int  third,
int  fourth 
)

Changes the ordering of the values. This allows swaps like X-Y. You should specify which channel will receive which value.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::valueordering.

◆ SetValueRange() [1/2]

void SetValueRange ( int  channel,
float  min,
float  max 
)

Changes the data range, which scales the data effect on the component.

Not all effects are affected by the range.

References ASSERT, ComponentTemplate::ChangedEvent, ComponentTemplate::valuemax, and ComponentTemplate::valuemin.

◆ SetValueRange() [2/2]

void SetValueRange ( std::array< float, 4 >  min,
std::array< float, 4 >  max 
)

Changes the data range, which scales the data effect on the component.

Not all effects are affected by the range.

References ComponentTemplate::ChangedEvent, ComponentTemplate::valuemax, and ComponentTemplate::valuemin.

◆ SetValueSource()

void SetValueSource ( ValueSource  value)

Returns the value source that will be used.

References ComponentTemplate::ChangedEvent, and ComponentTemplate::source.

Member Data Documentation

◆ baseline

int baseline
protected

Manually set baseline for this component. When 0, it will not be effective.

◆ center

Point center
protected

Center point for rotation.

◆ ChangedEvent

Event<ComponentTemplate> ChangedEvent

This event will be fired whenever any property is changed.

Can be used to update widget automatically.

◆ clip

bool clip
protected

If set to true, will clip the contents of the component to the bounds.

◆ condition

ComponentCondition condition
protected

Condition when this component will be visible.

◆ condition_to

ComponentCondition condition_to
protected

Condition when this component will be visible, setting condition_to will create a transition component.

◆ container

Anchor container
protected

Anchor point of the container that this component will be attached to, if it is attaching to its parent.

◆ dataeffect

DataEffect dataeffect
protected

The effect that the data will have on this component.

◆ indent

Margin indent
protected

Indent is added to the margin and padding on the edge of the container.

◆ index

int index
protected

Component index.

Only one component can exist for a specific index position. The ordering and visibility of the components will be determined from the condition. Components will be laid out according to this index. Z-ordering is performed using the order of components in container.

◆ margin

Margin margin
protected

Margin around the object, will be collapsed with other object margins and padding.

◆ my

Anchor my
protected

Anchor point of the current component.

This point will be matched to the previous component's anchor point

◆ position

Point position
protected

Position of the component.

◆ positioning

PositionType positioning
protected

Positioning mode.

◆ previous

Anchor previous
protected

Anchor point of the previous component that this component will be attached to.

If the component positioning is absolute or this is the first component, it will be anchored to the container and parent anchor point will be used.

◆ repeat

RepeatMode repeat
protected

Whether the component will be repeated along an axis.

If an item will

◆ reversible

bool reversible
protected

◆ size

Size size
protected

Size of the object.

◆ sizingh

SizingMode sizingh
protected

◆ sizingw

SizingMode sizingw
protected

Sizing mode.

◆ source

ValueSource source
protected

The value that will be used for this component.

◆ tag

Tag tag
protected

Tag identifies a component for various modifications depending on the widget.

◆ valuemax

std::array<float, 4> valuemax
protected

◆ valuemin

std::array<float, 4> valuemin
protected

If required, can be used to scale incoming data.

◆ valuemod

ValueModification valuemod
protected

The property of the component that will be affected by the value.

◆ valueordering

std::array<int, 4> valueordering
protected

Changes the ordering of the value source.


The documentation for this class was generated from the following file: