You.i Engine
CYISignalWidget Class Reference

Detailed Description

A dev widget that calls a signal when activated.

This widget provides an easy way to trigger behaviour on-demand. The usage pattern is to create a CYISignalWidget instance, connecting to the CYISignalWidget::Activated signal (and optionally to the CYISignalWidget::Deactivated signal) and adding the widget to the dev panel. When the widget's dev panel item is clicked, the CYISignalWidget::Activated signal is called.

If both the CYISignalWidget::Activated and CYISignalWidget::Deactivated signals are connected to, the widget's dev panel item will be displayed with an on/off indicator. As the widget's dev panel item is clicked, the CYISignalWidget::Activated and CYISignalWidget::Deactivated signals will be called alternatively.

This header is part of the debug-tools optional module.

#include <debug/YiSignalWidget.h>

Inheritance diagram for CYISignalWidget:

Public Member Functions

 CYISignalWidget (const CYIString &title="Untitled Signal Widget")
void SetUseDevPanelSignals ()
- Public Member Functions inherited from CYIDevWidget
 CYIDevWidget (const CYIString &title, const CYIString &subtitle="")
virtual ~CYIDevWidget ()
bool IsUsingIndicator () const
bool IsUsingSimulatedKeys () const
bool IsCapturingAllEvents () const
bool IsUsingConfigurationItems () const
State GetState () const
virtual const CYIStringGetTitle () const
virtual const CYIStringGetSubtitle () const
void SetParentPanel (CYIDevPanel *pPanel, size_t indexInPanel)
size_t GetIndexInPanel () const
void UpdateWidgetState ()
virtual void OnConfigureButtonClicked ()
virtual void OnConfigurationItemClicked (size_t buttonID)
virtual void OnConfigurationSubpanelClosed ()
virtual void OnDraw ()
virtual bool OnUpdate (bool *pSkipUpdate=nullptr)
virtual bool OnHandleKeyInputs (const CYIKeyEvent &keyEvent)
virtual bool OnHandleActionInputs (const CYIActionEvent &actionEvent)
virtual bool OnPreFilterEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent, CYIEventHandler *pDestination)
void SimulatePanelItemClicked ()
bool SimulateKeyPress (const CYIKeyEvent &keyEvent)
void SimulatedKeyPressesEnded ()
- Public Member Functions inherited from CYISignalHandler
 CYISignalHandler ()
 CYISignalHandler (const CYISignalHandler &signalHandler)
virtual ~CYISignalHandler ()
CYISignalHandleroperator= (const CYISignalHandler &signalHandler)
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 &threadAffinity)
virtual bool IsConnected () const
virtual bool IsConnected (const CYISignalBase &signal) const
void Disconnect (CYISignalBase &signal)
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 Attributes

CYISignal Activated
CYISignal Deactivated

Protected Member Functions

virtual void RefreshState () override
virtual void OnPanelItemClicked () override
- Protected Member Functions inherited from CYIDevWidget
void SetUseSimulatedKeys (bool useSimulatedKeys)
void SetCaptureAllEvents (bool captureAllEvents)
void SetUsesConfigurationItems (bool usesConfigurationItems)
virtual std::vector< std::pair< CYIString, CYIString > > GetConfigurationButtonTitles ()
CYISceneNodeGetLogicalRoot () const

Additional Inherited Members

- Public Types inherited from CYIDevWidget
enum  State {
  State::Off = 0,
- Protected Attributes inherited from CYIDevWidget
size_t m_indexInPanel
State m_state
CYIString m_title
CYIString m_subtitle

Constructor & Destructor Documentation

◆ CYISignalWidget()

CYISignalWidget::CYISignalWidget ( const CYIString title = "Untitled Signal Widget")

Member Function Documentation

◆ OnPanelItemClicked()

virtual void CYISignalWidget::OnPanelItemClicked ( )

Called when the widget's item in the dev panel is clicked. This is where a widgets should implement its behaviour. Widgets often update their state when this function is called.

At a minimum, dev widgets must implement this function.

Implements CYIDevWidget.

◆ RefreshState()

virtual void CYISignalWidget::RefreshState ( )

Used to refresh the state of the widget. This is called when the dev panel is opened.

Reimplemented from CYIDevWidget.

◆ SetUseDevPanelSignals()

void CYISignalWidget::SetUseDevPanelSignals ( )

Configures this widget to use the CYIDevlPanel::UserActivated and CYIDevlPanel::UserDeactivated signals from the dev panel instead of the CYISignalWidget::Activated and CYISignalWidget::Deactivated signals.

Member Data Documentation

◆ Activated

CYISignal CYISignalWidget::Activated

The signal emitted when this widget is activated. If nothing is connected to this signal, the widget will automatically be disabled.

◆ Deactivated

CYISignal CYISignalWidget::Deactivated

The signal emitted when this widget is deactivated. If nothing is connected to this signal, the widget will be placed in 'stateless' mode and only the CYISignalWidget::Activated signal will be called.

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