ButtonGroup Objects

版本 1.0.0.0 (5.7 KB) 作者: Matthew Whitaker
Container objects to manage radio or toggle buttons with functionality of the GUI Layout Toolbox
1.3K 次下载
更新时间 2011/6/21

查看许可证

The ButtonGroup controls require the GUI Layout Toolbox by Ben Tordoff and David
Sampson available at:
http://www.mathworks.com/matlabcentral/fileexchange/27758-gui-layout-toolbox
The controls in this submissionshould be placed in the +uiextras folder in the GUI Layout Toolbox or in another folder called +uiextras that resides under a folder on your path. It is recommended to run rehash path after doing this.

EXample:
function buttonGroupExample
f = figure;
vb = uiextras.VBox('Parent',f,'Units','Normalized');
bgH = uiextras.HButtonGroup('Parent',vb,'Buttons',{'1','2','3'},'Spacing',50,'Padding',10,'SelectedChild',1,'SelectionChangeFcn',@onSelectionChange);
hb = uiextras.HBox('Parent',vb);
bgV = uiextras.VButtonGroup('Parent',hb,'ButtonStyle','toggle','Buttons',('123')','Spacing',20,'Padding',10,'SelectedChild',3,'SelectionChangeFcn',@onSelectionChange);
p = uiextras.Panel('Parent',hb);
set(hb,'Sizes',[100,-1]);
lblDisplay = uicontrol('Parent',p,'FontSize',16,'Style','text');
onSelectionChange([],[]);
function onSelectionChange(src,evt)
disp(evt);
set(lblDisplay,'String',int2str([bgH.SelectedChild,bgV.SelectedChild]));
end %onSelectionChange
end %buttonGroupExample

引用格式

Matthew Whitaker (2024). ButtonGroup Objects (https://www.mathworks.com/matlabcentral/fileexchange/31902-buttongroup-objects), MATLAB Central File Exchange. 检索时间: .

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

参考作品: GUI Layout Toolbox

Community Treasure Hunt

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

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