Constructors

FlexControl

#
public FlexControl()
Sets up the basic stuff.

Fields

DefaultDwellDelay

#
public static readonly TimeSpan DefaultDwellDelay
Gets the default dwell delay for Grasshopper tooltips.

Properties

AllowPan

#
public bool AllowPan { get; set; }
Gets whether this control supports mouse panning.
AllowPan

AllowScrollGesture

#
protected bool AllowScrollGesture { get; set; }
Gets or sets whether this control captures two-finger trackpad scroll and mouse-wheel events via its ScrollGesture. Set to false for FlexControls hosted in a Scrollable so the parent receives the scroll natively (native direction, momentum, rubber-band).

AllowZoom

#
public bool AllowZoom { get; set; }
Gets whether this control supports mouse zooming.
AllowZoom

AltKeyDown

#
public static bool AltKeyDown { get; }
Gets whether the Alt/Option key is down.

AutoWindowSelect

#
public bool AutoWindowSelect { get; set; }
Gets or sets whether a window selection automatically starts if a primary mousedown goes unhandled.

Border

#
public ControlBorder Border { get; set; }
Gets or sets the border drawn around this control.
Border

ContentBounds

#
public RectangleF ContentBounds { get; set; }
Gets or sets the bounding box of the content. Use an empty rectangle to indicate boundless content.
ContentBounds

ContentToControl

#
public IMatrix ContentToControl { get; }
Gets the transformation matrix from content coordinates to control coordinates.
ContentToControl

ControlKeyDown

#
public static bool ControlKeyDown { get; }
Gets whether the control key is down.

ControlToContent

#
public IMatrix ControlToContent { get; }
Gets the transformation matrix from control coordinates to content coordinates.
ControlToContent

CurrentWindowSelection

#
public WindowSelection CurrentWindowSelection { get; }
Gets the current window selection. This field will only be non-null during a window selection process. If you wish to respond to a completes window selection, handle the WindowSelection event.

DrawContentBoundary

#
public bool DrawContentBoundary { get; set; }
Gets or sets whether the content boundary ought to be drawn when visible.

DrawScrollbars

#
public bool DrawScrollbars { get; set; }
Gets whether this control should display scrollbars when needed. Scrollbars will only be displayed when the content exceeds the inner bounds. If AllowPan is set to False, then scrollbars will never be shown.
DrawScrollbars

FloatingButtonRail

#
protected virtual RectangleF FloatingButtonRail { get; }
Gets the rail along which floating buttons are positioned. By default, the rail is equal to the inner bounds offset by the button size. Override this property to define a custom rail, for example if some regions near the control boundary need to remain free of buttons.

FloatingButtons

#
public FloatingButtonCollection FloatingButtons { get; }
Gets the floating button collection for this control.
FloatingButtons

FocusObject

#
public IResponsive FocusObject { get; }
Gets the object which currently has focus, if any. Focused objects are most likely either IInteractions or IResponsives.
FocusObject
Explicit

IFlexControl.DrawEndTime

#
DrawEndTime
Explicit

IFlexControl.DrawStartTime

#
DateTime IFlexControl.DrawStartTime
DrawStartTime

InnerBounds

#
public RectangleF InnerBounds { get; }
Gets the area in control coordinates for the content of the control. This area does not include the control border.
InnerBounds

InnerScreenBounds

#
public RectangleF InnerScreenBounds { get; }
Gets the inner bounds of this control in screen coordinates.
InnerScreenBounds

IntegerOrigin

#
public bool IntegerOrigin { get; set; }
Gets or sets whether this control only allows integer accuracy coordinates for the origin point.
IntegerOrigin

IsDragSource

#
public bool IsDragSource { get; set; }
Gets or sets whether this control is potentially a source for drag+drop operations.
IsDragSource

IsDropTarget

#
public bool IsDropTarget { get; set; }
Gets or sets whether this control is potentially a target for drag+drop operations.
IsDropTarget

MaximumZoom

#
public float MaximumZoom { get; set; }
Gets or sets the maximum allowed zoom.
MaximumZoom

MinimumZoom

