IGH_Attributes
Base interface for all Attributes. Attributes are the visual portion of GH_DocumentObjects. They handle display, mouse events, layout, context menus etc. etc. You should consider inheriting from GH_Attributes or some other abstract class instead of implementing this interface from scratch.
Namespace: Grasshopper.Kernel
Assembly: Grasshopper (in Grasshopper.dll)
Syntax
public interface IGH_Attributes : GH_ISerializable, IGH_ResponsiveObject, IGH_TooltipAwareObject
The IGH_Attributes type exposes the following members.
Properties
Name
Description
Public Property
AllowMessageBalloon
Gets a value indicating whether these attributes allow warning and error boxes to be drawn on top of them.
Public Property
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.
Public Property
DocObject
Gets the owner object of these attributes.
Public Property
GetTopLevel
Gets the top level attributes of these attributes.
Public Property
HasInputGrip
Gets a value indicating whether or not these attributes have an input grip.
Public Property
HasOutputGrip
Gets a value indicating whether or not these attributes have an output grip.
Public Property
InputGrip
Gets the input grip location for these attributes. If HasInputGrip equals False, this point is meaningless.
Public Property
InstanceGuid
Gets the instance ID for these attributes.
Public Property
IsTopLevel
Gets whether these attributes are top_level (i.e. no Parent attributes)
Public Property
OutputGrip
Gets the output grip location for these attributes. If HasOutputGrip equals False, this point is meaningless.
Public Property
Parent
Gets or sets the parent attributes. Top level attributes do not have parents.
Public Property
PathName
Get a description of the location of these attributes within the local attribute tree.
Public Property
Pivot
Gets 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.
Public Property
Selected
Gets or sets the selected state of the top-level attributes.
Public Property
TooltipEnabled
Gets the tooltip enabled value. If False, no further tooltip functions will be called.
(Inherited from IGH_TooltipAwareObject.)
Methods
Name
Description
Public Method
AppendToAttributeTree
Recursively append these attributes and all child attributes to the attribute list.
Public Method
ExpireLayout
Expires the entire layout of the attributes. When overridden, implementer must place a call to the base class ExpireLayout().
Public Method
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.
Public Method
IsMenuRegion
Determines whether a point is available for context menu popups. By default, IsMenuRegion calls IsPickRegion(PointF).
Public Method
IsPickRegion(PointF)
Determines whether a point is within the pickable region for this object. By default, any point inside the Bounds is treated as pickable.
Public Method
IsPickRegion(RectangleF, GH_PickBox)
Determines whether a rectangle is a valid pick region for this object. By default, the picking rectangle is intersected with the Bounds rectangle.
Public Method
IsTooltipRegion
Determine whether the specified pixel should result in a tooltip when the cursor hovers over it.
(Inherited from IGH_TooltipAwareObject.)
Public Method
NewInstanceGuid.
Generate a new instance GUID for the owner object.
Public Method
NewInstanceGuid(Guid)
Generate a new instance GUID for the owner object. Do not use this overload unless you’re > 1.95m and called David.
Public Method
PerformLayout
Recompute the layout for these attributes. This function is automatically called during Drawing operations, so you typically don’t have to.
Public Method
Read
This method is called whenever the instance is required to deserialize itself.
(Inherited from GH_ISerializable.)
Public Method
RenderToCanvas
Render these attributes into a Canvas control.
Public Method
RespondToKeyDown
(Inherited from IGH_ResponsiveObject.)
Public Method
RespondToKeyUp
(Inherited from IGH_ResponsiveObject.)
Public Method
RespondToMouseDoubleClick
This function will be called whenever the left button is double-clicked over the canvas. If you are active, you will be the only object who gets called.
(Inherited from IGH_ResponsiveObject.)
Public Method
RespondToMouseDown
This function will be called whenever a mouse button is pressed over the canvas. If you are active, you will be the only object who gets called. If you are inactive, you might get called if nobody on top of you decides to become active.
(Inherited from IGH_ResponsiveObject.)
Public Method
RespondToMouseMove
This function will be called when the mouse moves across the canvas. If you are active, you will be the only object who gets called. If you are inactive, you might get called if nobody on top of you decides to become active.
(Inherited from IGH_ResponsiveObject.)
Public Method
RespondToMouseUp
This function will be called whenever a mouse button is released over the canvas. If you are active, you will be the only object who gets called. If you are inactive, you will not be called at all for MouseUp events.
(Inherited from IGH_ResponsiveObject.)
Public Method
SetupTooltip
This function is called when a tooltip it about to be displayed.
(Inherited from IGH_TooltipAwareObject.)
Public Method
Write
This method is called whenever the instance is required to serialize itself.
(Inherited from GH_ISerializable.)