Can I create a questdlg box with multiple yes/no options in the same box?

20 次查看(过去 30 天)
choice = questdlg('Living Room outlet', ...
'', ...
'On','Off','Off');
switch choice
case 'On'
disp(' Outlet is on.')
outlet = 1;
case 'Off'
disp(' Outlet is off.')
outlet = 2;
end
Right now, of course 2 options show up in the box, however I want the user to be able to select multiple 'on ' 'off' options within the same dlg box. For example:
Living Room: On Off
Master room: On Off
Bedroom: On Off
All of that in the same dlg box and still be able to implement other actions based on the users input.

回答(2 个)

Image Analyst
Image Analyst 2016-4-24
You might want to setup a GUI with three static text labels and 3 pairs of radio buttons. Put the radio button pairs in a group panel, one panel per pair, so they will turn each other off when selected.

Jakob Sievers
Jakob Sievers 2019-4-4
This is an old question but I was wondering if anyone know of any solution to this question? If not I'll sit down and code it myself but I figured that I'd ask if it's been done (I haven't been able to find it yet) so as to not spend too much time on this.
What I need is not just more buttons than the current questdlg allows but essentially a number of on/off buttons which can be set as desired and then an ok and a cancel button at the bottom. Maybe someone knows of a solution to this problem?
Thanks in advance
  2 个评论
Jakob Sievers
Jakob Sievers 2019-4-5
The mathworks page for menu() suggested to use listdlg instead so I had a look and that has the functionality that I was looking for so thanks for guiding me in the right direction :-)

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Dialog Boxes 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by