You.i Engine
CYIToggleButtonView Class Reference

Detailed Description

Provides an implementation of a button which maintains a state based on user interaction.

This toggle button can be used to accept user interaction and trigger an event based on signals emitted by this class at various stages of interaction. Once pressed the toggle button will remain in the toggled on state until the user presses the button again to toggle the button into the toggled off state.

The class maintains the various state timelines and plays them at the various stages of interaction, see below for supported timelines:

View Template Specification

Type Labels Property Description
Marker Press Optional The timeline to play when pressed down in the unchecked state. Releasing will cause the state of the toggle button to go from unchecked to checked, and the 'Toggle-On' marker to be played.
Marker Press-Checked Optional The timeline to play when pressed down in the checked state. Releasing will cause the state of the toggle button to go from checked to unchecked, and the 'Toggle-Off' marker to be played.
Marker Toggle-On Optional The timeline to play when going from the unchecked to checked state. The reverse will be played if 'Toggle-Off' marker is not provided.
Marker Toggle-Off Optional The timeline to play when going from the checked to unchecked state. The reverse will be played if 'Toggle-On' marker is not provided.
Marker Disable Optional The timeline to play when disabled in the unchecked state. The reverse will be played when going from disabled to enabled state.
Marker Disable-Checked Optional The timeline to play when disabled in the checked state. The reverse will be played when going from disabled to enabled state.
Marker Up-Over Optional The timeline to play when a cursor enters the button area in the unchecked state. If this marker is not provided, the reverse of 'Over-Up' marker will be played.
Marker Up-Over-Checked Optional The timeline to play when a cursor enters the button area in the checked state. If this marker is not provided, the reverse of 'Over-Up-Checked' marker will be played.
Marker Over-Up Optional The timeline to play when a cursor leaves the button area in the unchecked state. If this marker is not provided, the reverse of 'Up-Over' marker will be played.
Marker Over-Up-Checked Optional The timeline to play when a cursor leaves the button area in the checked state. If this marker is not provided, the reverse of 'Up-Over-Checked' marker will be played.
Marker Down-Up Optional The timeline to play when a cursor leaves the button area while being pressed in the unchecked state. If this marker is not provided, the reverse of 'Press' will be played. The state of the toggle button will not change.
Marker Down-Up-Checked Optional The timeline to play when a cursor leaves the button area while being pressed in the checked state. If this marker is not provided, the reverse of 'Press-Checked' will be played. The state of the toggle button will not change.
Marker FocusIn-Checked Optional An alternative to CYISceneView's 'FocusIn' timeline, that will be played when the button gains focus in the checked state. If this marker is not provided, 'FocusIn' will be played instead.
Marker FocusOut-Checked Optional An alternative to CYISceneView's 'FocusOut' timeline, that will be played when the button loses focus in the checked state. If this marker is not provided, 'FocusOut' will be played instead. If 'FocusOut' is not provided either, the next fallback is 'FocusIn-Checked' played in reverse, and failing that, 'FocusIn' played in reverse.
Marker FocusIn-Toggle-Transition Optional A transition animation for focus states. Meant to provide a way to make the change from FocusIn to FocusIn-Checked look visually correct. Automatically played when a button toggles on and it has focus.
Marker FocusIn-Checked-Toggle-Transition Optional A transition animation for focus states. Meant to provide a way to make the change from FocusIn-Checked to FocusIn look visually correct. Automatically played when a button toggles off and it has focus.
Node Text OR Placeholder-Text Optional Text displayed on the button, which can be set using SetText().
Node TextPressed OR Placeholder-TextPressed Optional Text displayed on the button when pressed, which can be set using SetText(). This is useful if you want a different font or color when pressed.
Comment text Optional Corresponds to: SetText(). Contains a quoted string, which will be set as the text of this button, assuming the correct text nodes are present.

Toggle buttons are automatically marked focusable when the 'FocusIn' timeline (specified in CYISceneView) is present. The enter or select keys are used to activate a focused button.

#include <view/YiToggleButtonView.h>

Inheritance diagram for CYIToggleButtonView:

Public Types

enum  TOGGLE_STATE {
  TOGGLED_OFF = 0,
  TOGGLED_ON
}
 
- Public Types inherited from CYIAbstractButtonView
enum  ENABLE_STATE {
  DISABLED = 0,
  ENABLED
}
 
enum  PRESS_STATE {
  RELEASED = 0,
  PRESSED
}
 
enum  OVER_STATE {
  AWAY = 0,
  OVER
}
 
- Public Types inherited from CYISceneView
enum  ASSET_REQUIREMENT_TYPE {
  REQUIRES_NODE,
  REQUIRES_TIMELINE
}
 
enum  TIMELINE_GET_MODE {
  GET_DEFAULT,
  GET_TIMELINE,
  GET_TIMELINE_GROUP,
  GET_COMPONENT_OF_TIMELINE_GROUP
}
 
- Public Types inherited from CYISceneNode
enum  DirtyFlag {
  DirtyClean = 0x0000,
  DirtySceneGraph = 0x0001,
  DirtyVisibility = 0x0002,
  DirtyOpacity = 0x0004,
  DirtyLocalTransform = 0x0008,
  DirtyWorldTransform = 0x0010,
  DirtyUniform = 0x0020,
  DirtyWorldBoundingBox = 0x0040,
  DirtyMesh = 0x0080,
  DirtyWorldSurfaceScale = 0x0100,
  DirtyWorldScale = 0x0200,
  DirtyLocalBoundingBox = 0x0400,
  DirtyEverything = (DirtySceneGraph | DirtyVisibility | DirtyOpacity | DirtyLocalTransform | DirtyWorldTransform | DirtyUniform | DirtyWorldBoundingBox | DirtyWorldSurfaceScale | DirtyWorldScale | DirtyLocalBoundingBox)
}
 
enum  LayoutDirtyFlag {
  LayoutClean,
  LayoutChildDirty,
  LayoutDirty
}
 
