www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgtradeoffgui/@mmTableSetupView/pUpdateSwitchNames.m

    function pUpdateSwitchNames(obj)
%PUPDATESWITCHNAMES Update the names of the switch inputs in the object 
%
%  PUPDATESWITCHNAMES(OBJ) alters the GUI of the object to match the
%  current switching input names.

%  Copyright 2000-2010 The MathWorks, Inc. and Ford Global Technologies, Inc.


if ~isempty(obj.MessageService) ...
        && length(obj.MessageService.SwitchInputs)==2
    
    inputnames = obj.MessageService.SwitchInputs;
    set([obj.hAxisLabel1.Control; obj.hAxisLabel2.Control], ...
        'String', inputnames);
    set([obj.hAxisLabel1; obj.hAxisLabel2], 'Enable', 'on');
    set([obj.hNormLabel1; obj.hNormLabel2], ...
        {'String'}, ...
        {sprintf('%s normalizer:', inputnames{1}); ...
        sprintf('%s normalizer:', inputnames{2})});
else
    set([obj.hAxisLabel1; obj.hAxisLabel2], 'Enable', 'off');
    set([obj.hAxisLabel1.Control; obj.hAxisLabel2.Control], {'String'}, {{''};{''}});
    set([obj.hNormLabel1; obj.hNormLabel2], ...
        {'String'}, ...
        {'Normalizer 1:'; 'Normalizer 2:'});
end