GH_Attributes.T.
Derive from this class rather than implementing IGH_Attributes from scratch.
Inheritance Hierarchy
System.Object
Grasshopper.Kernel.GH_Attributes.T.
Grasshopper.Kernel.Attributes.GH_ComponentAttributes
Grasshopper.Kernel.Attributes.GH_FloatingParamAttributes
Grasshopper.Kernel.Attributes.GH_LinkedParamAttributes
Grasshopper.Kernel.Attributes.GH_ResizableAttributes.T.
Grasshopper.Kernel.GH_ComponentParamServer.NullParamAttributes
Namespace: Grasshopper.Kernel
Assembly: Grasshopper (in Grasshopper.dll)
Syntax
public abstract class GH_Attributes<T> : IGH_Attributeswhere T : IGH_DocumentObject
T
Type of the objects that owns these attributes.
The GH_Attributes.T. type exposes the following members.
Constructors
Name
Description
Protected method
GH_Attributes.T.
Construct a new instance of this class.
Properties
Name
Description
Public Property
AllowMessageBalloon
Gets a value indicating whether these attributes allow warning and error balloons 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 the attribute stack these attributes belong to.
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 of the document object that owns 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
Owner
Gets the type-safe owner object of these attributes. This property is identical to the DocObject property.
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 stack.
Public Property
Pivot
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.
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.
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.
Protected methodStatic Member
IsIconMode
Utility function for determining Icon display modes. If the supplied mode is ::application, then it will be adjusted to match the current app settings.
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
Determines whether a point is available for tooltip popups. By default, IsMenuRegion calls IsTooltipRegion(PointF).
Protected method
Layout
Perform dedicated layout logic specific to this particular DocumentObject. This method is called from PerformLayout if the existing layout is stale.
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.
Protected method
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.
Public Method
Read
Protected method
Render
Override this function to supply custom Render logic.
Protected method
RenderIncomingWires(GH_Painter, IEnumerable.IGH_Param., GH_ParamWireDisplay)
Utility function for derived classes. This method draws all the wires going into the left side of the attributes.
Protected method
RenderIncomingWires(GH_Painter, IEnumerable.IGH_Param., IEnumerable.Pen.)
Utility function for derived classes. This method draws all the wires going into the left side of the attributes.
Public Method
RenderToCanvas
Render these attributes into a Canvas control. This function places calls to PrepareForRender() and Render(), you should override those.
Public Method
RespondToKeyDown
Public Method
RespondToKeyUp
Public Method
RespondToMouseDoubleClick
Public Method
RespondToMouseDown
Public Method
RespondToMouseMove
Public Method
RespondToMouseUp
Public Method
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.
Public Method
Static Member
SolvePathBoxPick
Utility function for testing window selections with freeform Graphics paths.
Public Method
Write