www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@xregdesign/designAugmentReplaceGUI.m
function [out,ok]=designAugmentReplaceGUI(~) %designAugmentReplaceGUI GUI asking user how to update an existing design % Popup a small figure to ask what to do with the potential new design % points that already exist in a design % % [out,ok]=designAugmentReplaceGUI(~) % out is the selected option: 1 - replace all points in design % 2 - augment existing design % 3 - keep fixed points % 4 - cancel % ok is a boolean flag indicating if the user clicked OK % Copyright 2015 The MathWorks, Inc. dlg = mbcgui.container.Dialog('Buttons', 'OK_CANCEL', ... 'Name', 'Design Augment/Replace', ... 'Size', [350 150], ... 'Resize', 'off'); fig = dlg.Figure; txt=uicontrol('Parent',fig,'Style','text','Enable','inactive',... 'HorizontalAlignment','left',... 'String','This design currently contains design points. Do you want to:'); opts=xregGui.rbgroup(fig,'nx',1,'ny',3,'value',[1; 0; 0],'string',... {'Replace the current points with a new design';... 'Augment the current design with additional points';... 'Keep only the fixed points from the current design'}); lyt=xreggridlayout(fig, ... 'dimension',[2 1], ... 'correctalg','on', ... 'rowsizes',[25 65],... 'border', [0 5 0 5], ... 'elements',{txt,opts}, ... 'packstatus','off'); dlg.Content = lyt; Result = dlg.showDialog(); switch Result case 'OK' out = get(opts,'Selected'); ok = true; otherwise out = 0; ok = false; end delete(dlg);