www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/+mbcgui/+container/createTextPanel.m

    function [pnl, txt] = createTextPanel(varargin)
%createTextPanel Create a panel that contains a single text label
%
%  [hPanel, hText] = createTextPanel(Prop, Value, ...) creates an instance
%  of a LayoutPanel that contains a single text uicontrol and is set
%  with an appropriate border and border indent.  Input arguments are
%  passed to the LayoutPanel constructor.  Handles to both the panel and
%  the contained text control are returned.

%  Copyright 2010 The MathWorks, Inc.


pnl = mbcgui.container.layoutpanel(...
    'BorderType', 'beveledin', ...
    'LayoutBorder', [0 1 2 1], ...
    varargin{:});
txt = uicontrol('Parent', pnl, ...
    'Style', 'text', ...
    'Enable', 'inactive', ...
    'HitTest','off',...
    'HorizontalAlignment', 'left');
set(pnl, 'LayoutComponent', txt);