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

UI-affine owner of the editor source and nonfocusable arrow actions. More...

#include <spin_box.hpp>

Public Member Functions

 ~SpinBoxBinding ()
 Disconnect future input/data delivery; admitted callbacks retain their owners.
 SpinBoxBinding (SpinBoxBinding &&other) noexcept
SpinBoxBinding & operator= (SpinBoxBinding &&other) noexcept
 SpinBoxBinding (const SpinBoxBinding &)=delete
SpinBoxBinding & operator= (const SpinBoxBinding &)=delete
std::expected< void, TreeError > sync (Node< Widget > focused)
std::expected< SpinBoxResult, TreeError > setValue (double value)

Friends

class ManagedScene
std::expected< SpinBoxBinding, TreeError > bindSpinBox (WidgetTree &tree, EventRouter &router, Node< LineEdit > editor, Node< Button > decrease, Node< Button > increase, std::shared_ptr< Property< NumericValue > > model, std::uint64_t pageSteps, std::function< void(SpinBoxResult)> result, LineEditEvents events={})
 Bind pre-mounted editor/decrement/increment children of one SpinBox.

Detailed Description

UI-affine owner of the editor source and nonfocusable arrow actions.

Constructor & Destructor Documentation

◆ SpinBoxBinding()

portals::SpinBoxBinding::SpinBoxBinding ( SpinBoxBinding && other)
noexcept
Parameters
otherToken transferred on UI outside frames.

Member Function Documentation

◆ operator=()

SpinBoxBinding & portals::SpinBoxBinding::operator= ( SpinBoxBinding && other)
noexcept
Parameters
otherToken replacing this binding on UI outside frames.
Returns
This token.

◆ setValue()

std::expected< SpinBoxResult, TreeError > portals::SpinBoxBinding::setValue ( double value)
Parameters
valueFinite in-range replacement, following the editor's EditMode.
Returns
Exact draft/commit observation or a pre-accept error. Read-only permits programmatic changes.

◆ sync()

std::expected< void, TreeError > portals::SpinBoxBinding::sync ( Node< Widget > focused)
Parameters
focusedCurrent router focus.
Returns
Existing checked editor synchronization result.

◆ bindSpinBox

std::expected< SpinBoxBinding, TreeError > bindSpinBox ( WidgetTree & tree,
EventRouter & router,
Node< LineEdit > editor,
Node< Button > decrease,
Node< Button > increase,
std::shared_ptr< Property< NumericValue > > model,
std::uint64_t pageSteps,
std::function< void(SpinBoxResult)> result,
LineEditEvents events = {} )
friend

Bind pre-mounted editor/decrement/increment children of one SpinBox.

Parameters
treeBorrowed UI tree outliving the binding.
routerBorrowed matching router.
editorThe single ordinary editor.
decreaseNonfocusable plain decrement button.
increaseNonfocusable plain increment button.
modelRequired authoritative numeric source.
pageStepsPositive number of increments per PageUp/PageDown.
resultRequired owning result observer; callbacks may remove nodes or destroy the binding.
eventsExisting typed text and confirmation observations.
Returns
Scoped binding or the original typed admission/allocation error.

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