Rhino C++ API  9.0
Public Member Functions | List of all members
CRhinoUserInterfaceRadioButton Class Reference

#include <rhinoSdkUserInterfaceObject.h>

Inheritance diagram for CRhinoUserInterfaceRadioButton:
CRhinoUserInterfaceControl CRhinoUserInterfaceObject

Public Member Functions

 CRhinoUserInterfaceRadioButton ()
 
 CRhinoUserInterfaceRadioButton (const wchar_t *text)
 
 CRhinoUserInterfaceRadioButton (const wchar_t *text, int group)
 
virtual ~CRhinoUserInterfaceRadioButton ()
 
bool AcceptsKeyboardFocus () const override
 
bool Checked () const
 
CRhinoUserInterfaceRadioButtonCheckedButtonInGroup ()
 
const CRhinoUserInterfaceRadioButtonCheckedButtonInGroup () const
 
ON_4fRect ComputedRect (const CRhinoDisplayPipeline *pipeline, bool logicalPixels) const override
 
ON_2fSize ComputeSize () const override
 
void Draw (CRhinoDisplayPipeline &dp) override
 
int Group () const
 
bool IsMouseOver (const CRhinoMouseEventArgs &mouse) override
 
bool OnCharacter (unsigned int character, unsigned int flags) override
 
virtual void OnCheckedChanged ()
 
void OnKeyboardFocusChanged (bool hasFocus) override
 
bool OnKeyDown (unsigned int virtualKey, unsigned int flags) override
 
void OnMouseClick (const CRhinoMouseEventArgs &mouse) override
 
void OnMouseDown (const CRhinoMouseEventArgs &mouse) override
 
void OnMouseEnter (const CRhinoMouseEventArgs &mouse) override
 
void OnMouseLeave (const CRhinoMouseEventArgs &mouse) override
 
void OnMouseUp (const CRhinoMouseEventArgs &mouse) override
 
void SetChecked (bool checked)
 
void SetGroup (int group)
 
- Public Member Functions inherited from CRhinoUserInterfaceControl
 CRhinoUserInterfaceControl ()
 
virtual ~CRhinoUserInterfaceControl ()
 
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
 
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
 
bool MoveKeyboardFocusToSibling (bool forward, CRhinoDoc *doc)
 
virtual void OnMouseDoubleClick (const CRhinoMouseEventArgs &mouse)
 