enum  LayoutConfigFetchMode {
  LAYOUT_CONFIG_DO_NOT_LAZY_INSTANTIATE = 0,
  LAYOUT_CONFIG_LAZY_INSTANTIATE
}
 
enum  MeasureMode {
  MEASURE_UNSPECIFIED,
  MEASURE_UP_TO,
  MEASURE_EXACTLY
}
 
enum  FETCH_TYPE {
  FETCH_OPTIONAL = 0,
  FETCH_MANDATORY
}
 
typedef std::reverse_iterator< IteratorReverseIterator
 
- Public Types inherited from CYIEventTarget
enum  EVENT_PHASE {
  BUBBLE,
  CAPTURE
}
 

Public Member Functions

 CYIToggleButtonView ()
 
virtual ~CYIToggleButtonView ()
 
virtual bool Init () override
 
void SetToggled (bool bIsToggled)
 
void ToggleOn ()
 
void ToggleOff ()
 
bool IsToggledOn () const
 
void SetState (CYIAbstractButtonView::ENABLE_STATE eEnabledState, TOGGLE_STATE eToggleState)
 
- Public Member Functions inherited from CYIAbstractButtonView
 CYIAbstractButtonView ()
 
virtual ~CYIAbstractButtonView ()
 
void Enable ()
 
void Disable ()
 
void SetEnabled (bool bEnabled)
 
bool IsEnabled () const
 
bool IsPressed () const
 
bool IsOver () const
 
void SetText (const CYIString &text)
 
void SetButtonID (int32_t nButtonID)
 
int32_t GetButtonID () const
 
- Public Member Functions inherited from CYISceneView
 CYISceneView ()
 
virtual ~CYISceneView ()
 
bool BuildFromTemplate (CYISceneManager *pSceneManager, const std::shared_ptr< CYIAssetViewTemplate > &pAssetViewTemplate, CYISceneManager::MISSING_CLASS_HANDLING_MODE eMissingHandlingMode=CYISceneManager::ABORT)
 
bool IsInitialized () const
 
void SetClippingAreaNode (CYISceneNode *pClippingNode)
 
virtual bool GetProperty (const CYIString &propertyName, CYIString *pValue) const override
 
void EnableDefaultHitZone ()
 
bool IsResponsiveLayoutEnabled () const
 
void EnableResponsiveLayout ()
 
void DisableResponsiveLayout ()
 
void AddAnchor (YI_ANCHOR_TYPE anchorType)
 
YI_ANCHOR_DATA GetAnchor (YI_ANCHOR_TYPE anchorType) const
 
virtual const CYISceneView::AssetRequirementGetAssetRequirements (uint32_t *pRequirementCount)
 
CYIAbstractTimelineGetInTimeline () const
 
CYIAbstractTimelineGetOutTimeline () const
 
CYIAbstractTimelineGetFocusInTimeline () const
 
CYIAbstractTimelineGetFocusOutTimeline () const
 
virtual bool HandlesFocusInDescendants () const
 
virtual bool RequestFocus (CYIFocus::FOCUS_DIRECTION eDirection=CYIFocus::FOCUS_FORWARD, CYIFocus::FOCUS_ROOT_RULE eFocusRootRule=CYIFocus::FOCUS_ROOT_DESCENDANTS_UPDATE_CONTEXT, const CYIAABB &previousFocusRect=CYIAABB(), const CYIFocusSearchOptions &options=CYIFocusSearchOptions())
 
bool HasFocus () const
 
void SetFocusable (bool bFocusable)
 
bool IsFocusable () const
 
bool CanBeFocused () const
 
void SetNextFocus (CYISceneView *pView, CYIFocus::FOCUS_DIRECTION eDirection)
 
CYISceneViewGetNextFocus (CYIFocus::FOCUS_DIRECTION eDirection) const
 
void SetInitiallyFocusedView (CYISceneView *pView)
 
CYISceneViewGetInitiallyFocusedView () const
 
