biometrics_tracker.gui.widgets module
- class biometrics_tracker.gui.widgets.BloodGlucoseWidget(*args: Any, **kwargs: Any)
Bases:
MetricWidget
A widget that allows the entry of a Blood Glucose datapoint
- check_change(event)
Check to see if the widgets metric value has been changed
- Parameters
event (tkinter.Event) –
- Returns
None
- focus_set() None
Sets the focus on the bg_entry field when the focus_set method on the widget is called
- Returns
None
- get_value() int
Returns the blood glucose value
- Returns
int blood glucose value
- Return type
int
- zero_value() None
Zeros the blood glucose value and set the note to an empty string
- Returns
None
- class biometrics_tracker.gui.widgets.BloodPressureWidget(*args: Any, **kwargs: Any)
Bases:
MetricWidget
A widget that allows the entry of a Blood Pressure datapoint
- check_change(event)
Check to see if the widgets metric value has been changed :param event: :return: None
- focus_set() None
Sets the focus on the systolic_entry field when the focus_set method of the widget is called :return: None
- get_value() -> (<class 'int'>, <class 'int'>)
Returns the systolic and diastolic values entered to the widget :return: tuple(int, int) representing the systolic and diastolic values
- static label_width(text: str, min_width: int) int
Calculates a width for the label based on the label text and a minumum width
- Parameters
text (str) – the label test
min_width (int) – the minimum label width
- ReFturn
the calculated label width
- Return type
int
- zero_value() None
Zeros the systolic and diastolic values and set the note to an empty string :return: None
- class biometrics_tracker.gui.widgets.BodyTempWidget(*args: Any, **kwargs: Any)
Bases:
MetricWidget
A widget that allows the entry of a Body Temperature datapoint
- check_change(event)
Check to see if the widgets metric value has been changed :param event: :return: None
- focus_set() None
Sets the focus on the temp_entry field when the focus_set methold on the widget is called :return: None
- get_value() Decimal
Returns the body temperature value :return: Decimal body temperature
- zero_value() None
Zeros the body temperature value and set the note to an empty string :return: None
- class biometrics_tracker.gui.widgets.BodyWeightWidget(*args: Any, **kwargs: Any)
Bases:
MetricWidget
A widget that allows the entry of a Body Weight datapoint
- check_change(event)
Check to see if the widgets metric value has been changed :param event: :return: None
- focus_set() None
Sets the value widget in focus when the focus_set method on the widget is called :return: None
- get_value() Decimal
Returns the body weight value :return: Decimal body weight value
- zero_value() None
Zeros the body weight value and set the note to an empty string :return: None
- class biometrics_tracker.gui.widgets.Checkbutton(*args: Any, **kwargs: Any)
Bases:
Checkbutton
Subclass of ttkbootstrap.Checkbutton that changes it appears when it is in focus, so that the user can tell when that can use the space bar to select or unselect a checkbox
- focus_in(event)
Handler for the <FocusIn> event. Changes config parm bootstyle to ‘toolbutton’ :param event: :return: None
- focus_out(event)
Handler for the <FocusOut> event. Changes config parm bootstyle to ‘primary’ :param event: :return:
- class biometrics_tracker.gui.widgets.DailyScheduleWidget(*args: Any, **kwargs: Any)
Bases:
ScheduleWidget
A widget to present and modify the info related to ScheduleEntry instances with a Daily frequency
- get_schedule_entry() ScheduleEntry
Create and return an instance of ScheduleEntry
- Parameters
self –
- Returns
the created instance
- Return type
- class biometrics_tracker.gui.widgets.DataPointTypeComboWidget(*args: Any, **kwargs: Any)
Bases:
Frame
A ComboBox for selecting an option from a list of DataPointType enum values
- get_dp_type() DataPointType
Returns the DataPointType selected by the user
- Returns
biometrics_tracker.model.datapoints.DataPointType
- retrieve_selection(event)
Retrieve the selection and convert it to a DataPointType. The values used for the list are the returned value from the label method of the corresponding container class. For instance, the value for DataPointType.BG selection comes from BloodGlucose.label()
- Parameters
event –
- Returns
None
- set_selection(dp_type: DataPointType)
Set the selected item in the list of DataPointType enums. This method performs the inverse of the operation performed by the retrieve_selection method
- Parameters
dp_type (biometrics_tracker.model.datapoints.DataPointType) – The DataPointType enum value to be set
- Returns
None
- class biometrics_tracker.gui.widgets.DataPointTypeWidget(parent, dp_type: DataPointType, uom: UOM, tracked: bool)
Bases:
Frame
A widget that contains a checkbox and a gui.widgets.UOMRadioWidget. The radio button group is disabled unless the checkbox is checked. This widget is used on gui.tk_gui.PersonFrame to allow the selection of tracked metrics and a selection of the u.o.m to be used for the metric
- focus_set() None
Sets the focus on the check_btn field when the focus_set method on the DataPointTypeWidget is called
- Returns
None
- set_tracked()
Retrieves the variable value for the checkbox. If the box is checked, the u.o.m radio buttons are enabled, otherwise they are disabled :return: None
- class biometrics_tracker.gui.widgets.DataPointWidget(*args: Any, **kwargs: Any)
Bases:
Frame
A frame that contains DataPoint Taken date and time and a MetricWidget subclass to allow editing of DataPoint info
- focus_set() None
Delete focus_set calls to the Taken date
- Returns
None
- get_datapoint() DataPoint
Return a DataPoint objects whose values are taken from the prompt values
- Returns
a Datapoint
- Return type
biometrics_tracker.model.datapoint.DataPoint
- get_metric_widget() Union[BloodPressureWidget, PulseWidget, BloodGlucoseWidget, BodyWeightWidget, BodyTempWidget]
Returns the MetricWidget subclass contained in the Frame
- Returns
a MetricWidget subclass
- Return type
Union[BloodPressureWidget, PulseWidget, BloodGlucoseWidget, BodyWeightWidget, BodyTempWidget]
- get_taken() datetime
Returns a datetime created from the values fo the Taken date and time widgets
- Returns
the Taken datetime
- Return type
datetime.datetime
- is_changed() bool
Have the edit prompt values been changed
- Returns
True if there have been changes
- Return type
bool
- class biometrics_tracker.gui.widgets.DateWidget(*args: Any, **kwargs: Any)
Bases:
Frame
A general purpose date entry widget
- clear_key_count(event)
Sets the keystroke counter to 0. This method is bound to the <FocusIn> event for the month, day and year fields :param event: :return: None
- day_keypress(event)
Tracks the keystrokes entered to the day field, puts the year entry field in focus after two keystrokes. This method is bound to the <KeyPress> event of the day entry field. :param event: :return: None
- disable() None
Disables the month, day and year fields
- Returns
None
- enable() None
Enables the month, day and year fields
- Returns
None
- focus_set() None
Delegates focus_set to the month entry
- Returns
None
- get_date() Optional[date]
Build a date value from the values entered to the month, day and year entry fields.
- Returns
datetime.date instance
- month_keypress(event)
Tracks the keystrokes entered to the month field, puts the day entry field in focus after two keystrokes. This method is bound to the <KeyPress> event of the month field. :param event: :return: None
- select_range(start, end)
Delegates select range functionality to the month entry field :param start: :param end: :return:
- set_date(date_value: date)
Set the month, day and year field from the provided date
- Parameters
date_value (date) – the new value for the date widget
- Returns
None
- set_next_entry(entry) None
Establishes the widget to focus on when the Tab key is pressed in the Year field
- Parameters
entry –
- Returns
None
- set_prev_entry(entry) None
Establishes the widget to focus on when the Back Tab key is pressed in the Month field
- Parameters
entry –
- Returns
None
- validate_date(event)
Validates the month, day and year elements of the date and presents a Messagebox if any is invalid This method is bound to the Focus Out event of the year entry field. :param event: :return: None
- year_keypress(event)
Tracks the keystrokes entered to the year field, puts the next entry field on the GUI in focus after two keystrokes. This method is bound to the <KeyPress> event of the year entry field. :param event: :return: None
- class biometrics_tracker.gui.widgets.DaysOfMonthManager(parent, month: int, year: int, column: int, row: int, columnspan: int = 1, allow_navigation: bool = False)
Bases:
object
Manages a DaysOfMonthWidget by handling navigation (if it is specified) and collecting the days checked for each month.
- disable()
Delegate disable to the widget
- Returns
None
- enable()
Delegate enable to the widget
- Returns
None
- focus_set()
Pass focus_set calls through to the widget :return:
- get_days_of_months() dict[slice((<class 'int'>, <class 'int'>), list[int], None)]
Returns the dict containing the days of the months that were checked. Before returning, the entries for months in which no boxes where checked are removed from the dict.
- Returns
DaysOfMonthsType (dict[[int, int]: list[int]]
- next_month()
Next month navigation handler. Prior to navigation, the checkboxes for the current month are collect and placed in a dictionary keyed by year and month. After the new widget is created, the values collected
(if any) when the month was navigated away from are used to preset the checkboxes
- return
None
- prev_month()
Previous month navigation handler. Prior to navigation, the checkboxes for the current month are collect and placed in a dictionary keyed by year and month. After the new widget is created, the values collected (if any) when the month was navigated away from are used to preset the checkboxes
- Returns
None
- set_days_of_months(doms: dict[slice((<class 'int'>, <class 'int'>), list[int], None)])
Set the initial checked state
- Parameters
doms (biometrics_tracker.gui.widgets.DaysOfMonthsType) – the map of the days of months that will be checked
- Returns
None
- class biometrics_tracker.gui.widgets.DaysOfMonthWidget(*args: Any, **kwargs: Any)
Bases:
Frame
Presents a calendar frame for the specified month/year, with a checkbox for each day of the month. Allows the user to select days of the month. Optionally the calendar can naviate through the months via ‘previous month’ and ‘next month’ buttons
- disable()
Disables each of the days of the month check boxes
- Returns
None
- enable()
Enables each of the days of the month check boxes
- Returns
None
- focus_set()
Delegates invocation of the focus_set method to the check box for the first day of the month.
- Returns
None
- get_days_of_month() list[int]
Returns a list of the days of the month selected by the user
- Returns
list[int]
- handle_arrows(event)
Handles keypresses of the arrow keys to allow navigation within the days of the month.
- Parameters
event –
- Returns
None
- set_days_of_month(days: list[int])
Sets the day of month check boxes for a list of days of the month
- Parameters
days (list[int]) – a list of the days to be set
- Returns
None
- class biometrics_tracker.gui.widgets.DecimalWidget(parent, label_text: str, regex_str: Optional[str] = '\\s*(\\d+[.]*\\d*)\\s*')
Bases:
EntryWidget
- get_value() Decimal
Return the widget’s entry value
- Returns
the widget’s entry value as a Decimal
- Return type
decimal.Decimal
- set_value(value: Union[Decimal, str])
The argument value is filtered through the validation regex and the resulting regex group is used to set the widget’s entry value
- Parameters
value (Union[decimal.Decimal, str]) – the value to be used to set the entry value
- Returns
None
- validate()
A validation callback for the validationcommand parameter of the tkinter Entry widget
- Returns
1 if validate, otherwise 0
- Return type
int
- class biometrics_tracker.gui.widgets.EntryWidget(parent, label_text: Optional[str], entry_width: int, regex_str: Optional[str] = None)
Bases:
object
An abstract base class for entry label/widget pairs
- apply_regex(value=None) Optional[tuple[Any, ...]]
Apply the widget’s regex either to the proved string or to the value entered to the widget prompt
- Parameters
value (str) – if not None, the regex will be applied to this value
- Returns
returns the groups collected by the regex
- Return type
Optional[tuple[Any, …]]
- bind(sequence: str | None = Ellipsis, func: Optional[Callable[[Event], Any]] = Ellipsis, add: Optional[Union[Literal['', '+'], bool]] = Ellipsis) str
Delegate bind calls to the entry widget
- Parameters
sequence (str | None) – the name of the event to be bound
func (Callable[[tk.Event], Any]) – the callback to be invoked when the event is captured
add (Literal["", "+"] | bool | None) – allows multiple bindings for single event
- Returns
None
- focus_set()
Delegates focus_set calls to the entry widget
- Returns
None
- abstract get_value()
An abstract method to be implemented by subclasses to return the entry widget value
- Returns
the entry widget value
- Return type
implementation dependant
- get_var() ttkbootstrap.StringVar
Returns the StringVar associated with the entry widget
- Returns
the StringVar associated with the entry widget
- Return type
ttkb.StringVar
- grid(**kwargs)
Delegate grid calls to the entry widget
- Parameters
kwargs (dict[str,Any]) – key word args
- Returns
None
- invalid()
This method is used as an ‘invalidcommand’ callback. It is invoked when validation fails. It sets the widget background color to red, which gives it a red border, then calls focus_set on the widget
- Returns
None
- set_regex(regex_str: str) None
Set the regular expression used to validate user input
- Parameters
regex_str (str) – a regular expression
- Returns
None
- abstract set_value(value: Union[int, Decimal, str]) None
An abstract method implemented by subclasses to set the entry widget value
- Parameters
value (Union[int, Decimal, str]) – value to be set
- Returns
None
- abstract validate() int
An abstract method implemented by subclasses to set the entry widget value
- Returns
1 if valid, 0 if not
- class biometrics_tracker.gui.widgets.ErrorMessageDialog(*args: Any, **kwargs: Any)
Bases:
MessageDialog
A ttkbootstrap.dialogs Dialog that displays error message
- Returns
None
- create_body(parent)
Overrides the create_body method of the base class. Builds the body of the Dialog
- Parameters
parent (Tkinter derived Window or Frame) – the GUI parent for this Dialog
- Returns
None
- class biometrics_tracker.gui.widgets.HourlyScheduleWidget(*args: Any, **kwargs: Any)
Bases:
ScheduleWidget
A widget to present and modify the info related to ScheduleEntry instances with an Hourly frequency
- get_schedule_entry() ScheduleEntry
Create and return an instance of ScheduleEntry
- Parameters
self –
- Returns
the created instance
- Return type
- class biometrics_tracker.gui.widgets.ImportExportFieldWidget(*args: Any, **kwargs: Any)
Bases:
Frame
A widget that represents a field in an import or export file. Each widget instance is associated with one of the string values defined at the beginning of the model.importers module
- field_index() int
Returns the int value that specifies the position of the field in the CSV file :return: int field index
- field_name() str
Returns the selected field anme :return: string field name
- is_changed() bool
Has a field name selection changed :return: boolean True is field name has changed, False otherwise
- class biometrics_tracker.gui.widgets.ImportExportSaveSpecWidget(*args: Any, **kwargs: Any)
Bases:
Toplevel
A dialog displays a list of existing ImportSpec or ExportSpec ID’s and prompts the user for the ID of the spec about to be persisted
- get_spec_id() str
Returns the entered ID :return: the entered ID :rtype: str
- show() None
Dislays the dialog
- Returns
None
- class biometrics_tracker.gui.widgets.ImportExportSpecButtons(*args: Any, **kwargs: Any)
Bases:
Frame
This widget contains a pair of buttons, one which invokes the display of an ImportExportSpecsListWidget and one which invokes the display of an ImportExportSaveSpecWidget
- destroy_save_widget()
Destroy the currently displayed ImportExportSaveSpecWidget
- Returns
None
- destroy_spec_list()
Destroy the currently displayed ImportExportSpecsListWidget
- Returns
None
- get_saved_spec_id() str
Retrieve the ID entered to an ImportExportSaveSpec dialog
- Returns
the entered ID
- Return type
str
- get_selected_spec_id() str
Retrieve the id of the Spec selected on the ImportExportSpecsListWidget dialog
- Returns
the selected ID
- Return type
str
- save_specs()
Display an ImportExportSaveSpecWidget dialog
- Returns
None
- select_specs()
Display an ImportExportSpecsListWidget. :return: None
- class biometrics_tracker.gui.widgets.ImportExportSpecsListWidget(*args: Any, **kwargs: Any)
Bases:
Toplevel
A dialog that prompts the user to select an Import or Export Spec for a list of Specs
- get_selected_id() str
Returns the select Spec ID
- Returns
the selected ImportSpec or ExportSpec ID
- Return type
str
- show() None
Displays the dialog
- Returns
None
- class biometrics_tracker.gui.widgets.IntegerWidget(parent, label_text: str, regex_str: Optional[str] = '\\s*(\\d*)\\s*')
Bases:
EntryWidget
- get_value()
Return the widget’s entry value
- Returns
the widget’s entry value as an integer
- Return type
int
- set_value(value: Union[int, str])
The argument value is filtered through the validation regex and the resulting regex group is used to set the widget’s entry value
- Parameters
value (Union[int, str]) – the value to be used to set the entry value
- Returns
None
- validate()
A validation callback for the validationcommand parameter of the tkinter Entry widget
- Returns
1 if validate, otherwise 0
- Return type
int
- class biometrics_tracker.gui.widgets.LabeledTextWidget(parent, label_text: str, label_width: int, label_grid_args: dict[str, Any], entry_width: int, entry_grid_args: dict[str, Any], regex_str: Optional[str] = '\\s*(\\w*)\\s*')
Bases:
object
A Frame containing a Label and a TextWidget
- bind(sequence: str | None = Ellipsis, func: Optional[Callable[[Event], Any]] = Ellipsis, add: Optional[Union[Literal['', '+'], bool]] = Ellipsis) str
Delegate bind calls to the entry widget
- Parameters
sequence (str | None) – the name of the event to be bound
func (Callable[[tk.Event], Any]) – the callback to be invoked when the event is captured
add (Literal["", "+"] | bool | None) – allows multiple bindings for single event
- Returns
None
- focus_set()
Delegates calls to focus_set to the entry widget
- Returns
None
- get_value() str
Return the widget’s entry value
- Returns
the widget’s entry value
- Return type
str
- static label_width(text: str, min_width: int) int
Calculates a width for the label based on the label text and a minumum width
- Parameters
text (str) – the label test
min_width (int) – the minimum label width
- Returns
the calculated label width
- Return type
int
- set_value(value: str) None
The argument value is filtered through the validation regex and the resulting regex group is used to set the widget’s entry value
- Parameters
value (str) – the value to be used to set the entry value
- Returns
None
- class biometrics_tracker.gui.widgets.MetricWidget(*args: Any, **kwargs: Any)
Bases:
Frame
A base class for widget that allow the entry of information on the recording of a particular type of metric
- check_changed_note(event=None)
Check to see if the note property has been changed :param event: :return: None
- create_note_entry() None
Create a note entry field either as a Entry in the DataPointFrame, or as a popup invoked a right click
- Returns
None
- edit_note(event)
Presents a dialog that allows the note to be edited if it is not displayed on the widget :param event: :return: None
- abstract focus_set() None
This method must be overridden to set the focus on the value widget :return: None
- get_note() str
Returns the text of the note associated with the datapoint :return: String note
- abstract get_value()
This method must be overriden to return the value entered for the metric :return: metric value
- handle_keypress(event)
Watch for up and down arrow key presses, if caught, set focus on the DataPointWidget above or below
- Parameters
event –
- Returns
None
- is_changed() bool
Returns a boolean flag that indicates whether the widgets value property has been changed. This property is maintained by the classes that inherit this class :return: bool
- abstract zero_value() None
This method must be overriden to set the IntVar associated with the value entry for the metric to zero and the note field to an empty string :return: None
- class biometrics_tracker.gui.widgets.MetricWidgetFactory
Bases:
object
This factory class creates the apporpriate widget for the specified datapoint type, optionally setting the initial field values from an instance of biometrics_tracker.model.datapoints.DataPoint
- classmethod make_widget(parent, track_cfg: TrackingConfig, datapoint: Optional[DataPoint] = None, show_note_field: bool = True) Union[BloodPressureWidget, PulseWidget, BloodGlucoseWidget, BodyWeightWidget, BodyTempWidget]
- Parameters
parent – parent GUI element for the new widget instance
track_cfg (biometrics_tracker.model.datapoints.TrackingConfig) – contains the DataPointType and UOM info to be used in creating the widget
datapoint (Optional[biometrics_tracker.model.datapoints.DataPoint]) – an optional datapoint to fill the widget field values
show_note_field (bool) – controls whether the widget Note field is shown on the widget of implemented as a right-click function
- Returns
a metric widget appropriate to the specified datapoint type
- Return type
biometrics_tracker.gui.widgets.widget_union
- class biometrics_tracker.gui.widgets.MonthlyScheduleWidget(*args: Any, **kwargs: Any)
Bases:
ScheduleWidget
A widget to present and modify the info related to ScheduleEntry instances with a Monthly frequency
- get_schedule_entry() ScheduleEntry
Create and return an instance of ScheduleEntry
- Parameters
self –
- Returns
the created instance
- Return type
- class biometrics_tracker.gui.widgets.NoteTip(widget, text)
Bases:
object
Implements a tool tip type window to display the note associated with a model.datapoints.DataPoint derived instance
- hidetip(event=None)
Hide the note tool tip :param event :return:
- showtip(event)
Display Note tool tip :param: event :return: None
- class biometrics_tracker.gui.widgets.OneTimeScheduleWidget(*args: Any, **kwargs: Any)
Bases:
ScheduleWidget
A widget to present and modify the info related to ScheduleEntry instances with a Once frequency
- get_schedule_entry() ScheduleEntry
Create and return an instance of ScheduleEntry
- Parameters
self –
- Returns
the created instance
- Return type
- class biometrics_tracker.gui.widgets.PayloadCheckbutton(*args: Any, **kwargs: Any)
Bases:
Checkbutton
A subclass of biometrics_tracker.gui.widgets.Checkbutton that adds a payload property to carry an instance of some class associated with the Checkbutton.
- class biometrics_tracker.gui.widgets.PayloadLabel(*args: Any, **kwargs: Any)
Bases:
Label
A subclass of ttkbootstrap.Label that adds a payload property to carry on instance of some class ossocated with the text of the label. This can be used to make the label a selection widget.
- class biometrics_tracker.gui.widgets.PlaceholderWidget(*args: Any, **kwargs: Any)
Bases:
Frame
- is_changed() bool
This method assures that the PlaceholderWidget presents an interface that is consistant with the DataPointWidget
- Returns
False
- Return type
bool
- class biometrics_tracker.gui.widgets.PluginBrowser(*args: Any, **kwargs: Any)
Bases:
Frame
,PluginBrowserBase
- class biometrics_tracker.gui.widgets.PulseWidget(*args: Any, **kwargs: Any)
Bases:
MetricWidget
A widget the allows entry of a pulse metric
- check_change(event)
Check to see if the widgets metric value has been changed
- Parameters
event (tkinter.Event) –
- Returns
None
- focus_set() None
Sets the focus on the pulse_entry field when the focus_set method of the widget is called
- Returns
None
- get_value() int
Returns the value entered for the metric
- Returns
int pulse metric value
- zero_value() None
Zeros the pulse value and set the note to an empty string
- Returns
None
- class biometrics_tracker.gui.widgets.Radiobutton(*args: Any, **kwargs: Any)
Bases:
Radiobutton
Subclass of ttkbootstrap.Radiobutton that changes it appears when it is in focus, so that the user can tell when that can use the space bar to select or unselect a button
- focus_in(event) None
Handler for the <FocusIn> event. Changes config parm bootstyle to ‘toolbutton’ :param event: :return: None
- focus_out(event)
Handler for the <FocusOut> event. Changes config parm bootstyle to ‘primary’ :param event: :return:
- class biometrics_tracker.gui.widgets.ScheduleDialog(widget: ScheduleWidget, cancel_action: Callable, save_action: Callable)
Bases:
Toplevel
Implements a dialog version of on of the ScheduleEntry widgets. Not used in the current codebase
- class biometrics_tracker.gui.widgets.ScheduleWidget(*args: Any, **kwargs: Any)
Bases:
Frame
A base class for widgets corresponding to the various schedule types; Monthly, Weekly, etc.
- disable()
Disable the interval and when time widgets for entry
- Returns
None
- enable()
Enable the interval and when time widgets for entry
- Returns
None
- focus_set()
Delegate focus_set to the interval widget
- Returns
None
- abstract get_schedule_entry() ScheduleEntry
Build a ScheduleEntry instance from the widget values and return it
- Returns
the created ScheduleEntry
- Return type
- class biometrics_tracker.gui.widgets.TextWidget(parent, label_text: str, entry_width: int, regex_str: Optional[str] = None)
Bases:
EntryWidget
A regex validated text entry widget
- get_value()
Return the widget’s entry value
- Returns
the widget’s entry value
- Return type
str
- set_value(value: str)
The argument value is filtered through the validation regex and the resulting regex group is used to set the widget’s entry value
- Parameters
value (str) – the value to be used to set the entry value
- Returns
None
- validate() int
A validation callback for the validationcommand parameter of the tkinter Entry widget
- Returns
1 if validate, otherwise 0
- Return type
int
- class biometrics_tracker.gui.widgets.TimeWidget(*args: Any, **kwargs: Any)
Bases:
Frame
A general purpose date entry widget
- am_keypress(event)
If the Tab key is pressed when the AM radio button is in focus, skip over the PM button and set the focus on the next_entry field if any has been specified :param event: :return: None
- clear_key_count(event)
Sets the keystroke counter to 0. This method is bound to the <FocusIn> event for the hour and minute entry fields :param event: :return: None
- disable() None
Disables the hour and minute fields and the ap/pm radio buttons.
- Returns
None
- enable() None
Enables the hour and minute fields and the am/pm radio buttons.
- Returns
None
- focus_set() None
Delegates set focus functionality to the hour field
- Returns
None
- get_datetime()
Returns a datetime instance with a zero date.
- Returns
datetime instance
- Return type
datetime
- get_time() Optional[time]
Builds a datetime.time instance using the values entered to the hour and minute entry fields. :return: datetime.time instance
- hour_keypress(event)
Tracks the keystrokes entered to the hour field, puts the minute entry field on the GUI in focus after two keystrokes. This method is bound to the <KeyPress> event of the hour entry field. :param event: :return: None
- minute_keypress(event)
Tracks the keystrokes entered to the minute field, puts the next entry field on the GUI on the GUI in focus after two keystrokes. This method is bound to the <KeyPress> event of the hour entry field. :param event: :return: None
- select_range(start, end) None
Delegates select range to the hour field
- Parameters
start – start position for selection
end – end position for selection
- Returns
None
- set_next_entry(entry)
Establishes the widget that will receive focus after the am/pm radio buttons
- Parameters
entry –
- Returns
None
- set_prev_entry(entry) None
Establishes the widget that will receive focus when the Back Tab key is pressed in the hour field.
- Parameters
entry –
- Returns
None
- set_time(time_value: time) None
Set the hour, minute and am/pm fields to the provided time
- Parameters
time_value (time) – the new value for the time widget
- Returns
None
- validate_time(event=None)
Validate the hour and minute values, display a MessageBox if either is invalid. This method is bound to the Button-1 events on the AM and PM radio buttons :param event: :return: None
- class biometrics_tracker.gui.widgets.UOMListWidget(parent, uom_enum: UOM, selected_uom: UOM)
Bases:
Listbox
A widget that extends tk.Listbox to present a selection list of u.o.m. Enum values for one of the Enum classes defined in model.uoms
- set_selected()
Retrieves the Listbox’s selected element and uses it to set the selection_uom property. This method is bound to the <Double-1> event for the Listbox :return: None
- class biometrics_tracker.gui.widgets.UOMRadioWidget(*args: Any, **kwargs: Any)
Bases:
Frame
- A widget that contains a series of ttkbootstrap.Radiobutton instances based on u.o.m. Enum values for one of the
Enum classes defined in model.uoms
- disable()
Disables the radio button group for entry :return: None
- enable()
Enables the radio button group for entry :return: None
- handle_selection()
Retrieves the select radio button value and uses it to return the corresponding model.uoms.UOM extending instance :return: an instance of an Enum that extends model.uoms.UOM
- class biometrics_tracker.gui.widgets.WeekDayCheckbuttonWidget(*args: Any, **kwargs: Any)
Bases:
Frame
A Frame containing a checkbox for each day of the week, allows selection of a list of week days
- get_checked_days() list[biometrics_tracker.model.datapoints.WeekDay]
Returns a list of WeekDay enums for the days whose checkboxes where selected
- Returns
a list of WeeKDay enums
- Return type
- class biometrics_tracker.gui.widgets.WeeklyScheduleWidget(*args: Any, **kwargs: Any)
Bases:
ScheduleWidget
A widget to present and modify the info related to ScheduleEntry instances with a Weekly frequency
- get_schedule_entry() ScheduleEntry
Create and return an instance of ScheduleEntry
- Parameters
self –
- Returns
the created instance
- Return type