CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::UIResponder Class Reference

An abstract class that forms the basis of event and command processing in the UI framework. More...

#include <CeresEngine/UI/UIResponder.hpp>

Inheritance diagram for CeresEngine::UIResponder:
CeresEngine::UIView CeresEngine::UIViewController CeresEngine::UIWindow CeresEngine::UIWindowController CeresEngine::UIClipView CeresEngine::UIContainerView CeresEngine::UIControl CeresEngine::UIGizmo CeresEngine::UILabel CeresEngine::UIMenuBar CeresEngine::UIScrollView CeresEngine::UISplitView CeresEngine::UIStackView CeresEngine::UIToolBar CeresEngine::UIViewport CeresEngine::TUIViewController< UISplitView > CeresEngine::TUIViewController< UIViewport > CeresEngine::TUIViewController< TViewType, TParentViewControllerType > CeresEngine::UIModelViewController< TModelType, TViewControllerType >

Public Member Functions

virtual ~UIResponder ()=default
 
virtual bool acceptsFirstResponder () const
 A Boolean value that indicates whether the responder accepts first responder status.
 
virtual bool becomeFirstResponder ()
 Notifies the receiver that it's about to become first responder in its window.
 
virtual bool resignFirstResponder ()
 Notifies the receiver that it's been asked to relinquish its status as first responder in its window.
 
virtual UIRespondergetNextResponder () const
 The next responder after this one, or nil if it has none.
 
virtual void mouseDown (const UIMouseEvent &event)
 Informs the receiver that the user has pressed the left mouse button.
 
virtual void mouseDragged (const UIMouseEvent &event)
 Informs the receiver that the user has moved the mouse with the left button pressed.
 
virtual void mouseUp (const UIMouseEvent &event)
 Informs the receiver that the user has released the left mouse button.
 
virtual void mouseMoved (const UIMouseEvent &event)
 Informs the receiver that the mouse has moved.
 
virtual void mouseEntered (const UIMouseEvent &event)
 Informs the receiver that the cursor has entered a tracking rectangle.
 
virtual void mouseExited (const UIMouseEvent &event)
 Informs the receiver that the cursor has exited a tracking rectangle.
 
virtual void rightMouseDown (const UIMouseEvent &event)
 Informs the receiver that the user has pressed the right mouse button.
 
virtual void rightMouseDragged (const UIMouseEvent &event)
 Informs the receiver that the user has moved the mouse with the right button pressed.
 
virtual void rightMouseUp (const UIMouseEvent &event)
 Informs the receiver that the user has released the right mouse button.
 
virtual void otherMouseDown (const UIMouseEvent &event)
 Informs the receiver that the user has pressed a mouse button other than the left or right one.
 
virtual void otherMouseDragged (const UIMouseEvent &event)
 Informs the receiver that the user has moved the mouse with a button other than the left or right button pressed.
 
virtual void otherMouseUp (const UIMouseEvent &event)
 Informs the receiver that the user has released a mouse button other than the left or right button.
 
virtual void scrollWheel (const UIMouseEvent &event)
 Informs the receiver that the mouse's scroll wheel has moved.
 
virtual void keyDown (const UIKeyEvent &event)
 Informs the receiver that the user has pressed a key.
 
virtual void keyUp (const UIKeyEvent &event)
 Informs the receiver that the user has released a key.
 
virtual void interpretKeyEvents (const Vector< UIKeyEvent > &events)
 Handles a series of key events.
 
virtual bool performKeyEquivalent (const UIKeyEvent &event)
 Handle a key equivalent.
 
virtual void flushBufferedKeyEvents ()
 Clears any unprocessed key events when overridden by subclasses.
 
virtual void cursorUpdate (const UIEvent &event)
 Informs the receiver that the mouse cursor has moved into a cursor rectangle.
 
virtual void flagsChanged (const UIEvent &event)
 Informs the receiver that the user has pressed or released a modifier key (Shift, Control, and so on).
 

Static Public Member Functions

static void dispatch (UIResponder *const firstResponder, const UIEvent &event)
 Dispatches a UIEvent to the given first responder.
 

