Sleeping Wombat GUI  0.100
swGUI
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
sw::gui::UIElement Class Referenceabstract

Interface for all controls in tree. More...

#include <UIElement.h>

Inheritance diagram for sw::gui::UIElement:
sw::gui::Visual sw::gui::DependencyObject EngineObject sw::gui::HostWindow TestUIElementClass

Public Member Functions

 UIElement ()=default
 
virtual ~UIElement ()=default
 
 REGISTER_EVENT_DECLARATION (PreviewMouseUp, RoutingStrategy::Tunnel, UIElement, MouseButtonEventArgs)
 
 REGISTER_EVENT_DECLARATION (PreviewMouseDown, RoutingStrategy::Tunnel, UIElement, MouseButtonEventArgs)
 
 REGISTER_EVENT_DECLARATION (PreviewMouseRightButtonUp, RoutingStrategy::Direct, UIElement, MouseButtonEventArgs)
 
 REGISTER_EVENT_DECLARATION (PreviewMouseRightButtonDown, RoutingStrategy::Direct, UIElement, MouseButtonEventArgs)
 
 REGISTER_EVENT_DECLARATION (PreviewMouseLeftButtonDown, RoutingStrategy::Direct, UIElement, MouseButtonEventArgs)
 
 REGISTER_EVENT_DECLARATION (PreviewMouseLeftButtonUp, RoutingStrategy::Direct, UIElement, MouseButtonEventArgs)
 
 REGISTER_EVENT_DECLARATION (PreviewMouseWheel, RoutingStrategy::Tunnel, UIElement, MouseWheelEventArgs)
 
 REGISTER_EVENT_DECLARATION (PreviewMouseMove, RoutingStrategy::Tunnel, UIElement, MouseMoveEventArgs)
 
 REGISTER_EVENT_DECLARATION (PreviewKeyDown, RoutingStrategy::Tunnel, UIElement, KeyEventArgs)
 
 REGISTER_EVENT_DECLARATION (PreviewKeyUp, RoutingStrategy::Tunnel, UIElement, KeyEventArgs)
 
 REGISTER_EVENT_DECLARATION (MouseUp, RoutingStrategy::Bubble, UIElement, MouseButtonEventArgs)
 
 REGISTER_EVENT_DECLARATION (MouseDown, RoutingStrategy::Bubble, UIElement, MouseButtonEventArgs)
 
 REGISTER_EVENT_DECLARATION (MouseRightButtonDown, RoutingStrategy::Direct, UIElement, MouseButtonEventArgs)
 
 REGISTER_EVENT_DECLARATION (MouseRightButtonUp, RoutingStrategy::Direct, UIElement, MouseButtonEventArgs)
 
 REGISTER_EVENT_DECLARATION (MouseLeftButtonDown, RoutingStrategy::Direct, UIElement, MouseButtonEventArgs)
 
 REGISTER_EVENT_DECLARATION (MouseLeftButtonUp, RoutingStrategy::Direct, UIElement, MouseButtonEventArgs)
 
 REGISTER_EVENT_DECLARATION (MouseWheel, RoutingStrategy::Bubble, UIElement, MouseWheelEventArgs)
 
 REGISTER_EVENT_DECLARATION (MouseMove, RoutingStrategy::Bubble, UIElement, MouseMoveEventArgs)
 
 REGISTER_EVENT_DECLARATION (KeyUp, RoutingStrategy::Tunnel, UIElement, KeyEventArgs)
 
 REGISTER_EVENT_DECLARATION (KeyDown, RoutingStrategy::Tunnel, UIElement, KeyEventArgs)
 
 REGISTER_EVENT_DECLARATION (MouseEnter, RoutingStrategy::Direct, UIElement, MouseEventArgs)
 
 REGISTER_EVENT_DECLARATION (MouseLeave, RoutingStrategy::Direct, UIElement, MouseEventArgs)
 
Layout fuctions
virtual Size2D Measure (Size2D availableSize)=0
 Meassure pass. Check documentation in WPF. More...
 
virtual void Arrange (Rect &finalRect)=0
 Arragement pass. Check WPF documentation. More...
 
Visual tree manipulation
virtual Size GetNumChildren ()=0
 Get number of children in visual tree. More...
 