#
public float MinimumZoom { get; set; }
Gets or sets the minimum allowed zoom.
MinimumZoom

MouseDwellDelay

#
public TimeSpan MouseDwellDelay { get; set; }
Gets or sets the duration required before a MouseDwell event is raised. Negative or zero length durations mean the MouseDwell event is never raised.

OuterBounds

#
public RectangleF OuterBounds { get; }
Gets the bounds of this control in container coordinates.
OuterBounds

ParentControl

#
public IFlexControl ParentControl { get; set; }
Gets or sets the parent control.
ParentControl

Projection

#
public Projection Projection { get; set; }
Gets or sets the projection for this control.
Projection

ResizeBehaviour

#
public ContentResizeBehaviour ResizeBehaviour { get; set; }
Gets or sets the projection behaviour of the content during control resizing events.
ResizeBehaviour

ResponsivesBackwards

#
public IEnumerable<IResponsive> ResponsivesBackwards { get; }
Enumerate over all registered responsive objects in reverse order.

ResponsivesForwards

#
public IEnumerable<IResponsive> ResponsivesForwards { get; }
Enumerate over all registered responsive objects.

ScreenBounds

#
public RectangleF ScreenBounds { get; }
Gets the bounds of this control in screen coordinates.
ScreenBounds

ShiftKeyDown

#
public static bool ShiftKeyDown { get; }
Gets whether the Shift key is down.

VisibleFrame

#
public RectangleF VisibleFrame { get; }
Gets the rectangle in content coordinates which represents the visible portion. This basically means the InnerBounds mapped into content coordinates.
VisibleFrame

ZoomFeedbackLocation

#
public FeedbackLocation ZoomFeedbackLocation { get; set; }
Gets or sets the location for zoom change feedback.

Methods

AddSparkle

#
public void AddSparkle(ISparkle sparkle)
Add a sparkle to this control.
sparkle (ISparkle)Sparkle to add.

Animate<T>

#
public T Animate<T>(Animated<T> animated)
Evaluate an animator. This method automatically schedules redraw events if those are needed for smooth animations.
animated (Animated<T>)Animator to evaluate.
Animated value.
Animate

AnimatedZoomFactor

#
public float AnimatedZoomFactor(ZoomThreshold threshold)
Gets the normalised factor (0.0, 1.0) which indicates to what extend the display is in the given state.
threshold (ZoomThreshold)Threshold.
Normalised value.
AnimatedZoomFactor

BeginWindowSelect

#
public void BeginWindowSelect()
Start a window selection process.
BeginWindowSelect

ComputeWrappingBounds

#
public RectangleF ComputeWrappingBounds(PointF location)
Determine the implied wrapping bounds given the control and the screen containing the location. The wrapping bounds are either the bounds of the screen containing the location, or the intersection of the screen containing the location and the bounds of the control if this intersection is not empty.
location (PointF)Hint location in control coordinates.
Wrapping bounds in control coordinates.

CreateFloatingButtons

#
protected virtual void CreateFloatingButtons()
Override this method to add a set of floating buttons to your control. It will automatically be called at the end of the constructor. You can always choose to add buttons later, but why not Zoidberg?

DispatchRotation

#
protected virtual Response DispatchRotation(ResponseRotationArgs e)
Route a rotation gesture through the responsives stack. The default implementation tries the focused object, then the coincident responsives in reverse order. Subclasses (e.g. Canvas) may override to extend the dispatch — typically by adding a document-pick step when the base path returns Ignored.
e (ResponseRotationArgs)

DrawWindowSelectionEdge

#
public void DrawWindowSelectionEdge()
If a window selection is currently in progress, draw the fill of that window selection fence. By calling this method you override the default window selection drawing pipeline, which allows you to have finer control over the layering of the window rectangle background and foreground.

DrawWindowSelectionEdge

#
public void DrawWindowSelectionEdge(Pen edge)
If a window selection is currently in progress, draw the fill of that window selection fence. By calling this method you override the default window selection drawing pipeline, which allows you to have finer control over the layering of the window rectangle background and foreground.
edge (Pen)Edge edge to use.

