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 CRhinoUserInterfaceCheckBox CRhinoUserInterfaceGrid CRhinoUserInterfaceIcon CRhinoUserInterfaceLabel CRhinoUserInterfaceSlider

Public Member Functions

 CRhinoUserInterfaceControl ()
 
virtual ~CRhinoUserInterfaceControl ()
 
virtual ON_4fRect ComputedRect (const CRhinoDisplayPipeline *pipeline, bool logicalPixels) const
 
virtual ON_2fSize ComputeSize () const
 
void GetAlignment (ControlHorizontalAlignment &h, ControlVerticalAlignment &v) const
 
void GetTextAlignment (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 SetTextAlignment (ControlHorizontalAlignment h, ControlVerticalAlignment v)
 
void SetTextColor (const ON_Color &color)
 
void SetTextHeight (float height)
 
void SetTrackingPoint (const ON_3dPoint &pt)
 
ON_2fSize Size () const
 
const ON_wStringText () const
 
ON_Color TextColor () const
 
float TextHeight () 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, float horizontal, float 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_4fRect CRhinoUserInterfaceControl::ComputedRect ( const CRhinoDisplayPipeline pipeline,
bool  logicalPixels 
) const
virtual

Description: Compute the location and size of this control in the coordinates of the thing that is drawing it. Parameters: pipeline - the display pipeline to compute location and size inside of. The same control can end up in different places in different pipelines, because of how it is aligned or because it is tracking a 3d point. Take the pipeline rather than the view it belongs to: a detail on a layout is drawn by its own nested pipeline whose view is the page view, so a view cannot say which of the two is being drawn. logicalPixels - should the rectangle be return in device or logical pixels

Reimplemented in CRhinoUserInterfaceGrid, CRhinoUserInterfaceSlider, CRhinoUserInterfaceCheckBox, CRhinoUserInterfaceIcon, CRhinoUserInterfaceButton, and CRhinoUserInterfaceLabel.

◆ ComputeSize()

virtual ON_2fSize CRhinoUserInterfaceControl::ComputeSize ( ) const
virtual

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

Reimplemented in CRhinoUserInterfaceGrid, CRhinoUserInterfaceSlider, CRhinoUserInterfaceCheckBox, CRhinoUserInterfaceIcon, CRhinoUserInterfaceButton, and CRhinoUserInterfaceLabel.

◆ GetAlignment()

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

◆ GetTextAlignment()

void CRhinoUserInterfaceControl::GetTextAlignment ( 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)

◆ SetTextAlignment()

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

Description: Where the text sits inside the control's rectangle. This is not the same as SetAlignment, which is where the control's rectangle sits inside its parent. The default is left / center.

◆ SetTextColor()

void CRhinoUserInterfaceControl::SetTextColor ( const ON_Color color)

Description: Color used to draw the text. The default is ON_UNSET_COLOR, which means use the standard text color for the theme that is in use.

◆ SetTextHeight()

void CRhinoUserInterfaceControl::SetTextHeight ( float  height)

Description: Height of the text in logical pixels. A value <= 0 (default) means use the standard control font height. Controls that draw no text ignore this.

◆ 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

◆ TextColor()

ON_Color CRhinoUserInterfaceControl::TextColor ( ) const

◆ TextHeight()

float CRhinoUserInterfaceControl::TextHeight ( ) const

◆ TrackingPoint()

ON_3dPoint CRhinoUserInterfaceControl::TrackingPoint ( ) const

Member Data Documentation

◆ m_ui_control_private

class CRhUserInterfaceControlPrivate* CRhinoUserInterfaceControl::m_ui_control_private = nullptr
protected