ProtractorAttributes
UserInputAttributes<1>ParameterAttributes<1>Attributes<1>The attributes for the angle picker.
Constructors
Properties
AggregateBounds
public RectangleF AggregateBounds { get; }
Gets the aggregate bounds of this object. This will include the bounds of all objects attached in some way to this object.
Implements: AggregateBounds
Bounds
public RectangleF Bounds { get; protected set; }
Gets the total outer bounds of the attributes. The attributes are assumed not to exist beyond this limit. Note that the bounds are updated during calls to Layout(), so may be out-of-date or even unset when called outside of the usual process.
Implements: Bounds
DrawOnTop
Override this property if the hosted control ought to be drawn on top of the underlying attributes.
Overrides: ParameterAttributes<T>.HasInlet
HasOutlet
Overrides: ParameterAttributes<T>.HasOutlet
HostingBounds
protected RectangleF HostingBounds { get; }
Gets the hosting bounds as currently layed out.
Inlet
public override PointF Inlet { get; }
Overrides: ParameterAttributes<T>.Inlet
IntegerPivot
Gets whether the pivot of these attributes is always rounded to integer coordinates. By default this property returns true, as the vast majority of objects ought to be laid out in integer coordinates.
MinimumHostingWidth
Gets the minimum allowed width of the hosting region.
Outlet
public override PointF Outlet { get; }
Overrides: ParameterAttributes<T>.Outlet
Owner
public T Owner { get; }
Pivot
public PointF Pivot { get; set; }
Gets or sets the pivot point for these attributes. The pivot is the main point around which the attribute geometry is positioned during layout.
Implements: Pivot
Responder
Gets the Responses dispatcher for these attributes. Subclasses can subscribe to the hook events on the returned object to extend interaction behaviour beyond what the UserInputAttributes<T>.HostMouseDown(ResponseMouseArgs) family covers.
Implements: Responder
ShowUiButton
Snappable
Gets whether these attributes can be used to align other objects on the canvas. Return false specifically when your object shape is not rectangular.
Implements: Snappable
Stack
The horizontal layout stack along the apex row. Derived classes typically (re)assign this during Attributes<T>.Layout(Shape) and reference sub-regions via class-local index constants. The default Attributes<T>.PivotMoved(PointF, PointF) translates the stack along with Attributes<T>.Bounds.
UiButtonBounds
public RectangleF UiButtonBounds { get; }
Gets the bounds of the UI popup button. Empty if the button is not shown. Exposed so external consumers (such as canvas hints) can target the button without reaching into the protected layout stack.
VerticalUnits
Methods
DefaultTooltipContent
Create the tooltip fields which are associated with this object by default.
Parameters:
| point (PointF) | Point for tooltip. |
| icon (out IIcon) | Icon. |
| caption (out string) | Caption text. |
| message (out string) | Message text. |
| details (out object) | Either text or an Action<Context, Rectangle> or null. |
| warnings (out bool) | Boolean flag indicating the existence of warnings. |
| errors (out bool) | Boolean flag indicating the existence of errors. |
Returns: True if a tooltip ought to be shown for this object at the given location.
Draw
Internal drawing method. Consider overriding this one instead of Attributes<T>.Draw(Context, Skin).
DrawHostedControl
#Overrides: UserInputAttributes<T>.DrawHostedControl
HandleDoubleClick
Handle a double click operation on these attributes. Since this is such a common operation it is provided by the base interface, rather than requiring an IResponseAttribues implementation.
Parameters:
| point (PointF) |
Implements: HandleDoubleClick
HostCursorAt
protected virtual Cursor HostCursorAt(PointF point)
Override to supply a cursor for a point over the hosted control, e.g. hover feedback over interactive elements the host draws. Called by the ICursorAwareAttributes implementation once the resize-grip cursors have been ruled out. Return
null (the default) for the standard cursor.Parameters:
| point (PointF) | Cursor location in content coordinates. |
HostingBoundsChanged
#protected override void HostingBoundsChanged(RectangleF newBounds)
Parameters:
| newBounds (RectangleF) |
Overrides: UserInputAttributes<T>.HostingBoundsChanged
HostKeyDown
Parameters:
| e (KeyEventArgs) |
HostKeyUp
Parameters:
| e (KeyEventArgs) |
HostMouseDoubleClick
#Parameters:
| e (ResponseMouseArgs) |
Overrides: UserInputAttributes<T>.HostMouseDoubleClick
HostMouseLeave
protected virtual void HostMouseLeave()
Override to react to the cursor moving off this attribute, e.g. by clearing any cached mouseover index. Default: no-op.
HostMouseOver
Override to respond to mouseover cursor motion (no buttons held). Called on every cursor motion while the cursor is coincident with this attribute. Default: no-op.
Parameters:
| e (ResponseMouseArgs) | Mouse event in content coordinates. |
HostMouseSingleClick
Parameters:
| e (ResponseMouseArgs) |
Intersects
Test whether a given rectangle intersects the shape of these attributes.
Parameters:
| box (RectangleF) | Intersection box. |
Returns: True if rectangle intersects these attributes.
Implements: Intersects
InvalidateDisplay
public virtual void InvalidateDisplay()
Signals that the attribute's visual appearance has changed without affecting layout. Fires the owner's DocumentObject.OnDisplayChanged(), which propagates through the document to the canvas redraw subscription.
Implements: InvalidateDisplay
InvalidateLayout
public override void InvalidateLayout()
Marks the layout as dirty so it gets recomputed on the next draw cycle. Subclasses typically flip an internal
_layoutValid flag. Most callers should also raise OnLayoutChanged on the owner to actually trigger a canvas redraw.Overrides: Attributes<T>.InvalidateLayout
IsCoincident
Test whether a given point is considered to be on the interior of these attributes.
Parameters:
| point (PointF) | Test point. |
Returns: True if point is on the object.
Implements: IsCoincident
IsContained
Test whether the shape of these attributes is fully contained within a given rectangle.
Parameters:
| box (RectangleF) | Containment box. |
Returns: True if rectangle contains these attributes.
Implements: IsContained
Layout
public override void Layout(Shape shape)
Parameters:
| shape (Shape) |
Overrides: Attributes<T>.Layout
PivotMoved
protected override void PivotMoved(PointF oldPivot, PointF newPivot)
Parameters:
| oldPivot (PointF) | |
| newPivot (PointF) |
Overrides: Attributes<T>.PivotMoved
ShowTooltipAt
Parameters:
| point (PointF) |
Overrides: Attributes<T>.ShowTooltipAt
ShowUi
protected virtual void ShowUi()
Override this method to handle clicks on the UI button.
TooltipDetails
Override this method to return custom details for a tooltip.
Parameters:
| point (PointF) | |
| state (ObjectSolutionState) |
Returns: One of the acceptable types of data for details. For example an array of LazyStrings or a Action<Context, RectangleF>.