TermOx
Classes | Public Member Functions | Protected Member Functions | List of all members
ox::Password_edit Class Reference

A Line_edit that veils the input characters so the contents are hidden. More...

#include <password_edit.hpp>

Inheritance diagram for ox::Password_edit:
ox::Line_edit ox::detail::Textline_base ox::Widget

Classes

struct  Parameters
 

Public Member Functions

 Password_edit (Glyph veil=U' *', bool show_contents=false)
 
 Password_edit (Parameters p)
 
void set_veil (Glyph x)
 Set the Glyph that is show in place of the actual input Glyphs.
 
auto veil () const -> Glyph
 Return the currently set veil.
 
void show_contents (bool enable)
 Display each input char instead of veil if enable is true.
 
auto shows_contents () const -> bool
 Return true if input chars are not hidden.
 
- Public Member Functions inherited from ox::Line_edit
 Line_edit (Glyph_string initial_text=U"", Align alignment=Align::Left, Action focus_in_action=Action::None, std::optional< Validator_t > validator=std::nullopt)
 
 Line_edit (Parameters p)
 
void set_validator (std::optional< Validator_t > x)
 Set the input validator, allowing or disallowing specific char values. More...
 
void disable_validator ()
 Turn off the validator so all text input is valid.
 
auto validator () const noexcept -> std::optional< Validator_t > const &
 Return the current validator function object, or nullopt if not set.
 
- Public Member Functions inherited from ox::detail::Textline_base
 Textline_base (ox::Glyph_string initial=U"", ox::Align align=ox::Align::Left, Action focus_in_action=Action::None)
 
 Textline_base (Parameters p)
 
void set_text (ox::Glyph_string x)
 Clear and reset the text being displayed.
 
auto text () const noexcept -> ox::Glyph_string const &
 Return the full text contents.
 
void set_alignment (ox::Align x)
 Set either Left or Right Alignment, asserts with other alignments.
 
auto alignment () const noexcept -> ox::Align
 Return the current alignment.
 
void set_focus_in_action (Action x)
 Set the Action that occurs on focus in events.
 
void clear_on_focus ()
 Clear the text on focus in event, restoring if nothing edited.
 
void nothing_on_focus ()
 Does nothing on focus in event.
 
auto focus_in_action () const noexcept -> Action
 Return the currently used focus in event Action.
 
void set_cursor_to_index (int i)
 Set the Cursor to the Glyph in text at index .
 
- Public Member Functions inherited from ox::Widget
 Widget (std::string name="", Focus_policy focus_policy_=Focus_policy::None, Size_policy width_policy_=Size_policy{}, Size_policy height_policy_=Size_policy{}, Brush brush_=Brush{}, Glyph wallpaper=U' ', bool brush_paints_wallpaper=true, Cursor cursor=Cursor{})
 Create an empty Widget.
 
 Widget (Parameters p)
 Create an empty Widget.
 
 Widget (Widget const &)=delete
 
 Widget (Widget &&)=delete
 
Widgetoperator= (Widget const &)=delete
 
Widgetoperator= (Widget &&)=delete
 
void set_name (std::string name)
 Set the identifying name of the Widget.
 
auto name () const -> std::string const &
 Return the name of the Widget.
 
auto unique_id () const -> std::uint16_t
 Return the ID number unique to this Widget.
 
void set_wallpaper (Glyph g)
 Used to fill in empty space that is not filled in by paint_event().
 
auto get_wallpaper () const -> Glyph
 Return the currently in use wallpaper or std::nullopt if none.
 
void enable (bool enable=true)
 Enable this Widget and send an Enable_event to itself. More...
 
void disable (bool disable=true)
 Disable this Widget and send a Disable_event to itself. More...
 
auto is_enabled () const -> bool
 Check whether the Widget is enabled.
 
auto parent () const -> Widget *
 Return the Widget's parent pointer. More...
 
auto top_left () const -> Point
 Return the global top left corner of this widget.
 
auto area () const -> Area
 Return the area the widget occupies.
 
virtual void update ()
 Post a paint event to this Widget.
 
virtual auto is_layout_type () const -> bool
 
void install_event_filter (Widget &filter)
 Install another Widget as an Event filter. More...
 
void remove_event_filter (Widget &filter)
 Remove a Widget from the Event filter list. More...
 
auto get_event_filters () const -> std::set< Widget * > const &
 Return the list of Event filter Widgets.
 
void enable_animation (std::chrono::milliseconds interval)
 Enable animation on this Widget. More...
 
void enable_animation (FPS fps)
 Enable animation with a frames-per-second value.
 
