www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgtradeoffgui/@tableCentricUI/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', 'toffapplyfill.bmp', ... 'TooltipString', 'Apply table filling values', ... 'ClickedCallback', {cmdStruct.ApplyFillAndSave, obj}); xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'Separator', 'on', ... 'ImageFile', 'extrapmaskadd.bmp', ... 'TooltipString', 'Add selection to extrapolation mask', ... 'ClickedCallback', {cmdStruct.AddToExtrapolationMask, obj}); xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'ImageFile', 'extrapmaskremove.bmp', ... 'TooltipString', 'Remove selection from extrapolation mask', ... 'ClickedCallback', {cmdStruct.RemoveFromExtrapolationMask, obj}); xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'ImageFile', 'extrapmaskclear.bmp', ... 'TooltipString', 'Clear extrapolation mask', ... 'ClickedCallback', {cmdStruct.ClearExtrapolationMask, obj}); xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'ImageFile', 'extrapregionsadd.bmp', ... 'TooltipString', 'Add selection to extrapolation regions', ... 'ClickedCallback', {cmdStruct.AddToExtrapolationRegions, obj}); xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'ImageFile', 'extrapregionsremove.bmp', ... 'TooltipString', 'Remove selection from extrapolation regions', ... 'ClickedCallback', {cmdStruct.RemoveFromExtrapolationRegions, obj}); xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'ImageFile', 'extrapregionsclear.bmp', ... 'TooltipString', 'Clear extrapolation regions', ... 'ClickedCallback', {cmdStruct.ClearExtrapolationRegions, obj}); xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'ImageFile', 'extrapolateregions.bmp', ... 'TooltipString', 'Extrapolate using regions', ... 'ClickedCallback', {cmdStruct.RegionExtrapolateAll, obj}); findbut(1) = xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'Separator', 'on', ... 'ImageFile', 'tofffindmin.bmp', ... 'TooltipString', 'Find minimum of output', ... 'ClickedCallback', {cmdStruct.MinimizeInput, obj}, ... 'Enable', 'off'); findbut(2) = xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'ImageFile', 'tofffindmax.bmp', ... 'TooltipString', 'Find maximum of output', ... 'ClickedCallback', {cmdStruct.MaximizeInput, obj}, ... 'Enable', 'off'); findbut(3) = xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'ImageFile', 'tofffindturn.bmp', ... 'TooltipString', 'Find turning point of output', ... 'ClickedCallback', {cmdStruct.TurningOfInput, obj}, ... 'Enable', 'off'); xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'ImageFile', 'toffresetvalues.bmp', ... 'TooltipString', 'Reset inputs to last saved values', ... 'ClickedCallback', {cmdStruct.ResetInputs, obj}); xregGui.uipushtool(tb, ... 'TransparentColor', [0 255 0], ... 'Separator', 'on', ... 'ImageFile', 'toffautomated.bmp', ... 'TooltipString', 'Automated tradeoff', ... 'ClickedCallback', {cmdStruct.AutoTradeoff, obj}); obj.hGraphSelChangeList_TB = handle.listener( ... obj.GraphsView, 'SelectionChange', {@i_inputfinderenable, findbut}); function i_inputfinderenable(src, evt, hButtons) if ~isempty(evt.data.Row) && evt.data.Row>0 set(hButtons, 'Enable', 'on'); else set(hButtons, 'Enable', 'off'); end