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.
#include <debug/YiSignalWidget.h>

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 CYIString & | GetTitle () const |
| virtual const CYIString & | GetSubtitle () const |
| void | SetParentPanel (CYIDevPanel *pPanel, uint32_t uIndexInPanel) |
| uint32_t | GetIndexInPanel () const |
| void | UpdateWidgetState () |
| virtual void | OnConfigureButtonClicked () |
| virtual void | OnConfigurationItemClicked (int32_t nButtonID) |
| virtual void | OnConfigurationSubpanelClosed () |
| virtual void | OnDraw () |
| virtual bool | OnUpdate (bool *pbSkipUpdate=nullptr) |
| virtual bool | OnHandleKeyInputs (const CYIKeyEvent &keyEvent) |
| virtual bool | OnHandleActionInputs (int32_t nX, int32_t nY, int32_t nWheelDelta, uint8_t uButton, YI_EVENT_TYPE eEventType, uint8_t uPointerID, bool bHover) |
| 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 &rSignalHandler) | |
| virtual | ~CYISignalHandler () |
| CYISignalHandler & | operator= (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 CYIScriptableObject | |
| CYIScriptableObject () | |
| CYIScriptableObject (const CYIScriptableObject &other) | |
| CYIScriptableObject & | operator= (const CYIScriptableObject &other) |
| virtual | ~CYIScriptableObject () |
| CYIBindingImplementation * | GetBindingImplementation () const |
| void | SetBindingImplementation (CYIBindingImplementation *pBindingImplementation) |
| virtual const CYIRuntimeTypeInfo * | GetRuntimeTypeInfoForScriptObject () const |
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 bUseSimulatedKeys) |
| void | SetCaptureAllEvents (bool bCaptureAllEvents) |
| void | SetUsesConfigurationItems (bool bUsesConfigurationItems) |
| virtual std::vector< std::pair< CYIString, CYIString > > | GetConfigurationButtonTitles () |
| CYISceneNode * | GetLogicalRoot () const |
Additional Inherited Members | |
Public Types inherited from CYIDevWidget | |
| enum | STATE { OFF, ON, STATELESS, DISABLED } |
Protected Attributes inherited from CYIDevWidget | |
| CYIDevPanel * | m_pParentPanel |
| uint32_t | m_uIndexInPanel |
| STATE | m_eState |
| CYIString | m_title |
| CYIString | m_subtitle |
| CYISignalWidget::CYISignalWidget | ( | const CYIString & | title = "Untitled Signal Widget" | ) |
|
overrideprotectedvirtual |
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.
Implements CYIDevWidget.
|
overrideprotectedvirtual |
Used to refresh the state of the widget. This is called when the dev panel is opened.
Reimplemented from CYIDevWidget.
| 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.
| CYISignal CYISignalWidget::Activated |
The signal emitted when this widget is activated. If nothing is connected to this signal, the widget will automatically be disabled.
| 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.