Skip to content

GH_Canvas

Public Class

The GH_Canvas is the control that handles all mouse and paint events for a single loaded document.

Inheritance Hierarchy

System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
Grasshopper.GUI.Canvas.GH_Canvas

Namespace: Grasshopper.GUI.Canvas

Assembly: Grasshopper (in Grasshopper.dll)

Syntax

public class GH_Canvas : Control

The GH_Canvas type exposes the following members.

Constructors

Name

Description


Public Method

Initializes a new instance of the GH_Canvas class


Properties

Name

Description


Public Property

Gets or sets the currently active interaction object.


Public Property

Gets or sets the currently active object.


Public Property

Gets or sets the currently active widget.


Public Property

Gets the location of the cursor in Canvas coordinates.


Public Property

Gets the location of the cursor in Control coordinates.


Public Property
Static Member

Gets or sets whether the Voronoi Over-dose warning message is displayed. This property is set once at Grasshopper startup to True.


Public Property

Gets or sets the document currently loaded in this canvas.


Public Property

Gets the current drawing mode for this canvas.


Public Property

Gets whether or not this canvas has a child control on it with focus.


Public Property

Gets a value indicating whether or not there is an interaction object loaded in this canvas.


Public Property

Gets a value indicating whether or not an object is currently activated.


Public Property

Gets a value indicating whether or not a widget is currently activated.


Public Property

Gets a value indicating whether or not a document is currently loaded in this canvas.


Public Property

Public Property

Gets or sets the modifiers enabled flag. When modifiers are disabled, only zooming and panning is still allowed.


Public Property
Static Member

Gets or sets the special key for panning down.


Public Property
Static Member

Gets or sets the special key for panning left.


Public Property
Static Member

Gets or sets the number of pixels for each pan operation.


Public Property
Static Member

Gets or sets the special key for panning right.


Public Property
Static Member

Gets or sets the special key for panning up.


Public Property
Static Member

Gets or sets the zoom factor for navigation zoom operations.


Public Property
Static Member

Gets or sets the special key for zooming in.


Public Property
Static Member

Gets or sets the special key for zooming in.


Public Property

Gets the painter object that handles most of the drawing logic for this canvas.


Public Property

Gets whether this canvas is currently busy painting itself.


Public Property

Public Property

Gets all the TagArtist IDs in this Canvas.


Public Property
Static Member

Gets the thumbnail size for documents.


Public Property

Gets the delay (in milliseconds) required for a tooltip popup. This delay is a user setting stored under the Canvas:TooltipDelay field of the core settings.


Public Property

Provides access to all the validators associated with this canvas.


Public Property

Gets the viewport that determines the panning and zooming for this canvas.


Public Property

Gets a list of all the widgets on this canvas.


Public Property
Static Member

Gets the ZUI fade alpha value for the high zoom level threshold. This static field gets set on every Canvas paint start. The high threshold is typically used for ZUI elements that only appear when zoomed in.


Public Property
Static Member

Gets the ZUI fade alpha value for the low zoom level threshold. This static field gets set on every Canvas paint start. The low threshold is typically used for fading of icons and object names.


Public Property
Static Member

Gets the ZUI fade alpha value for the medium zoom level threshold. This static field gets set on every Canvas paint start. The medium threshold is typically used for non-informative UI elements such as highlights.


Methods

Name

Description


Public Method

Add a Tag Artist instance to this canvas.


Public Method

Add a new drop validator to the canvas.


Public Method

Public Method

Public Method

Create new MRU panels. This function only does something if there is no document loaded in the canvas.


Public Method

Render this canvas to a thumbnail preview.


Public Method

Destroy any MRU panels that might be in existence.


Protected method

Releases the unmanaged resources used by the GH_Canvas and optionally releases the managed resources

(Overrides Control.Dispose(Boolean).)


Public Method

Generate a collection of hi-res images of the document.


Public Method