DrawWindowSelectionFill

#
public void DrawWindowSelectionFill()
If a window selection is currently in progress, draw the fill of that window selection fence. By calling this method you override the default window selection drawing pipeline, which allows you to have finer control over the layering of the window rectangle background and foreground.

DrawWindowSelectionFill

#
public void DrawWindowSelectionFill(Brush fill)
If a window selection is currently in progress, draw the fill of that window selection fence. By calling this method you override the default window selection drawing pipeline, which allows you to have finer control over the layering of the window rectangle background and foreground.
fill (Brush)Fill brush to use.

EndWindowSelect

#
public void EndWindowSelect()
If, for any reason, you wish to terminate a window selection process prematurely, call this method.
EndWindowSelect

FloatingButtonTooltipOverride

#
protected virtual bool FloatingButtonTooltipOverride(FloatingButton button)
Override this method to provide a custom tooltip for floating buttons.
button (FloatingButton)Button for tooltip.
True if the standard tooltip ought to be suppressed.

LooksLikeSingleClick

#
protected bool LooksLikeSingleClick(MouseEventArgs e)
Test whether the given mouse event is compatible with a single-click-event given the most recent MouseDown event cache.
e (MouseEventArgs)

Map

#
public PointF Map(PointF point, CoordinateSystem from, CoordinateSystem to)
Map a point from one coordinate system to another.
point (PointF)Point to map.
from (CoordinateSystem)Coordinate system in which the point is currently defined.
to (CoordinateSystem)Target coordinate system.
Mapped point.
Map

Map

#
public RectangleF Map(RectangleF rectangle, CoordinateSystem from, CoordinateSystem to)
Map a rectangle from one coordinate system to another.
rectangle (RectangleF)Rectangle to map.
from (CoordinateSystem)Coordinate system in which the rectangle is currently defined.
to (CoordinateSystem)Target coordinate system.
Mapped rectangle.
Map

OnKeyDown

#
protected override void OnKeyDown(KeyEventArgs e)
Key down handler.
e (KeyEventArgs)
Control.OnKeyDown

OnKeyUp

#
protected override void OnKeyUp(KeyEventArgs e)
Key up handler.
e (KeyEventArgs)
Control.OnKeyUp

OnLoad

#
protected override void OnLoad(EventArgs e)
Raises the Load event, and recurses to this container's children
e (EventArgs)Event arguments
Container.OnLoad

OnLoadComplete

#
protected override void OnLoadComplete(EventArgs e)
Raises the LoadComplete event, and recurses to this container's children
e (EventArgs)Event arguments
Container.OnLoadComplete

OnMouseDoubleClick

#
protected sealed override void OnMouseDoubleClick(MouseEventArgs e)
Default mousedoubleclick handler for IControl. The default handling includes event delegation to the entire IInteraction stack.
e (MouseEventArgs)
Control.OnMouseDoubleClick

OnMouseDown

#
protected sealed override void OnMouseDown(MouseEventArgs e)
Default mousedown handler for IControl. The default handling includes event delegation to the entire IInteraction stack, as well as the creation of Pan and Zoom interactions if needed.
e (MouseEventArgs)
Control.OnMouseDown

OnMouseLeave

#
protected sealed override void OnMouseLeave(MouseEventArgs e)
Default mouseleave handler for IControl. The default handling deals with the hover tracking mechanism.
e (MouseEventArgs)
Control.OnMouseLeave

OnMouseMove

#
protected sealed override void OnMouseMove(MouseEventArgs e)
Default mousemove handler for IControl. The default handling includes event delegation to the entire IInteraction stack, as well as the updating of any active window selection and hover delay tracking.
e (MouseEventArgs)
Control.OnMouseMove

OnMouseUp

#
protected sealed override void OnMouseUp(MouseEventArgs e)
Default mouseup handler for IControl. The default handling includes event delegation to the entire IInteraction stack, as well as the terminating of any window selections and the popping of context menus. Furthermore, this method decides whether to provide a Click event for interaction objects.
e (MouseEventArgs)
Control.OnMouseUp

OnMouseWheel

