GuiRadioButtonUtils Class Reference

#include <gui_radio_button_utils.h>

Detailed Description

Utility interface for radio button gadget metrics and icon state mapping.

Provides helpers to compute font-scaled radio button sizes and to resolve radio button icon resource IDs from hover, focus, disabled, and radio button states.

Note
Radio button visuals are vector-based, so they scale cleanly with UI/font scaling.
Radio buttons have no tristate: only UNCHECKED and CHECKED are valid states.
The checked state has no hover icon; hover only applies to the unchecked state.

Public Types

enum class  STATE : UChar {
  UNCHECKED ,
  CHECKED ,
  TRISTATE
}
 

Public Member Functions

enum maxon::GuiRadioButtonUtils::STATE UChar MAXON_ENUM_LIST_CLASS (STATE)
 

Static Public Member Functions

static MAXON_METHOD Int32 GetBaseSize ()
 
static MAXON_METHOD Int32 GetFontScaledSize (Opt< Float > fontSize={})
 
static MAXON_METHOD Int32 GetIconId (Bool isHovered, Bool isFocused, Bool isDisabled, STATE radioButtonState)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (GuiRadioButtonUtils, MAXON_REFERENCE_STATIC, "net.maxon.interface.guiradiobuttonutils")
 

Member Enumeration Documentation

◆ STATE

enum STATE : UChar
strong

Logical check state represented by a radio button.

Enumerator
UNCHECKED 

The radio button is unchecked.

CHECKED 

The radio button is checked.

TRISTATE 

The radio button is in an indeterminate state (e.g., partially checked).

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( GuiRadioButtonUtils  ,
MAXON_REFERENCE_STATIC  ,
"net.maxon.interface.guiradiobuttonutils"   
)
private

◆ GetBaseSize()

static MAXON_METHOD Int32 GetBaseSize ( )
static

Returns the unscaled base size used for the radio button gadget.

Note
GetFontScaledSize is the preferred way to retrieve radio button size for UI usage because it applies font scaling.
Returns
The base radio button size in pixels (currently 14).

◆ GetFontScaledSize()

static MAXON_METHOD Int32 GetFontScaledSize ( Opt< Float >  fontSize = {})
static

Returns the size of a radio button gadget, scaled according to the optional font size.

Parameters
fontSizeOptional font size override; if omitted, uses the font size defined in preferences.
Returns
The font scaled size of a radio button gadget in pixels.

◆ MAXON_ENUM_LIST_CLASS()

enum maxon::GuiRadioButtonUtils::STATE UChar MAXON_ENUM_LIST_CLASS ( STATE  )

◆ GetIconId()

static MAXON_METHOD Int32 GetIconId ( Bool  isHovered,
Bool  isFocused,
Bool  isDisabled,
STATE  radioButtonState 
)
static

Returns the icon resource identifier for a radio button with the specified interaction and radio button states.

Parameters
isHoveredTrue if the mouse cursor is hovering over the gadget.
isFocusedTrue if the gadget has keyboard focus.
isDisabledTrue if the gadget is disabled. Takes priority over hover and focus.
radioButtonStateThe current radio button state.
Returns
The corresponding icon resource identifier.