ButtonGroup Objects

Container objects to manage radio or toggle buttons with functionality of the GUI Layout Toolbox
1,3K téléchargements
Mise à jour 21 juin 2011

Afficher la licence

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

Citation pour cette source

Matthew Whitaker (2024). ButtonGroup Objects (https://www.mathworks.com/matlabcentral/fileexchange/31902-buttongroup-objects), MATLAB Central File Exchange. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2011a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur App Building dans Help Center et MATLAB Answers
Remerciements

Inspiré par : GUI Layout Toolbox

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
1.0.0.0