IGH_Attributes

References
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.

Properties

AllowMessageBalloon

#
bool AllowMessageBalloon { get; }
Gets a value indicating whether these attributes allow warning and error boxes to be drawn on top of them.

Bounds

#
RectangleF Bounds { get; set; }
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.

DocObject

#
IGH_DocumentObject DocObject { get; }
Gets the owner object of these attributes.

GetTopLevel

#
IGH_Attributes GetTopLevel { get; }
Gets the top level attributes of these attributes.

HasInputGrip

#
bool HasInputGrip { get; }
Gets a value indicating whether or not these attributes have an input grip.

HasOutputGrip

#
bool HasOutputGrip { get; }
Gets a value indicating whether or not these attributes have an output grip.

InputGrip

#
PointF InputGrip { get; }
Gets the input grip location for these attributes. If HasInputGrip equals False, this point is meaningless.

InstanceGuid

#
Guid InstanceGuid { get; }
Gets the instance ID for these attributes.

IsTopLevel

#
bool IsTopLevel { get; }
Gets whether these attributes are top_level (i.e. no Parent attributes)

OutputGrip

#
PointF OutputGrip { get; }
Gets the output grip location for these attributes. If HasOutputGrip equals False, this point is meaningless.

Parent

#
IGH_Attributes Parent { get; set; }
Gets or sets the parent attributes. Top level attributes do not have parents.

PathName

#
string PathName { get; }
Get a description of the location of these attributes within the local attribute tree.

Pivot

#
PointF Pivot { get; set; }
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.

Selected

#
bool Selected { get; set; }
Gets or sets the selected state of the top-level attributes.

TooltipEnabled

bool TooltipEnabled { get; }
Gets the tooltip enabled value. If False, no further tooltip functions will be called.
inherited fromIGH_TooltipAwareObject

Methods

AppendToAttributeTree

#
void AppendToAttributeTree(List<IGH_Attributes> attributes)
Recursively append these attributes and all child attributes to the attribute list.
attributes (List<IGH_Attributes>)List to append to.

ExpireLayout

#
void ExpireLayout()
Expires the entire layout of the attributes. When overridden, implementer must place a call to the base class ExpireLayout().

InvalidateCanvas

#
bool InvalidateCanvas(GH_Canvas canvas, GH_CanvasMouseEvent e)
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.
canvas (GH_Canvas)Canvas to potentially invalidate.
e (GH_CanvasMouseEvent)Event arguments for canvas mousemove.
True if the canvas ought to be invalidated.

IsMenuRegion

#
bool IsMenuRegion(PointF point)
Determines whether a point is available for context menu popups. By default, IsMenuRegion calls IsPickRegion(PointF).
point (PointF)Point location to test.

IsPickRegion

#
bool IsPickRegion(PointF point)
Determines whether a point is within the pickable region for this object. By default, any point inside the Bounds is treated as pickable.
point (PointF)Point location to test.

IsPickRegion

#
bool IsPickRegion(RectangleF box, GH_PickBox method)
Determines whether a rectangle is a valid pick region for this object. By default, the picking rectangle is intersected with the Bounds rectangle.
box (RectangleF)Selection box.
method (GH_PickBox)Selection method.

IsTooltipRegion

bool IsTooltipRegion(PointF canvasPoint)
Determine whether the specified pixel should result in a tooltip when the cursor hovers over it.
inherited fromIGH_TooltipAwareObject
canvasPoint (PointF)Point in Canvas coordinates.

NewInstanceGuid

#
void NewInstanceGuid()
Generate a new instance GUID for the owner object.

NewInstanceGuid

#
void NewInstanceGuid(Guid newID)
Generate a new instance GUID for the owner object. Do not use this overload unless you're > 1.95m and called David.
newID (Guid)New ID to assign.

PerformLayout

#
void PerformLayout()
Recompute the layout for these attributes. This function is automatically called during Drawing operations, so you typically don't have to.

Read

bool Read(GH_IReader reader)
This method is called whenever the instance is required to deserialize itself.
inherited fromGH_ISerializable
reader (GH_IReader)Reader object to deserialize from.
True on success, false on failure.

RenderToCanvas

#
void RenderToCanvas(GH_Canvas canvas, GH_CanvasChannel channel)
Render these attributes into a Canvas control.
canvas (GH_Canvas)Canvas to draw on.
channel (GH_CanvasChannel)Current drawing channel.
sender (GH_Canvas)
e (KeyEventArgs)
sender (GH_Canvas)
e (KeyEventArgs)

RespondToMouseDoubleClick

GH_ObjectResponse RespondToMouseDoubleClick(GH_Canvas sender, GH_CanvasMouseEvent e)
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 fromIGH_ResponsiveObject
sender (GH_Canvas)Base canvas.
e (GH_CanvasMouseEvent)Mouse event arguments.
All Response flags are valid.

RespondToMouseDown

GH_ObjectResponse RespondToMouseDown(GH_Canvas sender, GH_CanvasMouseEvent e)
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 fromIGH_ResponsiveObject
sender (GH_Canvas)Base canvas.
e (GH_CanvasMouseEvent)Mouse event arguments.
All Response flags are valid.

RespondToMouseMove

GH_ObjectResponse RespondToMouseMove(GH_Canvas sender, GH_CanvasMouseEvent e)
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 fromIGH_ResponsiveObject
sender (GH_Canvas)Base canvas.
e (GH_CanvasMouseEvent)Mouse event arguments.
All Response flags are valid.

RespondToMouseUp

GH_ObjectResponse RespondToMouseUp(GH_Canvas sender, GH_CanvasMouseEvent e)
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 fromIGH_ResponsiveObject
sender (GH_Canvas)Base canvas.
e (GH_CanvasMouseEvent)Mouse event arguments.
All Response flags are valid.

SetupTooltip

void SetupTooltip(PointF canvasPoint, GH_TooltipDisplayEventArgs e)
This function is called when a tooltip it about to be displayed.
inherited fromIGH_TooltipAwareObject
canvasPoint (PointF)The pixel coordinate on the canvas of the cursor.
e (GH_TooltipDisplayEventArgs)Tooltip display arguments.

Write

bool Write(GH_IWriter writer)
This method is called whenever the instance is required to serialize itself.
inherited fromGH_ISerializable
writer (GH_IWriter)Writer object to serialize with.
True on success, false on failure.