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

A controller that manages a window. More...

#include <CeresEngine/UI/UIWindowController.hpp>

Inheritance diagram for CeresEngine::UIWindowController:
CeresEngine::UIResponder

Public Member Functions

UIWindowgetWindow () const
 The window owned by the receiver.
 
void setWindow (UIWindow *window)
 The window owned by the receiver.
 
virtual void windowWillLoad ()
 Sent before the window owned by the receiver is loaded.
 
virtual void windowDidLoad ()
 Sent after the window owned by the receiver has been loaded.
 
void show ()
 Displays the window associated with the receiver.
 
void close ()
 Closes the window if it was loaded.
 
UIViewControllergetContentViewController () const
 The view controller for the window’s content view.
 
- Public Member Functions inherited from CeresEngine::UIResponder
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).
 

Protected Member Functions

virtual UIWindowloadWindow () const
 Loads the controller’s window.
 

Private Attributes

UIWindowmWindow = nullptr
 The window owned by the receiver.
 
bool mWindowLoaded = false
 A Boolean value that indicates whether the nib file containing the receiver’s window has been loaded.
 

Additional Inherited Members

- Static Public Member Functions inherited from CeresEngine::UIResponder
static void dispatch (UIResponder *const firstResponder, const UIEvent &event)
 Dispatches a UIEvent to the given first responder.
 

Detailed Description

A controller that manages a window.

Managing a window entails:

  • Loading and displaying the window
  • Closing the window when appropriate
  • Customizing the window’s title
  • Storing the window’s frame (size and location) in the defaults getDatabase
  • Cascading the window in relation to other document windows of the app

You should create a subclass of NSWindowController when you want to augment the default behavior, such as to give the window a custom title or to perform some setup tasks before the window is loaded.

Member Function Documentation

◆ close()

void CeresEngine::UIWindowController::close ( )

Closes the window if it was loaded.

◆ getContentViewController()

UIViewController * CeresEngine::UIWindowController::getContentViewController ( ) const

The view controller for the window’s content view.

The value of this property tracks the window’s contentView property.

◆ getWindow()

UIWindow * CeresEngine::UIWindowController::getWindow ( ) const

The window owned by the receiver.

If the window was loaded, the following methods are called in order: windowWillLoad(), loadWindow(), and windowDidLoad().

Setting this property releases the window controller’s old window, and establishes ownership of the specified new window. Typically, you should not use this property to set the window. Instead, create a new window controller for the new window and then release the old window controller.

◆ loadWindow()

virtual UIWindow * CeresEngine::UIWindowController::loadWindow ( ) const
protectedvirtual

Loads the controller’s window.

You should never directly invoke this method. Instead, access the window property so the windowDidLoad and windowWillLoad methods are invoked. Subclasses can override this method if the way it finds and loads the window is not adequate.

◆ setWindow()

void CeresEngine::UIWindowController::setWindow ( UIWindow window)

The window owned by the receiver.

If the window was loaded, the following methods are called in order: windowWillLoad(), loadWindow(), and windowDidLoad().

Setting this property releases the window controller’s old window, and establishes ownership of the specified new window. Typically, you should not use this property to set the window. Instead, create a new window controller for the new window and then release the old window controller.

◆ show()

void CeresEngine::UIWindowController::show ( )

Displays the window associated with the receiver.

◆ windowDidLoad()

virtual void CeresEngine::UIWindowController::windowDidLoad ( )
inlinevirtual

Sent after the window owned by the receiver has been loaded.

The default implementation does nothing.

◆ windowWillLoad()

virtual void CeresEngine::UIWindowController::windowWillLoad ( )
inlinevirtual

Sent before the window owned by the receiver is loaded.

The default implementation does nothing.

Member Data Documentation

◆ mWindow

UIWindow* CeresEngine::UIWindowController::mWindow = nullptr
private

The window owned by the receiver.

If the window was loaded, the following methods are called in order: windowWillLoad(), loadWindow(), and windowDidLoad().

Setting this property releases the window controller’s old window, and establishes ownership of the specified new window. Typically, you should not use this property to set the window. Instead, create a new window controller for the new window and then release the old window controller.

◆ mWindowLoaded

bool CeresEngine::UIWindowController::mWindowLoaded = false
private

A Boolean value that indicates whether the nib file containing the receiver’s window has been loaded.


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