Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::RadioGroup Class Reference

Ordinary one-focus-stop, model-owned resident radio group with clipped row painting. More...

#include <radio_group.hpp>

Inheritance diagram for portals::RadioGroup:
portals::RadioGroupportals::RadioGroup portals::SizedWidget portals::Widget portals::LayoutItem

Public Member Functions

 RadioGroup (ControlStyle style={}, SizePolicy policy=DEFAULT_CONTENT_POLICY, bool readOnly=false, WidthPolicy widthPolicy={}, RadioSelectionMode selectionMode=RadioSelectionMode::ON_ACTIVATION)
 RadioGroup (const RadioGroup &)=delete
 Tree-owned widgets cannot copy their live geometry context.
RadioGroup & operator= (const RadioGroup &)=delete
 Tree-owned widgets cannot be assigned.
 RadioGroup (RadioGroup &&)=delete
 A bound widget's address and tree identity remain fixed.
RadioGroup & operator= (RadioGroup &&)=delete
 A bound widget cannot transfer its tree context.
std::expected< CellSize, TreeError > measure (CellSize available) override
std::expected< void, TreeError > arrange (CellRect local) override
std::expected< void, TreeError > paint (PaintContext &context) override
ComputedStyle styleDefaults () const override
bool styleReadOnly () const noexcept override
RadioGroupValue value () const
Public Member Functions inherited from portals::SizedWidget
 SizedWidget (SizePolicy policy={})
 Own the supplied policies; checked by layout.
SizePolicy sizePolicy () const override
 Copy current policy without borrowing storage.
Public Member Functions inherited from portals::Widget
virtual ~Widget ()=default
 Destroy on UI after the last active tree borrow.
virtual void mount ()
 Called exactly once after attachment; exceptions are reported.
virtual void unmount ()
 Called once before destruction, children first; cleanup continues on exceptions.
const std::shared_ptr< const StyleSnapshot > & computedStyle () const noexcept
 Inspect the last atomically installed theme inside tree.read/frame.
std::uint64_t styleRevision () const noexcept
Public Member Functions inherited from portals::LayoutItem
virtual ~LayoutItem ()=default
 Destroy with the implementing widget.

Friends

class RadioGroupBinding
std::expected< void, TreeError > syncRadioGroup (WidgetTree &tree, Node< RadioGroup > node, Node< Widget > focused)

Detailed Description

Ordinary one-focus-stop, model-owned resident radio group with clipped row painting.

Constructor & Destructor Documentation

◆ RadioGroup()

portals::RadioGroup::RadioGroup ( ControlStyle style = {},
SizePolicy policy = DEFAULT_CONTENT_POLICY,
bool readOnly = false,
WidthPolicy widthPolicy = {},
RadioSelectionMode selectionMode = RadioSelectionMode::ON_ACTIVATION )
explicit
Parameters
styleManual normal/focused/disabled defaults.
policyOrdinary cell sizing constraints.
readOnlyProhibit user writes while retaining focus, navigation and programmatic changes.
selectionModeKeyboard navigation publication policy.
widthPolicyReceiving scene's complete width policy; mismatched model text is rejected at sync.

Member Function Documentation

◆ arrange()

std::expected< void, TreeError > portals::RadioGroup::arrange ( CellRect local)
overridevirtual
Parameters
localParent-relative allocation.
Returns
Success or INVALID_GEOMETRY before changing bounds.

Reimplemented from portals::Widget.

◆ measure()

std::expected< CellSize, TreeError > portals::RadioGroup::measure ( CellSize available)
overridevirtual
Parameters
availableOffered extent; intrinsic size uses prepared visible rows.
Returns
Cached natural cell size, without reading or formatting the model.

Reimplemented from portals::Widget.

◆ paint()

std::expected< void, TreeError > portals::RadioGroup::paint ( PaintContext & context)
overridevirtual
Parameters
contextSynchronous sink borrowing commands through the enclosing tree frame.
Returns
Original geometry/sink error; no model access or user callback occurs here. Bound groups visit only cumulative clipped rows; an unbound group is empty and uses its local allocation.

Reimplemented from portals::Widget.

◆ styleDefaults()

ComputedStyle portals::RadioGroup::styleDefaults ( ) const
overridevirtual
Returns
Owning manual defaults; selected markers inherit focused beneath theme layers.

Reimplemented from portals::Widget.

◆ styleReadOnly()

bool portals::RadioGroup::styleReadOnly ( ) const
overridevirtualnoexcept
Returns
Actual view-only policy for orthogonal style matching.

Reimplemented from portals::Widget.

◆ value()

RadioGroupValue portals::RadioGroup::value ( ) const
Returns
Last synchronized immutable presentation; the bound Property remains authoritative.

◆ syncRadioGroup

std::expected< void, TreeError > syncRadioGroup ( WidgetTree & tree,
Node< RadioGroup > node,
Node< Widget > focused )
friend
Parameters
treeBorrowed UI owner.
nodeLive group.
focusedCurrent router focus.
Returns
Eligibility/focus paint synchronization or original tree error.

The documentation for this class was generated from the following file: