Constructors

UserInterfaceObjectBase

#
protected UserInterfaceObjectBase()

Properties

BoundToActiveView

#Since v9.0
public bool BoundToActiveView { get; set; }

HasKeyboardFocus

#Since v9.0
public bool HasKeyboardFocus { get; }
Does this object have keyboard focus? An object with keyboard focus gets first refusal on what is typed in a viewport; what it does not use carries on to the command line as usual.

Tooltip

#Since v9.0
public string Tooltip { get; set; }
Text shown in a tooltip when the mouse rests over this object. Null or an empty string means no tooltip, which is what an object starts with. One tooltip is on screen at a time; whichever object the mouse is over owns it.

Visible

#Since v9.0
public bool Visible { get; set; }
Is the user interface object visible? Objects that are not visible will not be drawn and will not receive mouse events

Methods

ClearKeyboardFocus

#Since v9.0
public static void ClearKeyboardFocus(RhinoDoc doc)
Take keyboard focus away from whichever user interface object has it, so that typing goes to the command line again.
doc (RhinoDoc)Document to redraw. This can be null.

IsMouseOver

#
protected virtual bool IsMouseOver(MouseState mouse)
Called to test if the mouse is actively over this object
mouse (MouseState)
Return true if the mouse is over this object

IsRegistered

#Since v9.0
public bool IsRegistered()
Is this user interface object active

OnDraw

#
protected virtual void OnDraw(DrawEventArgs args)
All user interface objects are drawn and can customize their look with the OnDraw function
args (DrawEventArgs)

OnMouseClick

#
protected virtual void OnMouseClick(MouseState mouse)
Called during a mouse click event on this object
mouse (MouseState)

OnMouseDoubleClick

#
protected virtual void OnMouseDoubleClick(MouseState mouse)
Called during a mouse double click event on this object
mouse (MouseState)

OnMouseDown

#
protected virtual void OnMouseDown(MouseState mouse)
Called when the mouse goes down on this object
mouse (MouseState)Current mouse state when this event occurs

OnMouseEnter

#
protected virtual void OnMouseEnter(MouseState mouse)
Called when the mouse goes over this object
mouse (MouseState)

OnMouseLeave

#
protected virtual void OnMouseLeave(MouseState mouse)
Called when the mouse leaves this object
mouse (MouseState)

OnMouseMove

#
protected virtual void OnMouseMove(MouseState mouse)
Called when the mouse is moved
mouse (MouseState)

OnMouseUp

#
protected virtual void OnMouseUp(MouseState mouse)
Called when the mouse is released on this object
mouse (MouseState)

OnRunCommand

#
protected virtual Result OnRunCommand(RhinoDoc doc, RunMode mode, MouseState mouse)
Called after the above RunCommand function is called. This will be executing while inside of a Rhino command.
doc (RhinoDoc)Document that the command is running in
mode (RunMode)Interactive or scripted mode
mouse (MouseState)Mouse state that was passed to RunCommand
Result of the command. The default implementation returns Success

RegisterForAllDocuments

#Since v9.0
public bool RegisterForAllDocuments()
Make this object visible for all documents. Typically you will only have user interface objects work with single documents. For that case, call doc.ViewUserInterface.Add

RunCommand

#Since v9.0
public void RunCommand(MouseState mouse)
Call RunCommand to have the virtual OnRunCommand function executed in the scope of a Rhino command. If you are modifying the document from one of the mouse functions on this object, this is the best approach to do so since changes made inside of a command are recorded for undo.
mouse (MouseState)Current mouse state. This is handed back to OnRunCommand

Unregister

#Since v9.0
public void Unregister()
Unregister this object