www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@conbase/pCreateChooserLayout.m

    function [L, CB] = pCreateChooserLayout(obj, figh, hLabel, hCards,IsBoundary)
%PCREATECHOOSERLAYOUT Create a layout for a "type chooser" dialog
%
%  [LYT, CALLBACK] = PCREATECHOOSERLAYOUT(OBJ, FIGH, HLABEL, HCARDS)
%
%  HLABEL should be a xregGui.labelcontrol or similar that controls which
%  constraint is current
%
%  HCARDS is the layout for the "main" part that displays info or whatever
%  about the current constraint
%
%  See also CONBASE, 
%           CONBASE/GUITYPECHOOSER,
%           CONBASE/GUITYPEANDFACTORSCHOOSER.

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

if nargin<5
    IsBoundary = false;
end
descriptxt = axestext(figh, ...
    'verticalalignment','top', ...
    'visible', 'off');
descripim = mbcgui.widget.Image('Parent',figh, ...
    'Visible', 'off');
div = xregGui.dividerline('parent', figh, ...
    'visible', 'off');

L = xreggridbaglayout(figh, ...
    'dimension', [5 5], ...
    'rowsizes', [0 20 0 2 -1], ...
    'colsizes', [-1 20 300 40 5], ...
    'gapy', 10, ...
    'mergeblock', {[1 3] [3 3]}, ...
    'mergeblock', {[1 3] [4 4]}, ...
    'mergeblock', {[4 4] [1 5]}, ...
    'mergeblock', {[5 5] [1 5]}, ...
    'elements', {[], hLabel, [], div, hCards, ...
    [], [], [], [], [], ....
    descriptxt, [], [], [], [], ...
    descripim,[],[],[],[],...
    [],[],[],[],[]});

    CB = @i_switchoption;
    function i_switchoption(obj)
        set(descriptxt,'String',texdescription(obj,IsBoundary));
        set(descripim,'ImageFile',largeicon(obj));
    end
end