Gorgon Game Engine
ContainerTemplate Class Reference

Container class that defines an area according to the Box Model. More...

Inheritance diagram for ContainerTemplate:
[legend]

Public Member Functions

ContainerTemplateAddIndex (int componentindex)
 Adds an index to the container. More...
 
Geometry::Margin GetBorderSize () const
 Returns the border size. More...
 
int GetCount () const
 Returns the number of component indices stored in this container. More...
 
Graphics::Orientation GetOrientation () const
 Returns the current orientation of the container. More...
 
Geometry::Margin GetOverlayExtent () const
 Returns the overlay extent. More...
 
Margin GetPadding () const
 Returns the padding. More...
 
bool GetReportMouse () const
 
Geometry::Margin GetShadowExtent () const
 Returns the shadow extent. More...
 
virtual ComponentType GetType () const noexcept override
 Returns the type of the component. More...
 
void InsertIndex (int before, int componentindex)
 Insert an index to the specified location in the container. More...
 
int & operator[] (int index)
 Returns the component index at the given location. More...
 
int operator[] (int index) const
 Returns the component index at the given location. More...
 
void RemoveIndexAt (int index)
 Removes the index at the given position. More...
 
void SetBorderSize (Geometry::Margin value)
 Changes the border size of the component. More...
 
void SetBorderSize (int hor, int ver)
 Changes the border size of the component. More...
 
void SetBorderSize (int left, int top, int right, int bottom)
 Changes the border size of the component. More...
 
void SetBorderSize (int value)
 Changes the border size of the component. More...
 
void SetOrientation (Graphics::Orientation value)
 Changes the orientation of the template. More...
 
void SetOverlayExtent (Geometry::Margin value)
 Changes the overlay extent of the component. More...
 
void SetOverlayExtent (int hor, int ver)
 Changes the overlay extent of the component. More...
 
void SetOverlayExtent (int left, int top, int right, int bottom)
 Changes the overlay extent of the component. More...
 
void SetOverlayExtent (int value)
 Changes the overlay extent of the component. More...
 
void SetPadding (Dimension hor, Dimension ver)
 Changes the padding of the component. Padding is the minimum spacing inside the component. More...
 
void SetPadding (Dimension left, Dimension top, Dimension right, Dimension bottom)
 Changes the padding of the component. Padding is the minimum spacing inside the component. More...
 
void SetPadding (Dimension value)
 Changes the padding of the component. Padding is the minimum spacing inside the component. More...
 
void SetPadding (Geometry::Margin value, Dimension::Unit unit=Dimension::Pixel)
 Changes the padding of the component. Padding is the minimum spacing inside the component. More...
 
void SetPadding (int hor, int ver, Dimension::Unit unit=Dimension::Pixel)
 Changes the padding of the component. Padding is the minimum spacing inside the component. More...
 
void SetPadding (int left, int top, int right, int bottom, Dimension::Unit unit=Dimension::Pixel)
 Changes the padding of the component. Padding is the minimum spacing inside the component. More...
 
void SetPadding (int value, Dimension::Unit unit=Dimension::Pixel)
 Changes the padding of the component. Padding is the minimum spacing inside the component. More...
 
void SetPadding (Margin value)
 Changes the padding of the component. Padding is the minimum spacing inside the component. More...
 
void SetReportMouse (bool value)
 Mouse reporting allows component stack to report mouse events over this container to be reported separately. More...
 
void SetShadowExtent (Geometry::Margin value)
 Changes the shadow extent of the component. More...
 
void SetShadowExtent (int hor, int ver)
 Changes the shadow extent of the component. More...
 
void SetShadowExtent (int left, int top, int right, int bottom)
 Changes the shadow extent of the component. More...
 
void SetShadowExtent (int value)
 Changes the shadow extent of the component. More...
 
- Public Member Functions inherited from ComponentTemplate
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...
 
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

VisualProvider Background
 Background graphics. More...
 
VisualProvider Overlay
 Overlay graphics, overlay will be drawn on top of the contents. More...
 
- Public Attributes inherited from ComponentTemplate
Event< ComponentTemplateChangedEvent
 This event will be fired whenever any property is changed. More...
 

Additional Inherited Members

- Public Types inherited from ComponentTemplate
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...
 
- Protected Attributes inherited from ComponentTemplate
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

Container class that defines an area according to the Box Model.

It can contain other objects.

Member Function Documentation

◆ AddIndex()

ContainerTemplate& AddIndex ( int  componentindex)

Adds an index to the container.

The components will be drawn in order. Thus the components that are added later will be drawn on top. Multiple indexes will not cause any crashes, however, same component might be drawn multiple times on top of itself.

References ComponentTemplate::ChangedEvent.

◆ GetBorderSize()

Geometry::Margin GetBorderSize ( ) const

Returns the border size.

◆ GetCount()

int GetCount ( ) const

Returns the number of component indices stored in this container.

◆ GetOrientation()

Graphics::Orientation GetOrientation ( ) const

Returns the current orientation of the container.

◆ GetOverlayExtent()

Geometry::Margin GetOverlayExtent ( ) const

Returns the overlay extent.

◆ GetPadding()

Margin GetPadding ( ) const

Returns the padding.

◆ GetReportMouse()

bool GetReportMouse ( ) const

◆ GetShadowExtent()

Geometry::Margin GetShadowExtent ( ) const

Returns the shadow extent.

◆ GetType()

virtual ComponentType GetType ( ) const
overridevirtualnoexcept

Returns the type of the component.

Implements ComponentTemplate.

References Gorgon::UI::Container.

