Rhino C++ API  9.0
Public Member Functions | Protected Attributes | List of all members
CRhinoUserInterfaceControl Class Reference

#include <rhinoSdkUserInterfaceObject.h>

Inheritance diagram for CRhinoUserInterfaceControl:
CRhinoUserInterfaceObject CRhinoUserInterfaceButton CRhinoUserInterfaceIcon CRhinoUserInterfaceSlider

Public Member Functions

 CRhinoUserInterfaceControl ()
 
virtual ~CRhinoUserInterfaceControl ()
 
virtual ON_4dRect ComputedRect (const CRhinoView *view, bool logicalPixels) const
 
virtual ON_2fSize ComputeSize () const
 
void GetAlignment (ControlHorizontalAlignment &h, ControlVerticalAlignment &v) const
 
const ON_wStringImageSVG () const
 
ON_2fPoint Location () const
 
void SetAlignment (ControlHorizontalAlignment h, ControlVerticalAlignment v)
 
void SetImageSVG (const wchar_t *svg)
 
void SetLocation (float x, float y)
 
void SetLocation (ON_2fPoint location)
 
void SetLocation (ON_2fPoint location, ControlHorizontalAlignment hAlign, ControlVerticalAlignment vAlign)
 
void SetSize (const ON_2fSize &size)
 
void SetSize (float width, float height)
 
void SetText (const wchar_t *text)
 
void SetTrackingPoint (const ON_3dPoint &pt)
 
ON_2fSize Size () const
 
const ON_wStringText () const
 
ON_3dPoint TrackingPoint () const
 
- Public Member Functions inherited from CRhinoUserInterfaceObject
 CRhinoUserInterfaceObject ()
 
virtual ~CRhinoUserInterfaceObject ()
 
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 HasMouseCapture () const
 
bool IsBoundToActiveViewport () const
 
unsigned int IsBoundToViewport () const
 
virtual bool IsMouseOver (const CRhinoMouseEventArgs &mouse)
 
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, double horizontal, double vertical)
 
CRhinoUserInterfaceObjectParent ()
 
const CRhinoUserInterfaceObjectParent () 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
 

Protected Attributes

class CRhUserInterfaceControlPrivate * m_ui_control_private = nullptr
 
- Protected Attributes inherited from CRhinoUserInterfaceObject
class CRhUserInterfaceObjectPrivatem_private = nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from CRhinoUserInterfaceObject
virtual void ContinueAnimate (CRhinoDoc *doc)
 
void SetMouseCapture (CRhinoDoc *doc)
 

Detailed Description

Description: Controls are traditional 2d user interface elements that can be drawn and respond to mouse events in a rhino view.

Constructor & Destructor Documentation

◆ CRhinoUserInterfaceControl()

CRhinoUserInterfaceControl::CRhinoUserInterfaceControl ( )

◆ ~CRhinoUserInterfaceControl()

virtual CRhinoUserInterfaceControl::~CRhinoUserInterfaceControl ( )
virtual

Member Function Documentation

◆ ComputedRect()

virtual ON_4dRect CRhinoUserInterfaceControl::ComputedRect ( const CRhinoView view,
bool  logicalPixels 
) const
virtual

Description: Compute the location and size of this control in the coordinates of a view. Parameters: view - the view to use for computing location and size inside of. The same control can be in different locations for different views due to how the control is aligned in the view or if it is tracking a 3d point logicalPixels - should the rectangle be return in device or logical pixels

Reimplemented in CRhinoUserInterfaceSlider, CRhinoUserInterfaceIcon, and CRhinoUserInterfaceButton.

◆ ComputeSize()

virtual ON_2fSize CRhinoUserInterfaceControl::ComputeSize ( ) const
virtual

Description: Compute the size of this control in logical pixels.

Reimplemented in CRhinoUserInterfaceSlider, CRhinoUserInterfaceIcon, and CRhinoUserInterfaceButton.

◆ GetAlignment()

void CRhinoUserInterfaceControl::GetAlignment ( ControlHorizontalAlignment h,
ControlVerticalAlignment v 
) const

◆ ImageSVG()

const ON_wString& CRhinoUserInterfaceControl::ImageSVG ( ) const

◆ Location()

ON_2fPoint CRhinoUserInterfaceControl::Location ( ) const

◆ SetAlignment()

void CRhinoUserInterfaceControl::SetAlignment ( ControlHorizontalAlignment  h,
ControlVerticalAlignment  v 
)

Description: How this control is aligned in its parent

◆ SetImageSVG()

void CRhinoUserInterfaceControl::SetImageSVG ( const wchar_t *  svg)

◆ SetLocation() [1/3]

void CRhinoUserInterfaceControl::SetLocation ( float  x,
float  y 
)

Description: Location of this control in logical pixels. The actual location where the control ends up on the screen is determined by a combination of location, alignment and optionally a 3d teacking point.

◆ SetLocation() [2/3]

void CRhinoUserInterfaceControl::SetLocation ( ON_2fPoint  location)

◆ SetLocation() [3/3]

void CRhinoUserInterfaceControl::SetLocation ( ON_2fPoint  location,
ControlHorizontalAlignment  hAlign,
ControlVerticalAlignment  vAlign 
)

Description: Convenience function to set both location and alignment in one call

◆ SetSize() [1/2]

void CRhinoUserInterfaceControl::SetSize ( const ON_2fSize size)

◆ SetSize() [2/2]

void CRhinoUserInterfaceControl::SetSize ( float  width,
float  height 
)

Description: The size of this control in logical pixels. If size is 0 (default) for width or height, then a size is computed for the control based on it's contents.

◆ SetText()

void CRhinoUserInterfaceControl::SetText ( const wchar_t *  text)

◆ SetTrackingPoint()

void CRhinoUserInterfaceControl::SetTrackingPoint ( const ON_3dPoint pt)

Description: Controls can be made to "track" 3d locations in a viewport. In other words, the control will move around the viewport as if it were glued to a 3d location. By default the tracking point is unset which means the control will not track a 3d location

◆ Size()

ON_2fSize CRhinoUserInterfaceControl::Size ( ) const

◆ Text()

const ON_wString& CRhinoUserInterfaceControl::Text ( ) const

◆ TrackingPoint()

ON_3dPoint CRhinoUserInterfaceControl::TrackingPoint ( ) const

Member Data Documentation

◆ m_ui_control_private

class CRhUserInterfaceControlPrivate* CRhinoUserInterfaceControl::m_ui_control_private = nullptr
protected