GH_Capsule
Class used to draw standard Grasshopper interface boxes.
Inheritance Hierarchy
System.Object
Grasshopper.GUI.Canvas.GH_Capsule
Namespace: Grasshopper.GUI.Canvas
Assembly: Grasshopper (in Grasshopper.dll)
Syntax
public class GH_Capsule : IDisposable
The GH_Capsule type exposes the following members.
Properties
Name
Description
Public Property
Box
Gets the outline box for this Capsule.
Public Property
Box_Content
Gets the content box for this Capsule. Text and icons are drawn inside this box.
Public Property
Font
Gets or sets the Font to use for text rendering.
Public Property
Highlight
Gets the highlight size for this Capsule. Zero or negative means there is no highlight.
Public Property
HighlightShape
Gets the graphics path that describes the highlight bar shape of the capsule.
Public Property
InputGrips
Gets the list of locally defined input grip locations.
Public Property
JaggedLeft
Gets whether the left edge of this capsule is jagged.
Public Property
JaggedRight
Gets whether the right edge of this capsule is jagged.
Public Property
MaxRadius
Gets the largest radius defined for this capsule.
Public Property
OutlineShape
Gets the graphics path that describes the outer edge of the capsule.
Public Property
OutputGrips
Gets the list of locally defined output grip locations.
Public Property
Palette
Gets or sets the palette for this Capsule.
Public Property
Radius
Gets the radius of the rounded corners of this Capsule.
Public Property
RenderEngine
Gets the RenderEngine associated with this capsule. You typically don’t need to go this far, just use one of the Render() overloads on GH_Capsule directly.
Public Property
Text
Gets or sets the text to render in the content box.
Public Property
TextOrientation
Gets or sets the orientation of the text within the content box.
Methods
Name
Description
Public Method
AddInputGrip(Point)
Add an input grip to this UI Box.
Public Method
AddInputGrip(PointF)
Add an input grip to this UI Box.
Public Method
AddInputGrip(Single)
Add an input grip to this UI Box. This is the recommended overload.
Public Method
AddInputGrip(Single, Single)
Add an input grip to this UI Box.
Public Method
AddOutputGrip(Point)
Add an output grip to this UI Box.
Public Method
AddOutputGrip(PointF)
Add an output grip to this UI Box.
Public Method
AddOutputGrip(Single)
Add an output grip to this UI Box. This is the recommended overload.
Public Method
AddOutputGrip(Single, Single)
Add an output grip to this UI Box.
Public Method
Contains
Test a point for capsule containment.
Public Method
Static Member
CreateCapsule(Rectangle, GH_Palette)
Create a new blank capsule with default radius and highlight dimensions.
Public Method
Static Member
CreateCapsule(RectangleF, GH_Palette)
Create a new blank capsule with default radius and highlight dimensions.
Public Method
Static Member
CreateCapsule(Rectangle, GH_Palette, Int32, Int32)
Create a new blank capsule.
Public Method
Static Member
CreateCapsule(Rectangle, GH_Palette, .Int32., Int32)
Create a new blank capsule.
Public Method
Static Member
CreateCapsule(RectangleF, GH_Palette, Int32, Int32)
Create a new blank capsule.
Public Method
Static Member
CreateCapsule(RectangleF, GH_Palette, .Int32., Int32)
Create a new blank capsule.
Public Method
Static Member
CreateTextCapsule(Rectangle, Rectangle, GH_Palette, String)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(RectangleF, RectangleF, GH_Palette, String)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(Rectangle, Rectangle, GH_Palette, String, Font)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(RectangleF, RectangleF, GH_Palette, String, Font)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(Rectangle, Rectangle, GH_Palette, String, Font, GH_Orientation)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(Rectangle, Rectangle, GH_Palette, String, Int32, Int32)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(Rectangle, Rectangle, GH_Palette, String, .Int32., Int32)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(RectangleF, RectangleF, GH_Palette, String, Font, GH_Orientation)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(RectangleF, RectangleF, GH_Palette, String, Int32, Int32)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(RectangleF, RectangleF, GH_Palette, String, .Int32., Int32)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(Rectangle, Rectangle, GH_Palette, String, Font, Int32, Int32)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(Rectangle, Rectangle, GH_Palette, String, Font, .Int32., Int32)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(RectangleF, RectangleF, GH_Palette, String, Font, Int32, Int32)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(RectangleF, RectangleF, GH_Palette, String, Font, .Int32., Int32)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(Rectangle, Rectangle, GH_Palette, String, Font, GH_Orientation, Int32, Int32)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(Rectangle, Rectangle, GH_Palette, String, Font, GH_Orientation, .Int32., Int32)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(RectangleF, RectangleF, GH_Palette, String, Font, GH_Orientation, Int32, Int32)
Create a new capsule with content text.
Public Method
Static Member
CreateTextCapsule(RectangleF, RectangleF, GH_Palette, String, Font, GH_Orientation, .Int32., Int32)
Create a new capsule with content text.
Public Method
Dispose.
Releases all resources used by the GH_Capsule
Protected method
Dispose(Boolean)
Releases the unmanaged resources used by the GH_Capsule and optionally releases the managed resources
Public Method
Render(Graphics, GH_PaletteStyle)
Have this capsule draw itself onto a Graphics surface with a custom Style override.
Public Method
Render(Graphics, Color)
Have this capsule draw itself onto a Graphics surface with a custom colour override.
Public Method
Render(Graphics, Image, GH_PaletteStyle)
Have this capsule draw itself onto a Graphics surface with a custom Style override.
Public Method
Render(Graphics, Image, Color)
Have this capsule draw itself onto a Graphics surface with a custom colour override.
Public Method
Render(Graphics, Boolean, Boolean, Boolean)
Render the capsule onto a graphics context.
Public Method
Render(Graphics, Image, Boolean, Boolean, Boolean)
Render the capsule onto a graphics context.
Public Method
SetJaggedEdges
Assign left and right jagged edges.
Fields
Name
Description
Public Field
Static Member
DefaultHighlight
The default size (in pixel units) of the highlight bar.
Public Field
Static Member
DefaultRadius
The default radius (in pixel units) of the rounded corners.