ETWindowItem
ETWindowItem : ETDecoratorItem <ETFirstResponderSharingArea>Overview
A decorator which can be used to put a layout item inside a window.
With the AppKit widget backend, the window is an NSWindow object.
Once the window is managed by a window item, you must not call the following NSWindow methods: -setDelegate: , -setAcceptsMouseMovedEvents: and -registerForDraggedTypes: .
The NSWindow object is not in the EtoileUI responder chain, but common actions such as -performClose: are forwarded to the NSWindow.
Factory Methods
- + (ETWindowItem *) itemWithWindow: (NSWindow *)window objectGraphContext: (COObjectGraphContext *)aContext
Returns a new window item to which the given concrete window gets bound.
The returned item can be used as a decorator to wrap an existing layout item into a window.
Returns a new window item to which the given concrete window gets bound.
The returned item can be used as a decorator to wrap an existing layout item into a window.
- + (ETWindowItem *) panelItemWithObjectGraphContext: (COObjectGraphContext *)aContext
Returns a new window item to which a panel gets bound.
A panel is a utility window with a small titlebar.
For the AppKit, the panel cannot become the main item (the behavior might vary in other backends).The concrete window class used is NSPanel .
- + (ETWindowItem *) fullScreenItemWithObjectGraphContext: (COObjectGraphContext *)aContext
Returns a new window item to which a fullscreen concrete window gets bound.
The returned item can be used as a decorator to make an existing layout item full screen.
The concrete window class used is ETFullScreenWindow.
- + (ETWindowItem *) transparentFullScreenItemWithObjectGraphContext: (COObjectGraphContext *)aContext
Returns a new window item to which a fullscreen concrete window gets bound. This window has a transparent background. The returned item can be used as a decorator to make an existing layout item full screen. The concrete window class used is ETFullScreenWindow.
Initialization
- - (id) initWithWindow: (NSWindow *)window objectGraphContext: (COObjectGraphContext *)aContext
Initializes and returns a new window decorator with a hard window (provided by the widget backend).
Unless you write a subclass, you should never use this initializer but rather the factory methods.
The widget window is inserted in the responder chain between the receiver and -[ETLayoutItemFactory windowGroup] .
If window is nil, the receiver creates a standard widget backend window.
Initializes and returns a new window decorator with a hard window (provided by the widget backend).
Unless you write a subclass, you should never use this initializer but rather the factory methods.
The widget window is inserted in the responder chain between the receiver and -[ETLayoutItemFactory windowGroup] .
If window is nil, the receiver creates a standard widget backend window.
Main Accessors
- - (BOOL) usesCustomWindowTitle
Returns YES when you have provided a custom window title, otherwise when returns NO when the receiver manages the window title.
- - (BOOL) shouldKeepWindowFrame
Returns whether the window should keep its size when used as a decorator, rather than getting resized to match the decorated item size.
- - (void) setShouldKeepWindowFrame: (BOOL)shouldKeepWindowFrame
Sets whether the window should keep its size when used as a decorator.
This is needed for fullscreen windows, so that they fill the screen regardless of the size of the item they decorate.
- - (CGFloat) titleBarHeight
Returns the height of the window title bar or zero when no title bar is used.
Customized Decorator Methods
- - (NSRect) decorationRect
Returns the window frame in the window layer coordinate base which is flipped by default.
See also -[ETItemFactory windowGroup] .
- - (NSRect) contentRect
Returns the content view rect expressed in the window coordinate space.
This coordinate space includes the window decoration (titlebar etc.).
- - (BOOL) acceptsDecoratorItem: (ETDecoratorItem *)item
Returns NO. A window can never be decorated.
- - (BOOL) canDecorateItem: (id)item
Returns YES when item can be decorated with a window by the receiver, otherwise returns no.
First Responder Sharing Area
-
- (BOOL) makeFirstResponder: (id
) newResponder Sets the first responder in the window.
See also -firstResponder .
Sets the first responder in the window.
See also -firstResponder .
-
- (id
) firstResponder Returns the first responder in the window.
The first responder is the current responder where the action dispatch starts in the EtoileUI responder chain.
See ETResponder and -focusedItem .
- - (ETLayoutItem *) focusedItem
Returns the focused item in the window.
The focused item can be the first responder or some previous responder higher in the EtoileUI responder chain.
More explanations and examples in -[ETResponder focusedItem] .
See -firstResponder .
- - (ETLayoutItem *) activeFieldEditorItem
Returns the item owning the field editor which has the first responder status, or nil when no text editing is underway in the window.
- - (ETLayoutItem *) editedItem
Returns the item on which the text editing was initiated.
- - (void) setActiveFieldEditorItem: (ETLayoutItem *)editorItem editedItem: (ETLayoutItem *)editedItem
Inserts the editor item which provides text editing in the window and makes it the first responder.
Any existing active field editor item is removed first.
An NSInvalidArgumentException is raised when any given item is nil.
- - (void) removeActiveFieldEditorItem
Removes the item which provides text editing in the window.
Does nothing when there is no active field editor item in the window.
- - (ETLayoutItem *) hitTestFieldEditorWithEvent: (ETEvent *)anEvent
Returns the active field editor item if there is one located where the event occured, otherwise returns nil.
Actions
- - (IBAction) performClose: (id)sender
Forwards the action to the underlying window object.
Forwards the action to the underlying window object.
Framework Private
- + (NSRect) convertRectToWidgetBackendScreenBase: (NSRect)rect
This method is only exposed to be used internally by EtoileUI.
Converts the given rect expressed in the EtoileUI window layer coordinate space to the AppKit screen coordinate space.
This method will check whether the window layer (aka window group) is flipped and make the necessary adjustments.
This method is only exposed to be used internally by EtoileUI.
Converts the given rect expressed in the EtoileUI window layer coordinate space to the AppKit screen coordinate space.
This method will check whether the window layer (aka window group) is flipped and make the necessary adjustments.
- + (NSRect) convertRectFromWidgetBackendScreenBase: (NSRect)windowFrame
This method is only exposed to be used internally by EtoileUI.
Converts the given rect expressed in the AppKit screen coordinate space to the EtoileUI window layer coordinate space.
This method will check whether the window layer (aka window group) is flipped and make the necessary adjustments.
