You.i Engine
CYIDevWidgetWithText Class Reference

Detailed Description

A dev widget used to display text to the user.

This dev widget can be configured in one of two modes: floating or non-floating.

In non-floating mode, which is the default, a full-screen view is displayed with the text in a scrolling view. Clicking the on-screen X or hitting the ESC key on a keyboard dismisses the view.

In floating mode, the text is overlaid on top of the app in one of the corners. Clicking the view moves it between the app corners.

The title of the widget is displayed at the top of the text view.

#include <debug/YiDevWidgetWithText.h>

Inheritance diagram for CYIDevWidgetWithText:

Public Member Functions

 CYIDevWidgetWithText (const CYIString &title="Untitled Text Widget", const CYIString &subtitle="")
virtual void SetText (const CYIString &text, const CYIGeometryBatch::TextSettings &settings=CYIGeometryBatch::TextSettings())
void AddLine (const CYIString &text, const CYIGeometryBatch::TextSettings &settings=CYIGeometryBatch::TextSettings())
void SetFloatingMode (bool floating)
- 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 RefreshState ()
virtual void OnConfigureButtonClicked ()
virtual void OnConfigurationItemClicked (size_t buttonID)
virtual void OnConfigurationSubpanelClosed ()
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 ()
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 *)

Protected Member Functions

virtual void OnDraw () override
virtual bool OnUpdate (bool *pSkipUpdate=nullptr) override
virtual void OnPanelItemClicked () override
virtual void OnShow ()
virtual void OnHide ()
virtual bool OnHandleActionInputs (int32_t x, int32_t y, int32_t wheelDelta, CYIActionEvent::ButtonType button, CYIEvent::Type eventType, uint8_t pointerID, bool hover) override
virtual bool OnHandleKeyInputs (const CYIKeyEvent &keyEvent) override
virtual bool OnBackButtonPressed () override
void UpdateText ()
void OnClicked ()
- 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

◆ CYIDevWidgetWithText()

CYIDevWidgetWithText::CYIDevWidgetWithText ( const CYIString title = "Untitled Text Widget",
const CYIString subtitle = "" 

Member Function Documentation

◆ AddLine()

void CYIDevWidgetWithText::AddLine ( const CYIString text,
const CYIGeometryBatch::TextSettings settings = CYIGeometryBatch::TextSettings() 

Adds a single line of text to the existing text. The line of text can be styled using the settings parameter.

◆ OnBackButtonPressed()

virtual bool CYIDevWidgetWithText::OnBackButtonPressed ( )

Will be called when back button pressed is notified by NotifyBackButtonPressed if this listener is registered. Return true if the back button has been handled. Return false to pass the notification on to the next registered listener, or back to the system.

Registered listeners are called in a Last In, First Out order.

Implements CYIBackButtonHandler::Listener.

◆ OnClicked()

void CYIDevWidgetWithText::OnClicked ( )

Called when the floating text view is clicked.

◆ OnDraw()

virtual void CYIDevWidgetWithText::OnDraw ( )

Called during the app's Draw cycle. This is called after the scene tree has been rendered (and after the dev panel itself has been rendered). Widgets that make use of CYIGeometryBatch will typically want to implement this function.

Reimplemented from CYIDevWidget.

◆ OnHandleActionInputs()

virtual bool CYIDevWidgetWithText::OnHandleActionInputs ( int32_t  x,
int32_t  y,
int32_t  wheelDelta,
CYIActionEvent::ButtonType  button,
CYIEvent::Type  eventType,
uint8_t  pointerID,
bool  hover 

Called when an action input occurs. If true is returned, the input will not be propagated to the app.

Reimplemented from CYIDevWidget.

◆ OnHandleKeyInputs()

virtual bool CYIDevWidgetWithText::OnHandleKeyInputs ( const CYIKeyEvent keyEvent)

Called when a key event occurs. If true is returned, the event will not be propagated to the app.

Reimplemented from CYIDevWidget.

◆ OnHide()

virtual void CYIDevWidgetWithText::OnHide ( )

◆ OnPanelItemClicked()

virtual void CYIDevWidgetWithText::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.

◆ OnShow()

virtual void CYIDevWidgetWithText::OnShow ( )

◆ OnUpdate()

virtual bool CYIDevWidgetWithText::OnUpdate ( bool *  pSkipUpdate = nullptr)

Called during the app's Update cycle. This is called prior to the scene tree's update. The pSkipUpdate boolean can be set to true to skip updating the scene tree. This function should return true if a draw is required.

Reimplemented from CYIDevWidget.

◆ SetFloatingMode()

void CYIDevWidgetWithText::SetFloatingMode ( bool  floating)

Sets the floating mode to floating. If this function is called with true, the text will be displayed in a floating overlay. Otherwise, the text will be displayed in a full-screen scrolling view.

◆ SetText()

virtual void CYIDevWidgetWithText::SetText ( const CYIString text,
const CYIGeometryBatch::TextSettings settings = CYIGeometryBatch::TextSettings() 

Sets the text to display to text. The text can be styled using the settings parameter.

'Quake-style' coloring is supported within the text. For example, 'A word in ^009blue' would display the word 'blue' in blue.

◆ UpdateText()

void CYIDevWidgetWithText::UpdateText ( )

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