|
CeresEngine 0.2.0
A game development framework
|
The infrastructure for drawing and handling events in a UI. More...
#include <CeresEngine/UI/UIView.hpp>
Public Member Functions | |
| UIView () | |
Initializes new UIView object with an empty frame rectangle. | |
| UIView (const String &name) | |
Initializes new UIView object with an empty frame rectangle and custom name. | |
| UIView (const UIRect &frame, const String &name="") | |
Initializes new UIView object with a frame rectangle. | |
| UIView (const UISize &size, const String &name="") | |
Initializes new UIView object with an frame rectangle size. | |
| UIView (const UIPoint &origin, const UISize &size, const String &name="") | |
Initializes new UIView object with an frame rectangle size. | |
| UIView (const double x, const double y, const double width, const double height, const String &name="") | |
Initializes new UIView object with an frame rectangle size. | |
| ~UIView () override | |
Destroys a UIView. | |
| UIView * | getSuperView () const |
| The view that is the parent of the current view. | |
| const Vector< UIView * > & | getSubViews () const |
| The list of views embedded in the current view. | |
| void | setSubViews (const Vector< UIView * > &subViews) |
| The list of views embedded in the current view. | |
| UInt32 | getSubViewCount () const noexcept |
| Gets the number of sub-views in the view. | |
| UIView * | getSubView (UInt32 index) const |
| Gets the sub-view at the given index. | |
| UInt32 | getSubViewIndex (const UIView *view) const |
| Gtes the sub-view index for the given sub-view, if it is a sub-view. | |
| void | addSubView (UIView *view) |
| Adds a view to the view's subviews so it's displayed above its siblings. | |
| void | addSubView (const UIViewPtr &view) |
| Adds a view to the view's subviews so it's displayed above its siblings. | |
| template<typename T , typename... Args> | |
| T * | addSubView (Args &&... args) |
| Adds a view to the view's subviews so it's displayed above its siblings. | |
| void | replaceSubView (UIView *view, UIView *replacement) |
| Replaces one of the view's subviews with another view. | |
| void | removeFromSuperview () |
| Unlinks the view from its superview and its window, removes it from the responder chain, and invalidates its cursor rectangles. | |
| bool | isDescendant (const UIView *view) const |
| Returns true if the view is a subview of a given view or if it's identical to that view; otherwise, it returns false. | |
| UIView * | getOpaqueAncestor () const |
| The view's closest opaque ancestor, which might be the view itself. | |
| virtual UIWindow * | getWindow () const |
| The view's window object, if it is installed in a window. | |
| UIRect | getFrame () const |
| The view's frame rectangle, which defines its position and size in its superview's coordinate system. | |
| virtual void | setFrame (const UIRect &frame) |
| The view's frame rectangle, which defines its position and size in its superview's coordinate system. | |
| void | setFrame (const UIPoint &point, const UISize &size) |
| The view's frame rectangle, which defines its position and size in its superview's coordinate system. | |
| void | setFrame (const UIPoint &point, const double width, const double height) |
| The view's frame rectangle, which defines its position and size in its superview's coordinate system. | |
| void | setFrame (const double x, const double y, const UISize &size) |
| The view's frame rectangle, which defines its position and size in its superview's coordinate system. | |
| void | setFrame (const double x, const double y, const double width, const double height) |
| The view's frame rectangle, which defines its position and size in its superview's coordinate system. | |
| void | setFrameOrigin (const UIPoint &point) |
| Sets the origin of the view's frame rectangle to the specified point, effectively repositioning it within its superview. | |
| void | setFrameOrigin (const double x, const double y) |
| Sets the origin of the view's frame rectangle to the specified point, effectively repositioning it within its superview. | |
| void | setFrameSize (const UISize &size) |
| Sets the size of the view's frame rectangle to the specified dimensions, resizing it within its superview without affecting its coordinate system. | |
| void | setFrameSize (const double width, const double height) |
| Sets the size of the view's frame rectangle to the specified dimensions, resizing it within its superview without affecting its coordinate system. | |
| UIRect | getBounds () const |
| The view's bounds rectangle, which expresses its location and size in its own coordinate system. | |
| virtual void | setBounds (const UIRect &bounds) |
| The view's bounds rectangle, which expresses its location and size in its own coordinate system. | |
| void | setBounds (const UIPoint &point, const UISize &size) |
| The view's bounds rectangle, which expresses its location and size in its own coordinate system. | |
| void | setBounds (const UIPoint &point, const double width, const double height) |
| The view's bounds rectangle, which expresses its location and size in its own coordinate system. | |
| void | setBounds (const double x, const double y, const UISize &size) |
| The view's bounds rectangle, which expresses its location and size in its own coordinate system. | |
| void | setBounds (const double x, const double y, const double width, const double height) |
| The view's bounds rectangle, which expresses its location and size in its own coordinate system. | |
| void | setBoundsOrigin (const UIPoint &point) |
| Sets the origin of the view's bounds rectangle to a specified point. | |
| void | setBoundsOrigin (const double x, const double y) |
| Sets the origin of the view's bounds rectangle to a specified point. | |
| void | setBoundsSize (const UISize &size) |
| Sets the size of the view's bounds rectangle to specified dimensions, inversely scaling its coordinate system relative to its frame rectangle. | |
| void | setBoundsSize (const double width, const double height) |
| Sets the size of the view's bounds rectangle to specified dimensions, inversely scaling its coordinate system relative to its frame rectangle. | |
| virtual bool | acceptsFirstMouse (const UIEvent &theEvent) |
Overridden by subclasses to return true if the view should call mouseDown() for an initial mouse-down event, false if not. | |
| UIView * | hitTest (UIPoint aPoint, const Optional< const UIEvent & > &event=nullopt) |
| Returns the farthest descendant of the view in the view hierarchy (including itself) that contains a specified point, or nil if that point lies completely outside the view. | |
| virtual bool | isPointInside (const UIPoint &point, const Optional< const UIEvent & > &event=nullopt) |
| Returns a Boolean value indicating whether the receiver contains the specified point. | |
| bool | isMousePoint (const UIPoint &aPoint, const UIRect &aRect) |
| Returns whether a region of the view contains a specified point, accounting for whether the view is flipped or not. | |
| virtual bool | getMouseDownCanMoveWindow () const |
| This property lets you determine the region by which a window can be moved. | |
| const UIAppearance & | getAppearance () const noexcept |
| The UI appearance to be used by the view. | |
| void | setAppearance (UIAppearance *appearance) |
| The UI appearance to be used by the view. | |
| UIColor | getTintColor () const |
| The first non-default tint color value in the view's hierarchy, ascending from and starting with the view itself. | |
| void | setTintColor (const UIColor &color) |
| The first non-default tint color value in the view's hierarchy, ascending from and starting with the view itself. | |
| void | clearTintColor () |
| Clears the tint color for the current view. | |
| const UIColor & | getBackgroundColor () const noexcept |
| The view's background color. | |
| void | setBackgroundColor (const UIColor &color) |
| The view's background color. | |
| const UICornerRadius & | getCornerRadius () const noexcept |
| The view's background corner radius. | |
| void | setCornerRadius (const UICornerRadius &color) |
| The view's background corner radius. | |
| double | getAlpha () const noexcept |
| This property contains the opacity value from the view's layer. | |
| void | setAlpha (double alpha) |
| This property contains the opacity value from the view's layer. | |
| bool | isOpaque () const noexcept |
| A Boolean value indicating whether the view fills its frame rectangle with opaque content. | |
| void | setOpaque (bool isOpaque) |
| A Boolean value indicating whether the view fills its frame rectangle with opaque content. | |
| UIRect | getVisibleRect () const |
| Visibility, as reflected by this property, does not account for whether other view or window objects overlap the current view or whether the current view is installed in a window at all. | |
| bool | isVisible () const |
| A Boolean value indicating whether the view is visible. | |
| void | setVisible (bool visible) |
| A Boolean value indicating whether the view is visible. | |
| bool | isHidden () const |
| A Boolean value indicating whether the view is hidden. | |
| void | setHidden (const bool hidden) |
| A Boolean value indicating whether the view is hidden. | |
| bool | isHiddenOrHasHiddenAncestor () const |
| A Boolean value indicating whether the view is hidden from sight because it, or one of its ancestors, is marked as hidden. | |
| bool | isActive () const |
| A Boolean value indicating whether the view is active. | |
| void | setActive (bool active) |
| A Boolean value indicating whether the view is active. | |
| bool | getAutoresizesSubViews () const |
| A Boolean value indicating whether the view applies the autoresizing behavior to its subviews when its frame size changes. | |
| void | setAutoresizesSubViews (bool state) |
| Generates a hash for the provided type. | |
| const UIViewAutoresizingMask & | getAutoresizingMask () const |
| The options that determine how the view is resized relative to its superview. | |
| void | setAutoresizingMask (const UIViewAutoresizingMask &autoresizingMask) |
| The options that determine how the view is resized relative to its superview. | |
| virtual void | resizeSubviews (const UISize &oldBoundsSize) |
| Informs the view's subviews that the view's bounds rectangle size has changed. | |
| virtual void | resize (const UISize &oldBoundsSize) |
| Informs the view that the bounds size of its superview has changed. | |
| virtual UISize | getIntrinsicContentSize () const |
| The natural size for the receiving view, considering only properties of the view itself. | |
| bool | getNeedsLayout () const |
| A Boolean value indicating whether the view needs a layout pass before it can be drawn. | |
| void | setNeedsLayout () |
| A Boolean value indicating whether the view needs a layout pass before it can be drawn. | |
| void | setNeedsLayout (bool state) |
| A Boolean value indicating whether the view needs a layout pass before it can be drawn. | |
| void | layout () |
| Perform layout in concert with the layout system. | |
| void | layoutIfNeeded () |
| Updates the layout of the receiving view and its subviews based on the current views and constraints. | |
| virtual void | layoutSubviews () |
| Lays out subviews. | |
| virtual UISize | calculateFittingLayoutSize (const UISize &targetSize) const |
| Returns the optimal size of the view based on its current constraints. | |
| UISize | calculateMinimumLayoutSize () const |
| Returns the minimum size of the view based on its current constraints. | |
| UISize | calculateMaximumLayoutSize () const |
| Returns the maximum size of the view based on its current constraints. | |
| bool | getNeedsUpdateConstraints () const |
| A Boolean value that determines whether the view’s constraints need updating. | |
| void | setNeedsUpdateConstraints () |
| A Boolean value that determines whether the view’s constraints need updating. | |
| void | setNeedsUpdateConstraints (bool state) |
| A Boolean value that determines whether the view’s constraints need updating. | |
| virtual void | updateConstraints () |
| Updates constraints for the view. | |
| void | updateConstraintsIfNeeded () |
| Updates the constraints for the receiving view and its subviews. | |
| Span< const UILayoutConstraint > | getConstraints () const |
| Returns the constraints held by the view. | |
| void | setConstraints (Vector< UILayoutConstraint > &&constraints) |
| Returns the constraints held by the view. | |
| void | setConstraints (const Span< const UILayoutConstraint > &constraints) |
| Returns the constraints held by the view. | |
| void | addConstraint (const UILayoutConstraint &constraint) |
| Adds a constraint on the layout of the receiving view or its subviews. | |
| void | addConstraints (const Span< const UILayoutConstraint > &constraints) |
| Adds multiple constraints on the layout of the receiving view or its subviews. | |
| void | addConstraints (const InitializerList< UILayoutConstraint > constraints) |
| Adds multiple constraints on the layout of the receiving view or its subviews. | |
| void | removeConstraint (const UILayoutConstraint &constraint) |
| Removes the specified constraint from the view. | |
| void | removeConstraints (const Span< const UILayoutConstraint > &constraints) |
| Removes the specified constraints from the view. | |
| void | removeConstraints (const InitializerList< UILayoutConstraint > constraints) |
| Removes the specified constraints from the view. | |
| const UIEdgeInsets & | getLayoutMargins () const |
| The default spacing to use when laying out content in the view. | |
| void | setLayoutMargins (const UIEdgeInsets &layoutMargins) |
| The default spacing to use when laying out content in the view. | |
| double | getLayoutTopMargin () const |
| The default spacing to use when laying out content in the view. | |
| void | setTopLayoutMargin (double topLayoutMargin) |
| Generates a hash for the provided type. | |
| double | getBottomLayoutMargin () const |
| The default spacing to use when laying out content in the view. | |
| void | setBottomLayoutMargin (double bottomLayoutMargin) |
| The default spacing to use when laying out content in the view. | |
| double | getLeftLayoutMargin () const |
| The default spacing to use when laying out content in the view. | |
| void | setLeftLayoutMargin (double leftLayoutMargin) |
| The default spacing to use when laying out content in the view. | |
| double | getRightLayoutMargin () const |
| The default spacing to use when laying out content in the view. | |
| void | setRightLayoutMargin (double rightLayoutMargin) |
| The default spacing to use when laying out content in the view. | |
| void | setNeedsDisplay () |
| The displayIfNeeded methods check the value of this property to avoid unnecessary drawing, and all display methods set the value back to false when the view is up to date. | |
| void | setNeedsDisplay (const UIRect &invalidRect) |
| Marks the region of the view within the specified rectangle as needing display, increasing the view's existing invalid region to include it. | |
| bool | getNeedsDisplay () const |
| The displayIfNeeded methods check the value of this property to avoid unnecessary drawing, and all display methods set the value back to false when the view is up to date. | |
| void | display (UIGraphicsContext &context) |
| Displays the view and all its subviews if possible. | |
| void | display (UIGraphicsContext &context, const UIRect &aRect) |
Acts as display(), but confining drawing to a rectangular region of the view. | |
| void | displayIgnoringOpacity (UIGraphicsContext &context) |
| Displays the view but does not back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code. | |
| virtual void | displayIgnoringOpacity (UIGraphicsContext &context, const UIRect &aRect) |
| Displays the view but confines drawing to a specified region and does not back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code. | |
| void | displayIfNeeded (UIGraphicsContext &context) |
| Displays the view and all its subviews if any part of the view has been marked as needing display. | |
| void | displayIfNeeded (UIGraphicsContext &context, const UIRect &aRect) |
Acts as displayIfNeeded(), but confining drawing to a rectangular region of the view. | |
| void | displayIfNeededIgnoringOpacity (UIGraphicsContext &context) |
Acts as displayIfNeeded(), except that this method doesn’t back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code. | |
| void | displayIfNeededIgnoringOpacity (UIGraphicsContext &context, const UIRect &aRect) |
| Displays the view but confines drawing to a specified region and does not back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code. | |
| bool | canDraw () const |
| A Boolean value indicating whether drawing commands will produce any results. | |
| virtual void | draw (UIGraphicsContext &context, const UIRect &dirtyRect) |
| Overridden by subclasses to draw the view's texture within the specified rectangle. | |
| const Vector< UIRect > & | getRectsBeingDrawn () const |
Returns by a list of non-overlapping rectangles that define the area the view is being asked to draw in draw(). | |
| bool | needsToDraw (const UIRect &aRect) const noexcept |
| Returns a Boolean value indicating whether the specified rectangle intersects any part of the area that the view is being asked to draw. | |
| virtual bool | getClearsContextBeforeDrawing () const noexcept |
| A Boolean value that determines whether the view's bounds should be automatically cleared before drawing. | |
| virtual bool | getClipsToBounds () const |
| A Boolean value that determines whether subviews are confined to the bounds of the view. | |
| double | getContentScaleFactor () const |
| The scale factor applied to the view. | |
| void | setContentScaleFactor (const Optional< double > &contentScaleFactor) |
| The scale factor applied to the view. | |
| bool | isFirstResponder () const noexcept |
| Determines if this view is the current first responder. | |
| virtual UIScrollView * | getScrollView () const |
| Gets the closest parent scroll view to this view. | |
| virtual bool | canBecomeKeyView () const |
| When the value of this property is true, the view can become the key view. | |
| virtual bool | needsPanelToBecomeKey () const |
The default value of this property is false. | |
| UIView * | getNextKeyView () const |
| The view object that follows the current view in the key view loop. | |
| void | setNextKeyView (UIView *nextKeyView) |
| The view object that follows the current view in the key view loop. | |
| UIView * | getNextValidKeyView () const |
The value in this property is nullptr if there is no view that follows the current view and accepts the first responder status. | |
| UIView * | getPreviousKeyView () const |
The value in this property is nullptr if there is no view preceding the current view in the key view loop. | |
| UIView * | getPreviousValidKeyView () const |
The value in this property is nullptr if there is no view that precedes the current view and accepts the first responder status. | |
| AffineTransform | getTransformFrom (const UIView *aView=nullptr) const |
| const AffineTransform & | getTransformFromWindow () const |
| AffineTransform | getTransformFromSuperView () const |
| const AffineTransform & | getTransformFromBacking () const |
| AffineTransform | getTransformTo (const UIView *aView=nullptr) const |
| const AffineTransform & | getTransformToWindow () const |
| AffineTransform | getTransformToSuperView () const |
| const AffineTransform & | getTransformToBacking () const |
| UIPoint | convertFrom (const UIPoint &aPoint, const UIView *aView=nullptr) const |
| Converts a point from the coordinate system of a given view to that of the view. | |
| UIPoint | convertFromWindow (const UIPoint &aPoint) const |
| Converts a point from the coordinate system of a given view to that of the view. | |
| UIPoint | convertFromSuperView (const UIPoint &aPoint) const |
| Converts a point from the coordinate system of a given view to that of the view. | |
| UIPoint | convertFromBacking (const UIPoint &aPoint) const |
| Converts a point from its pixel aligned backing store coordinate system to the view’s interior coordinate system. | |
| UIPoint | convertTo (const UIPoint &aPoint, const UIView *aView=nullptr) const |
| Converts a point from the view's coordinate system to that of a given view. | |
| UIPoint | convertToWindow (const UIPoint &aPoint) const |
| Converts a point from the view's coordinate system to that of a given view. | |
| UIPoint | convertToSuperView (const UIPoint &aPoint) const |
| Converts a point from the view's coordinate system to that of a given view. | |
| UIPoint | convertToBacking (const UIPoint &aPoint) const |
| Converts a point from the view’s interior coordinate system to its pixel aligned backing store coordinate system. | |
| UISize | convertFrom (const UISize &aSize, const UIView *aView=nullptr) const |
| Converts a size from another view's coordinate system to that of the view. | |
| UISize | convertFromWindow (const UISize &aSize) const |
| Converts a point from the coordinate system of a given view to that of the view. | |
| UISize | convertFromSuperView (const UISize &aSize) const |
| Converts a point from the coordinate system of a given view to that of the view. | |
| UISize | convertFromBacking (const UISize &aSize) const |
| Converts a size from its pixel aligned backing store coordinate system to the view’s interior coordinate system. | |
| UISize | convertTo (const UISize &aSize, const UIView *aView=nullptr) const |
| Converts a size from the view's coordinate system to that of another view. | |
| UISize | convertToWindow (const UISize &aSize) const |
| Converts a point from the view's coordinate system to that of a given view. | |
| UISize | convertToSuperView (const UISize &aSize) const |
| Converts a point from the view's coordinate system to that of a given view. | |
| UISize | convertToBacking (const UISize &aSize) const |
| Converts a size from the view’s interior coordinate system to its pixel aligned backing store coordinate system. | |
| UIRect | convertFrom (const UIRect &aRect, const UIView *aView=nullptr) const |
| Converts a rectangle from the coordinate system of another view to that of the view. | |
| UIRect | convertFromWindow (const UIRect &aRect) const |
| Converts a point from the coordinate system of a given view to that of the view. | |
| UIRect | convertFromSuperView (const UIRect &aRect) const |
| Converts a point from the coordinate system of a given view to that of the view. | |
| UIRect | convertFromBacking (const UIRect &aRect) const |
| Converts a rectangle from its pixel aligned backing store coordinate system to the view’s interior coordinate system. | |
| UIRect | convertTo (const UIRect &aRect, const UIView *aView=nullptr) const |
| Converts a rectangle from the view's coordinate system to that of another view. | |
| UIRect | convertToWindow (const UIRect &aRect) const |
| Converts a point from the view's coordinate system to that of a given view. | |
| UIRect | convertToSuperView (const UIRect &aRect) const |
| Converts a point from the view's coordinate system to that of a given view. | |
| UIRect | convertToBacking (const UIRect &aRect) const |
| Converts a rectangle from the view’s interior coordinate system to its pixel aligned backing store coordinate system. | |
| UIViewController * | getViewController () const noexcept |
| The UIView controller, if any. | |
| const String & | getName () const |
| A human readable string that represents the view. | |
| void | setName (const String &name) |
| Generates a hash for the provided type. | |
| virtual StringView | getTypeName () const |
| A string that represents the view type. | |
| UIResponder * | getNextResponder () const final |
| The next responder after this one, or nil if it has none. | |
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 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). | |
Public Member Functions inherited from CeresEngine::RefCounted< UIView, RefCounter< false > > | |
| RefCounted (Args &&... args) | |
Creates a new RefCounted object and constructs a new Deleter by forwarding Args to it. | |
| void | retain () noexcept |
| Retains the object by increment it's reference count by one. | |
| bool | release () noexcept |
| Relases the object by decrementing it's reference count by one. | |
Public Attributes | |
| const UILayoutAnchor | left |
| The left side of the object's alignment rectangle. | |
| const UILayoutAnchor | right |
| The right side of the object's alignment rectangle. | |
| const UILayoutAnchor | top |
| The top of the object's alignment rectangle. | |
| const UILayoutAnchor | bottom |
| The bottom of the object's alignment rectangle. | |
| const UILayoutAnchor | width |
| The width of the object's alignment rectangle. | |
| const UILayoutAnchor | height |
| The height of the object's alignment rectangle. | |
| const UILayoutAnchor | centerX |
| The center along the x-axis of the object's alignment rectangle. | |
| const UILayoutAnchor | centerY |
| The center along the y-axis of the object's alignment rectangle. | |
| const UILayoutAnchor | lastBaseline |
| The object's baseline. | |
| const UILayoutAnchor | firstBaseline |
| The object's baseline. | |
| const UILayoutAnchor | leftMargin |
| The object's left margin. | |
| const UILayoutAnchor | rightMargin |
| The object's right margin. | |
| const UILayoutAnchor | topMargin |
| The object's top margin. | |
| const UILayoutAnchor | bottomMargin |
| The object's bottom margin. | |
| const UILayoutAnchor | centerXWithinMargins |
| The center along the x-axis between the object's left and right margin. | |
| const UILayoutAnchor | centerYWithinMargins |
| The center along the y-axis between the object's top and bottom margin. | |
Static Public Attributes | |
| static const double | kNoInstrinsicMetric |
| Used to indicate that a view has no intrinsic metric for a given numeric property. | |
| static const UISize | kNoIntrinsicSize |
| Used to indicate that a view has no intrinsic metric for a given size property. | |
| static const UInt32 | kInvalidViewIndex |
| Used to indicate that an invalid view index. | |
| static const UIRect | kDefaultFrame |
| A rectangle that represents the default frame set by a view without an explicit frame. | |
| static const UIColorAppearanceProperty | tintColorProperty |
Determines the default value for the tintColor property if not overridden by the view. | |
| static const UIPaintAppearanceProperty | labelPaintProperty |
| The primary color to use for text labels. | |
| static const UIPaintAppearanceProperty | secondaryLabelPaintProperty |
| The secondary color to use for text labels. | |
| static const UIPaintAppearanceProperty | tertiaryLabelPaintProperty |
| The tertiary color to use for text labels. | |
| static const UIPaintAppearanceProperty | quaternaryLabelPaintProperty |
| The quaternary color to use for text labels and separators. | |
| static const UIPaintAppearanceProperty | textPaintProperty |
| The color to use for text. | |
| static const UIPaintAppearanceProperty | placeholderTextPaintProperty |
| The color to use for placeholder text in controls or text views. | |
| static const UIPaintAppearanceProperty | selectedTextPaintProperty |
| The color to use for selected text. | |
| static const UIPaintAppearanceProperty | textBackgroundPaintProperty |
| The color to use for the background area behind text. | |
| static const UIPaintAppearanceProperty | selectedTextBackgroundPaintProperty |
| The color to use for the background of selected text. | |
| static const UIPaintAppearanceProperty | keyboardFocusIndicatorPaintProperty |
| The color to use for the keyboard focus ring around controls. | |
| static const UIPaintAppearanceProperty | unemphasizedSelectedTextPaintProperty |
| The color to use for selected text in an unemphasized context. | |
| static const UIPaintAppearanceProperty | unemphasizedSelectedTextBackgroundPaintProperty |
| The color to use for the text background in an unemphasized context. | |
| static const UIPaintAppearanceProperty | linkPaintProperty |
| The color to use for links. | |
| static const UIPaintAppearanceProperty | separatorPaintProperty |
| The color to use for separators between different sections of content. | |
| static const UIPaintAppearanceProperty | selectedContentBackgroundPaintProperty |
| The color to use for the background of selected and emphasized content. | |
| static const UIPaintAppearanceProperty | unemphasizedSelectedContentBackgroundPaintProperty |
| The color to use for selected and unemphasized content. | |
| static const UIPaintAppearanceProperty | selectedMenuItemTextPaintProperty |
| The color to use for the text in menu items. | |
| static const UIPaintAppearanceProperty | gridPaintProperty |
| The color to use for the optional gridlines, such as those in a table view. | |
| static const UIPaintAppearanceProperty | headerTextPaintProperty |
| The color to use for text in header cells in table views and outline views. | |
| static const UIPaintAppearanceProperty | alternatingContentBackgroundColorsProperty |
| The colors to use for alternating content, typically found in table views and collection views. | |
| static const UIPaintAppearanceProperty | controlAccentPaintProperty |
| The user's current accent color preference. | |
| static const UIPaintAppearanceProperty | controlPaintProperty |
| The color to use for the flat surfaces of a control. | |
| static const UIPaintAppearanceProperty | controlBackgroundPaintProperty |
| The color to use for the background of large controls, such as scroll views or table views. | |
| static const UIPaintAppearanceProperty | controlTextPaintProperty |
| The color to use for text on enabled controls. | |
| static const UIPaintAppearanceProperty | disabledControlTextPaintProperty |
| The color to use for text on disabled controls. | |
| static const UIPaintAppearanceProperty | currentControlTintProperty |
| The current system control tint color. | |
| static const UIPaintAppearanceProperty | selectedControlPaintProperty |
| The color to use for the face of a selected control—that is, a control that has been clicked or is being dragged. | |
| static const UIPaintAppearanceProperty | selectedControlTextPaintProperty |
| The color to use for text in a selected control—that is, a control being clicked or dragged. | |
| static const UIPaintAppearanceProperty | alternateSelectedControlTextPaintProperty |
| The color to use for text in a selected control. | |
| static const UIPaintAppearanceProperty | scrubberTexturedBackgroundPaintProperty |
| The patterned color to use for the background of a scrubber control. | |
| static const UIPaintAppearanceProperty | windowBackgroundPaintProperty |
| The color to use for the window background. | |
| static const UIPaintAppearanceProperty | windowFrameTextPaintProperty |
| The color to use for text in a window's frame. | |
| static const UIPaintAppearanceProperty | underPageBackgroundPaintProperty |
| The color to use in the area beneath your window's views. | |
| static const UIPaintAppearanceProperty | findHighlightPaintProperty |
| The highlight color to use for the bubble that shows inline search result values. | |
| static const UIPaintAppearanceProperty | highlightPaintProperty |
| The color to use as a virtual light source on the screen. | |
| static const UIPaintAppearanceProperty | shadowPaintProperty |
| The color to use for virtual shadows cast by raised objects on the screen. | |
| static const UIFontAppearanceProperty | fontProperty |
| The default font used by all UI elements. | |
| static const UIFloatAppearanceProperty | fontSizeProperty |
| The default font size used by all UI elements. | |
Protected Member Functions | |
| virtual void | didAddSubview (UIView &view) |
| Overridden by subclasses to perform additional actions when subviews are added to the view. | |
| virtual void | willRemoveSubview (UIView &view) |
| Overridden by subclasses to perform additional actions before subviews are removed from the view. | |
| virtual void | didRemoveSubview (UIView &view) |
| Overridden by subclasses to perform additional actions when subviews are removed to the view. | |
| virtual void | willMoveToSuperView (UIView *superView) |
| Informs the view that its superview is about to change to the specified superview (which may be nil). | |
| virtual void | didMoveToSuperView (UIView *superView) |
| Informs the view that its superview has changed (possibly to nil). | |
| virtual void | willMoveToWindow (UIWindow *window) |
| Informs the view that it's being added to the view hierarchy of the specified window object (which may be nil). | |
| virtual void | didMoveToWindow (UIWindow *window) |
| Informs the view that it has been added to a new view hierarchy. | |
| virtual void | didHide () |
| Invoked when the view is hidden, either directly, or in response to an ancestor being hidden. | |
| virtual void | didUnhide () |
| Invoked when the view is unhidden, either directly, or in response to an ancestor being unhidden. | |
| virtual void | willDraw () |
| Informs the view that it will be required to draw content. | |
| virtual void | tintColorDidChange () |
| Called by the system when the tintColor property changes. | |
| virtual void | didChangeFrame (const UIRect &oldFrame) |
Called whenever the view frame changes, either internally or programmatically by calls to setFrame. | |
| virtual void | didChangeBounds (const UIRect &oldBounds) |
Called whenever the view bounds changes, either internally or programmatically by calls to setBounds. | |
| void | invalidateIntrinsicContentSize () |
| Invalidates the view's intrinsic content size. | |
| void | updateIntrinsicContentSize () |
Private Member Functions | |
| UILayoutSolver & | ensureLayoutSolver () |
| Ensures that a layout solver is present on the view. | |
| void | registerLayoutAnchor (const UILayoutAnchor &layoutAnchor) |
| Registers a new layout anchor with the view. | |
| void | invalidateTransforms () |
| Internal method called by the system whenever it needs to invalidate transforms. | |
| void | updateTransformsIfNeeded () |
| void | invalidateBackingStore () |
Called whenever the UIView backing store must be invalidated. | |
| void | setWindow (UIWindow *window) |
| void | setSuperView (UIView *superView) |
| void | insertSubView (UIView *view, UInt32 index) |
| void | setViewController (UIViewController *viewController) |
| The UIView controller, if any. | |
Private Attributes | |
| friend | UIWindow |
| friend | UIViewController |
| UIView * | mSuperView = nullptr |
| The parent view. | |
| Vector< UIView * > | mSubViews |
| A list of children views. | |
| UIWindow * | mWindow = nullptr |
| The window this UIView is attached to. | |
| UIRect | mFrame |
| The view's frame rectangle, which defines its position and size in its superview's coordinate system. | |
| UIRect | mBounds |
| The view's bounds rectangle, which expresses its location and size in its own coordinate system. | |
| Optional< double > | mContentScaleFactor = nullopt |
| The scale factor applied to the view. | |
| bool | mCustomBounds = false |
| Determines if the view uses a custom bounds rectangle. | |
| UIViewStateFlags | mFlags |
| The view flags. | |
| UIAppearancePtr | mAppearance = nullptr |
| The UI appearance to be used by the view. | |
| Optional< UIColor > | mTintColor = std::nullopt |
| The base color to be used for UI tinting. | |
| UIColor | mBackgroundColor = UIColor::white |
| The view's background color. | |
| UICornerRadius | mCornerRadius |
| The view's background corner radius. | |
| bool | mOpaque = false |
| A Boolean value indicating whether the view fills its frame rectangle with opaque content. | |
| UIViewAutoresizingMask | mResizingMask = UIViewAutoResizing::Height | UIViewAutoResizing::Width |
| The options that determine how the view is resized relative to its superview. | |
| String | mName |
| A human readable string that represents the view. | |
| UIView * | mNextKeyView = nullptr |
| The view object that follows the current view in the key view loop. | |
| UIView * | mPreviousKeyView = nullptr |
| The view object preceding the current view in the key view loop. | |
| AffineTransform | mTransformToWindow |
| A 2D transformation matrix that transforms a point from the view coordinate space into the window coordinate space. | |
| AffineTransform | mTransformFromWindow |
| A 2D transformation matrix that transforms a point from the window coordinate space into the view coordinate space. | |
| AffineTransform | mTransformToBacking |
| A 2D transformation matrix that transforms a point from the view’s interior coordinate system to its pixel aligned backing store coordinate system. | |
| AffineTransform | mTransformFromBacking |
| A 2D transformation matrix that transforms a point from its pixel aligned backing store coordinate system to the view’s interior coordinate system. | |
| Vector< UIRect > | mTrackingRects |
| A list of tracking rectangles. | |
| UISize | mIntrinsicContentSize |
| The natural size for the receiving view, considering only properties of the view itself. | |
| UIEdgeInsets | mLayoutMargins |
| The default spacing to use when laying out content in the view. | |
| Vector< UIRect > | mInvalidRects |
| Vector< UIRect > | mRectsBeingDrawn |
A cache for getRectsBeingDrawn() the values returned. | |
| UIViewController * | mViewController = nullptr |
| The UIView controller, if any. | |
| UILayerPtr | mLayer |
| The UI layer that the view uses as its backing store. | |
| UPtr< UILayoutSolver > | mLayoutSolver |
| The layout solver for this view. | |
| Vector< UILayoutAnchor > | mLayoutAnchors |
| A vector that contains all anchors for the view. | |
Friends | |
| class | UILayoutAnchorVariable |
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. | |
The infrastructure for drawing and handling events in a UI.
You typically don't use UIView objects directly. Instead, you use objects whose classes descend from UIView or you subclass UIView yourself and override its methods to implement the behavior you need. An instance of the UIView class (or one of its subclasses) is commonly known as a view object, or simply as a view.
Views handle the presentation and interaction with your app's visible content. You arrange one or more views inside an UIWindow object, which acts as a wrapper for your content. A view object defines a rectangular region for drawing and receiving mouse events. Views handle other chores as well, including the dragging of icons and working with the UIScrollView class to support efficient scrolling.
Most of the functionality of the UIView class is automatically invoked by the UI framework. Unless you're implementing a concrete subclass of UIView or working intimately with the content of the view hierarchy at runtime, you don't need to know much about this class's interface. For any view, there are many methods that you can use as-is. The following methods are commonly used:
getFrame: returns the location and size of the UIView object.getBounds: returns the internal origin and size of the UIView object.needsDisplay: determines whether the UIView object needs to be redrawn.getWindow: returns the UIWindow object that contains the UIView object.If you subclass UIView directly and handle specific types of events, the implementation of your event-related methods should generally not call the base. Views inherit their event-handling capabilities from their UIResponder parent class. The default behavior for responders is to pass events up the responder chain, which is not the behavior you typically want if you handle events in a custom view. Therefore, you should not call super if your view implements any of the following methods and handles the event:
If your view descends from a class other than UIView, call super to let the parent view handle any events that you do not.
| CeresEngine::UIView::UIView | ( | ) |
Initializes new UIView object with an empty frame rectangle.
Initializes new UIView object with an empty frame rectangle and custom name.
Initializes new UIView object with a frame rectangle.
| frame | The frame rectangle for the created view object. |
Initializes new UIView object with an frame rectangle size.
The view is placed at the origin.
| size | The frame rectangle size for the created view object. |
|
inlineexplicit |
Initializes new UIView object with an frame rectangle size.
The view is placed at the origin.
| origin | The frame rectangle origin for the created view object. |
| size | The frame rectangle size for the created view object. |
|
inlineexplicit |
Initializes new UIView object with an frame rectangle size.
The view is placed at the origin.
| x | The frame rectangle origin x coordinate for the created view object. |
| y | The frame rectangle origin y coordinate for the created view object. |
| width | The frame rectangle width for the created view object. |
| height | The frame rectangle height for the created view object. |
|
override |
Destroys a UIView.
Overridden by subclasses to return true if the view should call mouseDown() for an initial mouse-down event, false if not.
The view can either return a value unconditionally or use the location of theEvent to determine whether or not it wants the event. The default implementation ignores theEvent and returns false.
Override this method in a subclass to allow instances to respond to click-through. This allows the user to click on a view in an inactive window, activating the view with one click, instead of clicking first to make the window active and then clicking the view. Most view objects refuse a click-through attempt, so the event simply activates the window. Many control objects, however, such as instances of UIButton and UISlider, do accept them, so the user can immediately manipulate the control without having to release the mouse button.
| theEvent | The initial mouse-down event, which must be over the view in its window. |
| void CeresEngine::UIView::addConstraint | ( | const UILayoutConstraint & | constraint | ) |
Adds a constraint on the layout of the receiving view or its subviews.
The constraint must involve only views that are within scope of the receiving view. Specifically, any views involved must be either the receiving view itself, or a subview of the receiving view. Constraints that are added to a view are said to be held by that view. The coordinate system used when evaluating the constraint is the coordinate system of the view that holds the constraint.
| constraint | The constraint to be added to the view. The constraint may only reference the view itself or its subviews. |
|
inline |
Adds multiple constraints on the layout of the receiving view or its subviews.
All constraints must involve only views that are within scope of the receiving view. Specifically, any views involved must be either the receiving view itself, or a subview of the receiving view. Constraints that are added to a view are said to be held by that view. The coordinate system used when evaluating each constraint is the coordinate system of the view that holds the constraint.
| constraints | An array of constraints to be added to the view. All constraints may only reference the view itself or its subviews. |
| void CeresEngine::UIView::addConstraints | ( | const Span< const UILayoutConstraint > & | constraints | ) |
Adds multiple constraints on the layout of the receiving view or its subviews.
All constraints must involve only views that are within scope of the receiving view. Specifically, any views involved must be either the receiving view itself, or a subview of the receiving view. Constraints that are added to a view are said to be held by that view. The coordinate system used when evaluating each constraint is the coordinate system of the view that holds the constraint.
| constraints | An array of constraints to be added to the view. All constraints may only reference the view itself or its subviews. |
|
inline |
Adds a view to the view's subviews so it's displayed above its siblings.
Adds a view to the view's subviews so it's displayed above its siblings.
Adds a view to the view's subviews so it's displayed above its siblings.
|
virtual |
Returns the optimal size of the view based on its current constraints.
| targetSize | The size that you prefer for the view. To obtain a view that is as small as possible, specify the constant UILayoutFittingCompressedSize. To obtain a view that is as large as possible, specify the constant UILayoutFittingExpandedSize. |
targetSize parameter as possible. This method does not actually change the size of the view.Reimplemented in CeresEngine::UIScrollView.
|
inline |
Returns the maximum size of the view based on its current constraints.
|
inline |
Returns the minimum size of the view based on its current constraints.
When the value of this property is true, the view can become the key view.
In order to become the key view, the view must be visible, it must be installed in a window that supports keyboard entry, and the view's acceptsFirstResponder method must return true.
| bool CeresEngine::UIView::canDraw | ( | ) | const |
A Boolean value indicating whether drawing commands will produce any results.
The value of this property is true when drawing produces expected results. A view object can draw onscreen if it is not hidden, it is attached to a view hierarchy in a window (UIWindow), and the window has a corresponding window device.
Check the value of this property before attempting to force drawing to a specific context. For example, if the value of this property is false, do not call draw() or do issue any drawing commands from the view. You do not need to check whether drawing can occur when calling the display method or any of its related methods. The display methods perform appropriate checks before asking the view to draw itself.
| void CeresEngine::UIView::clearTintColor | ( | ) |
Clears the tint color for the current view.
| UIPoint CeresEngine::UIView::convertFrom | ( | const UIPoint & | aPoint, |
| const UIView * | aView = nullptr |
||
| ) | const |
Converts a point from the coordinate system of a given view to that of the view.
| aPoint | A point specifying a location in the coordinate system of aView. |
| aView | The view with aPoint in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead. |
| UIRect CeresEngine::UIView::convertFrom | ( | const UIRect & | aRect, |
| const UIView * | aView = nullptr |
||
| ) | const |
Converts a rectangle from the coordinate system of another view to that of the view.
| aRect | The rectangle in aView's coordinate system. |
| aView | The view with aRect in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead. |
| UISize CeresEngine::UIView::convertFrom | ( | const UISize & | aSize, |
| const UIView * | aView = nullptr |
||
| ) | const |
Converts a size from another view's coordinate system to that of the view.
The returned UISize values are always forced to have positive a width and height.
| aSize | The size (width and height) in aView's coordinate system. |
| aView | The view with aSize in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead. |
UISize structure. Converts a point from its pixel aligned backing store coordinate system to the view’s interior coordinate system.
| aPoint | The point in the pixel backing store aligned coordinate system. |
Converts a rectangle from its pixel aligned backing store coordinate system to the view’s interior coordinate system.
| aRect | The rectangle in the pixel backing store coordinate system. |
Converts a size from its pixel aligned backing store coordinate system to the view’s interior coordinate system.
| aSize | The size in the pixel backing store aligned coordinate system. |
Converts a point from the coordinate system of a given view to that of the view.
| aPoint | A point specifying a location in the coordinate system of aView. |
| aView | The view with aPoint in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead. |
Converts a point from the coordinate system of a given view to that of the view.
| aPoint | A point specifying a location in the coordinate system of aView. |
| aView | The view with aPoint in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead. |
Converts a point from the coordinate system of a given view to that of the view.
| aPoint | A point specifying a location in the coordinate system of aView. |
| aView | The view with aPoint in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead. |
Converts a point from the coordinate system of a given view to that of the view.
| aPoint | A point specifying a location in the coordinate system of aView. |
| aView | The view with aPoint in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead. |
Converts a point from the coordinate system of a given view to that of the view.
| aPoint | A point specifying a location in the coordinate system of aView. |
| aView | The view with aPoint in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead. |
Converts a point from the coordinate system of a given view to that of the view.
| aPoint | A point specifying a location in the coordinate system of aView. |
| aView | The view with aPoint in its coordinate system. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts from window coordinates instead. |
| UIPoint CeresEngine::UIView::convertTo | ( | const UIPoint & | aPoint, |
| const UIView * | aView = nullptr |
||
| ) | const |
Converts a point from the view's coordinate system to that of a given view.
| aPoint | A point specifying a location in the coordinate system of the view. |
| aView | The view into whose coordinate system aPoint is to be converted. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead. |
aView. | UIRect CeresEngine::UIView::convertTo | ( | const UIRect & | aRect, |
| const UIView * | aView = nullptr |
||
| ) | const |
Converts a rectangle from the view's coordinate system to that of another view.
| aRect | A rectangle in the view's coordinate system. |
| aView | The view that is the target of the conversion operation. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts the rectangle to window coordinates instead. |
| UISize CeresEngine::UIView::convertTo | ( | const UISize & | aSize, |
| const UIView * | aView = nullptr |
||
| ) | const |
Converts a size from the view's coordinate system to that of another view.
The returned UISize values are always forced to have positive a width and height.
| aSize | The size (width and height) in the view's coordinate system. |
| aView | The view that is the target of the conversion operation. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead. |
UISize structure. Converts a point from the view’s interior coordinate system to its pixel aligned backing store coordinate system.
| aPoint | The point in the view’s interior coordinate system. |
Converts a rectangle from the view’s interior coordinate system to its pixel aligned backing store coordinate system.
| aRect | A rectangle in the view’s interior coordinate system. |
Converts a size from the view’s interior coordinate system to its pixel aligned backing store coordinate system.
| aSize | The size in the view’s interior coordinate system. |
Converts a point from the view's coordinate system to that of a given view.
| aPoint | A point specifying a location in the coordinate system of the view. |
| aView | The view into whose coordinate system aPoint is to be converted. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead. |
aView. Converts a point from the view's coordinate system to that of a given view.
| aPoint | A point specifying a location in the coordinate system of the view. |
| aView | The view into whose coordinate system aPoint is to be converted. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead. |
aView. Converts a point from the view's coordinate system to that of a given view.
| aPoint | A point specifying a location in the coordinate system of the view. |
| aView | The view into whose coordinate system aPoint is to be converted. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead. |
aView. Converts a point from the view's coordinate system to that of a given view.
| aPoint | A point specifying a location in the coordinate system of the view. |
| aView | The view into whose coordinate system aPoint is to be converted. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead. |
aView. Converts a point from the view's coordinate system to that of a given view.
| aPoint | A point specifying a location in the coordinate system of the view. |
| aView | The view into whose coordinate system aPoint is to be converted. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead. |
aView. Converts a point from the view's coordinate system to that of a given view.
| aPoint | A point specifying a location in the coordinate system of the view. |
| aView | The view into whose coordinate system aPoint is to be converted. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead. |
aView. Overridden by subclasses to perform additional actions when subviews are added to the view.
Reimplemented in CeresEngine::UISplitView, and CeresEngine::UIStackView.
|
inlineprotectedvirtual |
Called whenever the view bounds changes, either internally or programmatically by calls to setBounds.
Reimplemented in CeresEngine::UIButton, CeresEngine::UIViewport, and CeresEngine::UIToolBar.
Called whenever the view frame changes, either internally or programmatically by calls to setFrame.
Reimplemented in CeresEngine::UIButton.
Invoked when the view is hidden, either directly, or in response to an ancestor being hidden.
Informs the view that its superview has changed (possibly to nil).
Reimplemented in CeresEngine::UIGizmoManipulator, and CeresEngine::UIViewport.
Informs the view that it has been added to a new view hierarchy.
Reimplemented in CeresEngine::UIViewport.
Overridden by subclasses to perform additional actions when subviews are removed to the view.
Reimplemented in CeresEngine::UISplitView, and CeresEngine::UIStackView.
Invoked when the view is unhidden, either directly, or in response to an ancestor being unhidden.
| void CeresEngine::UIView::display | ( | UIGraphicsContext & | context | ) |
Displays the view and all its subviews if possible.
If the view isn't opaque, this method backs up the view hierarchy to the first opaque ancestor, calculates the portion of the opaque ancestor covered by the view, and begins displaying from there.
| void CeresEngine::UIView::display | ( | UIGraphicsContext & | context, |
| const UIRect & | aRect | ||
| ) |
Acts as display(), but confining drawing to a rectangular region of the view.
| context | The graphics context in which drawing will occur. |
| aRect | A rectangle defining the region of the view to be redrawn; it should be specified in the coordinate system of the view. |
| void CeresEngine::UIView::displayIfNeeded | ( | UIGraphicsContext & | context | ) |
Displays the view and all its subviews if any part of the view has been marked as needing display.
If the view isn't opaque, this method backs up the view hierarchy to the first opaque ancestor, calculates the portion of the opaque ancestor covered by the view, and begins displaying from there.
| context | The graphics context in which drawing will occur. |
| void CeresEngine::UIView::displayIfNeeded | ( | UIGraphicsContext & | context, |
| const UIRect & | aRect | ||
| ) |
Acts as displayIfNeeded(), but confining drawing to a rectangular region of the view.
| context | The graphics context in which drawing will occur. |
| aRect | A rectangle defining the region of the view to be redrawn; it should be specified in the coordinate system of the view. |
| void CeresEngine::UIView::displayIfNeededIgnoringOpacity | ( | UIGraphicsContext & | context | ) |
Acts as displayIfNeeded(), except that this method doesn’t back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.
| context | The graphics context in which drawing will occur. |
| void CeresEngine::UIView::displayIfNeededIgnoringOpacity | ( | UIGraphicsContext & | context, |
| const UIRect & | aRect | ||
| ) |
Displays the view but confines drawing to a specified region and does not back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.
| context | The graphics context in which drawing will occur. |
| aRect | A rectangle defining the region of the view to be redrawn; it should be specified in the coordinate system of the view. |
| void CeresEngine::UIView::displayIgnoringOpacity | ( | UIGraphicsContext & | context | ) |
Displays the view but does not back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.
| context | The graphics context in which drawing will occur. |
|
virtual |
Displays the view but confines drawing to a specified region and does not back up to the first opaque ancestor—it simply causes the view and its descendants to execute their drawing code.
| context | The graphics context in which drawing will occur. |
| aRect | A rectangle defining the region of the view to be redrawn; it should be specified in the coordinate system of the view. |
Reimplemented in CeresEngine::UIClipView.
|
virtual |
Overridden by subclasses to draw the view's texture within the specified rectangle.
Use this method to draw the specified portion of your view's content. Your implementation of this method should be as fast as possible and do as little work as possible. The dirtyRect parameter helps you achieve better performance by specifying the portion of the view that needs to be drawn. You should always limit drawing to the content inside this rectangle. For even better performance, you can call the getRectsBeingDrawn() method and use the list of rectangles returned by that method to limit drawing even further. You can also use the needsToDraw() method test whether objects in a particular rectangle need to be drawn.
The default implementation does nothing. Subclasses should override this method if they do custom drawing. Prior to calling this method, the framework creates an appropriate drawing context and configures it for drawing to the view; you do not need to configure the drawing context yourself.
If your custom view is a direct UIView subclass, you do not need to call super. For all other views, call super at some point in your implementation so that the parent class can perform any additional drawing.
isOpaque property is true, the view must completely fill the dirtyRect rectangle with opaque content.| dirtyRect | A rectangle defining the portion of the view that requires redrawing. This rectangle usually represents the portion of the view that requires updating. When responsive scrolling is enabled, this rectangle can also represent a nonvisible portion of the view that frameworks wants to cache. |
Reimplemented in CeresEngine::UIScrollView, CeresEngine::UIButton, CeresEngine::UICheckbox, CeresEngine::UIGizmoArrowManipulator, CeresEngine::UIGizmoCircleManipulator, CeresEngine::UILabel, CeresEngine::UIMenuBar, CeresEngine::UIScroller, CeresEngine::UISlider, CeresEngine::UISplitView, CeresEngine::UITextField, CeresEngine::UIToolBar, and CeresEngine::UIViewport.
|
private |
Ensures that a layout solver is present on the view.
|
inlinenoexcept |
This property contains the opacity value from the view's layer.
The acceptable range of values for this property are between 0.0 (transparent) and 1.0 (opaque). The default value of this property is 1.0.
|
noexcept |
The UI appearance to be used by the view.
The default value for this property is nulltpr, which means that the view uses the appearance it inherits from the nearest ancestor that has set an appearance. When you set appearance to a non-null value, the view and the views it contains use the specified appearance.
| bool CeresEngine::UIView::getAutoresizesSubViews | ( | ) | const |
A Boolean value indicating whether the view applies the autoresizing behavior to its subviews when its frame size changes.
When the value of this property is true and the view's frame changes, the view automatically calls the resizeSubViews() method to facilitate the resizing of its subviews. When the value of this property is false, the view does not autoresize its subviews.
The default value of this property is true.
|
inline |
The options that determine how the view is resized relative to its superview.
The value of this property is an integer bit mask specified by combining the options described in UIViewAutoresizingMask. This mask is used by the resize() method when the view needs to be resized.
If the autoresizing mask is set to UIViewNotSizable (that is, if none of the options are set), the view does not resize at all. When more than one option along an axis is set, the resize() method distributes the size difference as evenly as possible among the flexible portions. For example, if UIViewWidthSizable and UIViewMaxXMargin are set and the superview's width has increased by 10.0 points, the view's frame and right margin are each widened by 5.0 points.
The view's background color.
|
inline |
The default spacing to use when laying out content in the view.
This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.
|
inline |
The view's bounds rectangle, which expresses its location and size in its own coordinate system.
By default, this property contains a rectangle whose origin is (0, 0) and whose size matches the size of the view's frame rectangle (measured in points).
If you explicitly change the origin or size of the bounds rectangle, this property saves the rectangle you set.
Changing the bounds does not mark the view as needing to be displayed. Call the setNeedsDisplay when you want the view to be redisplayed. After changing the bounds rectangle, the view creates an internal transform, a tool for manipulating coordinates, (or appends these changes to an existing internal transform) to convert from frame coordinates to bounds coordinates in your view. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.
A Boolean value that determines whether the view's bounds should be automatically cleared before drawing.
When set to true, the drawing buffer is automatically cleared to transparent black before the draw method is called. This behavior ensures that there are no visual artifacts left over when the view's contents are redrawn. If the view's isOpaque property is also set to true, the getBackgroundColor property of the view will be used when clearing. The default value of this property is true.
If you set the value of this property to false, you are responsible for ensuring the contents of the view are drawn properly in your draw method. If your drawing code is already heavily optimized, setting this property to false can improve performance, especially during scrolling when only a portion of the view might need to be redrawn.
Reimplemented in CeresEngine::UICheckbox, CeresEngine::UIMenuBar, CeresEngine::UIToolBar, and CeresEngine::UIViewport.
A Boolean value that determines whether subviews are confined to the bounds of the view.
Setting this value to true causes subviews to be clipped to the bounds of the receiver. If set to false, subviews whose frames extend beyond the visible bounds of the receiver are not clipped. The default value is true.
| Span< const UILayoutConstraint > CeresEngine::UIView::getConstraints | ( | ) | const |
Returns the constraints held by the view.
| double CeresEngine::UIView::getContentScaleFactor | ( | ) | const |
The scale factor applied to the view.
The scale factor determines how content in the view is mapped from the logical coordinate space (measured in points) to the device coordinate space (measured in pixels). This value is typically either 1.0 or 2.0. Higher scale factors indicate that each point in the view is represented by more than one pixel in the underlying layer. For example, if the scale factor is 2.0 and the view frame size is 50 x 50 points, the size of the bitmap used to present that content is 100 x 100 pixels.
The default value for this property is the scale factor associated with the screen currently displaying the view. If your custom view implements a custom draw method and is associated with a window your view draws at the full resolution of the screen.
In general, you should not need to modify the value in this property. However, if your application draws using very expensive rendering operations, like a scene viewport, you may want to change the scale factor to trade texture quality for rendering performance.
|
inlinenoexcept |
The view's background corner radius.
If a background color is set, will specify the corner radius it should be draw with.
|
inline |
The view's frame rectangle, which defines its position and size in its superview's coordinate system.
Changing the value of this property repositions and resizes the view within the coordinate system of its superview. Changing the frame does not mark the view as needing to be displayed. Call setNeedsDisplay when you want the view to be redisplayed.
If your view does not use a custom bounds rectangle, this method also sets the view's bounds to match the size of the new frame. You can specify a custom bounds rectangle by changing the bounds property or by calling the setBoundsOrigin() or setBoundsSize() method explicitly. Once set, the view creates an internal transform to convert from frame coordinates to bounds coordinates. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.
The natural size for the receiving view, considering only properties of the view itself.
The default width and height values of this property are set to NSViewNoInstrinsicMetric. For a custom view, you can override this property and use it to communicate what size you would like your view to be based on its content. You might do this in cases where the layout system cannot determine the size of the view based solely on its current constraints. For example, a text field might override this method and return an intrinsic size based on the text it contains. The intrinsic size you supply must be independent of the content frame, because there's no way to dynamically communicate a changed width to the layout system based on a changed height. If your custom view has no intrinsic size for a given dimension, you can set the corresponding dimension to the UIViewNoInstrinsicMetric.
Reimplemented in CeresEngine::UIButton, CeresEngine::UICheckbox, CeresEngine::UILabel, CeresEngine::UIMenuBar, CeresEngine::UISlider, CeresEngine::UITextField, and CeresEngine::UIToolBar.
|
inline |
The default spacing to use when laying out content in the view.
This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.
|
inline |
The default spacing to use when laying out content in the view.
This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.
|
inline |
The default spacing to use when laying out content in the view.
This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.
This property lets you determine the region by which a window can be moved.
The default value of this property is false if the view is opaque; otherwise, it is set to true. Subclasses can override this property to return different values based on the event.
A human readable string that represents the view.
Used for debugging only.
| bool CeresEngine::UIView::getNeedsDisplay | ( | ) | const |
The displayIfNeeded methods check the value of this property to avoid unnecessary drawing, and all display methods set the value back to false when the view is up to date.
Whenever the data or state affecting the view's appearance changes, set this property to true. This marks the view as needing to update its display. On the next pass through the app's event loop, the view is automatically redisplayed.
| bool CeresEngine::UIView::getNeedsLayout | ( | ) | const |
A Boolean value indicating whether the view needs a layout pass before it can be drawn.
You only ever need to change the value of this property if your view implements the layout method. Setting this property to true lets the system know that the view's layout needs to be updated before it is drawn. The system checks the value of this property prior to applying layout rules for the view.
true if the view needs a layout pass, false otherwise. | bool CeresEngine::UIView::getNeedsUpdateConstraints | ( | ) | const |
A Boolean value that determines whether the view’s constraints need updating.
The constraint-based layout system uses the return value of this method to determine whether it needs to call updateConstraints on your view as part of its normal layout pass.
When a property of your custom view changes in a way that would impact constraints, you can call this method to indicate that the constraints need to be updated at some point in the future. The system will then call updateConstraints as part of its normal layout pass. Use this as an optimization tool to batch constraint changes. Updating constraints all at once just before they are needed ensures that you don’t needlessly recalculate constraints when multiple changes are made to your view in between layout passes.
true if the view’s constraints need updating, false otherwise.
|
inline |
The view object that follows the current view in the key view loop.
The value in this property is nullptr if there is no next view in the key view loop. You can assign a view to this property to make that view the next view in the loop. The view in this property should, if possible, be made first responder when the user navigates forward from the view using keyboard interface control.
|
finalvirtual |
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 from CeresEngine::UIResponder.
| UIView * CeresEngine::UIView::getNextValidKeyView | ( | ) | const |
The value in this property is nullptr if there is no view that follows the current view and accepts the first responder status.
The framework ignores hidden views when it determines the next valid key view.
nullptr if there is none. | UIView * CeresEngine::UIView::getOpaqueAncestor | ( | ) | const |
The view's closest opaque ancestor, which might be the view itself.
|
inline |
The value in this property is nullptr if there is no view preceding the current view in the key view loop.
The view in this property should, if possible, be made first responder when the user navigates backward from the current view using keyboard interface control.
| UIView * CeresEngine::UIView::getPreviousValidKeyView | ( | ) | const |
The value in this property is nullptr if there is no view that precedes the current view and accepts the first responder status.
The framework ignores hidden views when it determines the previous valid key view.
Returns by a list of non-overlapping rectangles that define the area the view is being asked to draw in draw().
An implementation of draw() can use this information to test whether objects or regions within the view intersect with the rectangles in the list, and thereby avoid unnecessary drawing that would be completely clipped away.
The needsToDraw() method gives you a convenient way to test individual objects for intersection with the area being drawn in draw(). However, you may want to retrieve and directly inspect the rectangle list if this is a more efficient way to perform intersection testing.
You should call this method only from within a draw() implementation. The aRect parameter of draw() is the rectangle enclosing the returned list of rectangles; you can use it in an initial pass to reject objects that are clearly outside the area to be drawn.
|
inline |
The default spacing to use when laying out content in the view.
This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.
|
virtual |
Gets the closest parent scroll view to this view.
Reimplemented in CeresEngine::UIScrollView.
Gets the sub-view at the given index.
|
inlinenoexcept |
Gets the number of sub-views in the view.
Gtes the sub-view index for the given sub-view, if it is a sub-view.
The list of views embedded in the current view.
This array contains zero or more UIView objects that represent the views embedded in the current view's content. The current view acts as the superview for each subview. The order of the subviews may be considered as being back-to-front, but this does not imply invalidation and drawing behavior.
When performing hit-test operations on a view, you should start at the last view in this array and work backwards.
Set this property to reorder the view's existing subviews, add or remove subviews en masse, replace all of the view's subviews with a new set of subviews, or remove all the view's subviews. When you assign a valid, new array of subviews, the system performs required sorting and calls addSubView() and removeFromSuperview() as necessary to leave the property with the requested new array. Any member of the new array that isn't already a subview of the view is added. Any member of the view's existing subviews array that isn't in the new array is removed. Any views that are in both subviews and the new array are moved in the subviews array as needed, without being removed and re-added.
This property marks the affected view and window areas as needing display.
|
inline |
The view that is the parent of the current view.
The superview is the immediate ancestor of the current view. The value of this property is nil when the view is not installed in a view hierarchy. To set the value of this property, use the addSubView method to embed the current view inside another view.
When checking the value of this property iteratively or recursively, be sure to compare the superview object to the content view of the window to avoid proceeding out of the view hierarchy.
| UIColor CeresEngine::UIView::getTintColor | ( | ) | const |
The first non-default tint color value in the view's hierarchy, ascending from and starting with the view itself.
If the system cannot find a non-default color in the hierarchy, this property's value is a system-defined color instead.
To refresh subview rendering when this property changes, override the tintColorDidChange() method.
| aView | The view into whose coordinate system transformation matrix is to be returned. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead. |
| const AffineTransform & CeresEngine::UIView::getTransformFromBacking | ( | ) | const |
|
inline |
| const AffineTransform & CeresEngine::UIView::getTransformFromWindow | ( | ) | const |
| aView | The view into whose coordinate system transformation matrix is to be returned. Both aView and the view must belong to the same UIWindow object, and that window must not be nullptr. If aView is nullptr, this method converts to window coordinates instead. |
| const AffineTransform & CeresEngine::UIView::getTransformToBacking | ( | ) | const |
|
inline |
| const AffineTransform & CeresEngine::UIView::getTransformToWindow | ( | ) | const |
|
virtual |
A string that represents the view type.
|
inlinenoexcept |
The UIView controller, if any.
Can be nullptr if the view is not attached to a controller.
| UIRect CeresEngine::UIView::getVisibleRect | ( | ) | const |
Visibility, as reflected by this property, does not account for whether other view or window objects overlap the current view or whether the current view is installed in a window at all.
This value of this property is zero if the current view is effectively hidden.
The view's window object, if it is installed in a window.
The value of this property is nullptr if the view is not currently installed in a window.
| UIView * CeresEngine::UIView::hitTest | ( | UIPoint | aPoint, |
| const Optional< const UIEvent & > & | event = nullopt |
||
| ) |
Returns the farthest descendant of the view in the view hierarchy (including itself) that contains a specified point, or nil if that point lies completely outside the view.
This method is used primarily by an UIWindow object to determine which view should receive a mouse-down event. You'd rarely need to invoke this method, but you might want to override it to have a view object hide mouse-down events from its subviews. This method ignores hidden views.
This method traverses the view hierarchy by calling the isMousePoint method of each subview to determine which subview should receive a mouse event. If isPointInside returns true, then the subview's hierarchy is similarly traversed until the frontmost view containing the specified point is found. If a view does not contain the point, its branch of the view hierarchy is ignored. You rarely need to call this method yourself.
This method ignores view objects that are hidden or have an alpha level less than 0.01. This method does not take the view's content into account when determining a hit. Thus, a view can still be returned even if the specified point is in a transparent portion of that view's content.
Points that lie outside the receiver's bounds are never reported as hits, even if they actually lie within one of the receiver's subviews. This can occur if the current view's clipsToBounds property is set to false and the affected subview extends beyond the view's bounds.
| aPoint | A point that is in the coordinate system of the view's superview, not of the view itself. |
| event | The event that warranted a call to this method. If you are calling this method from outside your event-handling code, you may specify nullptr. |
aPoint.
|
private |
Called whenever the UIView backing store must be invalidated.
Usually called whenever the UIWindow changes or when the backing UIWindowDevice of a window changes.
|
protected |
Invalidates the view's intrinsic content size.
Call this when something changes in your custom view that invalidates its intrinsic content size. This allows the layout system to take the new intrinsic content size into account in its next layout pass.
|
private |
Internal method called by the system whenever it needs to invalidate transforms.
| bool CeresEngine::UIView::isActive | ( | ) | const |
A Boolean value indicating whether the view is active.
Returns true if the view is a subview of a given view or if it's identical to that view; otherwise, it returns false.
|
noexcept |
Determines if this view is the current first responder.
|
inline |
A Boolean value indicating whether the view is hidden.
This property reflects the state of the current view only, as set in through the most recent change to this property. The property does not account for the state of the view's ancestors in the view hierarchy. Thus, if the view has a hidden ancestor, the value of this property may still be false even though the view itself is not visible. To determine whether a view is effectively hidden, for whatever reason, get the value of the isHiddenOrHasHiddenAncestor method instead.
A hidden view disappears from its window and does not receive input events. It remains in its superview's list of subviews, however, and participates in autoresizing as usual. The framework also disables any cursor rectangle, tool-tip rectangle, or tracking rectangle associated with a hidden view. Hiding a view with subviews has the effect of hiding those subviews and any view descendants they might have. This effect is implicit and does not alter the hidden state of the view's descendants as reported by this property.
Hiding the view that is the window's current first responder causes the view's next valid key view (nextValidKeyView) to become the new first responder. A hidden view remains in the nextKeyView chain of views it was previously part of, but is ignored during keyboard navigation.
| bool CeresEngine::UIView::isHiddenOrHasHiddenAncestor | ( | ) | const |
A Boolean value indicating whether the view is hidden from sight because it, or one of its ancestors, is marked as hidden.
Returns whether a region of the view contains a specified point, accounting for whether the view is flipped or not.
Point-in-rectangle functions generally assume that the bottom edge of a rectangle is outside of the rectangle boundaries, while the upper edge is inside the boundaries. This method views aRect from the point of view of the user—that is, this method always treats the bottom edge of the rectangle as the one closest to the bottom edge of the user's screen. By making this adjustment, this function ensures consistent mouse-detection behavior from the user's perspective.
| aPoint | A point that is expressed in the view's coordinate system. This point generally represents the hot spot of the mouse cursor. |
| aRect | A rectangle that is expressed in the view's coordinate system. |
true if aRect contains aPoint, false otherwise.
|
inlinenoexcept |
A Boolean value indicating whether the view fills its frame rectangle with opaque content.
The default value of this property is false to reflect the fact that views do no drawing by default. Subclasses can override this property and return true to indicate that the view completely covers its frame rectangle with opaque content. Doing so can improve performance during drawing operations by eliminating the need to render content behind the view.
|
virtual |
Returns a Boolean value indicating whether the receiver contains the specified point.
| point | A point that is in the receiver's local coordinate system (bounds). |
| event | The event that warranted a call to this method. If you are calling this method from outside your event-handling code, you may specify nullptr. |
true if point is inside the receiver's bounds; otherwise, false. Reimplemented in CeresEngine::UIGizmoArrowManipulator, CeresEngine::UIGizmoCircleManipulator, and CeresEngine::UIButton.
| bool CeresEngine::UIView::isVisible | ( | ) | const |
A Boolean value indicating whether the view is visible.
| void CeresEngine::UIView::layout | ( | ) |
Perform layout in concert with the layout system.
Override this method if your custom view needs to perform custom layout. In this case you are responsible for calling setNeedsLayout to true when something that impacts your custom layout changes.
You may not invalidate the layout of your superview or views outside of your view hierarchy. You also may not invoke a drawing pass as part of layout.
You must call the base layout() as part of your implementation.
| void CeresEngine::UIView::layoutIfNeeded | ( | ) |
Updates the layout of the receiving view and its subviews based on the current views and constraints.
This method updates the layout if needed. This method is called automatically by the system, but may be invoked manually if you need to examine the most up to date layout.
Lays out subviews.
Subclasses can override this method as needed to perform more precise layout of their subviews. You should override this method only if the autoresizing behavior of the subviews do not offer the behavior you want. You can use your implementation to set the frame rectangles of your subviews directly.
You should not call this method directly. If you want to force a layout update, call the setNeedsLayout() method instead to do so prior to the next drawing update. If you want to update the layout of your views immediately, call the layoutIfNeeded() method.
Reimplemented in CeresEngine::UIClipView, CeresEngine::UILabel, CeresEngine::UIScrollView, CeresEngine::UISplitView, CeresEngine::UITextField, and CeresEngine::UIToolBar.
The default value of this property is false.
Subclasses can override this property and use their implementation to determine if the view requires its panel to become the key window so that it can handle keyboard input and navigation. Such a subclass should also override acceptsFirstResponder to return true.
This property is also used in keyboard navigation. It determines if a mouse click should give focus to a view—that is, make it the first responder). Some views (for example, text fields) want to receive the keyboard focus when you click in them. Other views (for example, buttons) receive focus only when you tab to them. You wouldn't want focus to shift from a textfield that has editing in progress simply because you clicked on a check box.
Reimplemented in CeresEngine::UISlider, and CeresEngine::UITextField.
Returns a Boolean value indicating whether the specified rectangle intersects any part of the area that the view is being asked to draw.
You typically call this method from within a draw() implementation. It gives you a convenient way to determine whether any part of a given graphical entity might need to be drawn. It is optimized to efficiently reject any rectangle that lies outside the bounding box of the area that the view is being asked to draw in draw().
| aRect | A rectangle defining a region of the view. |
|
private |
Registers a new layout anchor with the view.
This is called automatically by the anchor constructor.
| void CeresEngine::UIView::removeConstraint | ( | const UILayoutConstraint & | constraint | ) |
Removes the specified constraint from the view.
| constraint | The constraint to remove. Removing a constraint not held by the view has no effect. |
|
inline |
Removes the specified constraints from the view.
| constraints | The constraints to remove. |
| void CeresEngine::UIView::removeConstraints | ( | const Span< const UILayoutConstraint > & | constraints | ) |
Removes the specified constraints from the view.
| constraints | The constraints to remove. |
| void CeresEngine::UIView::removeFromSuperview | ( | ) |
Unlinks the view from its superview and its window, removes it from the responder chain, and invalidates its cursor rectangles.
The view is also released; if you plan to reuse it, be sure to retain it before sending this message and to release it as appropriate when adding it as a subview of another UIView.
Replaces one of the view's subviews with another view.
Informs the view that the bounds size of its superview has changed.
This method is normally invoked automatically from resizeSubviews().
The default implementation resizes the view according to the autoresizing options specified by the autoresizingMask property. You shouldn't invoke this method directly, but you can override it to define a specific resizing behavior.
If you override this method and call the base as part of your implementation, you should be sure to call the base before making changes to the receiving view's frame yourself.
| oldBoundsSize | The previous size of the view's bounds rectangle. |
Informs the view's subviews that the view's bounds rectangle size has changed.
If the view is configured to autoresize its subviews, this method is automatically invoked by any method that changes the view's frame size.
The default implementation calls resize() to the view's subviews with oldBoundsSize as the argument. You shouldn't invoke this method directly, but you can override it to define a specific resizing behavior.
| oldBoundsSize | The previous size of the view's bounds rectangle. |
A Boolean value indicating whether the view is active.
This property contains the opacity value from the view's layer.
The acceptable range of values for this property are between 0.0 (transparent) and 1.0 (opaque). The default value of this property is 1.0.
| void CeresEngine::UIView::setAppearance | ( | UIAppearance * | appearance | ) |
The UI appearance to be used by the view.
The default value for this property is nulltpr, which means that the view uses the appearance it inherits from the nearest ancestor that has set an appearance. When you set appearance to a non-null value, the view and the views it contains use the specified appearance.
Generates a hash for the provided type.
Type must have a std::hash specialization.
| T | the type to be hashed |
| v | The value to be hashed |
| void CeresEngine::UIView::setAutoresizingMask | ( | const UIViewAutoresizingMask & | autoresizingMask | ) |
The options that determine how the view is resized relative to its superview.
The value of this property is an integer bit mask specified by combining the options described in UIViewAutoresizingMask. This mask is used by the resize() method when the view needs to be resized.
If the autoresizing mask is set to none (that is, if none of the options are set), the view does not resize at all. When more than one option along an axis is set, the resize() method distributes the size difference as evenly as possible among the flexible portions. For example, if widthSizable and maxXMargin are set and the superview's width has increased by 10.0 points, the view's frame and right margin are each widened by 5.0 points.
The default spacing to use when laying out content in the view.
This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.
|
inline |
The view's bounds rectangle, which expresses its location and size in its own coordinate system.
By default, this property contains a rectangle whose origin is (0, 0) and whose size matches the size of the view's frame rectangle (measured in points).
If you explicitly change the origin or size of the bounds rectangle, this property saves the rectangle you set.
Changing the bounds does not mark the view as needing to be displayed. Call the setNeedsDisplay when you want the view to be redisplayed. After changing the bounds rectangle, the view creates an internal transform, a tool for manipulating coordinates, (or appends these changes to an existing internal transform) to convert from frame coordinates to bounds coordinates in your view. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.
The view's bounds rectangle, which expresses its location and size in its own coordinate system.
By default, this property contains a rectangle whose origin is (0, 0) and whose size matches the size of the view's frame rectangle (measured in points).
If you explicitly change the origin or size of the bounds rectangle, this property saves the rectangle you set.
Changing the bounds does not mark the view as needing to be displayed. Call the setNeedsDisplay when you want the view to be redisplayed. After changing the bounds rectangle, the view creates an internal transform, a tool for manipulating coordinates, (or appends these changes to an existing internal transform) to convert from frame coordinates to bounds coordinates in your view. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.
|
inline |
The view's bounds rectangle, which expresses its location and size in its own coordinate system.
By default, this property contains a rectangle whose origin is (0, 0) and whose size matches the size of the view's frame rectangle (measured in points).
If you explicitly change the origin or size of the bounds rectangle, this property saves the rectangle you set.
Changing the bounds does not mark the view as needing to be displayed. Call the setNeedsDisplay when you want the view to be redisplayed. After changing the bounds rectangle, the view creates an internal transform, a tool for manipulating coordinates, (or appends these changes to an existing internal transform) to convert from frame coordinates to bounds coordinates in your view. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.
The view's bounds rectangle, which expresses its location and size in its own coordinate system.
By default, this property contains a rectangle whose origin is (0, 0) and whose size matches the size of the view's frame rectangle (measured in points).
If you explicitly change the origin or size of the bounds rectangle, this property saves the rectangle you set.
Changing the bounds does not mark the view as needing to be displayed. Call the setNeedsDisplay when you want the view to be redisplayed. After changing the bounds rectangle, the view creates an internal transform, a tool for manipulating coordinates, (or appends these changes to an existing internal transform) to convert from frame coordinates to bounds coordinates in your view. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.
The view's bounds rectangle, which expresses its location and size in its own coordinate system.
By default, this property contains a rectangle whose origin is (0, 0) and whose size matches the size of the view's frame rectangle (measured in points).
If you explicitly change the origin or size of the bounds rectangle, this property saves the rectangle you set.
Changing the bounds does not mark the view as needing to be displayed. Call the setNeedsDisplay when you want the view to be redisplayed. After changing the bounds rectangle, the view creates an internal transform, a tool for manipulating coordinates, (or appends these changes to an existing internal transform) to convert from frame coordinates to bounds coordinates in your view. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.
Sets the origin of the view's bounds rectangle to a specified point.
Sets the origin of the view's bounds rectangle to a specified point.
Sets the size of the view's bounds rectangle to specified dimensions, inversely scaling its coordinate system relative to its frame rectangle.
Sets the size of the view's bounds rectangle to specified dimensions, inversely scaling its coordinate system relative to its frame rectangle.
| void CeresEngine::UIView::setConstraints | ( | const Span< const UILayoutConstraint > & | constraints | ) |
Returns the constraints held by the view.
| void CeresEngine::UIView::setConstraints | ( | Vector< UILayoutConstraint > && | constraints | ) |
Returns the constraints held by the view.
The scale factor applied to the view.
The scale factor determines how content in the view is mapped from the logical coordinate space (measured in points) to the device coordinate space (measured in pixels). This value is typically either 1.0 or 2.0. Higher scale factors indicate that each point in the view is represented by more than one pixel in the underlying layer. For example, if the scale factor is 2.0 and the view frame size is 50 x 50 points, the size of the bitmap used to present that content is 100 x 100 pixels.
The default value for this property is the scale factor associated with the screen currently displaying the view. If your custom view implements a custom draw method and is associated with a window your view draws at the full resolution of the screen.
In general, you should not need to modify the value in this property. However, if your application draws using very expensive rendering operations, like a scene viewport, you may want to change the scale factor to trade texture quality for rendering performance.
| void CeresEngine::UIView::setCornerRadius | ( | const UICornerRadius & | color | ) |
The view's background corner radius.
If a background color is set, will specify the corner radius it should be draw with.
|
inline |
The view's frame rectangle, which defines its position and size in its superview's coordinate system.
Changing the value of this property repositions and resizes the view within the coordinate system of its superview. Changing the frame does not mark the view as needing to be displayed. Call setNeedsDisplay when you want the view to be redisplayed.
If your view does not use a custom bounds rectangle, this method also sets the view's bounds to match the size of the new frame. You can specify a custom bounds rectangle by changing the bounds property or by calling the setBoundsOrigin() or setBoundsSize() method explicitly. Once set, the view creates an internal transform to convert from frame coordinates to bounds coordinates. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.
The view's frame rectangle, which defines its position and size in its superview's coordinate system.
Changing the value of this property repositions and resizes the view within the coordinate system of its superview. Changing the frame does not mark the view as needing to be displayed. Call setNeedsDisplay when you want the view to be redisplayed.
If your view does not use a custom bounds rectangle, this method also sets the view's bounds to match the size of the new frame. You can specify a custom bounds rectangle by changing the bounds property or by calling the setBoundsOrigin() or setBoundsSize() method explicitly. Once set, the view creates an internal transform to convert from frame coordinates to bounds coordinates. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.
|
inline |
The view's frame rectangle, which defines its position and size in its superview's coordinate system.
Changing the value of this property repositions and resizes the view within the coordinate system of its superview. Changing the frame does not mark the view as needing to be displayed. Call setNeedsDisplay when you want the view to be redisplayed.
If your view does not use a custom bounds rectangle, this method also sets the view's bounds to match the size of the new frame. You can specify a custom bounds rectangle by changing the bounds property or by calling the setBoundsOrigin() or setBoundsSize() method explicitly. Once set, the view creates an internal transform to convert from frame coordinates to bounds coordinates. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.
The view's frame rectangle, which defines its position and size in its superview's coordinate system.
Changing the value of this property repositions and resizes the view within the coordinate system of its superview. Changing the frame does not mark the view as needing to be displayed. Call setNeedsDisplay when you want the view to be redisplayed.
If your view does not use a custom bounds rectangle, this method also sets the view's bounds to match the size of the new frame. You can specify a custom bounds rectangle by changing the bounds property or by calling the setBoundsOrigin() or setBoundsSize() method explicitly. Once set, the view creates an internal transform to convert from frame coordinates to bounds coordinates. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.
The view's frame rectangle, which defines its position and size in its superview's coordinate system.
Changing the value of this property repositions and resizes the view within the coordinate system of its superview. Changing the frame does not mark the view as needing to be displayed. Call setNeedsDisplay when you want the view to be redisplayed.
If your view does not use a custom bounds rectangle, this method also sets the view's bounds to match the size of the new frame. You can specify a custom bounds rectangle by changing the bounds property or by calling the setBoundsOrigin() or setBoundsSize() method explicitly. Once set, the view creates an internal transform to convert from frame coordinates to bounds coordinates. As long as the width-to-height ratio of the two coordinate systems remains the same, your content appears normal. If the ratios differ, your content may appear skewed.
Sets the origin of the view's frame rectangle to the specified point, effectively repositioning it within its superview.
Sets the origin of the view's frame rectangle to the specified point, effectively repositioning it within its superview.
Sets the size of the view's frame rectangle to the specified dimensions, resizing it within its superview without affecting its coordinate system.
Sets the size of the view's frame rectangle to the specified dimensions, resizing it within its superview without affecting its coordinate system.
A Boolean value indicating whether the view is hidden.
This property reflects the state of the current view only, as set in through the most recent change to this property. The property does not account for the state of the view's ancestors in the view hierarchy. Thus, if the view has a hidden ancestor, the value of this property may still be false even though the view itself is not visible. To determine whether a view is effectively hidden, for whatever reason, get the value of the isHiddenOrHasHiddenAncestor method instead.
A hidden view disappears from its window and does not receive input events. It remains in its superview's list of subviews, however, and participates in autoresizing as usual. The framework also disables any cursor rectangle, tool-tip rectangle, or tracking rectangle associated with a hidden view. Hiding a view with subviews has the effect of hiding those subviews and any view descendants they might have. This effect is implicit and does not alter the hidden state of the view's descendants as reported by this property.
Hiding the view that is the window's current first responder causes the view's next valid key view (nextValidKeyView) to become the new first responder. A hidden view remains in the nextKeyView chain of views it was previously part of, but is ignored during keyboard navigation.
| void CeresEngine::UIView::setLayoutMargins | ( | const UIEdgeInsets & | layoutMargins | ) |
The default spacing to use when laying out content in the view.
This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.
The default spacing to use when laying out content in the view.
This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.
Generates a hash for the provided type.
Type must have a std::hash specialization.
| T | the type to be hashed |
| v | The value to be hashed |
| void CeresEngine::UIView::setNeedsDisplay | ( | ) |
The displayIfNeeded methods check the value of this property to avoid unnecessary drawing, and all display methods set the value back to false when the view is up to date.
Whenever the data or state affecting the view's appearance changes, set this property to true. This marks the view as needing to update its display. On the next pass through the app's event loop, the view is automatically redisplayed.
Marks the region of the view within the specified rectangle as needing display, increasing the view's existing invalid region to include it.
A later displayIfNeeded method will then perform drawing only within the invalid region. View objects marked as needing display are automatically redisplayed on each pass through the application's event loop. (View objects that need to redisplay before the event loop comes around can of course immediately be sent the appropriate display method.)
| invalidRect | The rectangular region of the view to mark as invalid; it should be specified in the coordinate system of the view. |
| void CeresEngine::UIView::setNeedsLayout | ( | ) |
A Boolean value indicating whether the view needs a layout pass before it can be drawn.
You only ever need to change the value of this property if your view implements the layout method. Setting this property to true lets the system know that the view's layout needs to be updated before it is drawn. The system checks the value of this property prior to applying layout rules for the view.
true if the view needs a layout pass, false otherwise. A Boolean value indicating whether the view needs a layout pass before it can be drawn.
You only ever need to change the value of this property if your view implements the layout method. Setting this property to true lets the system know that the view's layout needs to be updated before it is drawn. The system checks the value of this property prior to applying layout rules for the view.
true if the view needs a layout pass, false otherwise. | void CeresEngine::UIView::setNeedsUpdateConstraints | ( | ) |
A Boolean value that determines whether the view’s constraints need updating.
The constraint-based layout system uses the return value of this method to determine whether it needs to call updateConstraints on your view as part of its normal layout pass.
When a property of your custom view changes in a way that would impact constraints, you can call this method to indicate that the constraints need to be updated at some point in the future. The system will then call updateConstraints as part of its normal layout pass. Use this as an optimization tool to batch constraint changes. Updating constraints all at once just before they are needed ensures that you don’t needlessly recalculate constraints when multiple changes are made to your view in between layout passes.
true if the view’s constraints need updating, false otherwise. A Boolean value that determines whether the view’s constraints need updating.
The constraint-based layout system uses the return value of this method to determine whether it needs to call updateConstraints on your view as part of its normal layout pass.
When a property of your custom view changes in a way that would impact constraints, you can call this method to indicate that the constraints need to be updated at some point in the future. The system will then call updateConstraints as part of its normal layout pass. Use this as an optimization tool to batch constraint changes. Updating constraints all at once just before they are needed ensures that you don’t needlessly recalculate constraints when multiple changes are made to your view in between layout passes.
true if the view’s constraints need updating, false otherwise. The view object that follows the current view in the key view loop.
The value in this property is nullptr if there is no next view in the key view loop. You can assign a view to this property to make that view the next view in the loop. The view in this property should, if possible, be made first responder when the user navigates forward from the view using keyboard interface control.
A Boolean value indicating whether the view fills its frame rectangle with opaque content.
The default value of this property is false to reflect the fact that views do no drawing by default. Subclasses can override this property and return true to indicate that the view completely covers its frame rectangle with opaque content. Doing so can improve performance during drawing operations by eliminating the need to render content behind the view.
The default spacing to use when laying out content in the view.
This property specifies the desired amount of space (measured in points) between the edge of the view and any subviews. Auto layout uses your margins as a cue for placing content. For example, if you specify a set of horizontal constraints using the format string “|-[subview]-|”, the left and right edges of the subview are inset from the edge of the superview by the corresponding layout margins. When the edge of your view is close to the edge of the superview and the preservesSuperviewLayoutMargins property is true, the actual layout margins may be increased to prevent content from overlapping the superview's margins.
The list of views embedded in the current view.
This array contains zero or more UIView objects that represent the views embedded in the current view's content. The current view acts as the superview for each subview. The order of the subviews may be considered as being back-to-front, but this does not imply invalidation and drawing behavior.
When performing hit-test operations on a view, you should start at the last view in this array and work backwards.
Set this property to reorder the view's existing subviews, add or remove subviews en masse, replace all of the view's subviews with a new set of subviews, or remove all the view's subviews. When you assign a valid, new array of subviews, the system performs required sorting and calls addSubView() and removeFromSuperview() as necessary to leave the property with the requested new array. Any member of the new array that isn't already a subview of the view is added. Any member of the view's existing subviews array that isn't in the new array is removed. Any views that are in both subviews and the new array are moved in the subviews array as needed, without being removed and re-added.
This property marks the affected view and window areas as needing display.
The first non-default tint color value in the view's hierarchy, ascending from and starting with the view itself.
If the system cannot find a non-default color in the hierarchy, this property's value is a system-defined color instead.
To refresh subview rendering when this property changes, override the tintColorDidChange() method.
Generates a hash for the provided type.
Type must have a std::hash specialization.
| T | the type to be hashed |
| v | The value to be hashed |
|
private |
The UIView controller, if any.
Can be nullptr if the view is not attached to a controller.
A Boolean value indicating whether the view is visible.
Called by the system when the tintColor property changes.
The system calls this method on a view when your code changes the value of the tintColor property on that view. In addition, the system calls this method on a subview that inherits a changed interaction tint color.
In your implementation, refresh the view rendering as needed.
Updates constraints for the view.
Override this method to optimize changes to your constraints.
It is almost always cleaner and easier to update a constraint immediately after the affecting change has occurred. For example, if you want to change a constraint in response to a button tap, make that change directly in the button’s action method. You should only override this method when changing constraints in place is too slow, or when a view is producing a number of redundant changes.
To schedule a change, call setNeedsUpdateConstraints on the view. The system then calls your implementation of updateConstraints before the layout occurs. This lets you verify that all necessary constraints for your content are in place at a time when your custom view’s properties are not changing. Your implementation must be as efficient as possible. Do not deactivate all your constraints, then reactivate the ones you need. Instead, your app must have some way of tracking your constraints, and validating them during each update pass. Only change items that need to be changed. During each update pass, you must ensure that you have the appropriate constraints for the app’s current state.
Do not call setNeedsUpdateConstraints inside your implementation. Calling setNeedsUpdateConstraints schedules another update pass, creating a feedback loop.
Call super as the final step in your implementation.
Reimplemented in CeresEngine::UIStackView.
| void CeresEngine::UIView::updateConstraintsIfNeeded | ( | ) |
Updates the constraints for the receiving view and its subviews.
Whenever a new layout pass is triggered for a view, the system invokes this method to ensure that any constraints for the view and its subviews are updated with information from the current view hierarchy and its constraints. This method is called automatically by the system, but may be invoked manually if you need to examine the most up to date constraints.
|
protected |
|
private |
Informs the view that it will be required to draw content.
In response to receiving one of the display methods, the view will recurse down the view hierarchy, sending this message to each of the views that may be involved in the display operation.
Subclasses can override this method to move or resize views, mark additional areas as requiring display, or other actions that can best be deferred until they are required for drawing. During the recursion, calling the setNeedsDisplay to views in the hierarchy that are about to be drawn is valid and supported, and will affect the assessment of the total area to be rendered in that drawing pass.
A subclass's implementation of willDraw can use the existing UIView getRectsBeingDrawn method to obtain a list of rectangles that bound the affected area, enabling it to restrict its efforts to that area.
Informs the view that its superview is about to change to the specified superview (which may be nil).
Informs the view that it's being added to the view hierarchy of the specified window object (which may be nil).
Overridden by subclasses to perform additional actions before subviews are removed from the view.
|
static |
The color to use for text in a selected control.
|
static |
The colors to use for alternating content, typically found in table views and collection views.
| const UILayoutAnchor CeresEngine::UIView::bottom |
The bottom of the object's alignment rectangle.
| const UILayoutAnchor CeresEngine::UIView::bottomMargin |
The object's bottom margin.
For UIView objects, the margins are defined by their layoutMargins property.
| const UILayoutAnchor CeresEngine::UIView::centerX |
The center along the x-axis of the object's alignment rectangle.
| const UILayoutAnchor CeresEngine::UIView::centerXWithinMargins |
The center along the x-axis between the object's left and right margin.
For UIView objects, the margins are defined by their layoutMargins property.
| const UILayoutAnchor CeresEngine::UIView::centerY |
The center along the y-axis of the object's alignment rectangle.
| const UILayoutAnchor CeresEngine::UIView::centerYWithinMargins |
The center along the y-axis between the object's top and bottom margin.
For UIView objects, the margins are defined by their layoutMargins property.
|
static |
The user's current accent color preference.
|
static |
The color to use for the background of large controls, such as scroll views or table views.
|
static |
The color to use for the flat surfaces of a control.
|
static |
The color to use for text on enabled controls.
|
static |
The current system control tint color.
|
static |
The color to use for text on disabled controls.
|
static |
The highlight color to use for the bubble that shows inline search result values.
| const UILayoutAnchor CeresEngine::UIView::firstBaseline |
The object's baseline.
For objects with more than one line of text, this is the baseline for the top-most line of text.
|
static |
The default font used by all UI elements.
|
static |
The default font size used by all UI elements.
|
static |
The color to use for the optional gridlines, such as those in a table view.
|
static |
The color to use for text in header cells in table views and outline views.
| const UILayoutAnchor CeresEngine::UIView::height |
The height of the object's alignment rectangle.
|
static |
The color to use as a virtual light source on the screen.
A rectangle that represents the default frame set by a view without an explicit frame.
|
static |
The color to use for the keyboard focus ring around controls.
Used to indicate that an invalid view index.
Used to indicate that a view has no intrinsic metric for a given numeric property.
Used to indicate that a view has no intrinsic metric for a given size property.
|
static |
The primary color to use for text labels.
| const UILayoutAnchor CeresEngine::UIView::lastBaseline |
The object's baseline.
For objects with more than one line of text, this is the baseline for the bottom-most line of text.
| const UILayoutAnchor CeresEngine::UIView::left |
The left side of the object's alignment rectangle.
| const UILayoutAnchor CeresEngine::UIView::leftMargin |
The object's left margin.
For UIView objects, the margins are defined by their layoutMargins property.
|
static |
The color to use for links.
|
private |
The UI appearance to be used by the view.
The default value for this property is nulltpr, which means that the view uses the appearance it inherits from the nearest ancestor that has set an appearance. When you set appearance to a non-null value, the view and the views it contains use the specified appearance.
|
private |
The view's background color.
|
private |
The view's bounds rectangle, which expresses its location and size in its own coordinate system.
The scale factor applied to the view.
The scale factor determines how content in the view is mapped from the logical coordinate space (measured in points) to the device coordinate space (measured in pixels). This value is typically either 1.0 or 2.0. Higher scale factors indicate that each point in the view is represented by more than one pixel in the underlying layer. For example, if the scale factor is 2.0 and the view frame size is 50 x 50 points, the size of the bitmap used to present that content is 100 x 100 pixels.
The default value for this property is the scale factor associated with the screen currently displaying the view. If your custom view implements a custom draw method and is associated with a window your view draws at the full resolution of the screen.
In general, you should not need to modify the value in this property. However, if your application draws using very expensive rendering operations, like a scene viewport, you may want to change the scale factor to trade texture quality for rendering performance.
|
private |
The view's background corner radius.
If a background color is set, will specify the corner radius it should be draw with.
Determines if the view uses a custom bounds rectangle.
If set to true, calls to setFrame() wont update the bounds anymore.
|
private |
The view flags.
|
private |
The view's frame rectangle, which defines its position and size in its superview's coordinate system.
|
private |
The natural size for the receiving view, considering only properties of the view itself.
The default width and height values of this property are set to NSViewNoInstrinsicMetric. For a custom view, you can override this property and use it to communicate what size you would like your view to be based on its content. You might do this in cases where the layout system cannot determine the size of the view based solely on its current constraints. For example, a text field might override this method and return an intrinsic size based on the text it contains. The intrinsic size you supply must be independent of the content frame, because there's no way to dynamically communicate a changed width to the layout system based on a changed height. If your custom view has no intrinsic size for a given dimension, you can set the corresponding dimension to the UIViewNoInstrinsicMetric.
|
private |
The UI layer that the view uses as its backing store.
Use this property to set or get the layer associated with the view, if any. When set, the layer serves as the backing store for the view’s contents.
|
private |
A vector that contains all anchors for the view.
|
private |
The default spacing to use when laying out content in the view.
|
private |
The layout solver for this view.
|
private |
A human readable string that represents the view.
Used for debugging only.
The view object that follows the current view in the key view loop.
A Boolean value indicating whether the view fills its frame rectangle with opaque content.
The default value of this property is false to reflect the fact that views do no drawing by default. Subclasses can override this property and return true to indicate that the view completely covers its frame rectangle with opaque content. Doing so can improve performance during drawing operations by eliminating the need to render content behind the view.
The view object preceding the current view in the key view loop.
A cache for getRectsBeingDrawn() the values returned.
|
private |
The options that determine how the view is resized relative to its superview.
The base color to be used for UI tinting.
A list of tracking rectangles.
Tracking rectangles are rectangles that the view will receive mouseMoved, mouseEntered and mouseExited events for.
|
private |
A 2D transformation matrix that transforms a point from its pixel aligned backing store coordinate system to the view’s interior coordinate system.
|
private |
A 2D transformation matrix that transforms a point from the window coordinate space into the view coordinate space.
|
private |
A 2D transformation matrix that transforms a point from the view’s interior coordinate system to its pixel aligned backing store coordinate system.
|
private |
A 2D transformation matrix that transforms a point from the view coordinate space into the window coordinate space.
|
private |
The UIView controller, if any.
Can be nullptr if the view is not attached to a controller.
|
static |
The color to use for placeholder text in controls or text views.
|
static |
The quaternary color to use for text labels and separators.
| const UILayoutAnchor CeresEngine::UIView::right |
The right side of the object's alignment rectangle.
| const UILayoutAnchor CeresEngine::UIView::rightMargin |
The object's right margin.
For UIView objects, the margins are defined by their layoutMargins property.
|
static |
The patterned color to use for the background of a scrubber control.
|
static |
The secondary color to use for text labels.
|
static |
The color to use for the background of selected and emphasized content.
|
static |
The color to use for the face of a selected control—that is, a control that has been clicked or is being dragged.
|
static |
The color to use for text in a selected control—that is, a control being clicked or dragged.
|
static |
The color to use for the text in menu items.
|
static |
The color to use for the background of selected text.
|
static |
The color to use for selected text.
|
static |
The color to use for separators between different sections of content.
|
static |
The color to use for virtual shadows cast by raised objects on the screen.
|
static |
The tertiary color to use for text labels.
|
static |
The color to use for the background area behind text.
|
static |
The color to use for text.
|
static |
Determines the default value for the tintColor property if not overridden by the view.
| const UILayoutAnchor CeresEngine::UIView::top |
The top of the object's alignment rectangle.
| const UILayoutAnchor CeresEngine::UIView::topMargin |
The object's top margin.
For UIView objects, the margins are defined by their layoutMargins property.
|
private |
|
private |
|
static |
The color to use in the area beneath your window's views.
|
static |
The color to use for selected and unemphasized content.
|
static |
The color to use for the text background in an unemphasized context.
|
static |
The color to use for selected text in an unemphasized context.
| const UILayoutAnchor CeresEngine::UIView::width |
The width of the object's alignment rectangle.
|
static |
The color to use for the window background.
|
static |
The color to use for text in a window's frame.