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

    function pCreateDisplay(obj)
%PCREATEDISPLAY Private display creation for factorselector2d
%
%  OUT = PCREATEDISPLAY(IN)

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


SC = xregGui.SystemColorsDbl;

% Create the background patch
Pnl = mbcgui.container.layoutpanel( ...
    'Parent', obj.Parent, ...
    'BackgroundColor', obj.BackgroundColor, ...
    'HitTest', 'off', ...
    'Visible', obj.Visible);
obj.PanelHandle = Pnl;

axW = mbcgui.widget.AxesContainer( ...
    'Parent',Pnl,...
    'PositionSetting','outer');
obj.Axes = axW.AxesHandle;
set(obj.Axes,...
    'Units','pixels',...
    'Layer','top',...
    'Color', obj.BackgroundColor,...
    'FontSize',8);

mbcxlabel(obj.Axes, '', 'Interpreter', 'none');
mbcylabel(obj.Axes, '', 'Interpreter', 'none');

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

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

obj.TextHandles = [xText ; yText];


lyt = xreggridbaglayout(Pnl,...
    'packgroup', 'mbcwidgets.factorselector2d',...
    'packstatus','off', ...
    'dimension',[2,5],...
    'rowsizes', [-1 20],...
    'colsizes',[-1 -1 -1 -1 -1],...
    'colratios',[1 8 2 8 1],...
    'gapy', 5,...
    'border', [10 10 10 10],...
    'mergeblock', {[1 1], [1 5]}, ...
    'elements',{axW, [], [],xText, [], [], [], yText});
set(Pnl, 'LayoutComponent', {lyt});
set(lyt, '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);