GH_ColourSwatchAttributes
GH_Attributes<1>Constructors
Fields
Properties
AllowMessageBalloon
Gets a value indicating whether these attributes allow warning and error balloons to be drawn on top of them.
Implements: AllowMessageBalloon
Bounds
Gets the rectangle that contains the active content of the attributes. Typically the Contents determine the active area for menus, tooltips etc. Attributes are not supposed to draw objects beyond the Bounds.
Implements: Bounds
Implements: DocObject
GetTopLevel
Gets the top-level attributes of the attribute stack these attributes belong to.
Implements: GetTopLevel
HasOutputGrip
Gets a value indicating whether or not these attributes have an output grip.
Implements: HasOutputGrip
InputGrip
public virtual PointF InputGrip { get; }
Gets the input grip location for these attributes. If HasInputGrip equals False, this point is meaningless.
Implements: InputGrip
InstanceGuid
Gets the instance ID of the document object that owns these attributes.
Implements: InstanceGuid
IsTopLevel
Gets whether these attributes are top_level (i.e. no Parent attributes)
Implements: IsTopLevel
OutputGrip
public virtual PointF OutputGrip { get; }
Gets the output grip location for these attributes. If HasOutputGrip equals False, this point is meaningless.
Implements: OutputGrip
Owner
public T Owner { get; }
Gets the type-safe owner object of these attributes. This property is identical to the DocObject property.
Parent
Gets or sets the parent attributes. Top level attributes do not have parents.
Implements: Parent
PathName
Get a description of the location of these attributes within the local attribute stack.
Implements: PathName
Pivot
public virtual PointF Pivot { get; set; }
Gets or sets the pivot for these attributes. The pivot controls the general placement of the attributes. If you want to move the attributes, change the pivot location.
Implements: Pivot
Selected
Gets or sets the selected state of the top-level attributes.
Implements: Selected
Methods
AppendToAttributeTree
Recursively append these attributes and all child attributes to the attribute list.
Parameters:
| attributes (List<IGH_Attributes>) | List to append to. |
Implements: AppendToAttributeTree
ExpireLayout
public virtual void ExpireLayout()
Expires the entire layout of the attributes. When overridden, implementer must place a call to the base class ExpireLayout().
Implements: ExpireLayout
InvalidateCanvas
If the mouse location should cause a canvas invalidation then return true. You only need to override this function if you draw objects that are dependant on cursor positions outside the bounds of the attributes.
Parameters:
| canvas (GH_Canvas) | Canvas to potentially invalidate. |
| e (GH_CanvasMouseEvent) | Event arguments for canvas mousemove. |
Returns: True if the canvas ought to be invalidated.
Implements: InvalidateCanvas
IsPickRegion
Determines whether a point is within the pickable region for this object. By default, any point inside the Bounds is treated as pickable.
Parameters:
| point (PointF) | Point location to test. |
Implements: IsPickRegion
IsPickRegion
Determines whether a rectangle is a valid pick region for this object. By default, the picking rectangle is intersected with the Bounds rectangle.
Parameters:
| box (RectangleF) | Selection box. |
| method (GH_PickBox) | Selection method. |
Implements: IsPickRegion
IsTooltipRegion
Determines whether a point is available for tooltip popups. By default, IsMenuRegion calls IsTooltipRegion(PointF).
Parameters:
| point (PointF) | Point location to test. |
Implements: IsTooltipRegion
NewInstanceGuid
public void NewInstanceGuid()
Generate a new instance GUID for the owner object.
Implements: NewInstanceGuid
NewInstanceGuid
Generate a new instance GUID for the owner object. Do not use this overload unless you're > 1.95m and called David.
Parameters:
| newId (Guid) |
Implements: NewInstanceGuid
PerformLayout
public void PerformLayout()
Recompute the layout for these attributes. This function is automatically called during Drawing operations, so you typically don't have to.
Implements: PerformLayout
PrepareForRender
This method will always be called exactly once prior to Render(). This would be a good place to make sure all the necessary GUI data is up and running.
Parameters:
| canvas (GH_Canvas) | Canvas that is about to render these attributes. |
Parameters:
| reader (GH_IReader) |
Implements: Read
Render
#Parameters:
| canvas (GH_Canvas) | |
| graphics (Graphics) | |
| channel (GH_CanvasChannel) |
Overrides: GH_Attributes<T>.Render
RenderIncomingWires
protected void RenderIncomingWires(GH_Painter painter, IEnumerable<IGH_Param> sources, GH_ParamWireDisplay style)
Utility function for derived classes. This method draws all the wires going into the left side of the attributes.
Parameters:
| painter (GH_Painter) | The graphics object to paint with |
| sources (IEnumerable<IGH_Param>) | A list of sources that will be connected with the input grip of this attribute |
| style (GH_ParamWireDisplay) | Style for wire display. |
RenderIncomingWires
protected void RenderIncomingWires(GH_Painter painter, IEnumerable<IGH_Param> sources, IEnumerable<Pen> styles)
Utility function for derived classes. This method draws all the wires going into the left side of the attributes.
Parameters:
| painter (GH_Painter) | The graphics object to paint with |
| sources (IEnumerable<IGH_Param>) | A list of sources that will be connected with the input grip of this attribute |
| styles (IEnumerable<Pen>) | A collection of pen objects to use for each source. If a pen is null, the default wire style will be used instead. |
RenderToCanvas
Render these attributes into a Canvas control. This function places calls to PrepareForRender() and Render(), you should override those.
Parameters:
| canvas (GH_Canvas) | Canvas to draw on. |
| channel (GH_CanvasChannel) | Current drawing channel. |
Implements: RenderToCanvas
RespondToKeyDown
Parameters:
| sender (GH_Canvas) | |
| e (KeyEventArgs) |
Implements: RespondToKeyDown
RespondToKeyUp
Parameters:
| sender (GH_Canvas) | |
| e (KeyEventArgs) |
Implements: RespondToKeyUp
RespondToMouseDoubleClick
Parameters:
| sender (GH_Canvas) | |
| e (GH_CanvasMouseEvent) |
Implements: RespondToMouseDoubleClick
RespondToMouseDown
Parameters:
| sender (GH_Canvas) | |
| e (GH_CanvasMouseEvent) |
Implements: RespondToMouseDown
RespondToMouseMove
Parameters:
| sender (GH_Canvas) | |
| e (GH_CanvasMouseEvent) |
Implements: RespondToMouseMove
RespondToMouseUp
#Parameters:
| sender (GH_Canvas) | |
| e (GH_CanvasMouseEvent) |
Overrides: GH_Attributes<T>.RespondToMouseUp
SetupTooltip
Populates the Grasshopper tooltip with all relevant data. If this function returns True, it is assumed that all possible fields have been filled out and the tooltip is ready for display.
Parameters:
| point (PointF) | The pixel coordinate on the canvas of the cursor. |
| e (GH_TooltipDisplayEventArgs) | Tooltip event arguments. |
Implements: SetupTooltip
Parameters:
| writer (GH_IWriter) |
Implements: Write