www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgtools/@cgbrowser/doDrawText.m
function doDrawText(h) %DODRAWTEXT Update labels and menus on browser % % DODRAWTEXT(CGB) updates the text of all labels, menu items and toolbar % items that have a dependence on the current node. % Copyright 2000-2010 The MathWorks, Inc. and Ford Global Technologies, Inc. if h.GUIExists p = h.SelNode; nm = h.CurrentType.Name; % Remove carriage returns and use string in panel titles nm = strrep(nm, sprintf('\n'), ' '); set(h.Hand.Figure.SelTPText{1}, 'BarTitle', nm); set(h.Hand.Figure.SelTPText{2}, 'BarTitle', nm); % Check remove menu item if ~isnull(p) nm = p.name(h.SelSubItem); else nm = ''; end lbl = sprintf('D&uplicate %s',nm); set([h.Hand.Menubar.Edit.Duplicate; h.ContextMenus.DuplicateMenus(:)],'Label',lbl); lbl = sprintf('Delete %s',nm); set([h.Hand.Menubar.Edit.Delete; h.ContextMenus.DeleteMenus(:)],'Label',['&' lbl]); set(h.Hand.Toolbar.buttons.Delete,'TooltipString',lbl); [nul,nm,ext] = fileparts(h.RootNode.projectfile); nm = ['CAGE Browser - ' nm ext]; set(h.Figure,'Name',nm); end