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

    function hInfo = generateEditorPages(obj, hPageGroup) %#ok<INUSL>
%GENERATEEDITORPAGES Generate a set of dialog pages for constraint editing 
%
%  HINFO = GENERATEEDITORPAGES(OBJ, HPAGEGROUP) returns an arrray of
%  DialogPageInfo objects that describe a set a of panels for editing the
%  constraint.

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


hInfo = mbcgui.dialog.PageInfo( ...
    'PageGroup', hPageGroup, ...
    'Name', 'Base Editor', ...
    'PreferredWidth', 500, ...
    'PreferredHeight', 250, ...
    'HelpHandler', 'mv_helptool', ...
    'HelpCode', 'mbc_Constraints', ...
    'CreateCallback', @i_createlyt);



function i_createlyt(hInfo, ~)

hParent = hInfo.Parent;

obj = hInfo.getObject;

msg = sprintf('%s constraints are not editable.', typename(obj));
txt = xreguicontrol(...
    'Visible', 'off', ...
    'Parent', hParent,...
    'HitTest', 'off',...
    'Enable', 'inactive',...
    'Style', 'text',...
    'String', msg,...
    'HorizontalAlignment', 'center');
lyt = xreggridbaglayout(hParent, ...
    'dimension', [2 1],...
    'rowsizes', [-1 -1],...
    'rowratios', [1 2],...
    'elements',{ [], txt } );

hInfo.setUI(lyt);