virtual UIElementGetUIChild (Size idx)=0
 Gets child in visual tree. More...
 
virtual bool AddChild (UIElementOPtr &&child)=0
 Add child. This function should set child parent to this pointer. More...
 
virtual void SetParent (UIElement *parent)
 Set control parent. Internal use. More...
 
virtual UIElementGetParent ()
 Returns control parent. More...
 
Restricted
virtual void InvokeEventDelegates (EventType eventID, UIElement *sender, IEventArgs *e, AccessKey)
 
GUISystem interaction events

Mouse and Keyboard input events and focus.

virtual void OnLoaded (UIElement *sender, IEventArgs *e)
 
virtual void OnUnloaded (UIElement *sender, IEventArgs *e)
 
virtual void OnGotFocus (UIElement *sender, IEventArgs *e)
 
virtual void OnLostFocus (UIElement *sender, IEventArgs *e)
 
virtual void OnMouseEnter (UIElement *sender, MouseEventArgs *e)
 
virtual void OnMouseLeave (UIElement *sender, MouseEventArgs *e)
 
virtual void OnMouseMove (UIElement *sender, MouseMoveEventArgs *e)
 
virtual void OnMouseWheel (UIElement *sender, MouseWheelEventArgs *e)
 
virtual void OnMouseDown (UIElement *sender, MouseButtonEventArgs *e)
 
virtual void OnMouseUp (UIElement *sender, MouseButtonEventArgs *e)
 
virtual void OnMouseRightButtonDown (UIElement *sender, MouseButtonEventArgs *e)
 
virtual void OnMouseRightButtonUp (UIElement *sender, MouseButtonEventArgs *e)
 
virtual void OnMouseLeftButtonDown (UIElement *sender, MouseButtonEventArgs *e)
 
virtual void OnMouseLeftButtonUp (UIElement *sender, MouseButtonEventArgs *e)
 
virtual void OnPreviewMouseMove (UIElement *sender, MouseMoveEventArgs *e)
 
virtual void OnPreviewMouseWheel (UIElement *sender, MouseWheelEventArgs *e)
 
virtual void OnPreviewMouseDown (UIElement *sender, MouseButtonEventArgs *e)
 
virtual void OnPreviewMouseUp (UIElement *sender, MouseButtonEventArgs *e)
 
virtual void OnPreviewMouseRightButtonDown (UIElement *sender, MouseButtonEventArgs *e)
 
virtual void OnPreviewMouseRightButtonUp (UIElement *sender, MouseButtonEventArgs *e)
 
virtual void OnPreviewMouseLeftButtonDown (UIElement *sender, MouseButtonEventArgs *e)
 
virtual void OnPreviewMouseLeftButtonUp (UIElement *sender, MouseButtonEventArgs *e)
 
virtual void OnKeyDown (UIElement *sender, KeyEventArgs *e)
 
virtual void OnKeyUp (UIElement *sender, KeyEventArgs *e)
 
virtual void OnPreviewKeyDown (UIElement *sender, KeyEventArgs *e)
 
virtual void OnPreviewKeyUp (UIElement *sender, KeyEventArgs *e)
 
- Public Member Functions inherited from sw::gui::Visual
 Visual ()=default
 
 ~Visual ()=default
 
virtual bool HitTest (const Position &point)=0
 Checks if point is within this object. More...
 
virtual void OnRender (DrawingContext &context)=0
 Control rendering behavior. More...
 
- Public Member Functions inherited from sw::gui::DependencyObject
 DependencyObject ()
 
 ~DependencyObject ()=default
 
- Public Member Functions inherited from EngineObject
TypeID GetType () const
 
std::string GetTypeName () const
 
virtual void Serialize (ISerializer *ser) const
 Implements default serialization. Serializes only declared properties. More...
 
virtual void Deserialize (IDeserializer *deser)
 Implements default deserialization. More...
 
virtual Size MemorySize ()
 
template<typename TargetType >
TargetType * DynamicCast ()
 

Protected Attributes

UIElementm_parent
 Parent in controls visual tree. More...
 
bool m_isVisible: 1
 
bool m_isEnabled: 1
 
bool m_isMouseOver: 1
 
bool m_isFocused: 1
 This is logical focus. More...
 
