C4 Engine Terathon Software C4 Engine API Documentation

• Interface Manager

API Links
Developer Links

class Element

Defined in:  C4Interface.h
Every user interface element is a subclass of the Element class.
Definition

class Element : public Transformable, public ExclusiveObservable<Element>, public UpdatableTree<Element>

Member Functions
Element::GetElementType Returns the type of an element.
Element::GetOwningWindow Returns the window to which an element belongs.
Element::GetElementState Returns an element's current state.
Element::SetElementState Sets an element's current state.
Element::Show Puts an element in the visible state.
Element::Hide Puts an element in the invisible state.
Element::Enable Puts an element in the enabled state.
Element::Disable Puts an element in the disabled state.
Element::Visible Returns a boolean value indicating whether an element is visible.
Element::Enabled Returns a boolean value indicating whether an element is enabled.
 
Element::GetElementTransform Returns an element's local transform.
Element::SetElementTransform Sets an element's local transform.
Element::SetElementMatrix3D Sets the 3 × 3 portion of an element's local transform.
Element::GetElementPosition Returns the translation portion of an element's local transform.
Element::SetElementPosition Sets the translation portion of an element's local transform.
 
Element::GetElementWidth Returns the width of an element.
Element::GetElementHeight Returns the height of an element.
Element::SetElementSize Sets the width and height of an element.
 
Element::HandleMouseEvent Handles mouse events that are directed to an element.
Element::HandleKeyboardEvent Handles keyboard events that are directed to an element.
Element::CalculatePickBox Calculates the bounding box of an element's interactive area.
Element::TestPickPoint Returns the part of an element in which the user clicked.
Element::TriggerElement Triggers an element if it is enabled.
Element::TrackTask Called once per frame while an element is being tracked.
Element::FocusTask Called once per frame while an element has the keyboard focus.
Element::Render Renders an element.
Constructor

Element(ElementType type, float width = 0.0F, float height = 0.0F);

Parameters
type The type of the element.
width The initial width of the element.
height The initial height of the element.
Description


Base Classes
Transformable Holds the element-to-world transform for an element.
ExclusiveObservable<Element> Elements can be observed for state changes by a single observer.
UpdatableTree<Element> Elements are stored in a hierachical updatable tree.