classdef Hauptfenster < handle
    properties
        HauptFigure    % Hauptfenster
        button_hinzu         %Button zum Hinzufügen neuer Textboxen
        textbox % neue Textbox anlegen
    end
    methods (Static, Access = public)  % Methoden des Hauptfensters
        
        function obj = Hauptfenster()
            obj.HauptFigure=figure();  % HauptFigure wird erstellt
            scrsz = get(0,'ScreenSize');  % Bildschirmgröße auslesen
            set(obj.HauptFigure, ...
                'Position',[0.3*scrsz(3),0.3*scrsz(4),0.6*scrsz(3),0.6*scrsz(4)],...
                'Units','normalized',...
                'Resize','on',...
                'MenuBar','none',...
                'Name','Gearboxtool 2015',...
                'NumberTitle','off');
            
            obj.button_hinzu = uicontrol();    %Button erstellen
            set(obj.button_hinzu, ...
                'style', 'pushbutton', ...
                'FontName', 'Arial', ...
                'FontSize', 10, ...
                'string', 'Hinzufügen', ...
                'Units','normalized', ...
                'Position', [.89,.15,.1,.07], ...
                'Callback', {@obj.button_hinzu_Callback, obj});
        end
    end
    methods (Static, Access = private)      
        function button_hinzu_Callback(~,~, obj)
            obj.textbox = uicontrol();
            set(obj.textbox, ...
                'style', 'text', ...
                'FontName', 'Arial', ...
                'FontSize', 10, ...
                'string', 'Nummer x', ...
                'HorizontalAlignment', 'left', ...
                'Units','normalized', ...
                'Position',[0.02 0.85 0.1 0.1], ...
                'BackgroundColor', 'green');
            %Hauptfenster.erstelleTextbox;
        end        
    end 
    methods (Static, Access = public)  
        
        function obj=erstelleTextbox()
            obj.textbox = uicontrol();
            set(obj.textbox, ...
                'style', 'text', ...
                'FontName', 'Arial', ...
                'FontSize', 10, ...
                'string', 'Nummer x', ...
                'HorizontalAlignment', 'left', ...
                'Units','normalized', ...
                'Position',[0.02 0.85 0.1 0.1], ...
                'BackgroundColor', 'green');
        end
        
    end
end