You.i Engine
YiDevWidgetWithText.h
Go to the documentation of this file.
1 #ifndef _YI_DEV_WIDGET_WITH_TEXT_H_
2 #define _YI_DEV_WIDGET_WITH_TEXT_H_
3 
7 
8 class CYIGeoButton;
9 class CYIGeoLabel;
10 class CYIGeoList;
11 class CYIGeoScene;
12 class CYIGeoView;
13 class CYISceneView;
14 
32 {
33 public:
34  CYIDevWidgetWithText(const CYIString &title = "Untitled Text Widget", const CYIString &subtitle = "");
35 
41  virtual void SetText(const CYIString &text, const CYIGeometryBatch::TextSettings &settings = CYIGeometryBatch::TextSettings());
42 
47 
51  void SetFloatingMode(bool floating);
52 
53 protected:
54  virtual void OnDraw() override;
55  virtual bool OnUpdate(bool *pSkipUpdate = nullptr) override;
56  virtual void OnPanelItemClicked() override;
57  virtual void OnShow();
58  virtual void OnHide();
59  virtual bool OnHandleActionInputs(int32_t x, int32_t y, int32_t wheelDelta, CYIActionEvent::ButtonType button, CYIEvent::Type eventType, uint8_t pointerID, bool hover) override;
60  virtual bool OnHandleKeyInputs(const CYIKeyEvent &keyEvent) override;
61  virtual bool OnBackButtonPressed() override;
62  void UpdateText();
63 
67  void OnClicked();
68 
69 private:
70  bool m_floating;
71  std::vector<std::shared_ptr<CYIGeoLabel>> m_lines;
72  int32_t m_alignment;
73 
74  std::shared_ptr<CYIGeoScene> m_pView;
75  std::shared_ptr<CYIGeoButton> m_pContainer;
76  std::shared_ptr<CYIGeoLabel> m_pTitle;
77  std::shared_ptr<CYIGeoList> m_pList;
78  std::shared_ptr<CYIGeoButton> m_pCloseButton;
79 
81 };
82 
85 #endif
Class for key events.
Definition: YiKeyEvent.h:15
The base class for all view types. Views are containers of renderable elements that often define inte...
Definition: YiSceneView.h:47
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:36
CYIDevWidgetWithText(const CYIString &title="Untitled Text Widget", const CYIString &subtitle="")
virtual void OnHide()
Implement this interface to provide custom behaviour when the system back button is pressed...
Definition: YiBackButtonHandler.h:30
Definition: YiGeometryBatch.h:91
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 void OnPanelItemClicked() override
void SetFloatingMode(bool floating)
virtual bool OnUpdate(bool *pSkipUpdate=nullptr) override
virtual bool OnHandleKeyInputs(const CYIKeyEvent &keyEvent) override
virtual void SetText(const CYIString &text, const CYIGeometryBatch::TextSettings &settings=CYIGeometryBatch::TextSettings())
ButtonType
Definition: YiActionEvent.h:21
virtual void OnDraw() override
A dev widget used to display text to the user.
Definition: YiDevWidgetWithText.h:31
The base class for all dev widgets.
Definition: YiDevWidget.h:36
#define YI_TYPE_BASES(CLASS, BASES...)
Definition: YiRtti.h:257
virtual bool OnBackButtonPressed() override
virtual void OnShow()
Type
The event type of the CYIEvent class instance.
Definition: YiEvent.h:33
void AddLine(const CYIString &text, const CYIGeometryBatch::TextSettings &settings=CYIGeometryBatch::TextSettings())