#
protected sealed override void OnMouseWheel(MouseEventArgs e)
Default mousewheel handler for IControl. The default handling includes event delegation to the entire IInteraction stack, as well as scroll zooming.
e (MouseEventArgs)
Control.OnMouseWheel

OnPaint

#
protected override void OnPaint(PaintEventArgs e)
Runs the drawing pipeline. Do not override this method unless you know *exactly* what you are doing. Handle the Draw(object, ControlDrawEventArgs) event instead.
e (PaintEventArgs)
Drawable.OnPaint

OnPinchGesture

#
protected virtual void OnPinchGesture(PointF cursor, float magnification)
Handle a pinch gesture tick. The default implementation applies a zoom to the FlexControl Projection (gated on AllowZoom). Subclasses with their own projection — for example the function editor's FrameF — override this to drive that projection instead.
cursor (PointF)Cursor position in control coordinates.
magnification (float)Per-tick magnification; positive zooms in.

OnPopulateContextMenu

#
protected virtual bool OnPopulateContextMenu(MouseEventArgs e)
Override this method to populate the context menu, or handle the PopulateContextMenu event. This method will automatically show the menu if it contains any items.
e (MouseEventArgs)Mouse event arguments associated with this menu popup.
True if menu was shown.

OnScrollGesture

#
protected virtual void OnScrollGesture(SizeF motion)
Handle a scroll gesture tick (two-finger trackpad drag or mouse wheel). The default implementation pans the FlexControl Projection (gated on AllowPan). Subclasses with their own projection override this to drive that projection instead.
motion (SizeF)Pan motion in control coordinates.

OnSizeChanged

#
protected override void OnSizeChanged(EventArgs e)
Raises the SizeChanged event.
e (EventArgs)Event arguments
Control.OnSizeChanged

OnTextInput

#
protected override void OnTextInput(TextInputEventArgs e)
Text input handler.
e (TextInputEventArgs)
Control.OnTextInput

PopFocus

#
public void PopFocus(IResponsive responsive)
Pop a responsive object off the focus stack. It doesn't matter if it's at the head of the stack, but if it is, the new head will receive focus.
responsive (IResponsive)

PushFocus

#
public void PushFocus(IResponsive responsive)
Push a new responsive object into the top of the focus stack. This does not register the object with this control.
responsive (IResponsive)

RegisterIResponsive

#
public void RegisterIResponsive(IResponsive responsive)
Add a responsive object to this control's awareness. Responsive objects which have been properly registered will automatically have their response methods invoked in case of mouse/keyboard events on the control. The object will not be drawn though, that is the responsibility of the owner.
responsive (IResponsive)Responsive to add.

ScheduleRedraw

#
public void ScheduleRedraw()
Schedule a redraw in the near future. Redraw will happen as quickly as possible, though the message queue will be emptied first.
ScheduleRedraw

ScheduleRedraw

#
public void ScheduleRedraw(TimeSpan delay)
Schedule a redraw at a roughly defined delay.
delay (TimeSpan)Time until redraw after the current drawing operation completes.
ScheduleRedraw

UnregisterIResponsive

#
public void UnregisterIResponsive(IResponsive responsive)
Remove a responsive object from this control's awareness.
responsive (IResponsive)

UpdateMapping

#
protected void UpdateMapping()
Update the mapping matrices. You *must* call this method whenever you change something that might affect the positioning of the content. For example origin, zoom, bounds...

Events

Draw

#
This event is raised whenever the control paints itself.
Draw

MouseDwell

#
public event EventHandler<MouseDwellEventArgs> MouseDwell
Raised when the mouse dwells over some pixel without moving for a while.

PopulateContextMenu

#
public event EventHandler<PopulateContextMenuEventArgs> PopulateContextMenu
Raised whenever the context menu ought to be populated.

ProjectionChanged

#
public event EventHandler<ProjectionChangedEventArgs> ProjectionChanged
Raised whenever the projection of a control changes.
ProjectionChanged

WindowSelection

#
public event EventHandler<WindowSelectionEventArgs> WindowSelection
Raised whenever a window selection completes.
WindowSelection