www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@xregGui/@MBCToolbar/notifyNewSeparator.m

    function notifyNewSeparator(obj, but)
%NOTIFYNEWSEPARATOR Notify toolbar that a separator setting has been altered
%
%  NOTIFYNEWSEPARATOR(OBJ, BUT) is called to notify OBJ that the separator
%  property of the button BUT has been altered.

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


ch = obj.Children;
ind = find(but==ch);
if ~isempty(ind)
    % Update the button separator cache
    bSep = strcmp(but.Separator, 'on');
    if bSep ~= obj.ButtonSepCache(ind)
        obj.ButtonSepCache(ind) = bSep;
        if obj.ButtonVisCache(ind)
            % Update the button edges values
            if bSep
                offset = 6;
            else
                offset = -6;
            end
            obj.ButtonEdges(ind:end, :) = obj.ButtonEdges(ind:end, :) + offset;
            
            if obj.DrawingEnabled
                % Update the number of buttons to render
                obj.NButtonsToRender = obj.pNumberOfButtonsToRender(obj.hToolbarInterface.Position);
            end
        end
    end
end