classdef DBInvisible < dialogmgr.DialogBorder
    % Abstract class for constructing simple DialogContent objects intended
    % to be used with DPSingleClient DialogPresenter.
    %
    % This DialogBorder style does not show any graphical affordance of the
    % border of the dialog.  It has no border edge, no dialog name, etc.
    %
    % This is useful for embedding within a single-dialog DialogPresenter
    % which uses a figure as the dialog border decoration.
    %
    % The uipanel is kept in pixels units.
    

%   Copyright 2010 The MathWorks, Inc.

methods (Access=protected)
    % NOTE: Does NOT override init()
    %       There are no additional graphical widgets needed
    
    function updateImpl(dialogBorder,dialogContent) %#ok<INUSD>
        % Reset position of Panel back to 'pixels' and the default
        % size, in case subclass changed those.  Recalculate height
        % only if requested.
        hPanel = dialogBorder.Panel;
        hPanel.Units = 'pixels';
        hPanel.BorderType = 'none';
        
        % Conceptual layout/parenting of panels in this dialogBorder
        %   Panel
        %      <panel overlapped title text>
        %      gutterTop
        %         [many widgets]
        %      gutterBot
        %
        % Indent to move content inside panel etch border
        gutter = 2*(hPanel.BorderWidth+1);
        ext = getExtent(dialogBorder.DialogContent);
        hPanel.Position = [3 1 0 gutter] + ext;
    end
end

end
