No BSD License  

Highlights from
Yet Another Layout Manager

  • resize_example 1. This layout manager is based on MATLAB Central File Exchange entry "Resizable
  • RE_Axis custom axis
  • RE_Box elementary layout building block, positions matrix of elements
  • RE_Button checkboxes/radiobuttons/togglebuttons column
  • RE_Layout Class which defines figure and has many factory methods for ui components
  • RE_Panel custom axis
  • RE_Separator separator with or without label
  • RE_Tabpane tab pane implementation using java element
  • View all files
image thumbnail
from Yet Another Layout Manager by amilcar chaudhary
Easily align gui elements and quickly build resizable gui

RE_Separator
%% separator with or without label
classdef RE_Separator < RE_Box

    properties
        Title = '';
    end

    methods

        % CONSTRUCTOR
        function obj = RE_Separator(varargin)
            
            obj = obj@RE_Box(); set(obj, varargin{:});
            
            hui(1) = uipanel;
            if ~isempty(obj.Title), hui(2) = uicontrol('string', obj.Title, 'FontWeight', 'bold', 'Fontname', 'verdana', 'fore', 'blue', 'style', 'text', 'hori', 'left'); end
                        
            set(obj, 'Element', hui);
        end        
    end % methods

    methods (Access = protected)
        
        %% set elements position
        function setPosition(obj)

            % separator line
            pos    = obj.Position + [obj.Padding(1), 0, -obj.Padding(1)-obj.Padding(3), 0];
            pos(2) = pos(2) + floor(pos(4)/3) - 4;
            pos(4) = 2;
            set(obj.Handle(1), 'position', pos);

            if length(obj.Handle) == 1, return; end

            % separator label
            ext = get(obj.Handle(2), 'extent');
            pos(2) = pos(2) - floor(ext(4)/2) + 4;
            pos(4) = ext(4) - 4;
            pos(3) = ext(3);
            set(obj.Handle(2), 'position', pos);
        end
    end % methods
end % classdef

Contact us at files@mathworks.com