CYISceneViewFindNextFocus (CYIFocus::FOCUS_DIRECTION eDirection, const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const
 
CYISceneViewFindNextFocus (CYIFocus::FOCUS_DIRECTION eDirection, CYIAABB &screenSpaceFocusRegion, const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const
 
virtual CYISceneViewFindNextFocusInDescendants (const CYISceneView *pCurrentFocusView, CYIFocus::FOCUS_DIRECTION eDirection, CYIAABB &screenSpaceFocusRegion, const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const
 
const CYISceneNodeGetFocusRoot () const
 
CYISceneViewGetFocusHandler () const
 
virtual void OnFocusGained ()
 
virtual void FocusGained ()
 
virtual void OnFocusLost ()
 
virtual void FocusLost ()
 
const std::shared_ptr< CYIAssetViewTemplate > & GetViewTemplate () const
 
const std::vector< CYIString > & GetChildTemplateNames ()
 
virtual CYIAbstractTimelineGetTimeline (const CYIString &rMarkerName, TIMELINE_GET_MODE eMode=GET_DEFAULT)
 
CYIAbstractTimelineGetTimeline (CYIMarkerData::MARKER_ID eID, TIMELINE_GET_MODE eMode=GET_DEFAULT)
 
std::map< CYIString, CYITimeline * > GetTimelines () const
 
bool FindTimeline (CYIAbstractTimeline *&pTimeline, const CYIString &markerName, FETCH_TYPE eType, const CYIString &tag="", TIMELINE_GET_MODE eMode=GET_DEFAULT)
 
CYITimelineGroupGetTimelineGroup (const CYIString &markerName)
 
std::unique_ptr< CYITimelineGroupBuildTimelineGroup (const CYIString &markerName)
 
void BuildAnchorList ()
 
virtual void Reset ()
 
void SetLayout (std::unique_ptr< CYILayout > pLayout)
 
const CYILayoutGetLayout () const
 
CYILayoutGetLayout ()
 
virtual void Measure (const MeasureSpec &widthSpec, const MeasureSpec &heightSpec, const MeasureSpec &depthSpec) override
 
virtual void ApplyMeasurements () override
 
virtual void BuildDrawList (std::vector< IYIRenderer::Command > &children, CYIAbstractCameraSceneNode *pCameraToDrawWith=nullptr) override
 
- Public Member Functions inherited from CYISceneNode
 CYISceneNode ()
 
virtual ~CYISceneNode ()
 
void ForceDirty ()
 
void ClearDirtyFlag ()
 
void SetDirtyFlag (DirtyFlag eDirtyFlag)
 
DirtyFlag GetDirtyFlag () const
 
DirtyFlag GetPreviousDirtyFlag () const
 
const CYIStringGetName () const
 
CYIString GetUniqueName () const
 
void SetSceneManager (CYISceneManager *pSceneManager)
 
void SetName (const CYIString &name)
 
int32_t GetID () const
 
void SetID (int32_t nID)
 
uint64_t GetUniqueID () const
 
bool AddChild (std::unique_ptr< CYISceneNode > pSceneNode)
 
bool AddChild (std::unique_ptr< CYISceneNode >, int32_t nIndex)
 
bool InsertChildAfter (CYISceneNode *pRefNode, std::unique_ptr< CYISceneNode > pSceneNode)
 
std::unique_ptr< CYISceneNodeRemoveChild (CYISceneNode *pSceneNode)
 
bool ReorderChild (uint32_t uFromIndex, uint32_t uToIndex)
 
CYISceneNodeGetParent () const
 
bool ChangeParent (CYISceneNode *pParent)
 
CYISceneNodeGetDrawParent () const
 
bool IsAncestorOf (const CYISceneNode *pNode) const
 
CYISceneManagerGetSceneManager () const
 
uint32_t GetChildCount () const
 
uint32_t GetChildCountRecursive () const
 
CYISceneNodeGetChild (uint32_t nIndex) const
 
Iterator begin (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const
 
Iterator end (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const
 
ReverseIterator rbegin (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const
 
ReverseIterator rend (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const
 
CYISceneNodeGetChild (const CYIString &sName) const
 
uint32_t GetDrawChildCount () const
 
CYISceneNodeGetDrawChild (uint32_t uIndex) const
 
CYISceneNodeGetDrawChildByID (int32_t nID) const
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetChild (uint32_t uTargetMatchedNodeCount=1) const
 
template<class YI_SCENE_NODE_SUBCLASS >
std::list< YI_SCENE_NODE_SUBCLASS * > GetChildren () const
 
int32_t GetIndexOfChild (const CYISceneNode *pSceneNode) const
 
void Show ()
 
void Hide ()
 
void SetVisibility (bool bVisible)
 
void SetOpacity (float fOpacity)
 
float GetCompositeOpacity () const
 
float GetLocalOpacity () const
 
bool IsVisible () const
 
bool IsTrulyVisible () const
 
CYISceneNodeGetNode (const CYIString &name)
 
CYISceneNodeGetNode (const CYIString &name, const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNode (const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNodeAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, CYISceneNode *pStartAfterTarget)
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetNode (const CYIString &name)
 
CYISceneNodeGetNode (const int32_t nID)
 
CYISceneNodeGetNode (const int32_t nID, const CYIRuntimeTypeInfo &enforceClassType)
 
template<class YI_SCENE_NODE_SUBCLASS >
bool FindNode (YI_SCENE_NODE_SUBCLASS *&pNode, const CYIString &nodeName, FETCH_TYPE eType, const CYIString &tag)
 
std::list< CYISceneNode * > GetNodes (const CYIString &name)
 
std::list< CYISceneNode * > GetNodes (int32_t nID)
 
std::list< CYISceneNode * > GetNodes (const CYIRuntimeTypeInfo &enforceClassType)
 
template<class YI_SCENE_NODE_SUBCLASS >
const YI_SCENE_NODE_SUBCLASS * GetNode (uint32_t uTargetMatchedNodeCount=1) const
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetNode (uint32_t uTargetMatchedNodeCount=1)
 
void SetMesh (const std::shared_ptr< CYIMesh > &pMesh)
 
void SetMaterial (const std::shared_ptr< CYIMaterial > &pMaterial, uint32_t nIndex=0)
 
void AddEffect (const std::shared_ptr< CYIEffect > &pEffect)
 
void RemoveEffect (const std::shared_ptr< CYIEffect > &pEffect)
 
uint32_t GetEffectCount () const
 
std::shared_ptr< CYIEffectGetEffect (uint32_t uIndex) const
 
void ConnectEffectsToTimelines (const CYITimelineTrack *pTrack)
 
void AddMask (std::unique_ptr< CYIMask > pMask)
 
std::unique_ptr< CYIMaskRemoveMask (const CYIMask *pMask)
 
uint32_t GetMaskCount () const
 
const CYIMaskGetMask (uint32_t uIndex) const
 
CYIMaskGetMask (uint32_t uIndex)
 
const std::shared_ptr< CYIMesh > & GetMesh () const
 
uint32_t GetMaterialCount () const
 
const std::shared_ptr< CYIMaterialGetMaterial (uint32_t nIndex=0) const
 
const std::shared_ptr< IYIUniformBufferObject > & GetShaderUniforms () const
 
void SetMeshTransform (const glm::mat4 &rTransform)
 
void DestroyChildren ()
 
const glm::mat4 & GetLocalTransform () const
 
const glm::mat4 & GetEffectTransform () const
 
const glm::mat4 & GetWorldTransform () const
 
bool Intersects (const CYISceneNode *pNode) const
 
void SetRenderTarget (const std::shared_ptr< CYIRenderTarget > &pRenderTarget)
 
const std::shared_ptr< CYIRenderTargetGetRenderTarget () const
 
const CYIAABBGetWorldAABB () const
 
const CYIAABBGetLocalAABB () const
 
void SetAnchorPoint (const glm::vec3 &ref)
 
void SetAnchorPoint (float fX, float fY, float fZ)
 
void SetAnchorPointX (float fX)
 
void SetAnchorPointY (float fY)
 
void SetAnchorPointZ (float fZ)
 
void SetPosition (const glm::vec3 &ref)
 
void SetPosition (float fX, float fY, float fZ)
 
void SetPositionX (float fX)
 
void SetPositionY (float fY)
 
void SetPositionZ (float fZ)
 
void SetRotation (const glm::vec3 &fEulerDegrees)
 
void SetRotation (float fPitchDegrees, float fYawDegrees, float fRollDegrees)
 
void SetRotationX (float fPitchDegrees)
 
void SetRotationY (float fYawDegrees)
 
void SetRotationZ (float fRollDegrees)
 
void SetOrientation (float fPitchDegrees, float fYawDegrees, float fRollDegrees)
 
void SetOrientation (const glm::quat &orient)
 
void SetScale (const glm::vec3 &fScaleFactors)
 
void SetScale (float fFactorX, float fFactorY, float fFactorZ)
 
void SetScaleX (float fFactor)
 
void SetScaleY (float fFactor)
 
void SetScaleZ (float fFactor)
 
const glm::vec3 & GetPosition () const
 
const glm::vec3 & GetScale () const
 
const glm::vec3 & GetWorldScale () const
 
const glm::vec3 & GetWorldSurfaceScale () const
 
const glm::vec3 & GetRotation () const
 
const glm::quat & GetOrientation () const
 
const glm::vec3 & GetAnchorPoint () const
 
virtual void SetSize (const glm::vec3 &vSize, bool bDirtyLayout=true)
 
const glm::vec3 & GetSize () const
 
const glm::vec3 & GetInitialSize () const
 
void SetMeasuredSize (const glm::vec3 &vMeasuredSize)
 
const glm::vec3 & GetMeasuredSize () const
 
void SetInternalCustomTimelineValue (uint32_t nTrackID, const CYIVariant &value)
 
virtual void SetCustomTimelineValue (uint32_t nTrackID, const CYIVariant &value)
 
void SetClippingOn ()
 
void SetClippingOff ()
 
bool GetClipping () const
 
void SetClippingBox (const CYIAABB &rWorldBox)
 
const CYIAABBGetClippingBox () const
 
void StartPropertyAnimation (YI_NODE_PROPERTY_TYPE ePropType, float fFrom, float fTo, uint32_t nDurMs, CYITimeInterpolator *pTimeInterpolator=nullptr, bool bDirtyLayout=true)
 
void StopPropertyAnimation (YI_NODE_PROPERTY_TYPE ePropType)
 
void UpdateLocalSpaceCollision (CYIActionEvent *pActionEvent)
 
virtual bool BroadcastEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent)
 
void UpdateEventForLocalSpace (CYIActionEvent *pActionEvent, glm::vec3 &rayOrigin, glm::vec3 &rayNonOriginPoint) const
 
bool IsBoundingBoxHit (const CYIRay &rWorldSpaceRay) const
 
bool IsMeshHit (const CYIRay &rWorldSpaceRay) const
 
void DumpTree () const
 
void StartCaptureKeyboardEvents ()
 
void StopCaptureKeyboardEvents ()
 
void StartCaptureTrackpadEvents ()
 
void StopCaptureTrackpadEvents ()
 
void StartCapturePointerEvents (uint8_t uPointerID)
 
void StopCapturePointerEvents (uint8_t uPointerID)
 
bool DrawBehindChildren (CYISceneNode *pSceneNode)
 
bool DrawInFrontOfChildren (CYISceneNode *pSceneNode)
 
bool DrawBehind (CYISceneNode *pSceneNode)
 
bool DrawInFront (CYISceneNode *pSceneNode)
 
bool IsFocusRoot () const
 
void SetIsFocusRoot (bool bIsFocusRoot)
 
virtual void OnFocusGainedInDescendants ()
 
virtual void FocusGainedInDescendants ()
 
virtual void OnFocusLostInDescendants ()
 
virtual void FocusLostInDescendants ()
 
virtual void OnFocusChangedInDescendants ()
 
virtual void FocusChangedInDescendants ()
 
virtual bool ContainsFocusableDescendant (const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const
 
void ShowPointerDebugNode (CYIActionEvent *pActionEvent)
 
void SetUseLocalTransformAndAlpha (bool bUse)
 
virtual const std::map< CYIString, CYIString > & GetProperties () const override
 
void SetProperty (const CYIString &rPropertyName, const CYIString &rPropertyValue)
 
const std::shared_ptr< CYISceneNodeProxy > & GetSceneNodeProxy () const
 
void SetLayoutConfig (std::unique_ptr< CYILayoutConfig > pLayoutConfig)
 
const CYILayoutConfigGetLayoutConfig (LayoutConfigFetchMode eFetchMode=LAYOUT_CONFIG_LAZY_INSTANTIATE) const
 
CYILayoutConfigGetLayoutConfig (LayoutConfigFetchMode eFetchMode=LAYOUT_CONFIG_LAZY_INSTANTIATE)
 
void SetLayoutState (std::unique_ptr< CYILayoutState > pLayoutState)
 
const CYILayoutStateGetLayoutState () const
 
CYILayoutStateGetLayoutState ()
 
void RequestLayout ()
 
LayoutDirtyFlag GetLayoutDirtyFlag () const
 
virtual void SetLayoutDirtyFlag (LayoutDirtyFlag eFlag)
 
CYIAbstractCameraSceneNodeFindActiveCamera () const
 
template<typename T >
bool CanCastTo () const
 
- Public Member Functions inherited from CYIEventTarget
 CYIEventTarget ()
 
virtual ~CYIEventTarget ()
 
bool AddEventListener (YI_EVENT_TYPE eEventType, CYIEventHandler *pListener, EVENT_PHASE ePhase=BUBBLE)
 
bool RemoveEventListener (YI_EVENT_TYPE eEventType, CYIEventHandler *pListener, EVENT_PHASE ePhase=BUBBLE)
 
void SetSpecialTypeFlag (YI_SPECIAL_EVENT_TARGET_TYPE eType)
 
void ClearSpecialTypeFlag (YI_SPECIAL_EVENT_TARGET_TYPE eType)
 
YI_SPECIAL_EVENT_TARGET_TYPE GetSpecialTypes () const
 
- Public Member Functions inherited from CYIScriptableRTTIObject
 CYIScriptableRTTIObject ()
 
virtual ~CYIScriptableRTTIObject ()
 
virtual const CYIRuntimeTypeInfoGetRuntimeTypeInfoForScriptObject () const override
 
- Public Member Functions inherited from CYIScriptableObject
 CYIScriptableObject ()
 
 CYIScriptableObject (const CYIScriptableObject &other)
 
CYIScriptableObjectoperator= (const CYIScriptableObject &other)
 
virtual ~CYIScriptableObject ()
 
CYIBindingImplementationGetBindingImplementation () const
 
void SetBindingImplementation (CYIBindingImplementation *pBindingImplementation)
 
- Public Member Functions inherited from CYISignalHandler
 CYISignalHandler ()
 
 CYISignalHandler (const CYISignalHandler &rSignalHandler)
 
virtual ~CYISignalHandler ()
 
CYISignalHandleroperator= (const CYISignalHandler &rSignalHandler)
 
void MoveToThread (CYIThread *pThread)
 This function allows the user to override the default thread affinity to any CYIThread that may or may not be running. More...
 
CYIThreadHandle GetThreadAffinity () const
 
void SetThreadAffinity (const CYIThreadHandle &rThreadAffinity)
 
virtual bool IsConnected () const
 
virtual bool IsConnected (const CYISignalBase &rSignal) const
 
void Disconnect (CYISignalBase &rSignal)
 
void DisconnectFromAllSignals ()
 
- Public Member Functions inherited from CYIThread::Listener
 Listener ()
 
virtual ~Listener ()
 
virtual void OnThreadStarted (CYIThread *)
 
virtual void OnThreadTerminated (CYIThread *)
 
virtual void OnThreadFinished (CYIThread *)
 
- Public Member Functions inherited from IYIPropertiesSource
virtual ~IYIPropertiesSource ()
 
- Public Member Functions inherited from CYIEventHandler
 CYIEventHandler ()
 
 CYIEventHandler (const CYIEventHandler &)
 
virtual ~CYIEventHandler ()
 
CYIEventHandleroperator= (const CYIEventHandler &)
 
bool RegisterEventFilter (CYIEventFilter *pFilter)
 
bool UnregisterEventFilter (CYIEventFilter *pFilter)
 
bool PreFilter (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent)
 
bool PostFilter (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent)
 
bool AreEventsEnabled () const
 
void EnableEvents (bool bEnable)
 

Public Attributes

CYISignal< bool, int32_t > ButtonPressing
 
CYISignal< int32_t > ButtonPressingOn
 
CYISignal< int32_t > ButtonPressingOff
 
CYISignal< bool, int32_t > ButtonPressed
 
CYISignal< int32_t > ButtonPressedOn
 
CYISignal< int32_t > ButtonPressedOff
 
CYISignal< bool, int32_t > ButtonToggled
 
CYISignal< int32_t > ButtonToggledOn
 
CYISignal< int32_t > ButtonToggledOff
 
CYISignal< bool, int32_t > ButtonReleasing
 
CYISignal< int32_t > ButtonReleasingOn
 
CYISignal< int32_t > ButtonReleasingOff
 
CYISignal< bool, int32_t > ButtonReleased
 
CYISignal< int32_t > ButtonReleasedOn
 
CYISignal< int32_t > ButtonReleasedOff
 
- Public Attributes inherited from CYISceneView
CYISignal< CYISceneView * > GainedFocus
 Emitted when focus has entered this view. More...
 
CYISignal< CYISceneView * > LostFocus
 Emitted when focus has left this view. More...
 
- Public Attributes inherited from CYISceneNode
CYISignal< CYISceneNode *, YI_NODE_PROPERTY_TYPEPropertyAnimationComplete
 
CYISignal DescendantGainedFocus
 Emitted when focus has entered this tree. More...
 
CYISignal DescendantLostFocus
 Emitted when focus has left this tree. More...
 
CYISignal DescendantsChangedFocus
 Emitted when focus has changed within this tree. More...
 

Protected Types

enum  EMIT_SIGNALS {
  WITH_SIGNALS,
  NO_SIGNALS
}
 

Protected Member Functions

virtual void OnEnable () override
 
virtual void OnDisable () override
 
virtual void OnPress () override
 
virtual void OnRelease () override
 
virtual void OnEnter () override
 
virtual void OnLeave () override
 
virtual void OnCancel () override
 
virtual void OnToggleOn (EMIT_SIGNALS eSignals)
 
virtual void OnToggleOff (EMIT_SIGNALS eSignals)
 
virtual void FinishAllPlayingTimelines () override
 
virtual void FinishAllPlayingFocusTimelines ()
 
void ToggleOn (EMIT_SIGNALS eSignals)
 
void ToggleOff (EMIT_SIGNALS eSignals)
 
void OnPressOnCompleted ()
 
void OnPressOffCompleted ()
 
void OnReleaseOnCompleted ()
 
void OnReleaseOffCompleted ()
 
virtual bool HandleEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) override
 
- Protected Member Functions inherited from CYIAbstractButtonView
void StartTimelineForward (CYIAbstractTimeline *pTimeline, const char *pFunctionName=nullptr, const char *pTimelineName=nullptr)
 
void StartTimelineReverse (CYIAbstractTimeline *pTimeline, const char *pFunctionName=nullptr, const char *pTimelineName=nullptr)
 
- Protected Member Functions inherited from CYISceneView
void UpdateClipping ()
 
virtual void WorldScaleUpdated () override
 
virtual void WorldBoundingBoxUpdated () override
 
virtual void OnViewReflowed (const glm::vec3 &worldScale)
 
virtual void ViewReflowed (const glm::vec3 &worldScale)
 
virtual bool ProcessEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) override
 
void UpdateResponsiveLayoutAnchors ()
 
virtual void SizeChanged () override
 
virtual void ChildNeedsLayout () override
 
virtual void LayoutDirtied () override
 
virtual void ChildAdded (CYISceneNode *pChild) override
 
virtual void ChildRemoved (CYISceneNode *pChild) override
 
virtual void ChildVisibilityChanged (CYISceneNode *pChild) override
 
void OnViewIsInAnimatedPosition ()
 
void OnViewIsGoingOutOfAnimatedPosition ()
 
void SetInTimeline (CYIAbstractTimeline *pTimeline)
 
void SetOutTimeline (CYIAbstractTimeline *pTimeline)
 
virtual void OnInit ()
 
bool TryRequestFocusOnInitiallyFocusedView ()
 
- Protected Member Functions inherited from CYISceneNode
void Update (bool bForceDirty=false)
 
virtual void OnUpdateBegin ()
 
virtual void UpdateBegin ()
 
virtual void OnUpdateEnd ()
 
virtual void UpdateEnd ()
 
virtual void OnDirtyFlagChanged ()
 
virtual void DirtyFlagChanged ()
 
virtual void OnTransformUpdated ()
 
virtual void TransformUpdated ()
 
virtual void OnWorldScaleUpdated ()
 
virtual void OnWorldSurfaceScaleUpdated ()
 
virtual void WorldSurfaceScaleUpdated ()
 
virtual void OnVisibilityUpdated ()
 
virtual void VisibilityUpdated ()
 
virtual void OnCompositeOpacityUpdated ()
 
virtual void CompositeOpacityUpdated ()
 
virtual void OnWorldBoundingBoxUpdated ()
 
virtual void OnLocalBoundingBoxUpdated ()
 
virtual void LocalBoundingBoxUpdated ()
 
virtual void OnChildAdded (CYISceneNode *pChild)
 
virtual void OnChildRemoved (CYISceneNode *pChild)
 
virtual void OnSizeChanged ()
 
virtual void CalculateLocalTransform (glm::mat4 *pTransform) const
 
virtual void OnChildVisibilityChanged (CYISceneNode *pChild)
 
LayoutDirtyFlag GetCurrentLayoutDirtyFlag () const
 
virtual CYIString GetDumpTreeString () const
 
void DumpTree (int32_t nIndentLevel) const
 
void SetShaderUniforms ()
 
virtual void SetCustomUniforms ()
 
template<class T >
void SetNodeType ()
 
virtual CYISceneNodeGetNodeFromChildren (const CYIString &name)
 
virtual CYISceneNodeGetNodeFromChildren (const int32_t nID)
 
virtual CYISceneNodeGetNodeFromChildren (const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNodeFromChildrenAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, bool *pbTargetReached, CYISceneNode *pStartAfterTarget)
 
- Protected Member Functions inherited from CYIScriptableRTTIObject
virtual std::pair< const CYIRuntimeTypeInfo *, const void * > GetRuntimeTypeInfoWithObject () const =0
 

Protected Attributes

TOGGLE_STATE m_eToggleState
 
CYIAbstractTimelinem_pPressAnim
 
CYIAbstractTimelinem_pPressCheckedAnim
 
CYIAbstractTimelinem_pToggleOnAnim
 
CYIAbstractTimelinem_pToggleOffAnim
 
CYIAbstractTimelinem_pDisableAnim
 
CYIAbstractTimelinem_pDisableCheckedAnim
 
CYIAbstractTimelinem_pUpOverAnim
 
CYIAbstractTimelinem_pUpOverCheckedAnim
 
CYIAbstractTimelinem_pOverUpAnim
 
CYIAbstractTimelinem_pOverUpCheckedAnim
 
CYIAbstractTimelinem_pDownUpAnim
 
CYIAbstractTimelinem_pDownUpCheckedAnim
 
CYIAbstractTimelinem_pFocusInCheckedAnim
 
CYIAbstractTimelinem_pFocusOutCheckedAnim
 
CYIAbstractTimelinem_pFocusInToggleTransitionAnim
 
CYIAbstractTimelinem_pFocusInCheckedToggleTransitionAnim
 
- Protected Attributes inherited from CYIAbstractButtonView
ENABLE_STATE m_eEnableState
 
PRESS_STATE m_ePressState
 
OVER_STATE m_eOverState
 
int32_t m_nButtonID
 
CYITextSceneNodem_pButtonTextNode
 
CYITextSceneNodem_pButtonTextNodePress
 
- Protected Attributes inherited from CYISceneView
bool m_bStopEventPropagation
 
bool m_bResponsiveLayoutEnabled
 
bool m_bSceneTreeBuilt
 
bool m_bInAnimatedPosition
 
CYISceneNodem_pClippingNode
 
CYIAbstractTimelinem_pFocusInTimeline
 
CYIAbstractTimelinem_pFocusOutTimeline
 
std::unique_ptr< CYILayoutm_pLayout
 
std::shared_ptr< CYIAssetViewTemplatem_pAssetViewTemplate
 
std::shared_ptr< CYISceneNodeProxym_pInitiallyFocusedView
 
std::multimap< YI_ANCHOR_TYPE, YI_ANCHOR_DATAm_anchors
 
std::map< CYIString, std::unique_ptr< CYITimeline > > m_timelines
 
std::map< CYIString, std::unique_ptr< CYIParallelTimelineGroup > > m_timelineGroups
 
- Protected Attributes inherited from CYISceneNode
CYIString m_name
 
CYISceneNodem_pParent
 
CYISceneNodem_pDrawParent
 
CYISceneManagerm_pSceneManager
 
std::vector< std::unique_ptr< CYISceneNode > > m_children
 
std::vector< CYISceneNode * > m_drawChildren
 
std::map< CYIString, CYIStringm_Properties
 
std::vector< std::shared_ptr< CYIMaterial > > m_pMaterials
 
std::vector< std::unique_ptr< CYIMask > > m_Masks
 
std::vector< std::shared_ptr< CYIEffect > > m_Effects
 
std::vector< PropertyAnimation * > m_propertyAnimations
 
float m_fLocalOpacity
 
CYIAABB m_WSClipBox
 
glm::mat4 m_EffectTransform
 
glm::quat m_Orientation
 
glm::vec3 m_Rotate
 
glm::vec3 m_AnchorPoint
 
glm::vec3 m_Position
 
glm::vec3 m_Scale
 
glm::vec3 m_vSize
 
glm::vec3 m_vInitialSize
 
glm::vec3 m_vMeasuredSize
 
glm::vec3 m_vlsLastCollision
 
bool m_bClip
 
bool m_bIsRotated
 
bool m_bIsOriented
 
bool m_bLocalVisibility
 
int32_t m_nID
 
uint64_t m_uGUID
 
std::shared_ptr< CYIRenderTargetm_pRenderTarget
 
std::shared_ptr< CYIMeshm_pMesh
 
std::shared_ptr< IYIUniformBufferObjectm_pShaderUniforms
 
- Protected Attributes inherited from CYIEventTarget
YI_SPECIAL_EVENT_TARGET_TYPE m_eSpecialTypes
 
std::vector< EventListenerEntry > m_listeners
 
- Protected Attributes inherited from CYIEventHandler
bool m_bEnableEvents
 

Additional Inherited Members

- Static Public Member Functions inherited from CYISceneView
static void RegisterAllViews ()
 
- Static Public Member Functions inherited from CYISceneNode
static void RegisterAllSceneNodes ()
 
- Static Public Attributes inherited from CYISceneNode
static const float OPACITY_NOT_VISIBLE_EPSILON
 

Member Enumeration Documentation

An enumeration representing whether or not a toggle event will emit signals. This can be used to differentiate programatic state changes which should emit signals to those which should not.

Enumerator
WITH_SIGNALS 

The toggle state change will emit signals in the order ButtonToggled, ButtonReleasing and ButtonReleased.

NO_SIGNALS 

No signals will be emitted.

Enumeration representing the possible toggles states for the toggle button.

Enumerator
TOGGLED_OFF 

State indicating that the button view is toggled off.

TOGGLED_ON 

State indicating that the button view is toggled on.

Constructor & Destructor Documentation

CYIToggleButtonView::CYIToggleButtonView ( )
virtual CYIToggleButtonView::~CYIToggleButtonView ( )
virtual

Member Function Documentation

virtual void CYIToggleButtonView::FinishAllPlayingFocusTimelines ( )
protectedvirtual

Finish playing all focus timelines which the toggle button view manages.

virtual void CYIToggleButtonView::FinishAllPlayingTimelines ( )
overrideprotectedvirtual

Implement to finish playing all timelines which the button view manages.

Reimplemented from CYIAbstractButtonView.

virtual bool CYIToggleButtonView::HandleEvent ( const std::shared_ptr< CYIEventDispatcher > &  pDispatcher,
CYIEvent pEvent 
)
overrideprotectedvirtual

Handle events from You.i Engine's event system. This is where input events are translated to button view events and button view states are changed.

Reimplemented from CYIAbstractButtonView.

virtual bool CYIToggleButtonView::Init ( )
overridevirtual

Initializes the view and all of its content. Subclasses must call CYISceneView::Init().

Note
This must be called after CYISceneView::BuildFromTemplate()

Reimplemented from CYIAbstractButtonView.

bool CYIToggleButtonView::IsToggledOn ( ) const

Returns true if the toggle button is currently in the CYIToggleButtonView::TOGGLED_ON state.

virtual void CYIToggleButtonView::OnCancel ( )
overrideprotectedvirtual

Callback occuring when the button view transitions into the CYIAbstractButtonView::AWAY state while the button was pressed. Subclasses can update the view to represent an idle state where the user hovered and pressed down on the view and then left the view without releasing.

Reimplemented from CYIAbstractButtonView.

virtual void CYIToggleButtonView::OnDisable ( )
overrideprotectedvirtual

Callback occuring when the button view transitions into the CYIAbstractButtonView::DISABLED state. Subclasses can update the view to represent a disabled state here.

Reimplemented from CYIAbstractButtonView.

virtual void CYIToggleButtonView::OnEnable ( )
overrideprotectedvirtual

Callback occuring when the button view transitions into the CYIAbstractButtonView::ENABLED state. Subclasses can update the view to represent an enabled state here.

Reimplemented from CYIAbstractButtonView.

virtual void CYIToggleButtonView::OnEnter ( )
overrideprotectedvirtual

Callback occuring when the button view transitions into the CYIAbstractButtonView::OVER state. Subclasses can update the view to represent a hover state here.

Reimplemented from CYIAbstractButtonView.

virtual void CYIToggleButtonView::OnLeave ( )
overrideprotectedvirtual

Callback occuring when the button view transitions into the CYIAbstractButtonView::AWAY state if the button was not pressed. Subclasses can update the view to represent an idle state where the user hovered over the button but did not interact with it.

Reimplemented from CYIAbstractButtonView.

virtual void CYIToggleButtonView::OnPress ( )
overrideprotectedvirtual

Callback occuring when the button view transitions into the CYIAbstractButtonView::PRESSED state. Subclasses can update the view to represent a pressed state here.

Reimplemented from CYIAbstractButtonView.

void CYIToggleButtonView::OnPressOffCompleted ( )
protected
void CYIToggleButtonView::OnPressOnCompleted ( )
protected
virtual void CYIToggleButtonView::OnRelease ( )
overrideprotectedvirtual

Callback occuring when the button view transitions into the CYIAbstractButtonView::RELEASED state. Subclasses can update the view to represent an idle state here.

Reimplemented from CYIAbstractButtonView.

void CYIToggleButtonView::OnReleaseOffCompleted ( )
protected
void CYIToggleButtonView::OnReleaseOnCompleted ( )
protected
virtual void CYIToggleButtonView::OnToggleOff ( EMIT_SIGNALS  eSignals)
protectedvirtual

Callback occurring when the toggle button view transitions into the CYIToggleButtonView::TOGGLED_OFF state. The view is updated to represent a toggled off state here.

Note
Once the button has toggled off, it will switch its focus animations automatically from FocusIn-Checked to FocusIn. This is done using the "FocusIn-Checked-Toggle-Transition" animation. If the animation is not present, the reverse of "FocusIn-Toggle-Transition" will be applied. If both the transition animations are not present the FocusIn animation will be fast-forwarded to its end state and the FocusIn-Checked will be rewinded to the beginning to give the button its correct visual state as a fallback behaviour. This fallback behaviour will only occur if the FocusIn-Checked animation is present.
virtual void CYIToggleButtonView::OnToggleOn ( EMIT_SIGNALS  eSignals)
protectedvirtual

Callback occurring when the toggle button view transitions into the CYIToggleButtonView::TOGGLED_ON state. The view is updated to represent a toggled on state here.

Note
Once the button has toggled on, it will switch its focus animations automatically from FocusIn to FocusIn-Checked if it is available. This is done by using the "FocusIn-Toggle-Transition" animation. If the transition animation is not present the FocusIn-Checked animation will be fast forwarded to the end and the FocusIn animation will be rewinded to the beginning to give the button its correct visual state as a fallback behaviour. This fallback behaviour will only occur if the FocusIn-Checked animation is present.
void CYIToggleButtonView::SetState ( CYIAbstractButtonView::ENABLE_STATE  eEnabledState,
TOGGLE_STATE  eToggleState 
)

Sets the current eEnabledState and eToggleState for the toggle button.

Note
Toggling the button using this method will not emit a signal.
void CYIToggleButtonView::SetToggled ( bool  bIsToggled)

Toggles the button state given bIsToggled.

Note
Toggling the button using this method will not emit a signal.
void CYIToggleButtonView::ToggleOff ( )

Toggles the button into the CYIToggleButtonView::TOGGLED_OFF state.

Note
Toggling the button using this method will not emit a signal.
void CYIToggleButtonView::ToggleOff ( EMIT_SIGNALS  eSignals)
protected

Transitions the toggle button into the CYIToggleButtonView::TOGGLED_OFF state, eSignals specifies if appropriate signals will be emitted. This method will have no effect if the button is already in the CYIToggleButtonView::TOGGLED_OFF state.

void CYIToggleButtonView::ToggleOn ( )

Toggles the button into the CYIToggleButtonView::TOGGLED_ON state.

Note
Toggling the button using this method will not emit a signal.
void CYIToggleButtonView::ToggleOn ( EMIT_SIGNALS  eSignals)
protected

Transitions the toggle button into the CYIToggleButtonView::TOGGLED_ON state, eSignals specifies if appropriate signals will be emitted. This method will have no effect if the button is already in the CYIToggleButtonView::TOGGLED_ON state.

Member Data Documentation

CYISignal<bool, int32_t> CYIToggleButtonView::ButtonPressed

Emitted when the press timeline completes, or immediately after CYIToggleButtonView::ButtonPressing if no eligible timeline exists. The first parameter indicates toggle state. The second parameter is the Button ID set using SetButtonID().

CYISignal<int32_t> CYIToggleButtonView::ButtonPressedOff
CYISignal<int32_t> CYIToggleButtonView::ButtonPressedOn
CYISignal<bool, int32_t> CYIToggleButtonView::ButtonPressing

Emitted on action down event. The first parameter indicates toggle state. The second parameter is the Button ID set using SetButtonID().

CYISignal<int32_t> CYIToggleButtonView::ButtonPressingOff

CYIToggleButtonView::ButtonPresssing when the button is in the CYIToggleButtonView::TOGGLED_OFF state.

CYISignal<int32_t> CYIToggleButtonView::ButtonPressingOn

CYIToggleButtonView::ButtonPresssing when the button is in the CYIToggleButtonView::TOGGLED_ON state.

CYISignal<bool, int32_t> CYIToggleButtonView::ButtonReleased

Emitted when the release timeline completes, or immediately after CYIToggleButtonView::ButtonReleasing if no eligible timeline exists state. The first parameter indicates toggle state. The second parameter is the Button ID set using SetButtonID().

CYISignal<int32_t> CYIToggleButtonView::ButtonReleasedOff
CYISignal<int32_t> CYIToggleButtonView::ButtonReleasedOn
CYISignal<bool, int32_t> CYIToggleButtonView::ButtonReleasing

Emitted immediately after ButtonToggled. The first parameter indicates toggle state. The second parameter is the Button ID set using SetButtonID().

CYISignal<int32_t> CYIToggleButtonView::ButtonReleasingOff
CYISignal<int32_t> CYIToggleButtonView::ButtonReleasingOn
CYISignal<bool, int32_t> CYIToggleButtonView::ButtonToggled

Emitted when the button is toggled (on action release event). The first parameter indicates toggle state. The second parameter is the Button ID set using SetButtonID().

CYISignal<int32_t> CYIToggleButtonView::ButtonToggledOff
CYISignal<int32_t> CYIToggleButtonView::ButtonToggledOn
TOGGLE_STATE CYIToggleButtonView::m_eToggleState
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pDisableAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pDisableCheckedAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pDownUpAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pDownUpCheckedAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pFocusInCheckedAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pFocusInCheckedToggleTransitionAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pFocusInToggleTransitionAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pFocusOutCheckedAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pOverUpAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pOverUpCheckedAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pPressAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pPressCheckedAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pToggleOffAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pToggleOnAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pUpOverAnim
protected
CYIAbstractTimeline* CYIToggleButtonView::m_pUpOverCheckedAnim
protected

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