◆ InsertIndex()

void InsertIndex ( int  before,
int  componentindex 
)

Insert an index to the specified location in the container.

The components will be drawn in order. Thus the components that are added later will be drawn on top. Multiple indexes will not cause any crashes, however, same component might be drawn multiple times on top of itself.

References ComponentTemplate::ChangedEvent.

◆ operator[]() [1/2]

int& operator[] ( int  index)

Returns the component index at the given location.

References ComponentTemplate::index.

◆ operator[]() [2/2]

int operator[] ( int  index) const

Returns the component index at the given location.

References ComponentTemplate::index.

◆ RemoveIndexAt()

void RemoveIndexAt ( int  index)

Removes the index at the given position.

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

◆ SetBorderSize() [1/4]

void SetBorderSize ( Geometry::Margin  value)

Changes the border size of the component.

Border size stays within the object area, but excluded from the interior area.

References ComponentTemplate::ChangedEvent.

◆ SetBorderSize() [2/4]

void SetBorderSize ( int  hor,
int  ver 
)

Changes the border size of the component.

Border size stays within the object area, but excluded from the interior area.

References ComponentTemplate::ChangedEvent.

◆ SetBorderSize() [3/4]

void SetBorderSize ( int  left,
int  top,
int  right,
int  bottom 
)

Changes the border size of the component.

Border size stays within the object area, but excluded from the interior area.

References ComponentTemplate::ChangedEvent.

◆ SetBorderSize() [4/4]

void SetBorderSize ( int  value)

Changes the border size of the component.

Border size stays within the object area, but excluded from the interior area.

References ComponentTemplate::ChangedEvent.

◆ SetOrientation()

void SetOrientation ( Graphics::Orientation  value)

Changes the orientation of the template.

References ComponentTemplate::ChangedEvent.

◆ SetOverlayExtent() [1/4]

void SetOverlayExtent ( Geometry::Margin  value)

Changes the overlay extent of the component.

Overlay extent stays within the object area, but excluded from the interior area.

References ComponentTemplate::ChangedEvent.

◆ SetOverlayExtent() [2/4]

void SetOverlayExtent ( int  hor,
int  ver 
)

Changes the overlay extent of the component.

Overlay extent stays within the object area, but excluded from the interior area.

References ComponentTemplate::ChangedEvent.

◆ SetOverlayExtent() [3/4]

void SetOverlayExtent ( int  left,
int  top,
int  right,
int  bottom 
)

Changes the overlay extent of the component.

Overlay extent stays within the object area, but excluded from the interior area.

References ComponentTemplate::ChangedEvent.

◆ SetOverlayExtent() [4/4]

void SetOverlayExtent ( int  value)

Changes the overlay extent of the component.

Overlay extent stays within the object area, but excluded from the interior area.

References ComponentTemplate::ChangedEvent.

◆ SetPadding() [1/8]

void SetPadding ( Dimension  hor,
Dimension  ver 
)

Changes the padding of the component. Padding is the minimum spacing inside the component.

References ComponentTemplate::ChangedEvent.

◆ SetPadding() [2/8]

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

Changes the padding of the component. Padding is the minimum spacing inside the component.

References ComponentTemplate::ChangedEvent.

◆ SetPadding() [3/8]

void SetPadding ( Dimension  value)

Changes the padding of the component. Padding is the minimum spacing inside the component.

References ComponentTemplate::ChangedEvent.

◆ SetPadding() [4/8]

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

Changes the padding of the component. Padding is the minimum spacing inside the component.

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

◆ SetPadding() [5/8]

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

Changes the padding of the component. Padding is the minimum spacing inside the component.

References ComponentTemplate::ChangedEvent.

◆ SetPadding() [6/8]

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

Changes the padding of the component. Padding is the minimum spacing inside the component.

References ComponentTemplate::ChangedEvent.

◆ SetPadding() [7/8]

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

Changes the padding of the component. Padding is the minimum spacing inside the component.

References ComponentTemplate::ChangedEvent.

◆ SetPadding() [8/8]

void SetPadding ( Margin  value)

Changes the padding of the component. Padding is the minimum spacing inside the component.

References ComponentTemplate::ChangedEvent.

◆ SetReportMouse()

void SetReportMouse ( bool  value)

Mouse reporting allows component stack to report mouse events over this container to be reported separately.

Setting a tag with this property will help distinguishing between multiple regions.

◆ SetShadowExtent() [1/4]

void SetShadowExtent ( Geometry::Margin  value)

Changes the shadow extent of the component.

Shadow extent stays within the object area, but excluded from the interior area.

References ComponentTemplate::ChangedEvent.

◆ SetShadowExtent() [2/4]

void SetShadowExtent ( int  hor,
int  ver 
)

Changes the shadow extent of the component.

Shadow extent stays within the object area, but excluded from the interior area.

References ComponentTemplate::ChangedEvent.

◆ SetShadowExtent() [3/4]

void SetShadowExtent ( int  left,
int  top,
int  right,
int  bottom 
)

Changes the shadow extent of the component.

Shadow extent stays within the object area, but excluded from the interior area.

References ComponentTemplate::ChangedEvent.

◆ SetShadowExtent() [4/4]

void SetShadowExtent ( int  value)

Changes the shadow extent of the component.

Shadow extent stays within the object area, but excluded from the interior area.

References ComponentTemplate::ChangedEvent.

Member Data Documentation

◆ Background

VisualProvider Background

Background graphics.

◆ Overlay

VisualProvider Overlay

Overlay graphics, overlay will be drawn on top of the contents.


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