virtual void OnMouseMove (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
 

Additional Inherited Members

- Public Types inherited from CRhinoUserInterfaceObject
enum  FocusReason : int { FocusReason::Unknown = 0, FocusReason::Pointer = 1, FocusReason::Navigation = 2 }
 
- Static Public Member Functions inherited from CRhinoUserInterfaceObject
static void ClearKeyboardFocus (CRhinoDoc *doc)
 
static FocusReason KeyboardFocusReason ()
 
- Protected Member Functions inherited from CRhinoUserInterfaceObject
virtual void ContinueAnimate (CRhinoDoc *doc)
 
void ReleaseKeyboardFocus (CRhinoDoc *doc)
 
void SetKeyboardFocus (CRhinoDoc *doc, FocusReason reason=FocusReason::Unknown)
 
void SetMouseCapture (CRhinoDoc *doc)
 
- Protected Attributes inherited from CRhinoUserInterfaceControl
class CRhUserInterfaceControlPrivate * m_ui_control_private = nullptr
 
- Protected Attributes inherited from CRhinoUserInterfaceObject
class CRhUserInterfaceObjectPrivatem_private = nullptr
 

Detailed Description

Description: A control that 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.

Constructor & Destructor Documentation

◆ CRhinoUserInterfaceRadioButton() [1/3]

CRhinoUserInterfaceRadioButton::CRhinoUserInterfaceRadioButton ( )

◆ CRhinoUserInterfaceRadioButton() [2/3]

CRhinoUserInterfaceRadioButton::CRhinoUserInterfaceRadioButton ( const wchar_t *  text)

◆ CRhinoUserInterfaceRadioButton() [3/3]

CRhinoUserInterfaceRadioButton::CRhinoUserInterfaceRadioButton ( const wchar_t *  text,
int  group 
)

◆ ~CRhinoUserInterfaceRadioButton()

virtual CRhinoUserInterfaceRadioButton::~CRhinoUserInterfaceRadioButton ( )
virtual

Member Function Documentation

◆ AcceptsKeyboardFocus()

bool CRhinoUserInterfaceRadioButton::AcceptsKeyboardFocus ( ) const
overridevirtual

Description: Radio buttons take keyboard focus, but Tab moves to a group rather than through it, the way it does in a dialog: the button that is on is the one Tab lands on, and the arrow keys move from there. When no button in the group is on it is the first button that Tab lands on.

Reimplemented from CRhinoUserInterfaceObject.

◆ Checked()

bool CRhinoUserInterfaceRadioButton::Checked ( ) const

Description: Is this the button that is on in its group?

◆ CheckedButtonInGroup() [1/2]

CRhinoUserInterfaceRadioButton* CRhinoUserInterfaceRadioButton::CheckedButtonInGroup ( )

◆ CheckedButtonInGroup() [2/2]

const CRhinoUserInterfaceRadioButton* CRhinoUserInterfaceRadioButton::CheckedButtonInGroup ( ) const

Description: The button in this button's group that is on, which can be this button. nullptr when nothing in the group has been turned on yet.

◆ ComputedRect()

ON_4fRect CRhinoUserInterfaceRadioButton::ComputedRect ( const CRhinoDisplayPipeline pipeline,
bool  logicalPixels 
) const
overridevirtual

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 from CRhinoUserInterfaceControl.

◆ ComputeSize()

ON_2fSize CRhinoUserInterfaceRadioButton::ComputeSize ( ) const
overridevirtual

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

Reimplemented from CRhinoUserInterfaceControl.

◆ Draw()

void CRhinoUserInterfaceRadioButton::Draw ( CRhinoDisplayPipeline dp)
overridevirtual

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 from CRhinoUserInterfaceObject.

◆ Group()

int CRhinoUserInterfaceRadioButton::Group ( ) const

Description: 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.

◆ IsMouseOver()

bool CRhinoUserInterfaceRadioButton::IsMouseOver ( const CRhinoMouseEventArgs mouse)
overridevirtual

Description: Return true if the input mouse is considered to be over this object

Reimplemented from CRhinoUserInterfaceObject.

◆ OnCharacter()

bool CRhinoUserInterfaceRadioButton::OnCharacter ( unsigned int  character,
unsigned int  flags 
)
overridevirtual

Description: Space turns on the button that has the focus.

Reimplemented from CRhinoUserInterfaceObject.

◆ OnCheckedChanged()

virtual void CRhinoUserInterfaceRadioButton::OnCheckedChanged ( )
virtual

Description: 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 base implementation does nothing.

◆ OnKeyboardFocusChanged()

void CRhinoUserInterfaceRadioButton::OnKeyboardFocusChanged ( bool  hasFocus)
overridevirtual

Description: Called when this object gains or loses keyboard focus. The base class implementation does nothing. KeyboardFocusReason says how focus arrived.

Reimplemented from CRhinoUserInterfaceObject.

◆ OnKeyDown()

bool CRhinoUserInterfaceRadioButton::OnKeyDown ( unsigned int  virtualKey,
unsigned int  flags 
)
overridevirtual

Description: The arrow keys move the focus, and the selection with it, to the next or previous button in the group, wrapping around at the ends.

Reimplemented from CRhinoUserInterfaceObject.

◆ OnMouseClick()

void CRhinoUserInterfaceRadioButton::OnMouseClick ( const CRhinoMouseEventArgs mouse)
overridevirtual

Description: Called when a mouse clicks on this UI element Parameters: mouse - mouse position, button and view

Reimplemented from CRhinoUserInterfaceObject.

◆ OnMouseDown()

void CRhinoUserInterfaceRadioButton::OnMouseDown ( const CRhinoMouseEventArgs mouse)
overridevirtual

Description: Called when a mouse button goes down over this UI element Parameters: mouse - mouse position, button and view

Reimplemented from CRhinoUserInterfaceObject.

◆ OnMouseEnter()

void CRhinoUserInterfaceRadioButton::OnMouseEnter ( const CRhinoMouseEventArgs mouse)
overridevirtual

Description: Called when first goes over this object (IsMouseOver returns true)

Reimplemented from CRhinoUserInterfaceObject.

◆ OnMouseLeave()

void CRhinoUserInterfaceRadioButton::OnMouseLeave ( const CRhinoMouseEventArgs mouse)
overridevirtual

Description: Called when mouse leaves this object (IsMouseOver returns false)

Reimplemented from CRhinoUserInterfaceObject.

◆ OnMouseUp()

void CRhinoUserInterfaceRadioButton::OnMouseUp ( const CRhinoMouseEventArgs mouse)
overridevirtual

Description: Called when a mouse button goes up over this UI element Parameters: mouse - mouse position, button and view

Reimplemented from CRhinoUserInterfaceObject.

◆ SetChecked()

void CRhinoUserInterfaceRadioButton::SetChecked ( bool  checked)

Description: Turn this button on or off. Turning it on turns off every other button in its group. Setting the state does not call OnCheckedChanged; that is only for a state the user changed. Turning the button that is on off leaves the group with nothing on, which is the state a group starts in.

◆ SetGroup()

void CRhinoUserInterfaceRadioButton::SetGroup ( int  group)