ae.gui_help
main app base class with context help for flow and app state changes
the class HelpAppBase
provided by this namespace portion is extending your application with a context-sensitive
help functionality.
the data-driven approach allows ad-hoc-changes of your app’s help texts without the need of code changes or
recompilation. this gets achieved within HelpAppBase
by overriding the main app class methods
change_flow()
and change_app_state()
.
so to add help support to the widgets of your app you only need to add/provide the help texts with a help id that is
matching the value of the help_id
attribute of the widget you need help for.
additionally, you can provide a separate i18n translation message file for each of the supported languages to make your help texts multilingual.
help layout implementation example
HelpAppBase
inherits from MainAppBase
while still being independent of the used GUI
framework/library.
Note
the user interface for this help system has to be provided externally on top of this module. it can either be implemented directly in your app project or in a separate framework-specific module.
use HelpAppBase
as base class of the GUI framework specific main application class and implement the abstract
methods init_app()
and ensure_top_most_z_index()
:
from ae.gui_help import HelpAppBase
class MyMainApp(HelpAppBase):
def init_app(self, framework_app_class=None):
self.framework_app = framework_app_class()
...
return self.framework_app.run, self.framework_app.stop
def ensure_top_most_z_index(self, widget):
framework_method_to_push_widget_to_top_most(widget)
...
to activate the help mode the widget to display the help texts have to be assigned to the main app attribute
help_layout
and to the framework app property help_layout
via
the change_observable()
method:
main_app.change_observable('help_layout', HelpScreenContainerOrWindow())
the help_layout
property is also used as a flag of the help mode activity. by assigning None to
these attributes the help mode will be deactivated:
main_app.change_observable('help_layout', None)
use the attribute help_activator
to provide and store a widget that allows the user to toggle the
help mode activation. the help_display()
is using it as fallback widget if no help target (or
widget to be explained) got found.
Hint
the de-/activation method help_activation_toggle()
together with the classes
HelpBehavior
, HelpToggler
and
Tooltip
are
demonstrating a typical implementation of help activator and help text tooltip widgets.
additional helper functions
the helper functions anchor_layout_x()
, anchor_layout_y()
, anchor_points()
and anchor_spec()
are
calculating framework-independent the position and direction of the targeting tooltip anchor arrow and its layout box.
flow change context message id
the message id to identify the help texts for each flow button is composed by the id_of_flow_help()
, using the
prefix marker string defined by the module variable FLOW_HELP_ID_PREFIX
followed by the flow id of the flow
widget.
for example the message id for a flow button with the flow action ‘open’, the object ‘item’ and the (optional) flow key ‘123456’ is resulting in the following help text message id:
'help_flow#open_item:123456'
if there is no need for a detailed message id that is taking the flow key into account, then simply create a help text message id without the flow key.
the method help_display()
does first search for a message id including the flow key in the available
help text files and if not found it will automatically fall back to use a message id without the flow key:
'help_flow#open_item'
Hint
more information regarding the flow id you find in the doc string of the module ae.gui_app
in the section
application flow.
application state change context message id
the message ids for app state change help texts are using the prefix marker string defined by the module variable
APP_STATE_HELP_ID_PREFIX
, followed by the name of the app state and are composed via the method
id_of_state_help()
.
pluralize-able help texts
each message id can optionally have several help texts for their pluralization. for that simply add a count item to the help_vars property of the help target widget and then define a help text for the all the possible count cases in your message text file like shown in the following example:
{
'message_id': {
'zero': "help text if {count} == 0", # {count} will be replaced with `'0'`
'one': "help text if count == 1",
'many': "help text if count > 1",
'negative': "help text if count < 0",
'': "fallback help text if count is None",
},
...
}
the provided count value can also be included/displayed in the help text, like shown in the ‘zero’ count case of the example.
pre- and post-change help texts
to display a different help message before and after the change of the flow id or the app state define a message dict with the keys ‘’ (an empty string) and ‘after’ like shown in the following example:
{
'message_id': {
'': "help text displayed before the flow/app-state change.",
'after': "help text displayed after the flow/app-state change",
},
...
}
if you want to move/change the help target to another widget after a change, then use instead of ‘after’ the ‘next_help_id’ message dict key:
{
'message_id': {
'': "help text before the change",
'next_help_id': "help_flow#next_flow_id",
},
...
}
in this case the help target will automatically change to the widget specified by the flow id in the ‘next_help_id’ key, if the user was tapping the second time on the first/initial help target widget.
i18n help texts
the displayed help messages related to the message id will automatically get translated into the default language of the current system/environment.
the declaration and association of message ids and their related help messages is done with the help of the namespace
portion ae.i18n
.
Hint
more details on these and other features of this help system, e.g. the usage of f-strings in the help texts, is
documented in the doc string of the ae.i18n
module.
a more complex example app demonstrating the features of this context help system can be found in the repository of the kivy lisz demo app.
app tours
the following classes provided by this portion building a solid fundament to implement tours for your app:
TourBase
- abstract base class of all app tours.
TourDropdownFromButton
- abstract base class for tours on dropdowns.
OnboardingTour
- minimal app onboarding tour, extendable with app specific tour pages.
UserPreferencesTour
- minimal user preferences dropdown tour.
app tour start and stop events
the following main app event methods get called (if they exist) in relation to the start/stop of an app tour:
on_tour_init: fired when the app tour instance got initialized and the app states backup got saved.
on_tour_start: fired after tour start() method get called; delay id configurable via tour_start_delay page data.
on_tour_exit: fired after an app tour got finished and the app states got restored to the values of the tour start. fired delayed letting UI events get processed; delay seconds configurable via the tour_exit_delay page data value.
UI-specific implementation
to complete the implementation of the app tours, the UI-specific framework has to provide a tour layout class, which is highlighting the widget explained and to display a tooltip and the tour page texts.
Hint
the TourOverlay
class is a quite complete implementation of a tour layout class.
optionally for the ‘user_registration’ page of the OnboardingTour
an open username editor flow has to be
implemented.
Module Attributes
flow id to close opened dropdown/popup |
|
message id prefix for app state change help texts |
|
message id prefix for flow change help texts |
|
message id prefix of tour page text/dict |
|
default value of tour start delay in seconds |
|
default value of tour exit delay in seconds |
|
tuple of flow ids never search/show help text for |
|
tuple of app state names never searched help for |
|
map(name: class) of all registered tour classes |
|
(see return value of |
|
single explained widget matcher type |
Functions
|
calculate x position of the layout box of an anchor. |
|
calculate y position of the layout box of an anchor. |
|
recalculate points of the anchor triangle drawing. |
|
calculate anchor center pos (x, y) and anchor direction to the targeted widget. |
|
determine the tour class if passed help id has attached tour pages. |
|
determine sub id (flow id, tour id or app state name) of the current/specified/passed help id. |
|
compose help id for specified flow id. |
|
compose help id for app state name/key. |
|
compose help id for specified tour page id. |
|
register app tour class. |
|
determine help translation for the passed page id (flow id or app state name). |
|
determine the tour class of the passed tour id. |
|
check if a help text exists for the passed help id. |
|
determine tour page id of passed widget. |
Classes
|
main app help base class. |
|
onboarding tour for first app start. |
|
abstract tour base class, automatically registering subclasses as app tours. |
|
generic tour base class to auto-explain a dropdown menu, starting with the button opening the dropdown. |
|
user preferences menu tour. |
- CLOSE_POPUP_FLOW_ID = 'close_flow_popup'
flow id to close opened dropdown/popup
- APP_STATE_HELP_ID_PREFIX = 'help_app_state#'
message id prefix for app state change help texts
- FLOW_HELP_ID_PREFIX = 'help_flow#'
message id prefix for flow change help texts
- TOUR_PAGE_HELP_ID_PREFIX = 'tour_page#'
message id prefix of tour page text/dict
- TOUR_START_DELAY_DEF = 0.15
default value of tour start delay in seconds
- TOUR_EXIT_DELAY_DEF = 0.45
default value of tour exit delay in seconds
- IGNORED_HELP_FLOWS = ('close_flow_popup',)
tuple of flow ids never search/show help text for
- IGNORED_HELP_STATES = ('flow_id', 'flow_path', 'win_rectangle')
tuple of app state names never searched help for
- REGISTERED_TOURS = {'AnimatedOnboardingTour': <class 'ae.kivy.tours.AnimatedOnboardingTour'>, 'OnboardingTour': <class 'ae.gui_help.OnboardingTour'>, 'SideloadingMenuTour': <class 'ae.kivy_sideloading.SideloadingMenuTour'>, 'TourDropdownFromButton': <class 'ae.gui_help.TourDropdownFromButton'>, 'UserPreferencesTour': <class 'ae.gui_help.UserPreferencesTour'>}
map(name: class) of all registered tour classes
- AnchorSpecType
(see return value of
anchor_spec()
)
- ExplainedMatcherType
single explained widget matcher type
- anchor_layout_x(anchor_spe, layout_width, win_width)[source]
calculate x position of the layout box of an anchor.
- Parameters:
- Return type:
- Returns:
absolute x coordinate within the app window of anchor layout.
- anchor_layout_y(anchor_spe, layout_height, win_height)[source]
calculate y position of the layout box of an anchor.
- anchor_points(font_size, anchor_spe)[source]
recalculate points of the anchor triangle drawing.
- Parameters:
- Return type:
- Returns:
tuple of the three x and y coordinates of the anchor triangle edges.
- anchor_spec(wid_x, wid_y, wid_width, wid_height, win_width, win_height)[source]
calculate anchor center pos (x, y) and anchor direction to the targeted widget.
- Parameters:
- Return type:
- Returns:
tooltip anchor specification tuple (
AnchorSpecType
) with the three items:anchor_x (anchor center absolute x coordinate in window),
anchor_y (anchor center absolute y coordinate in window) and
anchor_dir (anchor direction: ‘r’=right, ‘i’=increase-y, ‘l’=left, ‘d’=decrease-y)
Note
the direction in the y-axis got named increase for higher y values and decrease for lower y values to support different coordinate systems of the GUI frameworks.
e.g. Kivy has the y-axis zero value at the bottom of the app window, whereas in enaml/Qt it is at the top.
- help_id_tour_class(help_id)[source]
determine the tour class if passed help id has attached tour pages.
- help_sub_id(help_id)[source]
determine sub id (flow id, tour id or app state name) of the current/specified/passed help id.
opposite of
id_of_flow_help()
/id_of_state_help()
/id_of_tour_help()
.
- tour_help_translation(page_id)[source]
determine help translation for the passed page id (flow id or app state name).
- class TourBase(main_app)[source]
Bases:
object
abstract tour base class, automatically registering subclasses as app tours.
subclass this generic, UI-framework-independent base class to bundle pages of a tour and make sure that the attr:~TourBase.page_ids and
page_data
attributes are correctly set. a UI-framework-dependent tour overlay/layout instance, created and assigned to main_app.tour_layout, will automatically create an instance of your tour-specific subclass on tour start.- classmethod __init_subclass__(**kwargs)[source]
register tour class; called on declaration of tour subclass.
-
auto_switch_pages:
Union
[bool
,int
] enable/disable automatic switch of tour pages.
set to True, 1 or -1 to automatically switch tour pages; True and 1 will switch to the next page until the last page is reached, while -1 will switch back to the previous pages until the first page is reached; -1 and 1 automatically toggles at the first/last page the to other value (endless ping-pong until back/next button gets pressed by the user).
the seconds to display each page before switching to the next one can be specified via the item value of the the dict
page_data
dict with the key ‘next_page_delay’.
-
page_data:
Dict
[str
,Any
] additional/optional help variables (in help_vars key), tour and page text/layout/timing settings.
the class attribute values are default values for all tour pages and get individually overwritten for each tour page by the i18n translations attributes on tour page change via
load_page_data()
.supported/implemented dict keys:
app_flow_delay: time in seconds to wait until app flow change is completed (def=1.2, >0.9 for auto-width).
back_text: caption of tour previous page button (def=get_text(‘back’)).
fade_out_app: set to 0.0 to prevent the fade out of the app screen (def=1.0).
help_vars: additional help variables, e.g. help_translation providing context help translation dict/text.
next_text: caption of tour next page button (def=get_text(‘next’)).
next_page_delay: time in seconds to read the current page before next request_auto_page_switch() (def=9.6).
page_update_delay: time in seconds to wait until tour layout/overlay is completed (def=0.9).
tip_text or ‘’ (empty string): tour page tooltip text fstring message text template. alternatively put as first character a ‘=’ character followed by a tour page flow id to initialize the tip_text to the help translation text of the related flow widget, and the self help variable to the related flow widget instance.
tour_start_delay: seconds between tour.start() and on_tour_start main app event (def=TOUR_START_DELAY_DEF).
tour_exit_delay: seconds between tour.stop() and the on_tour_exit main app event (def=TOUR_EXIT_DELAY_DEF).
-
pages_explained_matchers:
Dict
[str
,Union
[Callable
[[Any
],bool
],str
,Tuple
[Union
[Callable
[[Any
],bool
],str
],...
]]] matchers (specified as callable or id-string) to determine the explained widget(s) of each tour page.
each key of this dict is a tour page id (for which the explained widget(s) will be determined).
the value of each dict item is a matcher or a tuple of matchers. each matcher specifies a widget to be explained/targeted/highlighted. for matcher tuples the minimum rectangle enclosing all widgets get highlighted.
the types of matchers, to identify any visible widget, are:
find_widget()
matcher callable (scanning framework_win.children)evaluation expression resulting in
find_widget()
matcher callablewidget id string, declared via kv lang, identifying widget in framework_root.ids
page id string, compiled from widgets app state/flow/focus via
widget_page_id()
to identify widget
-
page_ids:
List
[str
] list of tour page ids, either initialized via this class attribute or dynamically.
- main_app
shortcut to main app instance
- layout
tour overlay layout instance
- top_popup
top most popup widget (in app simulation)
- cancel_auto_page_switch_request(reset=True)[source]
cancel auto switch callback if requested, called e.g. from tour layout/overlay next/back buttons.
- load_page_data()[source]
load page before switching to it (and maybe reload after preparing app flow and before setup of layout).
- restore_app_states()[source]
restore app states of this app - saved via
backup_app_states()
.
- setup_explained_widget()[source]
determine and set the explained widget for the actual tour page.
- Return type:
- Returns:
list of explained widget instances.
- teardown_app_flow()[source]
restore app flow and app states before tour finishing or before preparing/switching to prev/next page.
- update_page_ids()[source]
update/change page ids on app flow setup (before tour page loading and the tour overlay/layout setup).
override this method to dynamically change the page_ids in a running tour. after adding/removing a page the attribute values of
last_page_idx
andpage_idx
have to be corrected accordingly.
- class TourDropdownFromButton(main_app)[source]
Bases:
TourBase
generic tour base class to auto-explain a dropdown menu, starting with the button opening the dropdown.
- determine_page_ids = '_v_'
- setup_app_flow()[source]
manage the opening state of the dropdown (open dropdown, only close it if opening button get explained).
- setup_layout()[source]
prepare layout for all tour pages - first page explains opening dropdown button.
-
auto_switch_pages:
Union
[bool
,int
] enable/disable automatic switch of tour pages.
set to True, 1 or -1 to automatically switch tour pages; True and 1 will switch to the next page until the last page is reached, while -1 will switch back to the previous pages until the first page is reached; -1 and 1 automatically toggles at the first/last page the to other value (endless ping-pong until back/next button gets pressed by the user).
the seconds to display each page before switching to the next one can be specified via the item value of the the dict
page_data
dict with the key ‘next_page_delay’.
-
page_data:
Dict
[str
,Any
] additional/optional help variables (in help_vars key), tour and page text/layout/timing settings.
the class attribute values are default values for all tour pages and get individually overwritten for each tour page by the i18n translations attributes on tour page change via
load_page_data()
.supported/implemented dict keys:
app_flow_delay: time in seconds to wait until app flow change is completed (def=1.2, >0.9 for auto-width).
back_text: caption of tour previous page button (def=get_text(‘back’)).
fade_out_app: set to 0.0 to prevent the fade out of the app screen (def=1.0).
help_vars: additional help variables, e.g. help_translation providing context help translation dict/text.
next_text: caption of tour next page button (def=get_text(‘next’)).
next_page_delay: time in seconds to read the current page before next request_auto_page_switch() (def=9.6).
page_update_delay: time in seconds to wait until tour layout/overlay is completed (def=0.9).
tip_text or ‘’ (empty string): tour page tooltip text fstring message text template. alternatively put as first character a ‘=’ character followed by a tour page flow id to initialize the tip_text to the help translation text of the related flow widget, and the self help variable to the related flow widget instance.
tour_start_delay: seconds between tour.start() and on_tour_start main app event (def=TOUR_START_DELAY_DEF).
tour_exit_delay: seconds between tour.stop() and the on_tour_exit main app event (def=TOUR_EXIT_DELAY_DEF).
-
pages_explained_matchers:
Dict
[str
,Union
[Callable
[[Any
],bool
],str
,Tuple
[Union
[Callable
[[Any
],bool
],str
],...
]]] matchers (specified as callable or id-string) to determine the explained widget(s) of each tour page.
each key of this dict is a tour page id (for which the explained widget(s) will be determined).
the value of each dict item is a matcher or a tuple of matchers. each matcher specifies a widget to be explained/targeted/highlighted. for matcher tuples the minimum rectangle enclosing all widgets get highlighted.
the types of matchers, to identify any visible widget, are:
find_widget()
matcher callable (scanning framework_win.children)evaluation expression resulting in
find_widget()
matcher callablewidget id string, declared via kv lang, identifying widget in framework_root.ids
page id string, compiled from widgets app state/flow/focus via
widget_page_id()
to identify widget
- class OnboardingTour(main_app)[source]
Bases:
TourBase
onboarding tour for first app start.
- setup_app_flow()[source]
overridden to open user preferences dropdown in responsible_layout tour page.
- teardown_app_flow()[source]
overridden to close the opened user preferences dropdown on leaving layout_font_size tour page.
- update_page_ids()[source]
overridden to remove 2nd-/well-done-page (only showing once on next-page-jump from 1st-/welcome-page).
-
auto_switch_pages:
Union
[bool
,int
] enable/disable automatic switch of tour pages.
set to True, 1 or -1 to automatically switch tour pages; True and 1 will switch to the next page until the last page is reached, while -1 will switch back to the previous pages until the first page is reached; -1 and 1 automatically toggles at the first/last page the to other value (endless ping-pong until back/next button gets pressed by the user).
the seconds to display each page before switching to the next one can be specified via the item value of the the dict
page_data
dict with the key ‘next_page_delay’.
-
page_data:
Dict
[str
,Any
] additional/optional help variables (in help_vars key), tour and page text/layout/timing settings.
the class attribute values are default values for all tour pages and get individually overwritten for each tour page by the i18n translations attributes on tour page change via
load_page_data()
.supported/implemented dict keys:
app_flow_delay: time in seconds to wait until app flow change is completed (def=1.2, >0.9 for auto-width).
back_text: caption of tour previous page button (def=get_text(‘back’)).
fade_out_app: set to 0.0 to prevent the fade out of the app screen (def=1.0).
help_vars: additional help variables, e.g. help_translation providing context help translation dict/text.
next_text: caption of tour next page button (def=get_text(‘next’)).
next_page_delay: time in seconds to read the current page before next request_auto_page_switch() (def=9.6).
page_update_delay: time in seconds to wait until tour layout/overlay is completed (def=0.9).
tip_text or ‘’ (empty string): tour page tooltip text fstring message text template. alternatively put as first character a ‘=’ character followed by a tour page flow id to initialize the tip_text to the help translation text of the related flow widget, and the self help variable to the related flow widget instance.
tour_start_delay: seconds between tour.start() and on_tour_start main app event (def=TOUR_START_DELAY_DEF).
tour_exit_delay: seconds between tour.stop() and the on_tour_exit main app event (def=TOUR_EXIT_DELAY_DEF).
-
pages_explained_matchers:
Dict
[str
,Union
[Callable
[[Any
],bool
],str
,Tuple
[Union
[Callable
[[Any
],bool
],str
],...
]]] matchers (specified as callable or id-string) to determine the explained widget(s) of each tour page.
each key of this dict is a tour page id (for which the explained widget(s) will be determined).
the value of each dict item is a matcher or a tuple of matchers. each matcher specifies a widget to be explained/targeted/highlighted. for matcher tuples the minimum rectangle enclosing all widgets get highlighted.
the types of matchers, to identify any visible widget, are:
find_widget()
matcher callable (scanning framework_win.children)evaluation expression resulting in
find_widget()
matcher callablewidget id string, declared via kv lang, identifying widget in framework_root.ids
page id string, compiled from widgets app state/flow/focus via
widget_page_id()
to identify widget
- class UserPreferencesTour(main_app)[source]
Bases:
TourDropdownFromButton
user preferences menu tour.
-
auto_switch_pages:
Union
[bool
,int
] enable/disable automatic switch of tour pages.
set to True, 1 or -1 to automatically switch tour pages; True and 1 will switch to the next page until the last page is reached, while -1 will switch back to the previous pages until the first page is reached; -1 and 1 automatically toggles at the first/last page the to other value (endless ping-pong until back/next button gets pressed by the user).
the seconds to display each page before switching to the next one can be specified via the item value of the the dict
page_data
dict with the key ‘next_page_delay’.
-
page_data:
Dict
[str
,Any
] additional/optional help variables (in help_vars key), tour and page text/layout/timing settings.
the class attribute values are default values for all tour pages and get individually overwritten for each tour page by the i18n translations attributes on tour page change via
load_page_data()
.supported/implemented dict keys:
app_flow_delay: time in seconds to wait until app flow change is completed (def=1.2, >0.9 for auto-width).
back_text: caption of tour previous page button (def=get_text(‘back’)).
fade_out_app: set to 0.0 to prevent the fade out of the app screen (def=1.0).
help_vars: additional help variables, e.g. help_translation providing context help translation dict/text.
next_text: caption of tour next page button (def=get_text(‘next’)).
next_page_delay: time in seconds to read the current page before next request_auto_page_switch() (def=9.6).
page_update_delay: time in seconds to wait until tour layout/overlay is completed (def=0.9).
tip_text or ‘’ (empty string): tour page tooltip text fstring message text template. alternatively put as first character a ‘=’ character followed by a tour page flow id to initialize the tip_text to the help translation text of the related flow widget, and the self help variable to the related flow widget instance.
tour_start_delay: seconds between tour.start() and on_tour_start main app event (def=TOUR_START_DELAY_DEF).
tour_exit_delay: seconds between tour.stop() and the on_tour_exit main app event (def=TOUR_EXIT_DELAY_DEF).
-
pages_explained_matchers:
Dict
[str
,Union
[Callable
[[Any
],bool
],str
,Tuple
[Union
[Callable
[[Any
],bool
],str
],...
]]] matchers (specified as callable or id-string) to determine the explained widget(s) of each tour page.
each key of this dict is a tour page id (for which the explained widget(s) will be determined).
the value of each dict item is a matcher or a tuple of matchers. each matcher specifies a widget to be explained/targeted/highlighted. for matcher tuples the minimum rectangle enclosing all widgets get highlighted.
the types of matchers, to identify any visible widget, are:
find_widget()
matcher callable (scanning framework_win.children)evaluation expression resulting in
find_widget()
matcher callablewidget id string, declared via kv lang, identifying widget in framework_root.ids
page id string, compiled from widgets app state/flow/focus via
widget_page_id()
to identify widget
-
auto_switch_pages:
- class HelpAppBase(**console_app_kwargs)[source]
Bases:
MainAppBase
,ABC
main app help base class.
-
tour_overlay_class:
Optional
[Type
] = None UI-framework-specific tour overlay class, set by main app subclass
- abstract call_method_delayed(delay, callback, *args, **kwargs)[source]
delayed call of passed callable/method with args/kwargs catching and logging exceptions preventing app exit.
- Parameters:
delay¶ (
float
) – delay in seconds before calling the callable/method specified bycallback
.callback¶ (
Union
[Callable
,str
]) – either callable or name of the main app method to call.args¶ – args passed to the callable/main-app-method to be called.
kwargs¶ – kwargs passed to the callable/main-app-method to be called.
- Return type:
- Returns:
delayed call event object instance, providing a cancel method to allow the cancellation of the delayed call within the delay time.
- abstract ensure_top_most_z_index(widget)[source]
ensure visibility of the passed widget to be the top most in the z index/order.
- abstract help_activation_toggle()[source]
button tapped event handler to switch help mode between active and inactive (also inactivating tour).
- change_app_state(app_state_name, state_value, send_event=True, old_name='')[source]
change app state via
change_app_state()
, show help text in active help mode.all parameters are documented in the overwritten method
change_app_state()
.
- change_flow(new_flow_id, **event_kwargs)[source]
change/switch flow id - overriding
change_flow()
.more detailed documentation of the parameters you find in the overwritten method
change_app_state()
.this method returns True if flow changed and got confirmed by a declared custom event handler (either event method or Popup class) of the app, if the help mode is not active or the calling widget is selected in active help mode, else False.
- Return type:
- help_app_state_display(help_vars, changed=False)[source]
actualize the help layout if active, before and after the change of the app state.
- Parameters:
locals (args/kwargs) of overwritten
change_flow()
method.- items passed to the help text formatter:
count: optional number used to render a pluralized help text for this app state change.
changed¶ (
bool
) – False before change of the app state, pass True if app state got just/already changed.
- Return type:
- Returns:
True if help mode and layout is active and found target widget is locked, else False.
- help_display(help_id, help_vars, key_suffix='', must_have=False)[source]
display help text to the user in activated help mode.
- Parameters:
help_vars¶ (
Dict
[str
,Any
]) – variables used in the conversion of the f-string expression to a string. optional items passed to the help text formatter: * count: optional number used to render a pluralized help text. * self: target widget to show help text for.key_suffix¶ (
str
) – suffix to the key used if the translation is a dict.must_have¶ (
bool
) – pass True to display error help text and console output if no help text exists.
- Return type:
- Returns:
True if help text got found and displayed.
- help_flow_display(help_vars, changed=False)[source]
actualize the help layout if active, exclusively called by
change_flow()
.
- help_is_inactive(help_id)[source]
check if help mode is inactive and reserve/note-down current help id for next help mode activation.
- help_widget(help_id, help_vars)[source]
ensure/find help target widget via attribute name/value and extend
help_vars
.- Parameters:
- Return type:
- Returns:
found help target widget or self.help_activator if not found.
- key_press_from_framework(modifiers, key)[source]
overwritten ae.gui_app.MainAppBase method to suppress key press events in help or app tour mode.
- on_flow_popup_close(_flow_key, _event_kwargs)[source]
overwritten popup close handler of FlowPopup widget to reset help widget/text.
- save_app_states()[source]
override MainAppBase method to not overwrite app states if app tour is active.
- Return type:
- start_app_tour(tour_class=None)[source]
start new app tour, automatically cancelling a currently running app tour.
- widget_by_page_id(page_id)[source]
determine the first (top-most) widget having the passed tour page id.
-
tour_overlay_class: