www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@mbcwidgets/@factorselector3d/pCreateDisplay.m

    function pCreateDisplay(obj, HasAxes)
%PCREATEDISPLAY Private display creation for factorselector3d
%
%  OUT = PCREATEDISPLAY(OBJ, HASAXES)

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


SC = xregGui.SystemColorsDbl;

Pnl = mbcgui.container.layoutpanel(...
    'Parent', obj.Parent, ...
    'BackgroundColor', obj.BackgroundColor, ...
    'HitTest', 'off', ...
    'Visible', obj.Visible);
obj.PanelHandle = Pnl;

if HasAxes
    axPnl = mbcgui.widget.AxesContainer( ...
        'Parent',Pnl,...
    'PositionSetting','outer');
    obj.Axes = axPnl.AxesHandle;
    set(obj.Axes,...
        'Units','pixels',...
        'Layer','top',...
        'XGrid', 'on', ...
        'YGrid', 'on', ...
        'Box', 'on', ...
        'Color','none',...
        'FontSize',8);
    view(obj.Axes, 3);
    
    mbcxlabel(obj.Axes, '','Interpreter', 'none');
    mbcylabel(obj.Axes, '','Interpreter', 'none');
    mbczlabel(obj.Axes, '','Interpreter', 'none');
    

end

obj.XFactorPopup = uicontrol('Style','popupmenu',...
    'Parent', Pnl,...
    'String',' ',...
    'Callback',{@i_factorClick, obj, 1},...
    'BackgroundColor', SC.WINDOW_BG,...
    'Tag', 'XFactorPopup');
xText = xregGui.labelcontrol('Parent', Pnl, ...
    'BackgroundColor', obj.BackgroundColor, ...
    'LabelSizeMode', 'absolute', ...
    'LabelSize', 40, ...
    'ControlSizeMode', 'relative', ...
    'ControlSize', 1, ...
    'String', 'X-axis:', ...
    'Control', obj.XFactorPopup);

obj.YFactorPopup = uicontrol('Style','popupmenu',...
    'Parent', Pnl,...
    'String',' ',...
    'Callback',{@i_factorClick, obj, 2},...
    'BackgroundColor', SC.WINDOW_BG,...
    'Tag', 'YFactorPopup');
yText = xregGui.labelcontrol('Parent', Pnl, ...
    'BackgroundColor', obj.BackgroundColor, ...
    'LabelSizeMode', 'absolute', ...
    'LabelSize', 40, ...
    'ControlSizeMode', 'relative', ...
    'ControlSize', 1, ...
    'String', 'Y-axis:', ...
    'Control', obj.YFactorPopup);

obj.ZFactorPopup = uicontrol('Style','popupmenu',...
    'Parent', Pnl,...
    'String',' ',...
    'Callback',{@i_factorClick, obj, 3},...
    'BackgroundColor', SC.WINDOW_BG,...
    'Tag', 'ZFactorPopup');
zText = xregGui.labelcontrol('Parent', Pnl, ...
    'BackgroundColor', obj.BackgroundColor, ...
    'LabelSizeMode', 'absolute', ...
    'LabelSize', 40, ...
    'ControlSizeMode', 'relative', ...
    'ControlSize', 1, ...
    'String', 'Z-axis:', ...
    'Control', obj.ZFactorPopup);

obj.TextHandles = [xText ; yText ; zText];

if HasAxes
    layout = xreggridbaglayout(Pnl,...
        'packgroup', 'mbcwidgets.factorselector3d',...
        'packstatus','off', ...
        'dimension', [2 7],...
        'rowsizes', [-1 20],...
        'colsizes',[-1 -1 -1 -1 -1 -1 -1],...
        'colratios',[1 8 2 8 2 8 1],...
        'gapy', 5,...
        'border', [10 10 10 10],...
        'mergeblock', {[1 1], [1 7]}, ...
        'elements',{axPnl,    [], ...
                     [], xText, ...
                     [],    [], ...
                     [], yText, ...
                     [],    [], ...
                     [], zText, ...
                     [],   []});
else
    layout = xreggridbaglayout(Pnl,...
        'packgroup', 'mbcwidgets.factorselector3d',...
        'packstatus','off', ...
        'dimension', [1 7],...
        'rowsizes', 20,...
        'colsizes', [-1 -1 -1 -1 -1 -1 -1],...
        'colratios', [1 8 2 8 2 8 1],...
        'gapy', 5,...
        'border', [10 10 10 10],...
        'mergeblock', {[1 1], [1 7]}, ...
        'elements',{[], xText, [], yText, [], zText, []});
end

set(Pnl, 'LayoutComponent', {layout});
set(layout, 'packstatus', 'on');
obj.Display = Pnl;


%------------------------------------------------------------------------
function i_factorClick(src, event, obj, VarIndex)
% Send to an internal function to decide what to do
obj.pFactorPopupClicked(VarIndex);