www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@mbcwidgets/@abstractcomponent/print.m
function print(obj, dest) %PRINT Prints a component % % PRINT(OBJ, DEST) prints out a copy of the component. DEST specifies % where the copy should be sent and must be one of 'clipboard', 'printer', % 'printdialog' or 'printpreview'. See MBCPRINT for more details on these % options. If DEST is not specified, 'printer' will be assumed'. % % This method calls the PRINTCOPY and PRINTSIZE methods of the component. % Copyright 2000-2010 The MathWorks, Inc. and Ford Global Technologies, Inc. if nargin<2 dest = 'printer'; end hFig = figure('Visible', 'off', ... 'Renderer', get(ancestor(obj.Parent, 'figure'), 'Renderer'), ... 'Color','w', ... 'MenuBar', 'none', ... 'ToolBar', 'none', ... 'NumberTitle', 'off', ... 'Name', 'MBC Printing Figure', ... 'Tag', 'MBCPrintFig',... 'IntegerHandle', 'off', ... 'HandleVisibility', 'off'); pObj = obj.printcopy(hFig); set(pObj, 'Visible', 'on'); if isa(pObj, 'xregcontainer') set(pObj, 'packstatus', 'on'); end mbcprint(pObj, obj.printSize, dest); delete(hFig);