navigate.view.custom_widgets.validation.ValidatedMixin
- class navigate.view.custom_widgets.validation.ValidatedMixin(*args, error_var=None, **kwargs)
Bases:
object
Validation functions
These functions are used to validate the input of the widget. They are called by the validatecommand attribute of the widget. They return True if the input is valid and False if it is not. They also set the error string to be displayed in the widget.
- __init__(*args, error_var=None, **kwargs)
Initialize the ValidatedMixin
- Parameters:
*args – Variable length argument list
error_var (tk.StringVar) – The variable to store the error message in if error_var = None, creates its own variable
**kwargs – Keyword arguments to pass to the parent class
Methods
__init__
(*args[, error_var])Initialize the ValidatedMixin
add_history
(event)Add the current value to the history of the widget.
redo
(event)Redo the last change that was undone.
Trigger the focusout validation of the widget
undo
(event)Undo the last change to the widget.
Attributes
The variable to store the error message in
The undo history of the widget
The redo history of the widget
The hover bubble for the widget
- add_history(event)
Add the current value to the history of the widget.
- Parameters:
event (tk.Event) – The event that triggered the history addition
- redo(event)
Redo the last change that was undone.
- Parameters:
event (tk.Event) – The event that triggered the redo
- trigger_focusout_validation()
Trigger the focusout validation of the widget
- undo(event)
Undo the last change to the widget.
- Parameters:
event (tk.Event) – The event that triggered the undo
- error
The variable to store the error message in
- Type:
tk.StringVar
- redo_history
The redo history of the widget
- Type:
list
- undo_history
The undo history of the widget
- Type:
list