bool m_isKeyboardFocus: 1
 This element has keyboard focus and will receive keyboard events. More...
 
bool m_isKeyboardFocusWithin: 1
 This element or it's children have keyboard focus. More...
 
bool m_isMouseCaptured: 1
 Check if element have captured mouse. More...
 
bool m_isMouseCapturedWithin: 1
 Element or it's children have captured mouse. More...
 
bool m_isFocusable: 1
 
Size2D m_desiredSize
 Desired size after Messure pass. More...
 
EventHandlers m_eventHandlers
 Managing delegates. More...
 
- Protected Attributes inherited from sw::gui::DependencyObject
EngineObjectm_dataContext
 Context for binding. More...
 

Private Member Functions

 RTTR_ENABLE (Visual)
 

Private Attributes

 RTTR_REGISTRATION_FRIEND
 

Friends

class UIElementTester
 

Detailed Description

Interface for all controls in tree.

Provides functionalities:

Connects WPF UIElement and FrameworkElement classes.

Todo:
Implement logical focus in future. (Check in WPF)

Constructor & Destructor Documentation

sw::gui::UIElement::UIElement ( )
explicitdefault
virtual sw::gui::UIElement::~UIElement ( )
virtualdefault

Member Function Documentation

virtual bool sw::gui::UIElement::AddChild ( UIElementOPtr &&  child)
pure virtual

Add child. This function should set child parent to this pointer.

Returns
Returns false if this control can't have children.

Implemented in sw::gui::HostWindow.

virtual void sw::gui::UIElement::Arrange ( Rect finalRect)
pure virtual

Arragement pass. Check WPF documentation.

Implemented in sw::gui::HostWindow, and TestUIElementClass.

virtual Size sw::gui::UIElement::GetNumChildren ( )
pure virtual

Get number of children in visual tree.

Implemented in sw::gui::HostWindow, and TestUIElementClass.

virtual UIElement* sw::gui::UIElement::GetParent ( )
inlinevirtual

Returns control parent.

virtual UIElement* sw::gui::UIElement::GetUIChild ( Size  idx)
pure virtual

Gets child in visual tree.

Implemented in sw::gui::HostWindow, and TestUIElementClass.

void sw::gui::UIElement::InvokeEventDelegates ( EventType  eventID,
UIElement sender,
IEventArgs e,
AccessKey   
)
virtual
virtual Size2D sw::gui::UIElement::Measure ( Size2D  availableSize)
pure virtual

Meassure pass. Check documentation in WPF.

Implemented in sw::gui::HostWindow, and TestUIElementClass.

