GuiCheckboxUtils Class Reference

#include <gui_checkbox_utils.h>

Detailed Description

Utility interface for checkbox gadget metrics and icon state mapping.

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

Note
Checkbox visuals are vector-based, so they scale cleanly with UI/font scaling.

Public Types

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

Public Member Functions

enum maxon::GuiCheckboxUtils::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 checkboxState)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (GuiCheckboxUtils, MAXON_REFERENCE_STATIC, "net.maxon.interface.guicheckboxutils")
 

Member Enumeration Documentation

◆ STATE

enum STATE : UChar
strong

Logical check state represented by a checkbox.

Enumerator
UNCHECKED 

The checkbox is unchecked.

CHECKED 

The checkbox is checked.

TRISTATE 

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

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( GuiCheckboxUtils  ,
MAXON_REFERENCE_STATIC  ,
"net.maxon.interface.guicheckboxutils"   
)
private

◆ GetBaseSize()

static MAXON_METHOD Int32 GetBaseSize ( )
static

Returns the unscaled base size used for the checkbox gadget.

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

◆ GetFontScaledSize()

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

Returns the size of a checkbox 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 checkbox gadget in pixels.

◆ MAXON_ENUM_LIST_CLASS()

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

◆ GetIconId()

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

Returns the icon resource identifier for a checkbox with the specified interaction and checkbox 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.
checkboxStateThe current checkbox state.
Returns
The corresponding icon resource identifier.