Generate a single tile in a Hi-Res image export.


Public Method

Get a bitmap that resembles the current state of the canvas.


Public Method

Gets a graphics object for this control. You are not allowed to draw with this object, use it only for visibility testing and such. If you’re inside a canvas update, use the Graphics() property instead. You must dispose of the Graphics object returned by this method or resources will be leaked.


Public Method

Hide all existing MRU panels by sliding them out of view.


Public Method

Public Method

Public Method

Perform a single navigation step.


Protected method

(Overrides Control.OnPaint(PaintEventArgs).)


Protected method

(Overrides Control.OnPaintBackground(PaintEventArgs).)


Public Method

Ensure the canvas and document viewport data are synchronised and raises the ViewportChanged event.


Public Method

Public Method

Remove all IGH_TagArtists from this canvas. Do not use this method unless you want to screw over everyone else.


Public Method

Remove all IGH_TagArtists from this canvas that match a certain ID.


Public Method

Remove a specific tag artist from this canvas. If the instance occurs multiple times in the TagArtist list, all instances will be removed.


Public Method

Remove a drop validator from the canvas.


Public Method

Schedule a regen to occur after the specified number of milliseconds have elapsed. If a Regen is called in this time frame, the schedule will be cleared. Only a single schedule can be active at any time, so any call to ScheduleRegen will clear existing schedules.


Public Method

When this method is called during a redraw, the TextRenderingHint of the associated graphics object will be set to either GH_CrispText or GH_SmoothText depending on zoom level.


Public Method

Display the component Search dialog at the current mouse location. The dialog cannot be shown if ModifiersEnabled=False.


Public Method

Display the component Search dialog at the given coordinate. The dialog cannot be shown if ModifiersEnabled=False.


Public Method

Show any hidden MRU panels by sliding them back into view.


Public Method

Displays the quick-navigation popup pane at the cursor.


Public Method

Display the Find dialog. If a Find dialog is already active for this canvas, nothing will happen.


Public Method

Start the auto-panning timer.


Public Method

Stop the auto-panning timer.


Public Method

Call this method to update the preview thumbnail for the currently loaded document. If no document is currently loaded, nothing will happen.


Events

Name

Description


Public Event

Raised after the background has been drawn.


Public Event

Raised before a new paint operation starts. This event is always raised, even if the Canvas isn’t visible.


Public Event

Raised after a paint operation completes. This event is always raised, even if the Canvas isn’t visible.


Public Event

Raised after group drawing completes.


Public Event

Raised after object drawing completes.


Public Event

Raised after object overlay drawing completes.


Public Event

Raised after widgets are drawn. This is the final event in the Drawing pipeline.


Public Event

Raised after wire drawing completes.


Public Event

Raised before group drawing starts.


Public Event

Raised before object drawing starts.


Public Event

Raised before object overlay drawing starts.


Public Event

Raised before Widgets are drawn.


Public Event

Raised before wire drawing starts.


Public Event

Public Event

Public Event

Public Event

Public Event

This event is raised whenever a different document is loaded into this canvas.


Public Event

This event is raised whenever the left mouse button is pressed while over a Document object.


Public Event

This event is raised whenever the ModifiersEnabled property changes.


Public Event
Static Member

Raised whenever any of the shared navigation properties changed.


Public Event

This event is raised whenever the viewport properties are modified, for example when the pan or zoom values are affected.


Public Event
Static Member

This event is raised once for every GH_Canvas object that is created anew. The event is Shared (static) because it is raised inside the constructor of a GH_Canvas object and therefor cannot be registered on an instance.


Fields

Name

Description


Public Field
Static Member
ScheduleInactive

Defines the delay used to indicate the absence of a schedule.


Public Field
Static Member
ThumbnailHeight
Public Field
Static Member
ThumbnailWidth

ExtensionMethods

Name

Description


Public Extension Method

(Defined by EtoExtensions.)