Sleeping Wombat GUI  0.100
swGUI
TestUIElementClass.h
Go to the documentation of this file.
1 #pragma once
2 
3 
6 
7 
8 #include <vector>
9 
10 //using namespace sw::gui;
11 
12 
13 
14 
15 // ================================ //
16 //
18 {
20 };
22 
23 
24 // ================================ //
25 //
27 {
29 };
31 
32 
33 //====================================================================================//
34 // Header
35 //====================================================================================//
36 
38 {
40 private:
41 
42  std::vector< sw::gui::UIElementOPtr > m_children;
43 
44 public:
45  // Event part
46  REGISTER_EVENT_DECLARATION( ValidationStarted, RoutingStrategy::Direct, TestUIElementClass, ValidationEventArgs );
47  REGISTER_EVENT_DECLARATION( ValidationEnded, RoutingStrategy::Direct, TestUIElementClass, ValidationEventArgs );
48  REGISTER_EVENT_DECLARATION( UnusedEvent, RoutingStrategy::Direct, TestUIElementClass, UnusedEventArgs );
49 
50  REGISTER_EVENT_DECLARATION( PreviewTunnelEvent, RoutingStrategy::Tunnel, TestUIElementClass, ValidationEventArgs );
51  REGISTER_EVENT_DECLARATION( BubbleEvent, RoutingStrategy::Bubble, TestUIElementClass, ValidationEventArgs );
52 public:
53  void EventRaisingFunction ();
54  void RaiseTunnelEvent ();
55  void RaiseBubbleEvent ();
56 
59 
60 #pragma region Inherited
61 
62 
63  // Inherited via UIElement
64  virtual bool HitTest( const sw::gui::Position & point ) override
65  {
66  return false;
67  }
68 
69  virtual void OnRender( sw::gui::DrawingContext & context ) override
70  {}
71 
72  virtual sw::gui::Size2D Measure( sw::gui::Size2D availableSize ) override
73  {
74  return sw::gui::Size2D();
75  }
76 
77  virtual void Arrange( sw::gui::Rect & finalRect ) override
78  {}
79 
80  virtual Size GetNumChildren () override;
81  virtual UIElement * GetUIChild ( Size idx ) override;
82  virtual bool AddChild ( sw::gui::UIElementOPtr && child ) override;
83 
84 #pragma endregion
85 
86 
87 
88 
89 };
91 
Definition: TestUIElementClass.h:26
virtual void OnRender(sw::gui::DrawingContext &context) override
Control rendering behavior.
Definition: TestUIElementClass.h:69
Base class for events.
Definition: IEventArgs.h:27
std::vector< sw::gui::UIElementOPtr > m_children
Definition: TestUIElementClass.h:42
virtual void Arrange(sw::gui::Rect &finalRect) override
Arragement pass. Check WPF documentation.
Definition: TestUIElementClass.h:77
virtual bool HitTest(const sw::gui::Position &point) override
Checks if point is within this object.
Definition: TestUIElementClass.h:64
DEFINE_OPTR_TYPE(ValidationEventArgs)
Definition: TestUIElementClass.h:37
RTTR_ENABLE(sw::gui::UIElement)
virtual sw::gui::Size2D Measure(sw::gui::Size2D availableSize) override
Meassure pass. Check documentation in WPF.
Definition: TestUIElementClass.h:72
virtual bool AddChild(sw::gui::UIElementOPtr &&child) override
Definition: TestUIElementClass.cpp:85
void RaiseTunnelEvent()
Definition: TestUIElementClass.cpp:46
Interface for all controls in tree.
Definition: UIElement.h:57
Rectangle structure.
Definition: CommonTypes.h:32
uint32 EventType
Event type identifier.
Definition: RegisteredEvent.h:19
DirectX::XMFLOAT2 Size2D
Definition: CommonTypes.h:28
Definition: TestUIElementClass.h:17
RTTR_ENABLE(sw::gui::IEventArgs)
size_t Size
Definition: TypesDefinitions.h:35
Context passed to rendering functions.
Definition: DrawingContext.h:22
void RaiseBubbleEvent()
Definition: TestUIElementClass.cpp:54
DirectX::XMFLOAT2 Position
Definition: CommonTypes.h:27
REGISTER_EVENT_DECLARATION(ValidationStarted, RoutingStrategy::Direct, TestUIElementClass, ValidationEventArgs)
bool ExistsDelegatesContainer(sw::gui::EventType eventID)
Check functions.
Definition: TestUIElementClass.cpp:62
void EventRaisingFunction()
Definition: TestUIElementClass.cpp:35
virtual UIElement * GetUIChild(Size idx) override
Gets child in visual tree.
Definition: TestUIElementClass.cpp:76
RTTR_ENABLE(sw::gui::IEventArgs)
virtual Size GetNumChildren() override
Get number of children in visual tree.
Definition: TestUIElementClass.cpp:69