|
CeresEngine 0.2.0
A game development framework
|
An abstract class that forms the basis of event and command processing in the UI framework. More...
#include <CeresEngine/UI/UIResponder.hpp>
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 UIResponder * | getNextResponder () 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. | |
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.
|
virtualdefault |
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.
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.
Informs the receiver that the mouse cursor has moved into a cursor rectangle.
|
static |
Dispatches a UIEvent to the given first responder.
| firstResponder | The first responder to dispatch the event to. |
| event | The event to be dispatched. |
Informs the receiver that the user has pressed or released a modifier key (Shift, Control, and so on).
| event | An object encapsulating information about the modifier-key event. |
Clears any unprocessed key events when overridden by subclasses.
|
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.
|
virtual |
Handles a series of key events.
|
virtual |
Informs the receiver that the user has pressed a key.
Reimplemented in CeresEngine::UIButton, CeresEngine::UIControl, CeresEngine::UISlider, CeresEngine::UITextField, and CeresEngine::UIViewport.
|
virtual |
Informs the receiver that the user has released a key.
Reimplemented in CeresEngine::UIButton.
|
virtual |
Informs the receiver that the user has pressed the left mouse button.
Reimplemented in CeresEngine::UIButton, CeresEngine::UIControl, CeresEngine::UIGizmoArrowManipulator, CeresEngine::UIGizmoCircleManipulator, CeresEngine::UIScroller, CeresEngine::UISlider, CeresEngine::UISplitView, and CeresEngine::UIViewport.
|
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.
|
virtual |
Informs the receiver that the cursor has entered a tracking rectangle.
Reimplemented in CeresEngine::UIGizmo, CeresEngine::UIControl, and CeresEngine::UIGizmoManipulator.
|
virtual |
Informs the receiver that the cursor has exited a tracking rectangle.
Reimplemented in CeresEngine::UIControl.
|
virtual |
Informs the receiver that the mouse has moved.
Reimplemented in CeresEngine::UIControl, and CeresEngine::UIViewport.
|
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.
|
virtual |
Informs the receiver that the user has pressed a mouse button other than the left or right one.
|
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.
|
virtual |
Informs the receiver that the user has released a mouse button other than the left or right button.
|
virtual |
Handle a key equivalent.
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.
|
virtual |
Informs the receiver that the user has pressed the right mouse button.
Reimplemented in CeresEngine::UIControl.
|
virtual |
Informs the receiver that the user has moved the mouse with the right button pressed.
Reimplemented in CeresEngine::UIViewport.
|
virtual |
Informs the receiver that the user has released the right mouse button.
Reimplemented in CeresEngine::UIControl.
|
virtual |
Informs the receiver that the mouse's scroll wheel has moved.
Reimplemented in CeresEngine::UIScrollView, CeresEngine::UISlider, and CeresEngine::UIViewport.