virtual void sw::gui::UIElement::OnGotFocus ( UIElement sender,
IEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnKeyDown ( UIElement sender,
KeyEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnKeyUp ( UIElement sender,
KeyEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnLoaded ( UIElement sender,
IEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnLostFocus ( UIElement sender,
IEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnMouseDown ( UIElement sender,
MouseButtonEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnMouseEnter ( UIElement sender,
MouseEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnMouseLeave ( UIElement sender,
MouseEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnMouseLeftButtonDown ( UIElement sender,
MouseButtonEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnMouseLeftButtonUp ( UIElement sender,
MouseButtonEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnMouseMove ( UIElement sender,
MouseMoveEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnMouseRightButtonDown ( UIElement sender,
MouseButtonEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnMouseRightButtonUp ( UIElement sender,
MouseButtonEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnMouseUp ( UIElement sender,
MouseButtonEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnMouseWheel ( UIElement sender,
MouseWheelEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnPreviewKeyDown ( UIElement sender,
KeyEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnPreviewKeyUp ( UIElement sender,
KeyEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnPreviewMouseDown ( UIElement sender,
MouseButtonEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnPreviewMouseLeftButtonDown ( UIElement sender,
MouseButtonEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnPreviewMouseLeftButtonUp ( UIElement sender,
MouseButtonEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnPreviewMouseMove ( UIElement sender,
MouseMoveEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnPreviewMouseRightButtonDown ( UIElement sender,
MouseButtonEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnPreviewMouseRightButtonUp ( UIElement sender,
MouseButtonEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnPreviewMouseUp ( UIElement sender,
MouseButtonEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnPreviewMouseWheel ( UIElement sender,
MouseWheelEventArgs e 
)
inlinevirtual
virtual void sw::gui::UIElement::OnUnloaded ( UIElement sender,
IEventArgs e 
)
inlinevirtual
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( PreviewMouseUp  ,
RoutingStrategy::Tunnel  ,
UIElement  ,
MouseButtonEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( PreviewMouseDown  ,
RoutingStrategy::Tunnel  ,
UIElement  ,
MouseButtonEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( PreviewMouseRightButtonUp  ,
RoutingStrategy::Direct  ,
UIElement  ,
MouseButtonEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( PreviewMouseRightButtonDown  ,
RoutingStrategy::Direct  ,
UIElement  ,
MouseButtonEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( PreviewMouseLeftButtonDown  ,
RoutingStrategy::Direct  ,
UIElement  ,
MouseButtonEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( PreviewMouseLeftButtonUp  ,
RoutingStrategy::Direct  ,
UIElement  ,
MouseButtonEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( PreviewMouseWheel  ,
RoutingStrategy::Tunnel  ,
UIElement  ,
MouseWheelEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( PreviewMouseMove  ,
RoutingStrategy::Tunnel  ,
UIElement  ,
MouseMoveEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( PreviewKeyDown  ,
RoutingStrategy::Tunnel  ,
UIElement  ,
KeyEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( PreviewKeyUp  ,
RoutingStrategy::Tunnel  ,
UIElement  ,
KeyEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( MouseUp  ,
RoutingStrategy::Bubble  ,
UIElement  ,
MouseButtonEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( MouseDown  ,
RoutingStrategy::Bubble  ,
UIElement  ,
MouseButtonEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( MouseRightButtonDown  ,
RoutingStrategy::Direct  ,
UIElement  ,
MouseButtonEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( MouseRightButtonUp  ,
RoutingStrategy::Direct  ,
UIElement  ,
MouseButtonEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( MouseLeftButtonDown  ,
RoutingStrategy::Direct  ,
UIElement  ,
MouseButtonEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( MouseLeftButtonUp  ,
RoutingStrategy::Direct  ,
UIElement  ,
MouseButtonEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( MouseWheel  ,
RoutingStrategy::Bubble  ,
UIElement  ,
MouseWheelEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( MouseMove  ,
RoutingStrategy::Bubble  ,
UIElement  ,
MouseMoveEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( KeyUp  ,
RoutingStrategy::Tunnel  ,
UIElement  ,
KeyEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( KeyDown  ,
RoutingStrategy::Tunnel  ,
UIElement  ,
KeyEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( MouseEnter  ,
RoutingStrategy::Direct  ,
UIElement  ,
MouseEventArgs   
)
sw::gui::UIElement::REGISTER_EVENT_DECLARATION ( MouseLeave  ,
RoutingStrategy::Direct  ,
UIElement  ,
MouseEventArgs   
)
sw::gui::UIElement::RTTR_ENABLE ( Visual  )
private
void sw::gui::UIElement::SetParent ( UIElement parent)
virtual

Set control parent. Internal use.

Friends And Related Function Documentation

friend class UIElementTester
friend

Member Data Documentation

Size2D sw::gui::UIElement::m_desiredSize
protected

Desired size after Messure pass.

EventHandlers sw::gui::UIElement::m_eventHandlers
protected

Managing delegates.

bool sw::gui::UIElement::m_isEnabled
protected
Todo:
Maybe it's something from higher level.
bool sw::gui::UIElement::m_isFocusable
protected
bool sw::gui::UIElement::m_isFocused
protected

This is logical focus.

bool sw::gui::UIElement::m_isKeyboardFocus
protected

This element has keyboard focus and will receive keyboard events.

bool sw::gui::UIElement::m_isKeyboardFocusWithin
protected

This element or it's children have keyboard focus.

bool sw::gui::UIElement::m_isMouseCaptured
protected

Check if element have captured mouse.

bool sw::gui::UIElement::m_isMouseCapturedWithin
protected

Element or it's children have captured mouse.

bool sw::gui::UIElement::m_isMouseOver
protected
bool sw::gui::UIElement::m_isVisible
protected
UIElement* sw::gui::UIElement::m_parent
protected

Parent in controls visual tree.

sw::gui::UIElement::RTTR_REGISTRATION_FRIEND
private

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