www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgtradeoffgui/@setupUI/pMakeToolbar.m
function pMakeToolbar(obj) %PMAKETOOLBAR Create toolbar for GUI % % PMAKETOOLBAR(OBJ) constructs a toolbar for the GUI and saves its handle % in the Toolbar field of the object. % Copyright 2000-2010 The MathWorks, Inc. and Ford Global Technologies, Inc. tb = obj.Browser.createToolbar(); tb.Visible = obj.Visible; obj.Toolbar = tb; cmdStruct = obj.pGetCommands; xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'ImageFile', 'toffaddnewtable.bmp', ... 'TooltipString', 'Add New Table', ... 'ClickedCallback', {cmdStruct.AddNewTable, obj}); xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'ImageFile', 'toffaddtable.bmp', ... 'TooltipString', 'Add Existing Tables', ... 'ClickedCallback', {cmdStruct.AddExistingTable, obj}); obj.hRemoveTableButton = xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'ImageFile', 'toffremovetable.bmp', ... 'TooltipString', 'Remove Table', ... 'ClickedCallback', {cmdStruct.RemoveTable, obj}); obj.hChangeFillButton = xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'Separator', 'on', ... 'ImageFile', 'toffchangefill.bmp', ... 'TooltipString', 'Change Filling Item', ... 'ClickedCallback', {cmdStruct.EditTableFill, obj}); obj.ModelSetup.attachToolbar(tb);