morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::testing::detail::FakeSlider Class Referencefinal

A fake SliderWidget: properties range (minimum..maximum/step), value. More...

#include <recording_backend.hpp>

Inheritance diagram for morph::ui::testing::detail::FakeSlider:
morph::ui::testing::detail::FakeField< SliderWidget > morph::ui::testing::detail::FakeLeaf< SliderWidget > morph::ui::SliderWidget morph::ui::FieldWidget morph::ui::Widget

Public Member Functions

void setRange (std::int64_t minimum, std::int64_t maximum, std::int64_t step) override
 Sets the range and the increment.
void setValue (std::int64_t value) override
 Shows a value. Never calls the onChange handler.
void setOnChange (std::function< void(std::int64_t)> onChange) override
 Sets what a user move calls, with the new value.
void setOnCommit (std::function< void(std::int64_t)> onCommit) override
 Sets what a finished move calls, with the value it ended on: a release after a drag, a key step, or a wheel step.
Public Member Functions inherited from morph::ui::testing::detail::FakeField< SliderWidget >
void setReadOnly (bool readonly) override
 Records property readonly; RecordingBackend's edits leave a read-only field alone.
void setRequired (bool required) override
 Records property required.
void setErrors (std::vector< std::string > const &errors) override
 Records property errors, as formatList gives the messages.
void setStale (bool stale) override
 Records property stale.
Public Member Functions inherited from morph::ui::testing::detail::FakeLeaf< SliderWidget >
 FakeLeaf (std::shared_ptr< RecordStore > store, std::string kind, ContainerWidget const *parent, PropList initial={})
 Records the new widget, appended to parent, and logs its creation.
 ~FakeLeaf () override
 Forgets the widget and logs its destruction; its remaining children become roots.
FakeLeaf & operator= (FakeLeaf const &)=delete
void setVisible (bool visible) override
 Records property visible.
void setEnabled (bool enabled) override
 Records property enabled.
void setLayout (LayoutHints const &hints) override
 Records property layout, as formatLayout gives it.
void setDragKey (std::optional< Key > const &key) override
 Records property dragKey and keeps the key for RecordingBackend::drag.
void setDropHandler (std::function< bool(Key const &)> accepts, std::function< void(Key)> onDrop) override
 Records property drop=handler and keeps both handlers for RecordingBackend::drag.
void setAccessibleName (std::string_view name) override
 Records property a11yName.
void setAccessibleRole (std::string_view role) override
 Records property a11yRole.
void setTestId (std::string_view testId) override
 Records property testId.
void setTooltip (std::string_view text) override
 Records property tooltip.
void setSurface (std::string_view surface) override
 Records property surface.
void setKeys (std::vector< std::string > const &chords, std::function< void(std::string)> onChord) override
 Records property keys, the chords joined by commas, and keeps the chords and the handler for RecordingBackend::press.
void focus () override
 Moves the backend's recorded focus here, and logs focus.
void setOnHover (std::function< void()> onHover) override
 Keeps the handler for RecordingBackend::hover.
Public Member Functions inherited from morph::ui::Widget
 Widget (Widget const &)=delete
Widget & operator= (Widget const &)=delete
 Widget (Widget &&)=delete
Widget & operator= (Widget &&)=delete

Additional Inherited Members

Protected Member Functions inherited from morph::ui::testing::detail::FakeLeaf< SliderWidget >
void set (std::string_view name, std::string value)
 Records a property set through a setter.
Callbacks & callbacks ()
 This widget's handlers.
RecordStore & store () const noexcept
 The store this widget records into.
std::shared_ptr< RecordStore > const & sharedStore () const noexcept
 The store, shared: what a part this widget makes (an overlay's footer) records into.
int id () const noexcept
 This widget's id.

Detailed Description

A fake SliderWidget: properties range (minimum..maximum/step), value.

Definition at line 1124 of file recording_backend.hpp.

Member Function Documentation

◆ setRange()

void morph::ui::testing::detail::FakeSlider::setRange ( std::int64_t minimum,
std::int64_t maximum,
std::int64_t step )
inlineoverridevirtual

Sets the range and the increment.

Parameters
minimumThe smallest value.
maximumThe largest value.
stepThe increment between neighbouring values.

Implements morph::ui::SliderWidget.

Definition at line 1127 of file recording_backend.hpp.

◆ setValue()

void morph::ui::testing::detail::FakeSlider::setValue ( std::int64_t value)
inlineoverridevirtual

Shows a value. Never calls the onChange handler.

Parameters
valueThe value.

Implements morph::ui::SliderWidget.

Definition at line 1130 of file recording_backend.hpp.

◆ setOnChange()

void morph::ui::testing::detail::FakeSlider::setOnChange ( std::function< void(std::int64_t)> onChange)
inlineoverridevirtual

Sets what a user move calls, with the new value.

Parameters
onChangeThe handler; empty does nothing.

Implements morph::ui::SliderWidget.

Definition at line 1131 of file recording_backend.hpp.

◆ setOnCommit()

void morph::ui::testing::detail::FakeSlider::setOnCommit ( std::function< void(std::int64_t)> onCommit)
inlineoverridevirtual

Sets what a finished move calls, with the value it ended on: a release after a drag, a key step, or a wheel step.

Parameters
onCommitThe handler; empty does nothing.

Implements morph::ui::SliderWidget.

Definition at line 1132 of file recording_backend.hpp.


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