inputQuestDlg

utils.dlgs.inputQuestDlg(ParentFigure, question, varargin)

INPUTQUESTDLG - Custom MIB question dialog compatible with MATLAB questdlg, extended with an optional options structure as the last argument.

Syntax:
% questdlg-compatible forms:
selection = inputQuestDlg(ParentFigure, question)
selection = inputQuestDlg(ParentFigure, question, dlgTitle)
selection = inputQuestDlg(ParentFigure, question, dlgTitle, btn1, btn2)
selection = inputQuestDlg(ParentFigure, question, dlgTitle, btn1, btn2, btn3)
selection = inputQuestDlg(ParentFigure, question, dlgTitle, btn1, btn2, defaultBtn)
selection = inputQuestDlg(ParentFigure, question, dlgTitle, btn1, btn2, btn3, defaultBtn)
% extended form - options struct as last argument:
[selection, dontShowAgain] = inputQuestDlg(..., options)
Input Arguments:
  • ParentFigure - handle to the parent window (AppContainer, uifigure, or []); used to center the dialog. Pass [] to use the cached handle from a prior call. In MIB pass obj.mibModel.getProgressBarParent() so the dialog follows the active dataset window when it is undocked. To supply the MIB installation path use options.mibPath.

  • question - [char|string|cell] question text; when cell, lines are joined with \n.

  • options (optional) - structure with the following fields:

    • .mibPath - [char] path to MIB installation folder (default: '')

    • .WindowWidth - [numeric] dialog width in pixels (default: 420)

    • .WindowHeight - [numeric] dialog height in pixels (default: 160)

    • .WindowStyle - [char] 'normal' or 'modal' (default: 'modal')

    • .Icon - [char] 'puffin_question' (default), 'puffin_warning',

      'puffin_info', 'question_48px', 'warning_48px', 'celebrate', 'call4help'

    • .IconWidth - [numeric] icon column width in pixels (default: 48)

    • .ParentFigure - [handle] parent window used to centre the dialog (default: [])

    • .DefaultKey - [char] 'default' or 'cancel'; controls which action the Enter key triggers (default: 'default')

    • .FontSize - [numeric] question text font size (default: 14)

    • .ButtonFontSize - [numeric] button font size (default: 12)

    • .DoNotShowAgain - [logical] show a “Do not show again” checkbox (default: false)

    • .DoNotShowAgainText - [char] checkbox label (default: 'Do not show again')

    • .HelpUrl - [char] URL/.html (opened in the browser) or a base-workspace command;

      when provided a Help button is shown at the bottom-left (default: [])

    • .HelpBtnText - [char] Help button label (default: 'Help')

Output Arguments:
  • selection - [char] label of the pressed button; '' when the dialog is closed or cancelled and no Cancel button exists.

  • dontShowAgain - [logical] state of the “Do not show again” checkbox (false when the checkbox is disabled or the dialog is cancelled).

Usage example:

opt = struct();
opt.WindowStyle = 'modal';
opt.Icon = 'warning_48px';
opt.DoNotShowAgain = true;
opt.WindowHeight = 250;
[answer, dontShow] = utils.dlgs.inputQuestDlg(obj.view.gui, ...
    'Overwrite existing file?', 'Overwrite', 'Yes', 'No', 'No', opt);
if strcmp(answer, 'Yes')
    % overwrite the file
end