UserInterfaceSlider
UserInterfaceControlUserInterfaceObjectBaseSliders allow dragging a grip back and forth along a defined range
Properties
Set to true if you want to allow dragging of the slider grip after the end of the defined range.
Set to true if you want to allow dragging of the slider grip before the start of the defined range.
BackgroundColor
Color the control is filled with: the face of a button, the track of a slider, the box of a check box or radio button, the field of a text box, the whole rectangle of a label, icon or grid. Color.Empty, the default, means the control chooses the color for the theme that is in use and follows the theme when it changes. Labels and icons draw no background when this is Color.Empty. A grid fills with the theme's panel color when it is a top level control, and draws no background when it is inside another control. UserInterfaceGrid.BackgroundOpacity makes the theme color see through, or turns the background off at 0.
BoundToActiveView
Number of digits of precision for the slider. If you want the slider to only represent integer values, set the Digits value to 0.
Should the slider display the current value as text on the screen
HasKeyboardFocus
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.
HorizontalAlignment
TextColor
Color used to draw the text. Color.Empty, the default, means use the standard text color for the theme that is in use.
TextHeight
Height of the text in logical pixels. A value of 0, the default, means use the standard control font height. Controls that draw no text ignore this setting.
TextHorizontalAlignment
Where the text sits inside the control's rectangle. This is not the same as HorizontalAlignment, which is where the control sits inside its parent.
TextVerticalAlignment
Where the text sits inside the control's rectangle. This is not the same as VerticalAlignment, which is where the control sits inside its parent.
Tooltip
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.
TrackingPoint
3d location that control "sticks" to if not null
VerticalAlignment
Visible
Is the user interface object visible? Objects that are not visible will not be drawn and will not receive mouse events
Methods
ComputedRectangle
IsMouseOver
Called to test if the mouse is actively over this object
Parameters:
| mouse (MouseState) |
Returns: Return true if the mouse is over this object
OnDraw
All user interface objects are drawn and can customize their look with the OnDraw function
Parameters:
| args (DrawEventArgs) |
OnMouseClick
Called during a mouse click event on this object
Parameters:
| mouse (MouseState) |
OnMouseDoubleClick
Called during a mouse double click event on this object
Parameters:
| mouse (MouseState) |
OnMouseDown
Called when the mouse goes down on this object
Parameters:
| mouse (MouseState) | Current mouse state when this event occurs |
OnMouseEnter
Called when the mouse goes over this object
Parameters:
| mouse (MouseState) |
OnMouseLeave
Called when the mouse leaves this object
Parameters:
| mouse (MouseState) |
Parameters:
| mouse (MouseState) |
OnMouseUp
Called when the mouse is released on this object
Parameters:
| mouse (MouseState) |
OnRunCommand
Called after the above RunCommand function is called. This will be executing while inside of a Rhino command.
Parameters:
| doc (RhinoDoc) | Document that the command is running in |
| mode (RunMode) | Interactive or scripted mode |
| mouse (MouseState) | Mouse state that was passed to RunCommand |
Returns: Result of the command. The default implementation returns Success
OnValueChanged
#protected virtual void OnValueChanged()
Called when the slider's value changes. The default implementation calls the ValueChanged event
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
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.
Parameters:
| mouse (MouseState) | Current mouse state. This is handed back to OnRunCommand |
Parameters:
| svg (string) |
Unregister
public void Unregister()
Unregister this object
Events
Event triggered when the slider's value changes