function varargout = paramArbreNoel(varargin)
% PARAMARBRENOEL M-file for paramArbreNoel.fig
%      PARAMARBRENOEL, by itself, creates a new PARAMARBRENOEL or raises the existing
%      singleton*.
%
%      H = PARAMARBRENOEL returns the handle to a new PARAMARBRENOEL or the handle to
%      the existing singleton*.
%
%      PARAMARBRENOEL('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in PARAMARBRENOEL.M with the given input arguments.
%
%      PARAMARBRENOEL('Property','Value',...) creates a new PARAMARBRENOEL or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before paramArbreNoel_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to paramArbreNoel_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help paramArbreNoel

% Last Modified by GUIDE v2.5 11-Jan-2004 18:26:45

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @paramArbreNoel_OpeningFcn, ...
                   'gui_OutputFcn',  @paramArbreNoel_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin & isstr(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before paramArbreNoel is made visible.
function paramArbreNoel_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to paramArbreNoel (see VARARGIN)

% Choose default command line output for paramArbreNoel
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes paramArbreNoel wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = paramArbreNoel_OutputFcn(hObject, eventdata, handles)
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes during object creation, after setting all properties.
function bp_CreateFcn(hObject, eventdata, handles)
% hObject    handle to bp (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function bp_Callback(hObject, eventdata, handles)
% hObject    handle to bp (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of bp as text
%        str2double(get(hObject,'String')) returns contents of bp as a double


% --- Executes during object creation, after setting all properties.
function ba_CreateFcn(hObject, eventdata, handles)
% hObject    handle to ba (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function ba_Callback(hObject, eventdata, handles)
% hObject    handle to ba (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of ba as text
%        str2double(get(hObject,'String')) returns contents of ba as a double


% --- Executes during object creation, after setting all properties.
function bs_CreateFcn(hObject, eventdata, handles)
% hObject    handle to bs (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function bs_Callback(hObject, eventdata, handles)
% hObject    handle to bs (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of bs as text
%        str2double(get(hObject,'String')) returns contents of bs as a double


% --- Executes during object creation, after setting all properties.
function bpd_CreateFcn(hObject, eventdata, handles)
% hObject    handle to bpd (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function bpd_Callback(hObject, eventdata, handles)
% hObject    handle to bpd (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of bpd as text
%        str2double(get(hObject,'String')) returns contents of bpd as a double


% --- Executes during object creation, after setting all properties.
function bad_CreateFcn(hObject, eventdata, handles)
% hObject    handle to bad (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function bad_Callback(hObject, eventdata, handles)
% hObject    handle to bad (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of bad as text
%        str2double(get(hObject,'String')) returns contents of bad as a double


% --- Executes during object creation, after setting all properties.
function bsd_CreateFcn(hObject, eventdata, handles)
% hObject    handle to bsd (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function bsd_Callback(hObject, eventdata, handles)
% hObject    handle to bsd (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of bsd as text
%        str2double(get(hObject,'String')) returns contents of bsd as a double


% --- Executes during object creation, after setting all properties.
function niveau_CreateFcn(hObject, eventdata, handles)
% hObject    handle to niveau (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function niveau_Callback(hObject, eventdata, handles)
% hObject    handle to niveau (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of niveau as text
%        str2double(get(hObject,'String')) returns contents of niveau as a double


% --- Executes on button press in dessine.
function dessine_Callback(hObject, eventdata, handles)
% hObject    handle to dessine (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
obj=findobj('tag','bp');
d.pointEmbranch=eval(get(obj,'string'))/100;
obj=findobj('tag','ba');
d.angleEmbranch=eval(get(obj,'string'));
obj=findobj('tag','bs');
d.tailleBranche=eval(get(obj,'string'))/100;
obj=findobj('tag','bpd');
d.pointEmbranchd=eval(get(obj,'string'))/100;
obj=findobj('tag','bad');
d.angleEmbranchd=eval(get(obj,'string'));
obj=findobj('tag','bsd');
d.tailleBranched=eval(get(obj,'string'))/100;
obj=findobj('tag','niveau');
d.niveau=eval(get(obj,'string'));
obj=findobj('tag','gbc');
d.gbc=(get(obj,'BackGroundcolor'));
obj=findobj('tag','pbc');
d.pbc=(get(obj,'BackGroundcolor'));
obj=findobj('tag','fc');
d.fc=(get(obj,'BackGroundcolor'));
obj=findobj('tag','bdn');
d.bdn=eval(get(obj,'string'))/100;
h=figure('name','Un sapin de Noel');
% Žcran standard
%%%%% taille=get(h,'position');
% plein Žcran
taille=[1 5 1280 923];
set(h,'Position',taille)
d.hauteurEcran=taille(4);
d.largeurEcran=taille(3);

set(h,'userdata',d)
arbreFractal


% --- Executes on button press in gbc.
function gbc_Callback(hObject, eventdata, handles)
% hObject    handle to gbc (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
a=uisetcolor;
set(gcbo,'BackGroundcolor',a)

% --- Executes on button press in pbc.
function pbc_Callback(hObject, eventdata, handles)
% hObject    handle to pbc (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
a=uisetcolor;
set(gcbo,'BackGroundcolor',a)

% --- Executes on button press in fc.
function fc_Callback(hObject, eventdata, handles)
% hObject    handle to fc (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
a=uisetcolor;
set(gcbo,'BackGroundcolor',a)


% --- Executes during object creation, after setting all properties.
function bdn_CreateFcn(hObject, eventdata, handles)
% hObject    handle to bdn (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function bdn_Callback(hObject, eventdata, handles)
% hObject    handle to bdn (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of bdn as text
%        str2double(get(hObject,'String')) returns contents of bdn as a double


