morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::FilePickerWidget Class Referenceabstract

A file path field, in the mode fixed at creation. More...

#include <backend.hpp>

Inheritance diagram for morph::ui::FilePickerWidget:
morph::ui::FieldWidget morph::ui::Widget morph::ui::testing::detail::FakeLeaf< FilePickerWidget > morph::ui::testing::detail::FakeField< FilePickerWidget > morph::ui::testing::detail::FakeFilePicker

Public Member Functions

virtual void setPath (std::string_view path)=0
 Shows a path. Never calls the onPicked handler.
virtual void setOnPicked (std::function< void(std::string)> onPicked)=0
 Sets what a user pick calls, with the path.
Public Member Functions inherited from morph::ui::FieldWidget
virtual void setReadOnly (bool readonly)=0
 Makes the value read-only or editable again. A read-only field still takes focus and lets its text be selected, and reports no edit, submit or commit.
virtual void setRequired (bool required)=0
 Shows or clears the mark of a field that must be given.
virtual void setErrors (std::vector< std::string > const &errors)=0
 Replaces the messages shown with the field.
virtual void setStale (bool stale)=0
 Shows or clears the mark of a value that is being recomputed.
Public Member Functions inherited from morph::ui::Widget
 Widget (Widget const &)=delete
Widget & operator= (Widget const &)=delete
 Widget (Widget &&)=delete
Widget & operator= (Widget &&)=delete
virtual void setVisible (bool visible)=0
 Shows or hides the widget and everything inside it.
virtual void setEnabled (bool enabled)=0
 Enables or disables input on the widget and everything inside it.
virtual void setLayout (LayoutHints const &hints)=0
 Sets the size request.
virtual void setDragKey (std::optional< Key > const &key)=0
 Makes the widget draggable, carrying key, or not draggable.
virtual void setDropHandler (std::function< bool(Key const &)> accepts, std::function< void(Key)> onDrop)=0
 Makes the widget a drop target.
virtual void setAccessibleName (std::string_view name)=0
 Sets the name assistive technology reads for the widget.
virtual void setAccessibleRole (std::string_view role)=0
 Sets the role assistive technology announces for the widget.
virtual void setTestId (std::string_view testId)=0
 Sets the stable identifier an automated test finds the widget by.
virtual void setTooltip (std::string_view text)=0
 Sets the text shown while the pointer rests on the widget.
virtual void setSurface (std::string_view surface)=0
 Styles the widget and everything inside it with a named token set of the theme.
virtual void setKeys (std::vector< std::string > const &chords, std::function< void(std::string)> onChord)=0
 Declares the keyboard chords the widget handles while focus is inside it.
virtual void focus ()=0
 Moves keyboard focus to the widget.
virtual void setOnHover (std::function< void()> onHover)
 Calls onHover each time the pointer comes to rest over the widget. A backend without a pointer, or one that does not report hovering, keeps the default, which never calls it: hovering is a hint, such as a prefetch, never something a widget relies on.

Detailed Description

A file path field, in the mode fixed at creation.

Definition at line 574 of file backend.hpp.

Member Function Documentation

◆ setPath()

virtual void morph::ui::FilePickerWidget::setPath ( std::string_view path)
pure virtual

Shows a path. Never calls the onPicked handler.

Parameters
pathThe path, UTF-8.

Implemented in morph::ui::testing::detail::FakeFilePicker.

◆ setOnPicked()

virtual void morph::ui::FilePickerWidget::setOnPicked ( std::function< void(std::string)> onPicked)
pure virtual

Sets what a user pick calls, with the path.

Parameters
onPickedThe handler; empty does nothing.

Implemented in morph::ui::testing::detail::FakeFilePicker.


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