Specifying icon in questdlg

版本 1.0.0.0 (24.0 KB) 作者: Dirk
'buttondlg' enables you to change the icon in the question dialog box.
575.0 次下载
更新时间 2014/4/29

查看许可证

'buttondlg' is a simple modification of MATLABs function QUESTDLG which enables the user to change the icon in the dialog box, known from the MATLAB function MSGBOX. Available icons are the same known from MSGBOX ('none', 'warn', 'error', 'help', 'custom'), but also 'quest' (known from the original QUESTDLG) and 'bulb'. If you choose 'custom', you also have to specify IconData and optional IconCMap, also known form fhe function MSGBOX. Best icon size is [50,50].

Examples (as shown in the image):

Example 1:

Button=buttondlg('System Error!','Error','Stop','Continue', struct('Default','Continue','IconString','error'));

Example 2:

Button=buttondlg('Do you like the color icon?','Question','Yes','Maybe','No',struct('Default','Yes','IconString','custom','IconData',uint8(rand(50,50,3).*256)));
% is the same like:
S.Default = 'Yes';
S.IconString = 'custom';
S.IconData = uint8(rand(50,50,3).*256);
Button=buttondlg('Do you like the color icon?','Question','Yes','Maybe','No',S);

Example 3:

options.Interpreter = 'tex';
options.Default = 'Don''t know';
options.IconString = 'none';
qstring = 'Is \Sigma(\alpha - \beta) < 0?';
title = 'Boundary Condition';
Button = buttondlg(qstring,title,'Yes','No','Don''t know',options)

引用格式

Dirk (2024). Specifying icon in questdlg (https://www.mathworks.com/matlabcentral/fileexchange/46401-specifying-icon-in-questdlg), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2013a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Dialog Boxes 的更多信息
致谢

参考作品: Specifying questdlg position

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0