void disable_animation ()
 Turn off animation, no more Timer_events will be sent to this Widget. More...
 
auto is_animated () const -> bool
 Return true if this Widget has animation enabled.
 
auto get_children ()
 Get a range containing Widget& to each child.
 
auto get_children () const
 Get a const range containing Widget& to each child.
 
auto get_descendants () const -> std::vector< Widget * >
 Return container of all descendants of self_.
 
void paint_wallpaper_with_brush (bool paints=true)
 Set if the brush is applied to the wallpaper Glyph.
 
auto paints_wallpaper_with_brush () const -> bool
 If true, the brush will apply to the wallpaper Glyph.
 
auto generate_wallpaper () const -> Glyph
 Return the wallpaper Glyph. More...
 
auto get_child_offset () const -> std::size_t
 Return the index of the first child displayed by this Widget.
 
auto child_count () const -> std::size_t
 Return the number of children held by this Widget.
 
virtual auto enable_event () -> bool
 Handles Enable_event objects.
 
virtual auto disable_event () -> bool
 Handles Disable_event objects.
 
virtual auto child_added_event (Widget &child) -> bool
 Handles Child_added_event objects.
 
virtual auto child_removed_event (Widget &child) -> bool
 Handles Child_removed_event objects.
 
virtual auto child_polished_event (Widget &child) -> bool
 Handles Child_polished_event objects.
 
virtual auto move_event (Point new_position, Point old_position) -> bool
 Handles Move_event objects.
 
virtual auto mouse_release_event (Mouse const &m) -> bool
 Handles Mouse_release_event objects.
 
virtual auto mouse_wheel_event (Mouse const &m) -> bool
 Handles Mouse_wheel_event objects.
 
virtual auto mouse_move_event (Mouse const &m) -> bool
 Handles Mouse_move_event objects.
 
virtual auto key_release_event (Key k) -> bool
 Handles Key_release_event objects. More...
 
virtual auto delete_event () -> bool
 Handles Delete_event objects.
 
virtual auto timer_event () -> bool
 Handles Timer_event objects.
 
virtual auto enable_event_filter (Widget &receiver) -> bool
 Handles Enable_event objects filtered from other Widgets.
 
virtual auto disable_event_filter (Widget &receiver) -> bool
 Handles Disable_event objects filtered from other Widgets.
 
virtual auto child_added_event_filter (Widget &receiver, Widget &child) -> bool
 Handles Child_added_event objects filtered from other Widgets.
 
virtual auto child_removed_event_filter (Widget &receiver, Widget &child) -> bool
 Handles Child_removed_event objects filtered from other Widgets.
 
virtual auto child_polished_event_filter (Widget &receiver, Widget &child) -> bool
 Handles Child_polished_event objects filtered from other Widgets.
 
virtual auto move_event_filter (Widget &receiver, Point new_position, Point old_position) -> bool
 Handles Move_event objects filtered from other Widgets.
 
virtual auto resize_event_filter (Widget &receiver, Area new_size, Area old_size) -> bool
 Handles Resize_event objects filtered from other Widgets.
 
virtual auto mouse_press_event_filter (Widget &receiver, Mouse const &m) -> bool
 Handles Mouse_press_event objects filtered from other Widgets.
 
virtual auto mouse_release_event_filter (Widget &receiver, Mouse const &m) -> bool
 Handles Mouse_release_event objects filtered from other Widgets.
 
virtual auto mouse_wheel_event_filter (Widget &receiver, Mouse const &m) -> bool
 Handles Mouse_wheel_event objects filtered from other Widgets.
 
virtual auto mouse_move_event_filter (Widget &receiver, Mouse const &m) -> bool
 Handles Mouse_move_event objects filtered from other Widgets.
 
virtual auto key_press_event_filter (Widget &receiver, Key k) -> bool
 Handles Key_press_event objects filtered from other Widgets.
 
virtual auto key_release_event_filter (Widget &receiver, Key k) -> bool
 Handles Key_release_event objects filtered from other Widgets.
 
virtual auto focus_in_event_filter (Widget &receiver) -> bool
 Handles Focus_in_event objects filtered from other Widgets.
 
virtual auto focus_out_event_filter (Widget &receiver) -> bool
 Handles Focus_out_event objects filtered from other Widgets.
 
virtual auto delete_event_filter (Widget &receiver) -> bool
 Handles Delete_event objects filtered from other Widgets.
 
virtual auto paint_event_filter (Widget &receiver, Painter &p) -> bool
 Handles Paint_event objects filtered from other Widgets.
 
