Draws a radio button with optional text beside it. Radio buttons that belong to the same group take turns: turning one on turns off whichever one was on before it, so exactly one button in a set is on at a time. Clicking a button that is already on does nothing.

A group is the radio buttons that share a Group number, sit in the same container and belong to the same document. The default group number is 0, so a set of radio buttons added to one grid is already a group. Give each set its own number when a container holds more than one set.

Constructors

UserInterfaceRadioButton

#Since v9.0
public UserInterfaceRadioButton()

UserInterfaceRadioButton

#Since v9.0
public UserInterfaceRadioButton(string text, int group)
text (string)
group (int)

UserInterfaceRadioButton

#Since v9.0
public UserInterfaceRadioButton(string text)
text (string)

Properties

BackgroundColor

public Color BackgroundColor { get; set; }
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.
inherited fromUserInterfaceControl

BoundToActiveView

public bool BoundToActiveView { get; set; }
inherited fromUserInterfaceObjectBase

Checked

#Since v9.0
public bool Checked { get; set; }
Is this the button that is on in its group? Turning a button on turns off every other button in its group. Setting this does not raise CheckedChanged; that is only for a state the user changed.

CheckedButtonInGroup

#Since v9.0
public UserInterfaceRadioButton CheckedButtonInGroup { get; }
The button in this button's group that is on, which can be this button, or null when nothing in the group has been turned on yet. The buttons have to have been added to a document for this to find anything, since it is the native side that keeps track of a group.

Group

#Since v9.0
public int Group { get; set; }
Which set of radio buttons this one belongs to. The default is 0. Two sets of radio buttons in the same container need different group numbers or they will turn each other off.

HasKeyboardFocus

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.
inherited fromUserInterfaceObjectBase

HorizontalAlignment

public ControlHorizontalAlignment HorizontalAlignment { get; set; }
inherited fromUserInterfaceControl

Location

public PointF Location { get; set; }
inherited fromUserInterfaceControl

Size

public SizeF Size { get; set; }
inherited fromUserInterfaceControl

Text

public virtual string Text { get; set; }
inherited fromUserInterfaceControl

TextColor

public Color TextColor { get; set; }
Color used to draw the text. Color.Empty, the default, means use the standard text color for the theme that is in use.
inherited fromUserInterfaceControl

TextHeight

public float TextHeight { get; set; }
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.
inherited fromUserInterfaceControl

TextHorizontalAlignment

public ControlHorizontalAlignment TextHorizontalAlignment { get; set; }
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.
inherited fromUserInterfaceControl

TextVerticalAlignment

public ControlVerticalAlignment TextVerticalAlignment { get; set; }
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.
inherited fromUserInterfaceControl

Tooltip

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.
inherited fromUserInterfaceObjectBase

TrackingPoint

public Point3d? TrackingPoint { get; set; }
3d location that control "sticks" to if not null
inherited fromUserInterfaceControl

VerticalAlignment

public ControlVerticalAlignment VerticalAlignment { get; set; }
inherited fromUserInterfaceControl

Visible

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
inherited fromUserInterfaceObjectBase

Methods

ComputedRectangle

public RectangleF ComputedRectangle(RhinoView view, bool logicalPixels)
inherited fromUserInterfaceControl
view (RhinoView)
logicalPixels (bool)

IsMouseOver

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

IsRegistered

public bool IsRegistered()
Is this user interface object active
inherited fromUserInterfaceObjectBase

OnCheckedChanged

#
protected virtual void OnCheckedChanged()
Called after a click or a key has changed the state of this button. Both ends of the change are told, the button that came on and the button that went off, so a set can be watched from any one of its buttons. The default implementation raises the CheckedChanged event.

OnDraw

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

OnMouseClick

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

OnMouseDoubleClick

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

OnMouseDown

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

OnMouseEnter

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

OnMouseLeave

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

OnMouseMove

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

OnMouseUp

protected virtual void OnMouseUp(MouseState mouse)
Called when the mouse is released on this object
inherited fromUserInterfaceObjectBase
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.
inherited fromUserInterfaceObjectBase
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

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
inherited fromUserInterfaceObjectBase

RunCommand

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.
inherited fromUserInterfaceObjectBase
mouse (MouseState)Current mouse state. This is handed back to OnRunCommand

SetSvg

public void SetSvg(string svg)
inherited fromUserInterfaceControl
svg (string)

Unregister

public void Unregister()
Unregister this object
inherited fromUserInterfaceObjectBase

Events

CheckedChanged

#Since v9.0
public event EventHandler CheckedChanged
Event triggered when a click or a key changes the state of this radio button