Fields
Properties
Box_Content
#public Rectangle Box_Content { get; }
Gets the content box for this Capsule. Text and icons are drawn inside this box.
Radius
#Gets the radius of the rounded corners of this Capsule.
Parameters:
| index (int) | Corner index. 0 = upper left 1 = upper right 2 = lower right 3 = lower left |
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.
Remarks: Do not store pointers to the RenderEngine, always call this property anew.
Methods
AddInputGrip
#Add an input grip to this UI Box.
AddInputGrip
#Add an input grip to this UI Box. This is the recommended overload.
Parameters:
| Y (float) | Y coordinate of grip. |
AddInputGrip
#public void AddInputGrip(Point P)
Add an input grip to this UI Box.
Parameters:
| P (Point) | Coordinate of grip. |
AddInputGrip
#public void AddInputGrip(PointF P)
Add an input grip to this UI Box.
Parameters:
| P (PointF) | Coordinate of grip. |
AddOutputGrip
#Add an output grip to this UI Box.
AddOutputGrip
#Add an output grip to this UI Box. This is the recommended overload.
Parameters:
| Y (float) | Y coordinate of grip. |
AddOutputGrip
#public void AddOutputGrip(Point P)
Add an output grip to this UI Box.
Parameters:
| P (Point) | Coordinate of grip. |
AddOutputGrip
#public void AddOutputGrip(PointF P)
Add an output grip to this UI Box.
Parameters:
| P (PointF) | Coordinate of grip. |
Contains
#Test a point for capsule containment.
Parameters:
| pt (PointF) | Point to test. |
Returns: True if the point is on the interior of the capsule.
CreateCapsule
#public static GH_Capsule CreateCapsule(Rectangle box, GH_Palette palette, int radius, int highlight)
Create a new blank capsule.
Parameters:
| box (Rectangle) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| palette (GH_Palette) | Colour palette to apply. |
| radius (int) | Radius of rounded corners. A radius of zero or lower disables corner fillets. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateCapsule
#public static GH_Capsule CreateCapsule(Rectangle box, GH_Palette palette, int[] radii, int highlight)
Create a new blank capsule.
Parameters:
| box (Rectangle) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| palette (GH_Palette) | Colour palette to apply. |
| radii (int[]) | Radii of rounded corners. This array must contain at least 4 integers. Radii are defined clockwise, starting at the upper left corner. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateCapsule
#Create a new blank capsule with default radius and highlight dimensions.
Parameters:
| box (Rectangle) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| palette (GH_Palette) | Colour palette to apply. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateCapsule
#public static GH_Capsule CreateCapsule(RectangleF box, GH_Palette palette, int radius, int highlight)
Create a new blank capsule.
Parameters:
| box (RectangleF) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| palette (GH_Palette) | Colour palette to apply. |
| radius (int) | Radius of rounded corners. A radius of zero or lower disables corner fillets. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateCapsule
#public static GH_Capsule CreateCapsule(RectangleF box, GH_Palette palette, int[] radii, int highlight)
Create a new blank capsule.
Parameters:
| box (RectangleF) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| palette (GH_Palette) | Colour palette to apply. |
| radii (int[]) | Radii of rounded corners. This array must contain at least 4 integers. Radii are defined clockwise, starting at the upper left corner. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateCapsule
#Create a new blank capsule with default radius and highlight dimensions.
Parameters:
| box (RectangleF) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| palette (GH_Palette) | Colour palette to apply. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(Rectangle box, Rectangle textbox, GH_Palette palette, string text, Font font, GH_Orientation orientation, int radius, int highlight)
Create a new capsule with content text.
Parameters:
| box (Rectangle) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (Rectangle) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| font (Font) | Font to draw text with. |
| orientation (GH_Orientation) | Orientation of text within box. |
| radius (int) | Radius of rounded corners. A radius of zero or lower disables corner fillets. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(Rectangle box, Rectangle textbox, GH_Palette palette, string text, Font font, GH_Orientation orientation, int[] radii, int highlight)
Create a new capsule with content text.
Parameters:
| box (Rectangle) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (Rectangle) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| font (Font) | Font to draw text with. |
| orientation (GH_Orientation) | Orientation of text within box. |
| radii (int[]) | Radii of rounded corners. This array must contain at least 4 integers. Radii are defined clockwise, starting at the upper left corner. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(Rectangle box, Rectangle textbox, GH_Palette palette, string text, Font font, GH_Orientation orientation)
Create a new capsule with content text.
Parameters:
| box (Rectangle) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (Rectangle) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| font (Font) | Font to draw text with. |
| orientation (GH_Orientation) | Orientation of text within box. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(Rectangle box, Rectangle textbox, GH_Palette palette, string text, Font font, int radius, int highlight)
Create a new capsule with content text.
Parameters:
| box (Rectangle) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (Rectangle) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| font (Font) | Font to draw text with. |
| radius (int) | Radius of rounded corners. A radius of zero or lower disables corner fillets. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(Rectangle box, Rectangle textbox, GH_Palette palette, string text, Font font, int[] radii, int highlight)
Create a new capsule with content text.
Parameters:
| box (Rectangle) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (Rectangle) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| font (Font) | Font to draw text with. |
| radii (int[]) | Radii of rounded corners. This array must contain at least 4 integers. Radii are defined clockwise, starting at the upper left corner. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(Rectangle box, Rectangle textbox, GH_Palette palette, string text, Font font)
Create a new capsule with content text.
Parameters:
| box (Rectangle) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (Rectangle) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| font (Font) | Font to draw text with. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(Rectangle box, Rectangle textbox, GH_Palette palette, string text, int radius, int highlight)
Create a new capsule with content text.
Parameters:
| box (Rectangle) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (Rectangle) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| radius (int) | Radius of rounded corners. A radius of zero or lower disables corner fillets. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(Rectangle box, Rectangle textbox, GH_Palette palette, string text, int[] radii, int highlight)
Create a new capsule with content text.
Parameters:
| box (Rectangle) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (Rectangle) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| radii (int[]) | Radii of rounded corners. This array must contain at least 4 integers. Radii are defined clockwise, starting at the upper left corner. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(Rectangle box, Rectangle textbox, GH_Palette palette, string text)
Create a new capsule with content text.
Parameters:
| box (Rectangle) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (Rectangle) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(RectangleF box, RectangleF textbox, GH_Palette palette, string text, Font font, GH_Orientation orientation, int radius, int highlight)
Create a new capsule with content text.
Parameters:
| box (RectangleF) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (RectangleF) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| font (Font) | Font to draw text with. |
| orientation (GH_Orientation) | Orientation of text within box. |
| radius (int) | Radius of rounded corners. A radius of zero or lower disables corner fillets. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(RectangleF box, RectangleF textbox, GH_Palette palette, string text, Font font, GH_Orientation orientation, int[] radii, int highlight)
Create a new capsule with content text.
Parameters:
| box (RectangleF) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (RectangleF) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| font (Font) | Font to draw text with. |
| orientation (GH_Orientation) | Orientation of text within box. |
| radii (int[]) | Radii of rounded corners. This array must contain at least 4 integers. Radii are defined clockwise, starting at the upper left corner. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(RectangleF box, RectangleF textbox, GH_Palette palette, string text, Font font, GH_Orientation orientation)
Create a new capsule with content text.
Parameters:
| box (RectangleF) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (RectangleF) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| font (Font) | Font to draw text with. |
| orientation (GH_Orientation) | Orientation of text within box. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(RectangleF box, RectangleF textbox, GH_Palette palette, string text, Font font, int radius, int highlight)
Create a new capsule with content text.
Parameters:
| box (RectangleF) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (RectangleF) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| font (Font) | Font to draw text with. |
| radius (int) | Radius of rounded corners. A radius of zero or lower disables corner fillets. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(RectangleF box, RectangleF textbox, GH_Palette palette, string text, Font font, int[] radii, int highlight)
Create a new capsule with content text.
Parameters:
| box (RectangleF) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (RectangleF) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| font (Font) | Font to draw text with. |
| radii (int[]) | Radii of rounded corners. This array must contain at least 4 integers. Radii are defined clockwise, starting at the upper left corner. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(RectangleF box, RectangleF textbox, GH_Palette palette, string text, Font font)
Create a new capsule with content text.
Parameters:
| box (RectangleF) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (RectangleF) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| font (Font) | Font to draw text with. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(RectangleF box, RectangleF textbox, GH_Palette palette, string text, int radius, int highlight)
Create a new capsule with content text.
Parameters:
| box (RectangleF) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (RectangleF) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| radius (int) | Radius of rounded corners. A radius of zero or lower disables corner fillets. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(RectangleF box, RectangleF textbox, GH_Palette palette, string text, int[] radii, int highlight)
Create a new capsule with content text.
Parameters:
| box (RectangleF) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (RectangleF) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
| radii (int[]) | Radii of rounded corners. This array must contain at least 4 integers. Radii are defined clockwise, starting at the upper left corner. |
| highlight (int) | Height of the highlight bar. A value of zero or lower disables the highlight. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
CreateTextCapsule
#public static GH_Capsule CreateTextCapsule(RectangleF box, RectangleF textbox, GH_Palette palette, string text)
Create a new capsule with content text.
Parameters:
| box (RectangleF) | Box for capsule dimensions. The box will be grown until it is at least 3 pixels wide and high. |
| textbox (RectangleF) | Box into which the text will be drawn. |
| palette (GH_Palette) | Colour palette to apply. |
| text (string) | Text to display inside the capsule. |
Returns: A new instance of GH_Capsule. Caller is responsible for disposing of the object.
Dispose
#public void Dispose()
Render
#Render the capsule onto a graphics context.
Parameters:
| G (Graphics) | Graphics object to draw with. Zoom factor is implied by the G.Transform property. |
| selected (bool) | If true, the capsule will be drawn with selected colours. |
| locked (bool) | If True, the capcule will be drawn in Locked style. |
| hidden (bool) | If True, the capsule will be drawn in Hidden style. |
Render
#Have this capsule draw itself onto a Graphics surface with a custom colour override.
Parameters:
| G (Graphics) | Graphics object to draw with. Zoom factor is implied by the G.Transform property. |
| colour (Color) | Base colour for the capsule. Other colours will be derived from the base colour. If you want full control over every colour involved, then use the overload that allows you to supply a custom Style instead. |
Render
#Have this capsule draw itself onto a Graphics surface with a custom Style override.
Parameters:
| G (Graphics) | Graphics object to draw with. Zoom factor is implied by the G.Transform property. |
| style (GH_PaletteStyle) | Style to draw capsule with. |
Render
#Render the capsule onto a graphics context.
Parameters:
| G (Graphics) | Graphics object to draw with. Zoom factor is implied by the G.Transform property. |
| icon (Image) | Icon to render in center of content/bounding box. |
| selected (bool) | If true, the capsule will be drawn with selected colours. |
| locked (bool) | If True, the capcule will be drawn in Locked style. |
| hidden (bool) | If True, the capsule will be drawn in Hidden style. |
Render
#Have this capsule draw itself onto a Graphics surface with a custom colour override.
Parameters:
| G (Graphics) | Graphics object to draw with. Zoom factor is implied by the G.Transform property. |
| icon (Image) | Icon to render in center of content/bounding box. |
| colour (Color) | Base colour for the capsule. Other colours will be derived from the base colour. If you want full control over every colour involved, then use the overload that allows you to supply a custom Style instead. |
Render
#Have this capsule draw itself onto a Graphics surface with a custom Style override.
Parameters:
| G (Graphics) | Graphics object to draw with. Zoom factor is implied by the G.Transform property. |
| icon (Image) | Icon to render in center of content/bounding box. |
| style (GH_PaletteStyle) | Style to draw capsule with. |