virtual auto timer_event_filter (Widget &receiver) -> bool
 Handles Timer_event objects filtered from other Widgets.
 
void set_top_left (Point p)
 Should only be used by Move_event send() function.
 
void set_area (Area a)
 Should only be used by Resize_event send() function.
 
void set_parent (Widget *parent)
 Should only be used by Layout.
 

Protected Member Functions

auto paint_event (Painter &p) -> bool
 Handles Paint_event objects.
 
- Protected Member Functions inherited from ox::Line_edit
auto key_press_event (ox::Key k) -> bool override
 Handles Key_press_event objects.
 
auto focus_out_event () -> bool override
 Handles Focus_out_event objects.
 
- Protected Member Functions inherited from ox::detail::Textline_base
auto mouse_press_event (ox::Mouse const &m) -> bool override
 Handles Mouse_press_event objects.
 
auto resize_event (ox::Area new_size, ox::Area old_size) -> bool override
 Handles Resize_event objects.
 
auto focus_in_event () -> bool override
 Handles Focus_in_event objects.
 

Additional Inherited Members

- Public Types inherited from ox::Line_edit
using Validator_t = std::function< bool(char32_t)>
 
- Public Types inherited from ox::detail::Textline_base
enum class  Action { None , Clear }
 
- Public Attributes inherited from ox::Line_edit
sl::Signal< void(std::string const &)> submitted
 Emitted on Enter key press, sends along the current contents.
 
sl::Signal< void(std::string const &)> text_modified
 Emitted on every printable key press, sends along the current contents.
 
- Public Attributes inherited from ox::Widget
Signal< void()> enabled
 
Signal< void()> disabled
 
Signal< void(Widget &)> child_added
 
Signal< void(Widget &)> child_removed
 
Signal< void(Widget &)> child_polished
 
Signal< void(Point, Point)> moved
 
Signal< void(Area, Area)> resized
 
Signal< void(Mouse const &)> mouse_pressed
 
Signal< void(Mouse const &)> mouse_released
 
Signal< void(Mouse const &)> mouse_wheel_scrolled
 
Signal< void(Mouse const &)> mouse_moved
 
Signal< void(Key)> key_pressed
 
Signal< void(Key)> key_released
 
Signal< void()> focused_in
 
Signal< void()> focused_out
 
Signal< void()> deleted
 
Signal< void(Painter &)> painted
 
Signal< void()> timer
 
Signal< bool(Widget &)> enabled_filter
 
Signal< bool(Widget &)> disabled_filter
 
Signal< bool(Widget &, Widget &)> child_added_filter
 
Signal< bool(Widget &, Widget &)> child_removed_filter
 
Signal< bool(Widget &, Widget &)> child_polished_filter
 
Signal< bool(Widget &, Point, Point)> moved_filter
 
Signal< bool(Widget &, Area, Area)> resized_filter
 
Signal< bool(Widget &, Mouse const &)> mouse_pressed_filter
 
Signal< bool(Widget &, Mouse const &)> mouse_released_filter
 
Signal< bool(Widget &, Mouse const &)> mouse_wheel_scrolled_filter
 
Signal< bool(Widget &, Mouse const &)> mouse_moved_filter
 
Signal< bool(Widget &, Key)> key_pressed_filter
 
Signal< bool(Widget &, Key)> key_released_filter
 
Signal< bool(Widget &)> focused_in_filter
 
Signal< bool(Widget &)> focused_out_filter
 
Signal< bool(Widget &)> deleted_filter
 
Signal< bool(Widget &, Painter &)> painted_filter
 
Signal< bool(Widget &)> timer_filter
 
Focus_policy focus_policy
 Describes how focus is given to this Widget.
 
Cursor cursor
 Provides information on where the cursor is and if it is enabled.
 
Size_policy width_policy
 Describes how the width of this Widget should be modified by a Layout.
 
Size_policy height_policy
 Describes how the height of this Widget should be modified by a Layout.
 
Brush brush
 A Brush that is applied to every Glyph painted by this Widget.
 
sl::Lifetime lifetime
 Slots can track this object's lifetime to disable Slot invocations.
 
- Protected Types inherited from ox::Widget
using Children_t = std::vector< std::unique_ptr< Widget > >
 
- Protected Attributes inherited from ox::detail::Textline_base
Textline_core core_
 
- Protected Attributes inherited from ox::Widget
Children_t children_
 
std::size_t child_offset_ = 0
 

Detailed Description

A Line_edit that veils the input characters so the contents are hidden.

Does not provide a validator, bad chars in a password should be caught after submission; Does not provide Alignment choice, always left aligned; Does not provide focus in action.


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