Simple settings dialog

버전 1.0.0.1 (8.02 KB) 작성자: Levente Hunyadi
A simple auto-resizing modal dialog box that lets the user change a series of settings.
다운로드 수: 634
업데이트 날짜: 2021/2/18

라이선스 보기

The settings dialog is constructed with a simple procedural syntax that accepts a variable number of control descriptors. A control descriptor is a MatLab class that defines the user interface presentation.

gui_logical descriptors are translated into two-state checkboxes. The properties Name, Caption and Default translate into parameter name, descriptive label presented to the user and initial value (true or false), respectively.

gui_option descriptors are mapped into a set of mutually exclusive radio buttons. The properties Name and Caption have similar roles as in the case of gui_logical, while Choices is a list of possible values a parameter may take, and Labels is a list of labels displayed to the user, each corresponding to a single radio button. The property Default is an ordinal or one of the values in Choices.

The settings dialog returns a structure with fields are defined by the descriptors' Name property and values as selected by the user (i.e. true/false for a checkbox, and one of the values in Choices for a set of radio buttons). If the dialog is canceled (either with the Cancel button or with the ESC key), an empty array is returned.

Example:

results = gui_settings_dlg( ...
'Sample settings dialog', ...
'Please choose an estimation strategy', ...
gui_option( ...
'Parameters', 'Estimated parameters', ...
{'Model','ModelNoise'}, {'model only','model and noise'}), ...
gui_option( ...
'SimulationMethod', 'Simulation method', ...
{'Single','Indeterminate'}, [], 'Indeterminate'), ...
gui_logical('ShowResults', 'Show results', false));

Output:
results =
Parameters: 'Model'
SimulationMethod: 'Indeterminate'
ShowResults: 1

MATLAB 릴리스 호환 정보
개발 환경: R2008a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Dialog Boxes에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.1

Updated to R2020b

1.0.0.0