Detailed Description

An abstract class that forms the basis of event and command processing in the UI framework.

The core classes—UIWindow and UIView—inherit from UIResponder, as must any class that handles events. The responder model is built around three components: events, actions, and the responder chain.

The exact path up the modified responder chain is: view > superviews > window.

In addition to handling events, responders also manage the forwarding of unhandled events to other parts the framework. If a given responder does not handle an event, it forwards that event to the next event in the responder chain. The framework manages the responder chain dynamically, using predefined rules to determine which object should be next to receive an event. For example, a view forwards events to its superview, and the root view of a hierarchy forwards events to the window.

Constructor & Destructor Documentation

◆ ~UIResponder()

virtual CeresEngine::UIResponder::~UIResponder ( )
virtualdefault

Member Function Documentation

◆ acceptsFirstResponder()

virtual bool CeresEngine::UIResponder::acceptsFirstResponder ( ) const
inlinevirtual

A Boolean value that indicates whether the responder accepts first responder status.

As first responder, the receiver is the first object in the responder chain to be sent key events and action messages. By default, this property is false. Subclasses set this property to true if the receiver accepts first responder status.

Reimplemented in CeresEngine::UIControl, and CeresEngine::UIViewport.

◆ becomeFirstResponder()

virtual bool CeresEngine::UIResponder::becomeFirstResponder ( )
inlinevirtual

Notifies the receiver that it's about to become first responder in its window.

The default implementation returns true, accepting first responder status. Subclasses can override this method to update state or perform some action such as highlighting the selection, or to return false, refusing first responder status.

Use the UIWindow::makeFirstResponder() method, not this method, to make an object the first responder. Never invoke this method directly.

Reimplemented in CeresEngine::UIControl.

◆ cursorUpdate()

virtual void CeresEngine::UIResponder::cursorUpdate ( const UIEvent event)
virtual

Informs the receiver that the mouse cursor has moved into a cursor rectangle.

◆ dispatch()

static void CeresEngine::UIResponder::dispatch ( UIResponder *const  firstResponder,
const UIEvent event 
)
static

Dispatches a UIEvent to the given first responder.

Parameters
firstResponderThe first responder to dispatch the event to.
eventThe event to be dispatched.

◆ flagsChanged()

virtual void CeresEngine::UIResponder::flagsChanged ( const UIEvent event)
virtual

Informs the receiver that the user has pressed or released a modifier key (Shift, Control, and so on).

Parameters
eventAn object encapsulating information about the modifier-key event.

◆ flushBufferedKeyEvents()

virtual void CeresEngine::UIResponder::flushBufferedKeyEvents ( )
virtual

Clears any unprocessed key events when overridden by subclasses.

◆ getNextResponder()

virtual UIResponder * CeresEngine::UIResponder::getNextResponder ( ) const
inlinevirtual

The next responder after this one, or nil if it has none.

The next responder must be an object that inherits, directly or indirectly, from UIResponder.

Reimplemented in CeresEngine::UIView, and CeresEngine::UIViewController.

◆ interpretKeyEvents()

virtual void CeresEngine::UIResponder::interpretKeyEvents ( const Vector< UIKeyEvent > &  events)
virtual

Handles a series of key events.

◆ keyDown()

virtual void CeresEngine::UIResponder::keyDown ( const UIKeyEvent event)
virtual

Informs the receiver that the user has pressed a key.

Reimplemented in CeresEngine::UIButton, CeresEngine::UIControl, CeresEngine::UISlider, CeresEngine::UITextField, and CeresEngine::UIViewport.

◆ keyUp()

virtual void CeresEngine::UIResponder::keyUp ( const UIKeyEvent event)
virtual

Informs the receiver that the user has released a key.

Reimplemented in CeresEngine::UIButton.

◆ mouseDown()

virtual void CeresEngine::UIResponder::mouseDown ( const UIMouseEvent event)
virtual

◆ mouseDragged()

virtual void CeresEngine::UIResponder::mouseDragged ( const UIMouseEvent event)
virtual

