|
Rhino C++ API
9.0
|
#include <rhinoSdkUserInterfaceObject.h>
Public Types | |
| enum | FocusReason : int { FocusReason::Unknown = 0, FocusReason::Pointer = 1, FocusReason::Navigation = 2 } |
Public Member Functions | |
| CRhinoUserInterfaceObject () | |
| virtual | ~CRhinoUserInterfaceObject () |
| virtual bool | AcceptsKeyboardFocus () const |
| void | Animate (CRhinoAnimatingDouble &value, double target, double duration, AnimationStyle style, CRhinoDoc *doc) |
| void | BindToActiveViewport (bool on) |
| void | BindToViewport (unsigned int viewport_sn) |
| virtual double | CameraDepth (const ON_Plane &cameraPlane) const |
| int | DisplayOrder () const |
| ON_UUID | DocumentGroupId () const |
| unsigned int | DocumentRuntimeSerialNumber () const |
| virtual void | Draw (CRhinoDisplayPipeline &dp) |
| bool | GetData (const wchar_t *key, bool &value) const |
| bool | GetData (const wchar_t *key, double &value) const |
| bool | GetData (const wchar_t *key, int &value) const |
| bool | GetData (const wchar_t *key, ON_UUID &value) const |
| bool | GetData (const wchar_t *key, ON_wString &value) const |
| bool | HasKeyboardFocus () const |
| bool | HasMouseCapture () const |
| bool | IsBoundToActiveViewport () const |
| unsigned int | IsBoundToViewport () const |
| virtual bool | IsMouseOver (const CRhinoMouseEventArgs &mouse) |
| bool | MoveKeyboardFocusToSibling (bool forward, CRhinoDoc *doc) |
| virtual bool | OnCharacter (unsigned int character, unsigned int flags) |
| virtual void | OnKeyboardFocusChanged (bool hasFocus) |
| virtual bool | OnKeyDown (unsigned int virtualKey, unsigned int flags) |
| virtual void | OnMouseClick (const CRhinoMouseEventArgs &mouse) |
| virtual void | OnMouseDoubleClick (const CRhinoMouseEventArgs &mouse) |
| virtual void | OnMouseDown (const CRhinoMouseEventArgs &mouse) |
| virtual void | OnMouseEnter (const CRhinoMouseEventArgs &mouse) |
| virtual void | OnMouseLeave (const CRhinoMouseEventArgs &mouse) |
| virtual void | OnMouseMove (const CRhinoMouseEventArgs &mouse) |
| virtual void | OnMouseUp (const CRhinoMouseEventArgs &mouse) |
| virtual void | OnMouseWheel (const CRhinoMouseEventArgs &mouse, int delta) |
| virtual CRhinoCommand::result | OnRunCommand (const CRhinoCommandContext &context, const CRhinoMouseEventArgs &mouse) |
| virtual void | OnTrackpadScroll (const CRhinoMouseEventArgs &mouse, float horizontal, float vertical) |
| CRhinoUserInterfaceObject * | Parent () |
| const CRhinoUserInterfaceObject * | Parent () const |
| bool | ReceivesMouseWheelEvents () const |
| bool | ReceivesTrackpadScrollEvents () const |
| bool | RegisterForAllDocuments () |
| void | RunCommand (const CRhinoMouseEventArgs &mouse) |
| unsigned int | RuntimeSerialNumber () const |
| void | SetCursor (HCURSOR cursor) |
| void | SetData (const wchar_t *key, bool value) |
| void | SetData (const wchar_t *key, const wchar_t *value) |
| void | SetData (const wchar_t *key, double value) |
| void | SetData (const wchar_t *key, int value) |
| void | SetData (const wchar_t *key, ON_UUID value) |
| void | SetDisplayOrder (int order) |
| void | SetReceivesMouseWheelEvents (bool enable) |
| void | SetReceivesTrackpadScrollEvents (bool enable) |
| void | SetTooltip (const wchar_t *tooltip) |
| void | SetVisible (bool visible) |
| bool | UnregisterFromAllDocuments () |
| bool | Visible () const |
Static Public Member Functions | |
| static void | ClearKeyboardFocus (CRhinoDoc *doc) |
| static FocusReason | KeyboardFocusReason () |
Protected Member Functions | |
| virtual void | ContinueAnimate (CRhinoDoc *doc) |
| void | ReleaseKeyboardFocus (CRhinoDoc *doc) |
| void | SetKeyboardFocus (CRhinoDoc *doc, FocusReason reason=FocusReason::Unknown) |
| void | SetMouseCapture (CRhinoDoc *doc) |
Protected Attributes | |
| class CRhUserInterfaceObjectPrivate * | m_private = nullptr |
Friends | |
| class | CRhinoDisplayPipeline |
| class | CRhinoDisplayWindowBase |
| class | CRhinoDoc |
| class | CRhinoObjRef |
| class | CRhinoUserInterfaceGrid |
| class | CRhUserInterfaceObjectPrivate |
| class | CRhViewBase |
Description: Base class for in-viewport user interface objects. These are objects that are shown and can respond to mouse events for things like heads up displays or clickable and dragable items.
|
strong |
Description: How keyboard focus arrived. A control can want to behave differently for each: a text box selects all of its text when Tab lands on it, the way a dialog field does, but leaves the text alone when it was clicked, because the click also says where in the text to put the caret.
| Enumerator | |
|---|---|
| Unknown | asked for in code, with nothing more specific said |
| Pointer | clicked on |
| Navigation | Tab or Shift+Tab moved on to it from a sibling. |
| CRhinoUserInterfaceObject::CRhinoUserInterfaceObject | ( | ) |
|
virtual |
|
virtual |
Description: Can this object take keyboard focus? This is what Tab looks at when it goes looking for the next control to move to. The base class returns false.
Reimplemented in CRhinoUserInterfaceTextBox, and CRhinoUserInterfaceRadioButton.
| void CRhinoUserInterfaceObject::Animate | ( | CRhinoAnimatingDouble & | value, |
| double | target, | ||
| double | duration, | ||
| AnimationStyle | style, | ||
| CRhinoDoc * | doc | ||
| ) |
Description: Use this method to register a new animation this method also should get called in Draw routine of the parent class for every animation in m_animations
| void CRhinoUserInterfaceObject::BindToActiveViewport | ( | bool | on | ) |
| void CRhinoUserInterfaceObject::BindToViewport | ( | unsigned int | viewport_sn | ) |
|
virtual |
Description: If this is a "world space" type user interface object (grip, text dot, direction arrow), this function returns the minimum distance to the camera to allow for depth sorting user interface objects before drawing them. The default return value is ON_UNSET_VALUE
Reimplemented in CRhinoGripUserInterfaceObject, and CRhinoTextDotUserInterfaceObject.
|
static |
Description: Take keyboard focus away from whichever object has it, if any. This is what a click that lands somewhere other than on that object does, and it is how code ends an edit without waiting for the user to press Enter. Parameters: doc - [in] document to redraw, can be nullptr
|
protectedvirtual |
Reimplemented in CRhinoUserInterfaceGrid.
| int CRhinoUserInterfaceObject::DisplayOrder | ( | ) | const |
Description: Sort order for user interface object to be drawn. Values <= 0 will be drawn before overlay cinduits and values > 0 wil be drawn after overlay conduits.
| ON_UUID CRhinoUserInterfaceObject::DocumentGroupId | ( | ) | const |
| unsigned int CRhinoUserInterfaceObject::DocumentRuntimeSerialNumber | ( | ) | const |
|
virtual |
Description: All user interface objects must implement a Draw function. This is where drawing using the input display pipeline is performed. The base class Draw function does nothing.
Reimplemented in CRhinoUserInterfaceGrid, CRhinoUserInterfaceTextBox, CRhinoUserInterfaceSlider, CRhinoUserInterfaceRadioButton, CRhinoUserInterfaceCheckBox, CRhinoUserInterfaceIcon, CRhinoUserInterfaceButton, CRhinoUserInterfaceLabel, CRhinoRotationGripUserInterfaceObject, CRhinoDirectionGripUserInterfaceObject, CRhinoGripUserInterfaceObject, and CRhinoTextDotUserInterfaceObject.
| bool CRhinoUserInterfaceObject::GetData | ( | const wchar_t * | key, |
| bool & | value | ||
| ) | const |
| bool CRhinoUserInterfaceObject::GetData | ( | const wchar_t * | key, |
| double & | value | ||
| ) | const |
| bool CRhinoUserInterfaceObject::GetData | ( | const wchar_t * | key, |
| int & | value | ||
| ) | const |
| bool CRhinoUserInterfaceObject::GetData | ( | const wchar_t * | key, |
| ON_UUID & | value | ||
| ) | const |
| bool CRhinoUserInterfaceObject::GetData | ( | const wchar_t * | key, |
| ON_wString & | value | ||
| ) | const |
| bool CRhinoUserInterfaceObject::HasKeyboardFocus | ( | ) | const |
Description: Does this object have keyboard focus. Only one user interface object has keyboard focus at a time, and only that object is sent characters and keys. Everything typed in a viewport goes to the command line as usual when no object has focus, or when the object with focus does not use the key.
| bool CRhinoUserInterfaceObject::HasMouseCapture | ( | ) | const |
Description: Does this object have mouse capture. Mouse capture is typically set when the mouse is down and dragging ui objects around. Only one object has mouse capture at any given time
| bool CRhinoUserInterfaceObject::IsBoundToActiveViewport | ( | ) | const |
| unsigned int CRhinoUserInterfaceObject::IsBoundToViewport | ( | ) | const |
|
virtual |
Description: Return true if the input mouse is considered to be over this object
Reimplemented in CRhinoUserInterfaceGrid, CRhinoUserInterfaceTextBox, CRhinoUserInterfaceSlider, CRhinoUserInterfaceRadioButton, CRhinoUserInterfaceCheckBox, CRhinoUserInterfaceIcon, CRhinoUserInterfaceButton, CRhinoRotationGripUserInterfaceObject, CRhinoDirectionGripUserInterfaceObject, CRhinoGripUserInterfaceObject, and CRhinoTextDotUserInterfaceObject.
|
static |
Description: Why the object that has keyboard focus was given it. Read this from OnKeyboardFocusChanged; it means nothing once focus has moved on.
| bool CRhinoUserInterfaceObject::MoveKeyboardFocusToSibling | ( | bool | forward, |
| CRhinoDoc * | doc | ||
| ) |
Description: Give keyboard focus to the control that comes after this one, or before it, among the controls in the same container. Tab order is the order the controls were added in and it wraps around at the ends. Controls that are hidden or that do not accept keyboard focus are passed over. Parameters: forward - [in] true moves on to the next control, false back to the previous doc - [in] document to redraw, can be nullptr Returns: True when focus moved to another control. False when this control is not in a container, or when no other control in it will take focus.
|
virtual |
Description: Called when a character is typed while this object has keyboard focus. Parameters: character - [in] the character that was typed flags - [in] platform key state flags Returns: True when this object used the character. A character this object does not use carries on to the command line, the way typing in a viewport normally works. The base class returns false.
Reimplemented in CRhinoUserInterfaceTextBox, and CRhinoUserInterfaceRadioButton.
|
virtual |
Description: Called when this object gains or loses keyboard focus. The base class implementation does nothing. KeyboardFocusReason says how focus arrived.
Reimplemented in CRhinoUserInterfaceTextBox, and CRhinoUserInterfaceRadioButton.
|
virtual |
Description: Called when a key goes down while this object has keyboard focus. This is where the keys that do not produce characters arrive: the arrows, Home, End, Backspace, Delete, Enter and Escape. Parameters: virtualKey - [in] virtual key code, VK_LEFT and friends flags - [in] platform key state flags Returns: True when this object used the key. The base class returns false.
Reimplemented in CRhinoUserInterfaceTextBox, and CRhinoUserInterfaceRadioButton.
|
virtual |
Description: Called when a mouse clicks on this UI element Parameters: mouse - mouse position, button and view
Reimplemented in CRhinoUserInterfaceRadioButton, and CRhinoUserInterfaceCheckBox.
|
virtual |
Description: Called when a mouse double clicks on this UI element Parameters: mouse - mouse position, button and view
Reimplemented in CRhinoUserInterfaceGrid, and CRhinoUserInterfaceTextBox.
|
virtual |
Description: Called when a mouse button goes down over this UI element Parameters: mouse - mouse position, button and view
Reimplemented in CRhinoUserInterfaceGrid, CRhinoUserInterfaceTextBox, CRhinoUserInterfaceSlider, CRhinoUserInterfaceRadioButton, CRhinoUserInterfaceCheckBox, CRhinoUserInterfaceButton, CRhinoDirectionGripUserInterfaceObject, and CRhinoGripUserInterfaceObject.
|
virtual |
Description: Called when first goes over this object (IsMouseOver returns true)
Reimplemented in CRhinoUserInterfaceGrid, CRhinoUserInterfaceTextBox, CRhinoUserInterfaceSlider, CRhinoUserInterfaceRadioButton, CRhinoUserInterfaceCheckBox, CRhinoUserInterfaceButton, CRhinoGripUserInterfaceObject, and CRhinoTextDotUserInterfaceObject.
|
virtual |
Description: Called when mouse leaves this object (IsMouseOver returns false)
Reimplemented in CRhinoUserInterfaceGrid, CRhinoUserInterfaceTextBox, CRhinoUserInterfaceSlider, CRhinoUserInterfaceRadioButton, CRhinoUserInterfaceCheckBox, CRhinoUserInterfaceButton, CRhinoGripUserInterfaceObject, and CRhinoTextDotUserInterfaceObject.
|
virtual |
Description: Called when a mouse moves over this UI element Parameters: mouse - mouse position, button and view
Reimplemented in CRhinoUserInterfaceGrid, CRhinoUserInterfaceTextBox, CRhinoUserInterfaceSlider, CRhinoDirectionGripUserInterfaceObject, and CRhinoGripUserInterfaceObject.
|
virtual |
Description: Called when a mouse button goes up over this UI element Parameters: mouse - mouse position, button and view
Reimplemented in CRhinoUserInterfaceGrid, CRhinoUserInterfaceTextBox, CRhinoUserInterfaceSlider, CRhinoUserInterfaceRadioButton, CRhinoUserInterfaceCheckBox, CRhinoUserInterfaceButton, CRhinoDirectionGripUserInterfaceObject, and CRhinoGripUserInterfaceObject.
|
virtual |
Description: Called when a mouse wheel event occurs over this user interface object. The control needs to explicitly enable mouse wheel support (default off) in order to receive these events
Reimplemented in CRhinoUserInterfaceGrid.
|
virtual |
Description: Called after the above RunCommand function is called. This will be executing while inside a Rhino command.
|
virtual |
Description: Called when a trackpad scroll event occurs and the mouse is over this user interface control. The control also needs to explicitly turn on track pad scroll support (default off) in order to receive these events.
Reimplemented in CRhinoUserInterfaceGrid.
| CRhinoUserInterfaceObject* CRhinoUserInterfaceObject::Parent | ( | ) |
| const CRhinoUserInterfaceObject* CRhinoUserInterfaceObject::Parent | ( | ) | const |
| bool CRhinoUserInterfaceObject::ReceivesMouseWheelEvents | ( | ) | const |
| bool CRhinoUserInterfaceObject::ReceivesTrackpadScrollEvents | ( | ) | const |
| bool CRhinoUserInterfaceObject::RegisterForAllDocuments | ( | ) |
|
protected |
Description: Give up keyboard focus. Does nothing when this object does not have it.
| void CRhinoUserInterfaceObject::RunCommand | ( | const CRhinoMouseEventArgs & | mouse | ) |
Description: Call RunCommand to have the virtual OnRunCommand function executed in the scope of a command. If you are modifying the document in a mouse function, this is the best approach to do so.
| unsigned int CRhinoUserInterfaceObject::RuntimeSerialNumber | ( | ) | const |
| void CRhinoUserInterfaceObject::SetCursor | ( | HCURSOR | cursor | ) |
Description: Set mouse cursor that will be displayed when the mouse is "over" this object
| void CRhinoUserInterfaceObject::SetData | ( | const wchar_t * | key, |
| bool | value | ||
| ) |
| void CRhinoUserInterfaceObject::SetData | ( | const wchar_t * | key, |
| const wchar_t * | value | ||
| ) |
| void CRhinoUserInterfaceObject::SetData | ( | const wchar_t * | key, |
| double | value | ||
| ) |
| void CRhinoUserInterfaceObject::SetData | ( | const wchar_t * | key, |
| int | value | ||
| ) |
| void CRhinoUserInterfaceObject::SetData | ( | const wchar_t * | key, |
| ON_UUID | value | ||
| ) |
| void CRhinoUserInterfaceObject::SetDisplayOrder | ( | int | order | ) |
|
protected |
Description: Take keyboard focus. The object that had it, if any, is told that it lost it. The reason is what KeyboardFocusReason hands back for as long as this object keeps focus.
|
protected |
| void CRhinoUserInterfaceObject::SetReceivesMouseWheelEvents | ( | bool | enable | ) |
| void CRhinoUserInterfaceObject::SetReceivesTrackpadScrollEvents | ( | bool | enable | ) |
| void CRhinoUserInterfaceObject::SetTooltip | ( | const wchar_t * | tooltip | ) |
Description: Set or clear the tooltip string for this object
| void CRhinoUserInterfaceObject::SetVisible | ( | bool | visible | ) |
| bool CRhinoUserInterfaceObject::UnregisterFromAllDocuments | ( | ) |
| bool CRhinoUserInterfaceObject::Visible | ( | ) | const |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
1.8.17