wolfhece.dialog_provider ======================== .. py:module:: wolfhece.dialog_provider Module Contents --------------- .. py:class:: ProgressHandle Simple wrapper around wx.ProgressDialog for easier mocking in tests. .. py:attribute:: dialog :type: wx.ProgressDialog .. py:method:: update(value: int, message: str | None = None) -> bool Update progress and return wx's continuation flag. .. py:method:: value() -> int Return current progress value. .. py:method:: close() -> None Destroy the wrapped progress dialog. .. py:class:: DialogStyles Named style presets used across dialog helpers and call sites. .. py:attribute:: OK .. py:attribute:: CANCEL .. py:attribute:: OK_CANCEL .. py:attribute:: ICON_INFORMATION .. py:attribute:: ICON_QUESTION .. py:attribute:: ICON_WARNING .. py:attribute:: ICON_ERROR .. py:attribute:: YES_NO .. py:attribute:: YES_NO_QUESTION .. py:attribute:: YES_NO_DEFAULT_YES .. py:attribute:: YES_NO_DEFAULT_NO .. py:attribute:: YES_NO_QUESTION_DEFAULT_YES .. py:attribute:: YES_NO_QUESTION_DEFAULT_NO .. py:attribute:: OK_INFO .. py:attribute:: OK_CANCEL_WARNING .. py:class:: DialogProvider Wrapper around common wx dialogs used in the viewer. This class centralizes dialog interactions so tests can inject a mock implementation with deterministic answers. .. py:method:: ask_file_open(message: str, wildcard: str = 'all (*.*)|*.*', default_path: str = '', style: int | None = None, parent=None) -> str | None .. py:method:: ask_file_open_with_filter(message: str, wildcard: str = 'all (*.*)|*.*', default_path: str = '', style: int | None = None, parent=None) -> tuple[str, int] | None Open a file dialog and return (path, filter_index) or None on cancel. .. py:method:: ask_file_save(message: str, wildcard: str = 'all (*.*)|*.*', default_path: str = '', default_file: str = '', style: int | None = None, parent=None) -> str | None .. py:method:: ask_directory(message: str, default_path: str = '', style: int = wx.DD_DEFAULT_STYLE, parent=None) -> str | None .. py:method:: ask_yes_no(message: str, caption: str = '', style: int = DialogStyles.YES_NO_QUESTION, parent=None) -> bool .. py:method:: show_message(message: str, caption: str = '', style: int = DialogStyles.OK_INFO, parent=None) -> int .. py:method:: ask_ok_cancel(message: str, caption: str = '', style: int = DialogStyles.OK_CANCEL, parent=None) -> bool .. py:method:: ask_single_choice(message: str, caption: str, choices: list[str], preselected: int | None = None, style: int = wx.CHOICEDLG_STYLE, parent=None) -> str | None .. py:method:: ask_multi_choice(message: str, caption: str, choices: list[str], preselected: list[int] | tuple[int, Ellipsis] | None = None, style: int = wx.CHOICEDLG_STYLE, parent=None) -> list[int] | None .. py:method:: ask_text(message: str, caption: str = '', default: str = '', style: int = DialogStyles.OK_CANCEL, parent=None) -> str | None .. py:method:: ask_float(message: str, caption: str = '', default: float | str = '', style: int = DialogStyles.OK_CANCEL, parent=None) -> float | None .. py:method:: ask_integer(message: str, prompt: str = '', caption: str = '', default: int = 0, min_value: int = 0, max_value: int = 0, parent=None) -> int | None .. py:method:: create_progress(title: str, message: str, maximum: int, style: int = wx.PD_APP_MODAL | wx.PD_AUTO_HIDE, parent=None) -> ProgressHandle .. py:method:: show_busy(message: str, title: str = '', parent=None) Context manager that shows an indeterminate progress bar while work runs. .. py:method:: ask_confirmation(message: str, caption: str = '', default: Literal['yes', 'no'] = 'yes', parent=None) -> bool