gui_structure.py

This document contains all the information relevant for the GUI. It contains all the options, categories etc. that should appear on the GUI.

class ScenarioGUI.gui_classes.gui_structure.GuiStructure(default_parent: QtW.QWidget, translations: Translations)

Bases: object

This class contains all the elements that are relevant for the GUI.

All the elements that should be placed on the GUI, should be written in chronologial order, in this __init__ function.

change_font_size_2(size: int) None

changes the font size to the size value

Parameters
size: int

new font size

change_toggle_button() None

This function changes the behaviour of both the ButtonBox and aim selection from either toggle behaviour to not-change behaviour.

Returns
None
create_lists()

creates the lists with the different elements

create_results_page()

creates the results page Returns ——-

None

create_settings_page()

creates the settings page Returns ——-

None

static show_option_under_multiple_conditions(options_to_be_shown: OptionShow | list[OptionShow], options_2_be_checked: Option | Aim | list[Option | Aim], *, functions_check_for_and: list[Callable[[], bool]] | None = None, functions_check_for_or: list[Callable[[], bool]] | None = None, custom_logic: Callable[[], bool] | None = None, check_on_visibility_change: bool = False) None

show the option_to_be_shown if all functions_of_options of the options_2_be_checked are returning true

Important!: This function can only be used once per option. Otherwise, this can lead to unexpected behaviour, where most probably the last function call is the dominant one.

Parameters
options_to_be_shown: Option or list of options

The option (or list of options) which should be shown if all conditions are met

options_2_be_checked: list[Option]

list of options and function of the options that evoke the evaluation of the logical values

functions_check_for_and: list[Callable[[], bool]] | None

list of options and function of the options that should be checked for the “and” condition (so all have to be true)

functions_check_for_or: list[Callable[[], bool]] | None

list of options and function of the options that should be checked for the “or” condition (so one have to be true)

custom_logicCallable

custom logic for the evaluation of the truth value

check_on_visibility_change: bool

check also on visibility change

Returns
None
translate(index: int, translation: Translations) None

This function translates the GUI.

Parameters
indexint

Index of the language

translationTranslations

Class with all the translations

Returns
None