Informs the receiver that the user has moved the mouse with the left button pressed.

Reimplemented in CeresEngine::UIScroller, CeresEngine::UIGizmoArrowManipulator, CeresEngine::UIGizmoCircleManipulator, CeresEngine::UISlider, CeresEngine::UISplitView, and CeresEngine::UIViewport.

◆ mouseEntered()

virtual void CeresEngine::UIResponder::mouseEntered ( const UIMouseEvent event)
virtual

Informs the receiver that the cursor has entered a tracking rectangle.

Reimplemented in CeresEngine::UIGizmo, CeresEngine::UIControl, and CeresEngine::UIGizmoManipulator.

◆ mouseExited()

virtual void CeresEngine::UIResponder::mouseExited ( const UIMouseEvent event)
virtual

Informs the receiver that the cursor has exited a tracking rectangle.

Reimplemented in CeresEngine::UIControl.

◆ mouseMoved()

virtual void CeresEngine::UIResponder::mouseMoved ( const UIMouseEvent event)
virtual

Informs the receiver that the mouse has moved.

Reimplemented in CeresEngine::UIControl, and CeresEngine::UIViewport.

◆ mouseUp()

virtual void CeresEngine::UIResponder::mouseUp ( const UIMouseEvent event)
virtual

Informs the receiver that the user has released the left mouse button.

Reimplemented in CeresEngine::UIButton, CeresEngine::UICheckbox, CeresEngine::UIControl, CeresEngine::UIScroller, CeresEngine::UISplitView, and CeresEngine::UIViewport.

◆ otherMouseDown()

virtual void CeresEngine::UIResponder::otherMouseDown ( const UIMouseEvent event)
virtual

Informs the receiver that the user has pressed a mouse button other than the left or right one.

◆ otherMouseDragged()

virtual void CeresEngine::UIResponder::otherMouseDragged ( const UIMouseEvent event)
virtual

Informs the receiver that the user has moved the mouse with a button other than the left or right button pressed.

Reimplemented in CeresEngine::UIViewport.

◆ otherMouseUp()

virtual void CeresEngine::UIResponder::otherMouseUp ( const UIMouseEvent event)
virtual

Informs the receiver that the user has released a mouse button other than the left or right button.

◆ performKeyEquivalent()

virtual bool CeresEngine::UIResponder::performKeyEquivalent ( const UIKeyEvent event)
virtual

Handle a key equivalent.

◆ resignFirstResponder()

virtual bool CeresEngine::UIResponder::resignFirstResponder ( )
inlinevirtual

Notifies the receiver that it's been asked to relinquish its status as first responder in its window.

The default implementation returns true, resigning first responder status. Subclasses can override this method to update state or perform some action such as unhighlighting the selection, or to return false, refusing to relinquish first responder status.

Use the UIWindow::makeFirstResponder() method, not this method, to make an object the first responder. Never invoke this method directly.

Reimplemented in CeresEngine::UIWindow, and CeresEngine::UIControl.

◆ rightMouseDown()

virtual void CeresEngine::UIResponder::rightMouseDown ( const UIMouseEvent event)
virtual

Informs the receiver that the user has pressed the right mouse button.

Reimplemented in CeresEngine::UIControl.

◆ rightMouseDragged()

virtual void CeresEngine::UIResponder::rightMouseDragged ( const UIMouseEvent event)
virtual

Informs the receiver that the user has moved the mouse with the right button pressed.

Reimplemented in CeresEngine::UIViewport.

◆ rightMouseUp()

virtual void CeresEngine::UIResponder::rightMouseUp ( const UIMouseEvent event)
virtual

Informs the receiver that the user has released the right mouse button.

Reimplemented in CeresEngine::UIControl.

◆ scrollWheel()

virtual void CeresEngine::UIResponder::scrollWheel ( const UIMouseEvent event)
virtual

Informs the receiver that the mouse's scroll wheel has moved.

Reimplemented in CeresEngine::UIScrollView, CeresEngine::UISlider, and CeresEngine::UIViewport.


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