Click or drag to resize

UserInterfaceTextBox Class

A single line text box. Click it to give it keyboard focus, then type. The characters go into the box instead of to the command line for as long as it has focus; Enter commits what was typed, Escape puts back the text the box started with, and both give the focus back to the viewport.
Inheritance Hierarchy
SystemObject
  Rhino.UIUserInterfaceObjectBase
    Rhino.UIUserInterfaceControl
      Rhino.UIUserInterfaceTextBox

Namespace:  Rhino.UI
Assembly:  RhinoCommon (in RhinoCommon.dll)
Syntax
public class UserInterfaceTextBox : UserInterfaceControl

The UserInterfaceTextBox type exposes the following members.

Constructors
  NameDescription
Public methodUserInterfaceTextBox
Initializes a new instance of the UserInterfaceTextBox class
Public methodUserInterfaceTextBox(String)
Initializes a new instance of the UserInterfaceTextBox class
Top
Properties
  NameDescription
Public propertyBackgroundColor
Color the box is filled with. Color.Empty, the default, means use the standard color for the theme that is in use.
Public propertyBorderColor
Color of the outline around the box. Color.Empty, the default, means use the standard color for the theme that is in use. The outline is drawn thicker and brighter while the box has keyboard focus, whatever color it is given.
Public propertyBoundToActiveView (Inherited from UserInterfaceObjectBase.)
Public propertyCaretPosition
Where the insertion point sits, as a count of characters from the start of the text. Setting it clamps to the length of the text.
Public propertyHasKeyboardFocus
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 from UserInterfaceObjectBase.)
Public propertyHorizontalAlignment (Inherited from UserInterfaceControl.)
Public propertyLocation (Inherited from UserInterfaceControl.)
Public propertyMaximumLength
Most characters the text will hold. 0, the default, means no limit.
Public propertyPlaceholderText
Text drawn, dimmed, when the box is empty and does not have focus
Public propertyReadOnly
A read only text box can take focus and be scrolled through, but typing does not change it. False by default.
Public propertySize (Inherited from UserInterfaceControl.)
Public propertyText
What the box holds. Unlike the other controls, this is something the user changes, so reading it asks the box itself what is in it.
(Overrides UserInterfaceControlText.)
Public propertyTextColor
Color used to draw the text. Color.Empty, the default, means use the standard text color for the theme that is in use.
(Inherited from UserInterfaceControl.)
Public propertyTextHeight
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 from UserInterfaceControl.)
Public propertyTextHorizontalAlignment
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 from UserInterfaceControl.)
Public propertyTextVerticalAlignment
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 from UserInterfaceControl.)
Public propertyTooltip
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 from UserInterfaceObjectBase.)
Public propertyTrackingPoint
3d location that control "sticks" to if not null
(Inherited from UserInterfaceControl.)
Public propertyVerticalAlignment (Inherited from UserInterfaceControl.)
Public propertyVisible
Is the user interface object visible? Objects that are not visible will not be drawn and will not receive mouse events
(Inherited from UserInterfaceObjectBase.)
Top
Methods
  NameDescription
Public methodComputedRectangle (Inherited from UserInterfaceControl.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodIsMouseOver
Called to test if the mouse is actively over this object
(Inherited from UserInterfaceObjectBase.)
Public methodIsRegistered
Is this user interface object active
(Inherited from UserInterfaceObjectBase.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnDraw
All user interface objects are drawn and can customize their look with the OnDraw function
(Inherited from UserInterfaceObjectBase.)
Protected methodOnEditCanceled
Called when Escape is pressed. The text has already been put back to what it was when the box took focus. The default implementation raises the EditCanceled event.
Protected methodOnKeyboardFocusChanged
Called when the box gains or loses keyboard focus. Read HasKeyboardFocus to find out which. The default implementation raises the KeyboardFocusChanged event.
Protected methodOnMouseClick
Called during a mouse click event on this object
(Inherited from UserInterfaceObjectBase.)
Protected methodOnMouseDoubleClick
Called during a mouse double click event on this object
(Inherited from UserInterfaceObjectBase.)
Protected methodOnMouseDown
Called when the mouse goes down on this object
(Inherited from UserInterfaceObjectBase.)
Protected methodOnMouseEnter
Called when the mouse goes over this object
(Inherited from UserInterfaceObjectBase.)
Protected methodOnMouseLeave
Called when the mouse leaves this object
(Inherited from UserInterfaceObjectBase.)
Protected methodOnMouseMove
Called when the mouse is moved
(Inherited from UserInterfaceObjectBase.)
Protected methodOnMouseUp
Called when the mouse is released on this object
(Inherited from UserInterfaceObjectBase.)
Protected methodOnRunCommand
Called after the above RunCommand function is called. This will be executing while inside of a Rhino command.
(Inherited from UserInterfaceObjectBase.)
Protected methodOnTextChanged
Called every time the text changes, once per keystroke. The default implementation raises the TextChanged event.
Protected methodOnTextCommitted
Called when Enter is pressed, and when the box loses focus with the text changed from what it started with. This is where you do something about the new text. The default implementation raises the TextCommitted event.
Public methodRegisterForAllDocuments
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 from UserInterfaceObjectBase.)
Public methodRunCommand
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 from UserInterfaceObjectBase.)
Public methodSetSvg (Inherited from UserInterfaceControl.)
Public methodTakeKeyboardFocus
Give this text box keyboard focus, as clicking it does
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUnregister
Unregister this object
(Inherited from UserInterfaceObjectBase.)
Top
Events
  NameDescription
Public eventEditCanceled
Event triggered when Escape puts back the text the box started with
Public eventKeyboardFocusChanged
Event triggered when the box gains or loses keyboard focus
Public eventTextChanged
Event triggered every time the text changes, once per keystroke
Public eventTextCommitted
Event triggered when what was typed is committed, by Enter or by the box losing focus with the text changed
Top
See Also