1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
| function myGUI
h1 = figure(...
'Units','characters',...
'PaperUnits',get(0,'defaultfigurePaperUnits'),...
'Color',[0.941176470588235 0.941176470588235 0.941176470588235],...
'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],...
'IntegerHandle','off',...
'InvertHardcopy',get(0,'defaultfigureInvertHardcopy'),...
'MenuBar','none',...
'Name','fiche_entraineur',...
'NumberTitle','off',...
'PaperPosition',get(0,'defaultfigurePaperPosition'),...
'PaperSize',[20.98404194812 29.67743169791],...
'PaperType',get(0,'defaultfigurePaperType'),...
'Position',[103.8 15.1538461538462 230.8 46.3076923076923],...
'Resize','off',...
'UseHG2','off',...
'HandleVisibility','callback',...
'Tag','figure1',...
'UserData',[],...
'Visible','on');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%%%%% INTITULE DES DIFFERENTS PARAMETRES A ENTRER %%%%%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% texte prénom
h2 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Position',[29.8 32.6153846153846 30.2 2.07692307692308],...
'String','Prénom',...
'Style','text',...
'Tag','text2');
%% texte nom
h3 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Position',[29.8 36.4615384615385 30.2 2.07692307692308],...
'String','Nom',...
'Style','text',...
'Tag','text3');
%% texte adresse
h4 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Position',[29.8 28.7692307692308 30.2 2.07692307692308],...
'String','Adresse',...
'Style','text',...
'Tag','text4');
%% texte ville
h5 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Position',[29.8 25.0769230769231 20.2 1.92307692307692],...
'String','Ville',...
'Style','text',...
'Tag','text5');
%% texte code postal
h6 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Position',[89.6 25.0769230769231 20.2 1.92307692307692],...
'String','Code postal',...
'Style','text',...
'Tag','text6');
%% texte région
h7 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Position',[29.8 21.2307692307692 20.2 1.92307692307692],...
'String','Région',...
'Style','text',...
'Tag','text7');
%% texte nationalité
h8 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Position',[89.8 21.2307692307692 20.2 1.92307692307692],...
'String','Nationalité',...
'Style','text',...
'Tag','text8');
%% panel commentaires
h9 = uipanel(...
'Parent',h1,...
'Units','characters',...
'Title','Commentaires',...
'Tag','uipanel1',...
'Clipping','on',...
'Position',[29.8 11.5384615384615 110.2 7.76923076923077]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%%%%% EDIT BOX %%%%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% edit box commentaires
h10 = uicontrol(...
'Parent',h9,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','fiche_entraineur_export(''edit8_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[1.8 0.769230769230772 106 5.53846153846154],...
'String','edit commentaires',...
'Style','edit');
%% edit box nom
h11 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','fiche_entraineur_export(''edit1_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[59.8 36.5384615384615 80.2 2],...
'String','edit nom',...
'Style','edit');
%% edit box adresse
h12 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','fiche_entraineur_export(''edit2_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[59.8 28.8461538461538 80.2 2],...
'String','edit adresse',...
'Style','edit');
%% edit box prénom
h13 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','fiche_entraineur_export(''edit3_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[59.8 32.6923076923077 80.2 2],...
'String','edit prenom',...
'Style','edit');
%% edit box ville
h14 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','fiche_entraineur_export(''edit4_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[49.8 25.3846153846154 30.2 1.61538461538462],...
'String','edit ville',...
'Style','edit');
%% edit box code postal
h15 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','fiche_entraineur_export(''edit5_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[109.8 25.3846153846154 30.2 1.61538461538462],...
'String','edit code postal',...
'Style','edit');
%% edit box region
h16 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','fiche_entraineur_export(''edit6_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[49.8 21.5384615384615 30.2 1.61538461538462],...
'String','edit region',...
'Style','edit');
%% edit box nationalité
h17 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'Callback','fiche_entraineur_export(''edit7_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[109.8 21.5384615384615 30.2 1.61538461538462],...
'String','edit nationalité',...
'Style','edit');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%%%%% TITRE FICHE %%%%%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% texte fiche entraîneur
h18 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'FontUnits','centimeters',...
'FontAngle','italic',...
'FontSize',0.6345175,...
'FontWeight','bold',...
'ForegroundColor',[1 0 0],...
'HorizontalAlignment','left',...
'Position',[29.8 40 110.2 5.07692307692308],...
'String','FICHE ENTRAÎNEUR',...
'Style','text',...
'Tag','text9');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%%%%% PUSH BUTTON %%%%%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% pushbutton enregistrer
h19 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','fiche_entraineur_export(''pushbutton1_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[119.8 43.1538461538462 20.2 1.69230769230769],...
'String','Enregistrer',...
'callback','@save2txt',...
'Tag','pushbutton1');
%% pushbutton retour
h20 = uicontrol(...
'Parent',h1,...
'Units','characters',...
'Callback','fiche_entraineur_export(''pushbutton2_Callback'',gcbo,[],guidata(gcbo))',...
'Position',[119.8 40.6923076923077 20.2 1.69230769230769],...
'String','Retour',...
'callback','menu_principal',...
'Tag','pushbutton2');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% %%%%%% SAUVEGARDER EN FORMAT TEXTE + BARRE DE CHARGEMENT %%%%%% %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function save2txt(obj,event)
handles=guihandles(gcbf);
a=str2num(get(handles.edit_nom,'string'));
b=str2num(get(handles.edit_prenom,'string'));
c=str2num(get(handles.edit_adresse,'string'));
d=str2num(get(handles.edit_ville,'string'));
e=str2num(get(handles.edit_code_postal,'string'));
f=str2num(get(handles.edit_region,'string'));
g=str2num(get(handles.edit_nationalite,'string'));
[filename,pathname]=uiputfile('*.txt','sauvegarde')
if isequal(filename,0) || isequal(pathname,0)
disp('User pressed cancel')
else
save(fullfile(pathname,filename),'a','b','c','d','e','f','g','-ascii')
h = waitbar(0,'Please wait...');
for i=1:100,
waitbar(i/100)
end
close(h)
end |
Partager