www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgtradeoffgui/@tableTableView/pCreateLegendObjects.m

    function pCreateLegendObjects(obj)
%PCREATELEGENDOBJECTS Create objects that are required for viewing the legend
%
%  PCREATELEGENDOBJECTS(OBJ) creates all of the additional objects that are
%  needed for displaying the legend.

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


pnl = mbcgui.container.layoutpanel(...
    'Parent', obj.Parent, ...
    'Visible', obj.Visible, ...
    'BorderType', 'beveledout');
obj.hLegendPanel = pnl;

% Create the legend items
lock = iMakeItem(pnl, 'lock_small.bmp', 'Locked table cell');
tick = iMakeItem(pnl, 'tick_small_black.bmp', 'Inputs have been saved');
model = iMakeItem(pnl, '', '');
extrap = iMakeItem(pnl, 'toffextrapcell.bmp', 'Extrapolation mask');
region = iMakeItem(pnl, 'toffregioncell.bmp', 'Region mask');
extrapregion = iMakeItem(pnl, 'toffextrapregioncell.bmp', 'Extrapolation and region mask');

obj.hLegendValidModel = model;

g = xreggridbaglayout(pnl, ...
    'dimension', [3 2], ...
    'colsizes', [150 170], ...
    'gapx', 10, ...
    'border', [2 0 2 0], ...
    'elements', {tick, lock, model, extrap, region, extrapregion});
set(pnl, 'LayoutComponent', {g});


function h = iMakeItem(hParent, Image, String)
h = mbcgui.widget.IconText('Parent', hParent, ...
    'String', String, ...
    'ImageFile', Image);