qmathe@club-internet.fr)ETLayoutItem is the base class for all node subclasses that can be used in a layout item tree. ETLayoutItem instances are leaf nodes for the layout item tree structure.
Copyright: (C) 2007 Quentin Mathe
- Declared in:
- ETLayoutItem.h
- Conforms to:
- ETObjectInspection
- ETFragment
You must never subclass ETLayoutItem.
Disables automatic layout updates in the interval between the current event and the next event.
EtoileUI also stops to track items that need a layout update. So -setNeedsLayoutUpdate does nothing then, the method returns immediately.
Before the next event,
+enablesAutolayout
can be called to entirely cancel
+disablesAutolayoutIncludingNeedsUpdate:
.
You can nest these method invocations, but automatic layout won't be restored until +enablesAutolayout
has been called the same number of times than +disablesAutolayoutIncludingNeedsUpdate:
.
See also +enablesAutolayout .
Enables automatic layout updates in the interval between the current event and the next event.
See also +disablesAutolayout .
@taskunit Autolayout
Returns whether automatic layout updates are enabled.
If YES, items on which
-setNeedsLayoutUpdate
was invoked, will receive
-updateLayoutRecursively:
in the interval between the current event and the next
event.
By default, returns YES
to eliminate the need to use
-updateLayout
.
Returns whether automatic layout updates are enabled.
If YES, items on which
-setNeedsLayoutUpdate
was invoked, will receive
-updateLayoutRecursively:
in the interval between the current event and the next
event.
By default, returns YES
to eliminate the need to use
-updateLayout
.
Sets whether the bounding box is drawn.
See also -showsBoundingBox .
Sets whether the frame is drawn.
See also -showsFrame .
Returns whether the bounding box is drawn.
When YES, the receiver draws its
bounding box as a red stroked rect.
Returns whether the frame is drawn.
When YES, the receiver draws its frame
as a blue stroked rect.
Returns the receiver UTI type as -[NSObject UTI], but combines it with the subtype and the represented object type when available.
When the receiver has a subtype, the returned type
is a transient type whose supertypes are the class
type and the subtype.
When the receiver has a
represented object, the returned type is a
transient type whose supertypes are the class
type and the represented object class type.
In case, the receiver has both a represented object
and a subtype, the returned type will combine both as
supertypes.
Returns NO when the receiver should
be ignored by the tools for both hit tests and action
dispatch. By default, returns YES,
otherwise NO when
-actionsHandler
returns nil.
Returns the action that can be sent by the action handler associated with the receiver.
See also -setAction: .
Returns the action handler associated with the receiver. See ETTool to know more about event handling in the layout item tree.
Returns the topmost ancestor layout item,
including itself, whose layout returns
YES to
-isOpaque
(see ETLayout). If none is found, returns self.
Returns the current anchor point associated with the receiver content bounds. The anchor point is expressed in the receiver content coordinate space.
By default, the anchor point is centered in the content bounds rectangle. See -contentBounds .
The item position is relative to the anchor point. See -position .
Returns the autoresizing mask that applies to the layout item as whole.
See also -setAutoresizingMask: .
Returns the layout item group which controls the
receiver.
An item group is said to be
base item that controls its descendant items when
its represented path base is neither nil
nor a blank value (see -hasValidRepresentedPathBase).
For every descendant item under its control, the base item will drive:
All descendant items are controlled by the receiver
base item until a descendant becomes a new base item
(by providing a represented path base).
See
also
-representedPathBase
,
-representedPath
, -[ETLayoutItemGroup source] and related setter
methods.
An item group is automatically turned into a base item, when you set a source or a controller (see -[ETLayoutItemGroup setController:]).
This method will return nil when the
receiver isn't a base item or has no ancestor
which is a base item.
Hence -[[[ETLayoutItem
alloc] init] baseItem] returns nil.
Invokes -beginEditingForItem: on the action handler which makes the item view the first responder or the item when there is no view.
Returns the rect that fully encloses the receiver and represents the maximal extent on which hit test is done and redisplay requested. This rect is expressed in the receiver content coordinate space.
You must be cautious with the bounding box, since its value is subject to be overwritten by the layout in use. See -setBoundingBox: .
Invokes -commitEditingForItem: on the action handler which in turn invokes -commitEditing on the item view when possible.
Returns whether a point expressed in the parent item content coordinate space is within the receiver frame. The item frame is also expressed in the parent item content coordinate space. This method checks whether the parent item is flipped or not.
Returns that the content aspect that describes how the content looks when the receiver is resized.
See ETContentAspect enum.
This method is only exposed to be used internally by EtoileUI.
Returns the -styleGroup visible drawing area (i.e. the clipping rect).
The returned rect is the visible content bounds.
Returns a point expressed in the receiver coordinate space equivalent to point parameter expressed in the parent item content coordinate space.
Returns a point expressed in the receiver content coordinate space equivalent to point parameter expressed in the receiver coordinate space.
The content coordinate space is located inside -contentBounds .
Returns a point expressed in the parent item content coordinate space equivalent to point parameter expressed in the receiver coordinate space.
Returns a rect expressed in the receiver coordinate space equivalent to rect parameter expressed in ancestor coordinate space.
In case the receiver is not a descendent or
ancestor is nil, returns a
null rect.
Returns a rect expressed in ancestor coordinate space equivalent to rect parameter expressed in the receiver coordinate space.
In case the receiver is not a descendent or
ancestor is nil, returns a
null rect.
Returns a rect expressed in the receiver coordinate space equivalent to rect parameter expressed in the receiver content coordinate space.
The content coordinate space is located inside -contentBounds .
Returns a rect expressed in the receiver coordinate space equivalent to rect parameter expressed in the parent item content coordinate space.
Returns a rect expressed in the receiver content coordinate space equivalent to rect parameter expressed in the receiver coordinate space.
The content coordinate space is located inside -contentBounds .
Returns a rect expressed in the parent item content coordinate space equivalent to rect parameter expressed in the receiver coordinate space.
Returns a deep copy of the receiver by copying the view and all its subview hierarchy, the styles, the decorators, the represented object and all the descendant children items if the receiver is an ETLayoutItemGroup r elated classes. All copied collections are mutable (styles, decorators, representedObject, children items). TODO: Implement styles copying that is currently missing (decorators too in -copyWithZone:).
Returns the default frame associated with the receiver. See -setDefaultFrame: .
Tells the receiver the layout has been changed and it should post ETLayoutItemLayoutDidChangeNotification.
This method tries to notify the delegate that might exist with subclasses e.g. ETLayoutItemGroup.
You should never use this method unless you write an ETLayoutItem subclass.
Updates the view 'object value' property when the represented object value changed.
Invokes -discardEditingForItem: on the action handler which in turn invokes -discardEditing on the item view when possible.
Triggers the redisplay of the receiver and the entire layout item tree owned by it.
To handle the display, an ancestor view is looked up and the rect to refresh is converted into this ancestor coordinate space. Precisely both the lookup and the conversion are handled by -convertDisplayRect:toAncestorDisplayView:rootView:parentItem: .
If the receiver has a display view, this view will be asked to draw by itself.
Redisplays the areas marked as invalid in the receiver and all its descendant items.
Areas can be marked as invalid with -setNeedsDisplay: and -setNeedsDisplayInRect: .
Returns the display name associated with the receiver. See also NSObject(Model) in EtoileFoundation.
Triggers the redisplay of the given receiver area and the entire layout item subtree that intersects it.
More explanations in -display .
Returns the bounds where the given style is expected to draw the item.
When the style is the cover style, the drawing area
is enclosed in the item frame.
When the style
is a content style that belongs to
-styleGroup
, the drawing area is enclosed in the item content
bounds (which might be partially clipped by a
decorator).
When no decorator is set on the receiver, returns the same rect usually.
For example, we have an item with boundingBox = {-10, -10, 170, 220} and frame = {30, 40, 150, 200}, then in an ETStyle subclass whose instances would receive this item through -render:layoutItem:dirtyRect:
// bounds.origin is the current drawing context origin
NSRect bounds = [item drawingBoundsForStyle: self];
NSRect box = [item boundingBox];
[NSBezierPath fillRect: bounds]; // bounds is { 0, 0, 150, 200 }
// With a custom bounding box, you can draw outside of the drawing bounds
[NSBezierPath strokeRect: box]; // box is { -10, -10, 170, 220 }
See also -contentBounds , -frame , -boundingBox , -coverStyle , -styleGroup and -style .
This method is only exposed to be used internally by EtoileUI.
Returns the -coverStyle drawing area (i.e. the clipping rect).
The returned rect is the bouding box but adjusted to prevent drawing on the window decorations.
Returns the first display view bound to a layout item upwards in the layout item tree. This item is identical to the one returned by -supervisorViewBackedAncestorItem .
The receiver display view itself can be returned.
Returns the current frame. If the receiver has a view attached to it, the returned frame is equivalent to the display view frame.
This value is always in sync with the persistent
frame in a positional and non-computed layout such
as ETFreeLayout, but is usually different when the
layout is computed.
See also
-setPersistentFrame:
Returns the current height associated with the receiver frame size. See also -frame .
Returns the image to be displayed when the
receiver must be represented in a symbolic
style. This icon is commonly used by some layouts
and also if the receiver represents another layout
item (when
-isMetaItem
returns YES).
By default, this method returns by decreasing order of priority:
nil
nil
nil, if none of the above
conditions are met
-image and -icon can be considered as symetric equivalents of -name and -displayName methods.
Returns the identifier associated with the layout item.
The returned value can be nil or an
empty string.
Returns the image representation associated with the receiver.
By default this method, returns by decreasing order of priority:
nil, if none of the above
conditions are met
Returns the receiver absolute index path by
collecting the index of each parent item until
the root item is reached (when
-parentItem
returns nil).
This method is equivalent to [[self rootItem] indexPathForItem: self].
Returns the given item index path relative to the receiver.
This method is equivalent to [item indexFromItem: self].
Returns nil when the given
item isn't a receiver descendant.
Passing nil is equivalent to passing
the root item. In this case, the returned
value is nil because the root
item can never be a receiver descendant.
If the given item is equal to
self, the resulting index path is an blank one
(relative to itself).
Returns receiver index path relative to the given item.
The index path is computed by climbing up the layout item tree until we find the given item. At each level we traverse, the parent relative index is pushed into the index path to be returned.
Passing nil is equivalent to passing
the root item.
If the given
item is equal to self, the resulting
index path is a blank one (relative to itself).
You must use -[ETLayoutItemFactory itemXXX] or -[ETLayoutItemFactory itemGroupXXX] methods rather than this method.
Initializes and returns a layout item with the given view, cover style and action handler.
Any of the arguments can be nil.
When the given view is nil,
the returned item will use
+defaultItemRect
as its frame.
See also -setView: , -setCoverStyle: and -setActionHandler: .
Returns the custom inspector associated with the
receiver. By default, returns nil.
-[NSObject(EtoileUI) inspect:] will
show this inspector, unless nil is
returned.
Returns whether the receiver is a base item or not.
To be a base item the receiver must have a source or a controller set. See -[ETLayoutItemGroup setSource:] and -[ETLayoutItemGroup setController:].
By default, returns NO.
Returns whether the receiver uses flipped coordinates to position its content. The returned value will be taken in account in methods related to geometry, event handling and drawing. If you want to alter the flipping, you must use -setFlipped: and never alter the supervisor view directly with -[ETView setFlipped:].
Returns whether the value is ETLayoutItem object or not. See also -value , -valueKey and -representedObject .
Returns whether the receiver should be displayed or not. See also -setVisible: .
Returns the name associated with the layout item.
The returned value can be nil or an
empty string.
Returns whether the layout is going to be updated in the interval between the current and the next event.
Returns the current origin associated with the receiver frame. See also -frame .
Returns the layout item group to which the receiver belongs to.
For the root item, returns nil.
Returns the persistent frame associated with the receiver.
This custom frame is used by ETFreeLayout. This property keeps track of the fixed location and size that are used for the receiver in the free layout, even if you switch to another layout that alters the receiver frame. The current frame is returned by -frame in all cases, hence when ETFreeLayout is in use, -frame is equal to -persistentFrame .
Returns whether a point expressed in the receiver coordinate space is inside the receiver frame.
If the bounding box is used to test the
point location, YES can be
returned with a point whose y or x
values are negative.
Returns the current position associated with the receiver frame. The position is expressed in the parent item coordinate space. See also -setPosition: .
When the receiver is visible in an opaque layout and
won't redraw by itself, marks the ancestor item to
redisplay the area that corresponds to the
receiver in this layout. Else marks the receiver
to be redisplayed exactly as
-setNeedsDisplay:
with YES.
See also -ancestorItemForOpaqueLayout .
Detaches the receiver from the item group it belongs to.
You are in charge of retaining the receiver, otherwise it could be deallocated if no other objects retains it.
Renders or draws the receiver in the given rendering context.
The rendering is entirely delegated to the style
group.
Subclasses such as ETLayoutItemGroup
can override this method to extend, alter or replace
this behavior.
EtoileUI will lock and unlock the focus when needed around this method, unless you call this method directly. In this case, you are responsible to lock/unlock the focus.
You are allowed to draw beyond the receiver frame
(EtoileUI doesn't clip the drawing). In that
case, you have to use
-setBoundingBox
to specify the area were the redisplay is now expected
to occur, otherwise methods like
-display
and
-setNeedsDisplay:
won't work correctly.
You should be careful
and only use this possibility to draw visual
embellishments strictly related to the
receiver. e.g. borders, selection mark, icon
badge, control points etc.
dirtyRect indicates the receiver portion
that needs to be redrawn and is expressed in the
receiver coordinate space. This rect is is
usally equal to
-drawingFrame
. But it can be smaller when the parent item doesn't
need to be entirely redrawn and the portion to
redraw intersects the receiver area (without
covering it).
Warning: When
-decoratorItem
is not nil, the receiver coordinate space
is not equal to the receiver content coordinate space.
inputValues is a key/value pair list
that is initially passed to the ancestor item on
which the rendering was started. You can add or
remove key/value pairs to let styles know how they
are expected to be rendered.
This key/value
pair list will be carried downwards until the
rendering is finished.
ctxt represents the rendering context
which encloses the drawing context. For now, the
context is nil and must be ignored.
Returns the model object which embeds the data to be displayed and represented on screen by the receiver. See also -setRepresentedObject: .
Returns YES. See
-[ETPropertyValueCoding
requiresKeyValueCodingForAccessingProperties].
Returns the item, or a responder view inside it in case the item uses a widget view (either provided by the layout or as a simple widget view).
Used by -[ETFirstResponderSharingArea makeFirstResponder:] to determine the real responder.
If the receiver is returned, then first responder and focused item are one and the same.
See also -usesWidgetView , -[ETLayout responder] and -[NSView responder].
Modifies the frame associated with the receiver to match the current default frame.
Returns the root item of the layout item tree to which the receiver belongs to.
This method never returns nil. The
returned value is equal to self when the
receiver has no parent item.
When the receiver content is presented inside
scrollers, returns the decorator item that
owns the scrollers provided by the widget backend
(e.g. AppKit), otherwise returns nil.
When multiple scrollable area items are present in the decorator chain, the first is returned.
Won't return an enclosing scrollable area item bound to an ancestor item.
Sets the action that can be sent by the action handler associated with the receiver.
This won't alter the action set on the receiver view, both are completely distinct.
Sets the action handler associated with the receiver.
Sets the current anchor point associated with the receiver content bounds. anchor must be expressed in the receiver content coordinate space.
Sets the autoresizing mask that applies to the layout item as whole.
The autoresizing mask only applies to the last
decorator item (which might be the receiver
itself).
When the receiver has a
decorator, the content autoresizing is
controlled by the decorator and not by the
receiver autoresizing mask directly.
Marks the receiver as needing a layout update. Marks the parent item too, when the receiver has no decorator.
TODO: Autoresizing mask isn't yet supported when the receiver has no view.
Sets the rect that fully encloses the receiver and represents the maximal extent on which hit test is done and redisplay requested. This rect must be expressed in the receiver coordinate space.
The bounding box is used by ETTool in the hit test phase. It is also used by -display and -setNeedsDisplay: methods to compute the dirty area that needs to be refreshed. Hence it can be used by ETLayout subclasses related code to increase the area which requires to be redisplayed. For example, ETHandleGroup calls -setBoundingBox: on its manipulated object, because its handles are not fully enclosed in the receiver frame.
The bounding box must be always be greater or equal to the receiver frame.
Marks the receiver as needing a layout update. Marks the parent item too, when the receiver has no decorator.
Sets the content aspect that describes how the content looks when the receiver is resized.
When the item has a view, the view autoresizing mask and frame are altered to match the new content aspect.
See ETContentAspect enum.
Sets the content bounds associated with the receiver.
By default, the origin of the content bounds is (0.0, 0.0). You can customize it to translate the coordinate system used to draw the receiver. The receiver transform, which might include a translation too, won't be altered. Both translations are cumulative.
If the flipped property is modified, the content bounds remains identical.
Marks the receiver as needing a layout update. Marks the parent item too, when the receiver has no decorator.
Sets the content size associated with the receiver.
Sets the default frame associated with the receiver and updates the item frame to match. The default frame is not touched by layout-related transforms (such as item scaling) unlike the item frame returned by -frame .
When the layout item gets instantiated, the value is set to the initial item frame.
Sets the name associated with the receiver with -setName: .
Sets whether the receiver uses flipped coordinates to position its content.
This method updates the supervisor view and the decorator chain to match the flipping of the receiver.
You must never alter the supervisor view directly with -[ETView setFlipped:].
Marks the receiver as needing a layout update.
Sets the current frame and also the persistent frame if the layout of the parent item is positional and non-computed such as ETFreeLayout.
Marks the receiver as needing a layout update. Marks the parent item too, when the receiver has no decorator.
See also -[ETLayout isPositional] and -[ETLayout isComputedLayout].
Sets the current height associated with the receiver frame size. See also -setFrame: .
Sets the image to be displayed when the receiver must be represented in a symbolic style. See also -icon .
If img is nil, then the
default behavior of
-icon
is restored and the icon image should not be expected
to be nil.
Sets the identifier associated with the layout item.
Sets the image representation associated with the receiver.
The image is drawn by the styles based on the content
aspect. See ETBasicItemStyle as an example.
You can adjust the image size by altering
the receiver size combined with a content aspect such
as ETContentAspectScaleXXX or
ETContentAspectStretchXXX.
If img is nil, then the
default behavior of
-image
is restored and the returned image should not be
expected to be nil.
Sets the custom inspector associated with the receiver.
Sets the layout associated with the receiver to present its content.
Layout are not yet supported on ETLayoutItem instances, which this method is useless currently.
Marks the receiver and the entire layout item tree owned by it to be redisplayed the next time an ancestor view receives a display if needed request (see -[NSView displayIfNeededXXX] methods).
More explanations in -display .
Marks the given receiver area and the entire layout item subtree that intersects it, to be redisplayed the next time an ancestor view receives a display if needed request (see -[NSView displayIfNeededXXX] methods).
More explanations in -display .
Marks the receiver to have its layout updated and be redisplayed in the interval between the current and the next event.
See also +disablesAutolayout .
Sets the current origin associated with the receiver frame. See also -setFrame: .
Sets the layout item group to which the receiver belongs to.
If the given parent is nil,
the receiver becomes a root item.
You must never call this method directly, unless you
write a subclass.
To change the
parent, use
-addItem:
,
-removeFromParent
and other similar methods to manipulate the item
collection that belongs to the
parent.
Sets the persistent frame associated with the receiver. See -persistentFrame .
Sets the current position associated with the receiver frame.
When -setPosition: is called, the position is applied relative to -anchorPoint . position must be expressed in the parent item coordinate space (exactly as the frame). When the position is set, the frame is moved to have the anchor point location in the parent item coordinate space equal to the new position value.
Marks the parent item as needing a layout update.
Sets the model object which embeds the data to be displayed and represented on screen by the receiver.
Take note modelObject can be any objects
including an ETLayoutItem instance, in this
case the receiver becomes a meta item and returns
YES for
-isMetaItem
.
The item view is also synchronized with the object value of the given represented object when the view is a widget.
Sets whether the receiver can be selected.
If selectable is NO, resets
the selected property to NO.
Layouts can customize the item appearance based on -isSelectable . For instance, ETTableLayout or ETOutlineLayout turn such items into group rows.
See also -setSelected , -isSelected and -isSelectable .
Sets the receiver selection state.
You rarely need to call this method. You should rather use -setSelectionIndex: , -setSelectionIndexes: or -setSelectionIndexPaths: on the parent item (see ETLayoutItemGroup).
This method doesn't post an ETItemGroupSelectionDidChangeNotification unlike the previously mentioned ETLayoutItemGroup methods.
The new selection state won't be apparent until a redisplay occurs.
If
-isSelectable
returns NO, the new selection state
is not set.
Sets the current size associated with the receiver frame. See also -setFrame: .
Removes all styles inside the style group, then adds the given style to the style group.
If the given style is nil, the style
group becomes empty.
Sets the style group associated with the receiver.
The styles inside the style group control the drawing
of the receiver.
See ETStyle to understand how
to customize the layout item look.
Sets the receiver subtype.
This method can be used to subtype an object (without involving any subclassing).
You can use it to restrict pick and drop allowed types to the receiver type, when the receiver is a "pure UI object" without a represented object bound to it.
Sets the supervisor view associated with the receiver.
You should never need to call this method.
The view will be added as a subview to the supervisor view bound to the parent item to which the given item belongs to. Which means, this method may move the view to a different place in the view hierarchy.
Throws an exception when item parameter is
nil.
See also -supervisorView: .
Sets the target to which actions should be sent.
The target is not retained.
Sets the transform applied within the content bounds.
Marks the receiver as needing a layout update. Marks the parent item too, when the receiver has no decorator.
Sets a value object based on -valueKey .
The method uses
-setValue:forProperty:
to set the value object for the
value key. For a nil
value key, the represented object is set
(without resorting to -setValue:forProperty:).
See
-setRepresentedObject
. If the represented object is a viewpoint, then the
viewpoint value is set rather than
setting the item represented object. See
-[ETPropertyViewpoint setValue:].
Styles or layouts can use it to show the receiver
with a basic value representation or when
they restrict their presentation to a single
property.
e.g. a table layout with a
single column, or a positional layout letting
items draw their value through
ETBasicItemStyle. To know how the
value can be presented, see ETLayout and
ETStyle subclasses.
If -valueKey
is not nil and the represented object
declares a property 'value', both
[receiver valueForProperty: @"value"]
and
[receiver setValue: anObject forProperty:
@"value"]
access the receiver value and not the
one provided by the represented object, as usually
expected for
-valueForProperty:
and
-setValue:forProperty:
. See also -value
.
Sets a value identified by key of the model object returned by -representedObject .
See -valueForProperty: for more details.
Returns a value key to describe which property of the represented object is exposed through -value and -setValue: .
Registers the value transformer for the given property.
If the value transformer is nil, it is
unregistered.
For a nil key, raises a
NSInvalidArgumentException.
See also -valueTransformerForProperty: .
Sets the view associated with the receiver. This view is commonly a widget provided by the widget backend.
Sets whether the receiver should be displayed or not.
The new visibility state won't be apparent until a redisplay occurs.
When the layout changes, this receiver visibility might change. Any custom value you might have set is lost too and won't be restored by switching back to the previous layout in use.
Sets the current width associated with the receiver frame size. See also -setFrame: .
Sets the current x coordinate associated with the receiver frame origin. See also -setFrame: .
Sets the current y coordinate associated with the receiver frame origin. See also -setFrame: .
Returns the current size associated with the receiver frame. See also -frame .
Tries to resize the item view with -sizeToFit , then adjusts the receiver content size to match the view size.
Returns an image snapshot of the receiver. The snapshot is taken at the time this method is called.
The given rect must be expressed in the receiver coordinate space.
When the receiver isn't backed by a window and has
no window-backed ancestor item backed either, returns
nil.
Removes the receiver as an observer on all objects that it was observing until now.
You must override this method when a subclass calls
KVO methods such as
-addObserver:XXX
. In the overriden method, you must call the superclass
implementation.
You must never
call this method in your own code.
In -dealloc , we must stop to be a KVO observer immediately, otherwise we may receive KVO notifications triggered by releasing objects we observe. In the worst case, we can be retained/released and thereby reenter -dealloc .
See -[ETLayoutItem dealloc].
Returns the style group associated with the receiver. By default, returns a style group whose only style element is an ETBasicItemStyle object.
Returns the represented object when not
nil, otherwise returns the receiver.
You shouldn't have to use this method a lot since -valueForProperty: and -setValue:forProperty: make the property access transparent. For example [self valueForProperty: kNameProperty] is equivalent to [[self subject] name].
-subject can be useful with KVC which only considers the layout item itself. e.g. [itemCollection valueForKey: @"subject.name"].
Notifies the item it has begun to be edited.
This method is usually invoked by the item view or the action handler to allow the item to notify the controller item controller about the editing.
You can invoke it in an action handler method when
you want the possibility to react with
-commitEditingForItem:
or
-discardEditingForItem:
to an early editing termination by the controller.
See also -objectDidEndEditing: .
Notifies the item the editing underway ended.
This method is usually invoked by the item view or the action handler to allow the item to notify the controller item controller about the editing.
You must invoke it in an action handler method when
you have previously call
-objectDidBeginEditing
and your editor has finished to edit a property.
See also -objectDidBeginEditing: .
Returns the receiver subtype.
More explanations in -setSubtype . See also -type .
Returns the first layout item bound to a view upwards in the layout item tree.
The receiver itself can be returned.
Returns the transform applied within the content bounds.
Forces the layout to be recomputed to take in account geometry and content related changes since the last layout update.
This method is not yet implemented.
See also
-[ETLayoutItemGroup updateLayout].
Updates the layouts, previously marked with -setNeedsLayoutUpdate , in the entire item tree.
For ETLayoutItemGroup, won't be limited to the item subtree.
This method is only exposed to be used internally by EtoileUI.
Returns NO. See -[ETLayoutItemGroup
usesFlexibleLayoutFrame].
Returns whether the view used by the receiver is a widget.
Also returns YES when the receiver uses
a layout view which is a widget provided by the widget
backend. See -[ETLayout isWidget].
See also -[NSView(Etoile) isWidget].
Controls the automatic enabling/disabling of UI elements (such as menu items) that uses the responder chain to validate themselves, based on whether the receiver or its action handler can respond to the selector action that would be sent by the UI element in the EtoileUI responder chain.
Returns a value object based on -valueKey .
The method returns the result of
-valueForProperty:
for the value key. For a nil value key,
the represented object is returned (without resorting
to -valueForProperty:). If the represented object is a
viewpoint, then the viewpoint value is
returned rather than returning the item
represented object. See -[ETPropertyViewpoint
value:]. For items that presents a single
property in the UI, using
-value
and -valueKey
is a good choice. For example, a text field or a
slider presenting a common object value or a
property belonging to the represent object. See
also
-setValue:
.
Returns a value of the model object -representedObject , usually by calling -valueForProperty: on the represented object. If the represented object is a layout item, -valueForKey: will be called instead of -valueForProperty: .
-valueForProperty: is implemented by NSObject as part of the ETPropertyValueCoding informal protocol. When the represented object is a custom model object, it must override -valueForProperty: and -setValue:forProperty: or conform to NSKeyValueCoding protocol. See ETPropertyValueCoding to understand how to implement your model object.
When the represented object is a layout item, the receiver is a meta layout item (see -isMetaItem and -[NSObject(ETLayoutItem) isLayoutItem]).
Sets a value key to describe which property of the represented object is exposed through -value and -setValue: .
Returns the value transformer registered for the given property.
-valueForProperty: converts the value just before returning it by using -[ETItemValueTransformer transformValue:forKey:ofItem:] if a transformer is registered for the property. -setValue:forProperty: converts the value just before returning it by using -[ETItemValueTransformer receverTransformValue:forKey:ofItem:] if a transformer is registered for the property.
Returns the view associated with the receiver.
The view is an NSView class or subclass instance. See -setView: .
This method is only exposed to be used internally by EtoileUI.
Returns the visible portion of the content bounds when the receiver content is clipped by a decorator, otherwise the same than -contentBounds .
The returned rect is expressed in the receiver content coordinate space.
Returns a widget proxy for target/action and value related settings. You should use this proxy to control the widget settings rather than setting them directly on the view.
If -view
is
nil, the widget proxy holds the
settings for the item. You can use
-widget
to access these settings in an action handler or a
cover style (for example, if you are implementing a
new widget using custom ETStyle and ETActionHandler
objects without resorting to a widget from the
backend).
Returns the current width associated with the receiver frame size. See also -frame .
Returns the first layout item decorated by a window upwards in the layout item tree.
The receiver itself can be returned.
When the receiver content is presented inside a
window, returns the decorator item that owns the
window provided by the widget backend (e.g.
AppKit), otherwise returns nil.
Won't return an enclosing window item bound to an
ancestor item.
To retrieve the enclosing
window item, use [[self windowBackedAncestorItem]
windowItem].
Returns the current x coordinate associated with the receiver frame origin. See also -frame .
Returns the current y coordinate associated with the receiver frame origin. See also -frame .
- Declared in:
- ETLayoutItem.h
See ETLayoutItemLayoutDidChangeNotification.
Describes how the content looks when the layout item is resized.
The content can be:
nil
The content aspect is applied to a view by altering its
autoresizing mask.
For their parts,
styles are expected to rely on the item content
aspect to know how they should draw the properties
they retrieve through the layout item.
Some content aspects won't be applied to a view because they cannot be translated into an autoresizing mask.
Notification posted by ETLayoutItem and subclasses in reply to -setLayout: on the poster object. The poster object can be retrieved through -[NSNotification object].
If -setLayout: results in no layout change, no notification is posted.
This notification is also posted when the layout is modified by the user (e.g. through an inspector).