| 1 | // Classe CxxExecWindow : Control Window for CxxExecutor
 | 
|---|
| 2 | // Classe CxxExecOptWindow : Option Window for CxxExecutor
 | 
|---|
| 3 | // (c) DAPNIA (CEA)                 LAL (IN2P3/CNRS)
 | 
|---|
| 4 | //                           R. Ansari  C.Magneville 10/2000
 | 
|---|
| 5 | 
 | 
|---|
| 6 | #include "cxxexecutor.h"
 | 
|---|
| 7 | #include "cxxexecwin.h"
 | 
|---|
| 8 | 
 | 
|---|
| 9 | // --------------------------------------------------------------------
 | 
|---|
| 10 | // --------------------------------------------------------------------
 | 
|---|
| 11 | // ------------- Fenetre dde commande pour le CxxExecutor -------------
 | 
|---|
| 12 | // --------------------------------------------------------------------
 | 
|---|
| 13 | // --------------------------------------------------------------------
 | 
|---|
| 14 | 
 | 
|---|
| 15 | /* --Methode-- */
 | 
|---|
| 16 | CxxExecWind::CxxExecWind(PIStdImgApp* par, CxxExecutor * cxxexec)
 | 
|---|
| 17 | : PIWindow((PIMsgHandler *)par, "CxxExecutor", PIWK_normal, 400, 300, 150, 150)
 | 
|---|
| 18 | {
 | 
|---|
| 19 |   dap = par;
 | 
|---|
| 20 |   cxxex = cxxexec;
 | 
|---|
| 21 |   mFName[0] = "";
 | 
|---|
| 22 |   mFName[1] = "";
 | 
|---|
| 23 | 
 | 
|---|
| 24 |   int bsx, bsy, szx, szy;
 | 
|---|
| 25 |   int px, py, spx, spy;
 | 
|---|
| 26 |   int xtext, ytext;
 | 
|---|
| 27 | 
 | 
|---|
| 28 |   ////////////////////////////////////
 | 
|---|
| 29 |   //       Window Definition        //
 | 
|---|
| 30 |   ////////////////////////////////////
 | 
|---|
| 31 | 
 | 
|---|
| 32 |   // On definit la taille a partir de la taille par defaut des composantes 
 | 
|---|
| 33 |   PIApplicationPrefCompSize(bsx, bsy);
 | 
|---|
| 34 |   // On redefinit la taille de la fenetre
 | 
|---|
| 35 |   spx = bsx/6;
 | 
|---|
| 36 |   spy = bsy/6;
 | 
|---|
| 37 |   xtext = 8*bsx;
 | 
|---|
| 38 |   ytext = 8*bsy;
 | 
|---|
| 39 |   szx = xtext+2*spx;   
 | 
|---|
| 40 |   szy = 2*ytext+5*bsy+10*spy;
 | 
|---|
| 41 |   SetSize(szx, szy);
 | 
|---|
| 42 | 
 | 
|---|
| 43 |   ////////////////////////////////////
 | 
|---|
| 44 |   //       User Function Code       //
 | 
|---|
| 45 |   ////////////////////////////////////
 | 
|---|
| 46 | 
 | 
|---|
| 47 | // Creation du champ texte 
 | 
|---|
| 48 |   px = spx;
 | 
|---|
| 49 |   py = spy;
 | 
|---|
| 50 |   mText[0] = new PIText(this,"helptext",true,true,xtext,0.75*ytext,px,py);
 | 
|---|
| 51 |   mText[0]->SetTextEditable(true);
 | 
|---|
| 52 |   mText[0]->SetText("");
 | 
|---|
| 53 | 
 | 
|---|
| 54 | // Creation du champ titre, des boutons d'action et label fichier
 | 
|---|
| 55 |   px = spx;
 | 
|---|
| 56 |   py += (int)(spy+0.75*ytext);
 | 
|---|
| 57 |   mLab[3] = new PILabel(this,"FileFunc",xtext,bsy,px,py);
 | 
|---|
| 58 |   mLab[3]->SetLabel("");
 | 
|---|
| 59 |   mLab[3]->SetBorderWidth(1);
 | 
|---|
| 60 |   px = spx;
 | 
|---|
| 61 |   py += spy+bsy;
 | 
|---|
| 62 |   mLab[0] = new PILabel(this,"Function",2*bsx,bsy,px,py);
 | 
|---|
| 63 |   mLab[0]->SetLabel("User Function Code");
 | 
|---|
| 64 |   mLab[0]->SetBorderWidth(1);
 | 
|---|
| 65 |   px += spx+2*bsx;
 | 
|---|
| 66 |   mBut[0] = new PIButton(this,"Open",500,bsx,bsy,px,py);
 | 
|---|
| 67 |   px += bsx+spx;
 | 
|---|
| 68 |   mBut[1] = new PIButton(this,"Save",510,bsx,bsy,px,py);
 | 
|---|
| 69 |   px += bsx+spx;
 | 
|---|
| 70 |   mBut[2] = new PIButton(this,"Save As",520,bsx,bsy,px,py);
 | 
|---|
| 71 |   px += bsx+spx;
 | 
|---|
| 72 |   mBut[3] = new PIButton(this,"Reset Name",530,1.5*bsx,bsy,px,py);
 | 
|---|
| 73 | 
 | 
|---|
| 74 |   ////////////////////////////////////
 | 
|---|
| 75 |   //           User Code            //
 | 
|---|
| 76 |   ////////////////////////////////////
 | 
|---|
| 77 | 
 | 
|---|
| 78 | // Creation du champ texte 
 | 
|---|
| 79 |   px = spx;
 | 
|---|
| 80 |   py += 2*spy+bsy;
 | 
|---|
| 81 |   mText[1] = new PIText(this,"helptext",true,true,xtext,1.25*ytext,px,py);
 | 
|---|
| 82 |   mText[1]->SetTextEditable(true);
 | 
|---|
| 83 |   mText[1]->SetText("");
 | 
|---|
| 84 | 
 | 
|---|
| 85 | // Creation du champ titre, des boutons d'action et label fichier
 | 
|---|
| 86 |   px = spx;
 | 
|---|
| 87 |   py += (int)(spy+1.25*ytext);
 | 
|---|
| 88 |   mLab[4] = new PILabel(this,"FileCode",xtext,bsy,px,py);
 | 
|---|
| 89 |   mLab[4]->SetLabel("");
 | 
|---|
| 90 |   mLab[4]->SetBorderWidth(1);
 | 
|---|
| 91 |   px = spx;
 | 
|---|
| 92 |   py += spy+bsy;
 | 
|---|
| 93 |   mLab[1] = new PILabel(this,"Code",2*bsx,bsy,px,py);
 | 
|---|
| 94 |   mLab[1]->SetLabel("User Code");
 | 
|---|
| 95 |   mLab[1]->SetBorderWidth(1);
 | 
|---|
| 96 |   px += spx+2*bsx;
 | 
|---|
| 97 |   mBut[4] = new PIButton(this,"Open",501,bsx,bsy,px,py);
 | 
|---|
| 98 |   px += bsx+spx;
 | 
|---|
| 99 |   mBut[5] = new PIButton(this,"Save",511,bsx,bsy,px,py);
 | 
|---|
| 100 |   px += bsx+spx;
 | 
|---|
| 101 |   mBut[6] = new PIButton(this,"Save As",521,bsx,bsy,px,py);
 | 
|---|
| 102 |   px += bsx+spx;
 | 
|---|
| 103 |   mBut[7] = new PIButton(this,"Reset Name",531,1.5*bsx,bsy,px,py);
 | 
|---|
| 104 | 
 | 
|---|
| 105 |   ////////////////////////////////////
 | 
|---|
| 106 |   //     Buttons for execution      //
 | 
|---|
| 107 |   ////////////////////////////////////
 | 
|---|
| 108 | 
 | 
|---|
| 109 | // Creation du champ titre pour le code
 | 
|---|
| 110 |   px = spx;
 | 
|---|
| 111 |   py += 2*spy+bsy;
 | 
|---|
| 112 |   mLab[2] = new PILabel(this, "Execute",2*bsx,bsy,px,py);
 | 
|---|
| 113 |   mLab[2]->SetLabel("Execute :");
 | 
|---|
| 114 |   mLab[2]->SetBorderWidth(1);
 | 
|---|
| 115 | 
 | 
|---|
| 116 | // Creation des boutons d'action 
 | 
|---|
| 117 |   px += (int)(szx/2 - 1.2*bsx - spx);
 | 
|---|
| 118 |   mBut[8] = new PIButton(this,"Exec",600,1.2*bsx,bsy,px,py);
 | 
|---|
| 119 |   px += (int)(1.2*bsx+spx);
 | 
|---|
| 120 |   mBut[9] = new PIButton(this,"Dismiss",601,1.2*bsx,bsy,px,py);
 | 
|---|
| 121 | 
 | 
|---|
| 122 |   ////////////////////////////////////
 | 
|---|
| 123 |   //  Set Attributes for Elements   //
 | 
|---|
| 124 |   ////////////////////////////////////
 | 
|---|
| 125 | 
 | 
|---|
| 126 |   int ii;
 | 
|---|
| 127 |   for(ii=0; ii<5; ii++) 
 | 
|---|
| 128 |     mLab[ii]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 | 
|---|
| 129 |   for(ii=0; ii<10; ii++) 
 | 
|---|
| 130 |     mBut[ii]->SetBinding(PIBK_elastic , PIBK_elastic , PIBK_elastic , PIBK_elastic);
 | 
|---|
| 131 |   for(ii=0; ii<2; ii++) 
 | 
|---|
| 132 |     mText[ii]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 | 
|---|
| 133 | 
 | 
|---|
| 134 |   // File Chooser
 | 
|---|
| 135 |   pfc = new PIFileChooser(this,"CxxExec-FileChooser", 5000); 
 | 
|---|
| 136 | }
 | 
|---|
| 137 | 
 | 
|---|
| 138 | /* --Methode-- */
 | 
|---|
| 139 | CxxExecWind::~CxxExecWind()
 | 
|---|
| 140 | {
 | 
|---|
| 141 |   int i;
 | 
|---|
| 142 |   for(i=0; i<5; i++)  delete mLab[i];
 | 
|---|
| 143 |   for(i=0; i<10; i++) delete mBut[i];
 | 
|---|
| 144 |   for(i=0; i<2; i++)  delete mText[i];
 | 
|---|
| 145 |   delete pfc;
 | 
|---|
| 146 | }
 | 
|---|
| 147 | 
 | 
|---|
| 148 | /* --Methode-- */
 | 
|---|
| 149 | void CxxExecWind::Show()
 | 
|---|
| 150 | {
 | 
|---|
| 151 | mLab[3]->SetLabel(mFName[0]);
 | 
|---|
| 152 | mLab[4]->SetLabel(mFName[1]);
 | 
|---|
| 153 | PIWindow::Show();
 | 
|---|
| 154 | }
 | 
|---|
| 155 | 
 | 
|---|
| 156 | /* --Methode-- */
 | 
|---|
| 157 | void CxxExecWind::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* data)
 | 
|---|
| 158 | {
 | 
|---|
| 159 |   msg = UserMsg(msg);
 | 
|---|
| 160 |   switch (msg)  {
 | 
|---|
| 161 |     case 600:    // Bouton Execute C++
 | 
|---|
| 162 |       SetUnSensitive();
 | 
|---|
| 163 |       dap->GetConsole()->AddStr(
 | 
|---|
| 164 |          "CxxExecWind::Process() - Executing C++ Code ... \n", PIVA_Magenta);
 | 
|---|
| 165 |       dap->SetBusy();
 | 
|---|
| 166 |       cxxex->ExecuteCXX(mText[1]->GetText(),mText[0]->GetText());
 | 
|---|
| 167 |       dap->GetConsole()->AddStr(
 | 
|---|
| 168 |          "CxxExecWind ... End of Executing C++ Code \n");
 | 
|---|
| 169 |       SetSensitive();
 | 
|---|
| 170 |       dap->SetReady();
 | 
|---|
| 171 |       break;
 | 
|---|
| 172 |     case 601:   // Bouton Dismiss - On cache la fenetre
 | 
|---|
| 173 |       this->Hide();
 | 
|---|
| 174 |       break;
 | 
|---|
| 175 |     case 500:    // Open File for Function
 | 
|---|
| 176 |     case 501:    // Open File for Code
 | 
|---|
| 177 |       {
 | 
|---|
| 178 |       int i = msg-500;
 | 
|---|
| 179 |       pfc->AcceptNewFile(false); 
 | 
|---|
| 180 |       pfc->SetMsg(5500+i);
 | 
|---|
| 181 |       dap->SetBlocked();
 | 
|---|
| 182 |       pfc->Show();
 | 
|---|
| 183 |       break;
 | 
|---|
| 184 |       }
 | 
|---|
| 185 |     case 5500:  // Return from open-file dialog for Function
 | 
|---|
| 186 |     case 5501:  // Return from open-file dialog for Code
 | 
|---|
| 187 |       {
 | 
|---|
| 188 |       int i = msg-5500;
 | 
|---|
| 189 |       dap->SetBusy();
 | 
|---|
| 190 |       if(data) {
 | 
|---|
| 191 |         mFName[i] = pfc->GetFileName();
 | 
|---|
| 192 |         mLab[3+i]->SetLabel(mFName[i]);
 | 
|---|
| 193 |         string code = stringfrfile(mFName[i]);
 | 
|---|
| 194 |         mText[i]->SetText(code);
 | 
|---|
| 195 |       }
 | 
|---|
| 196 |       dap->SetReady();
 | 
|---|
| 197 |       break;
 | 
|---|
| 198 |       }
 | 
|---|
| 199 |     case 510:  // Save for Function
 | 
|---|
| 200 |     case 511:  // Save for Code
 | 
|---|
| 201 |     case 520:  // Save-File for Function
 | 
|---|
| 202 |     case 521:  // Save-File for Code
 | 
|---|
| 203 |       {
 | 
|---|
| 204 |       int i = msg%10;
 | 
|---|
| 205 |       if( msg<515 && mFName[i].length()>0 ) {
 | 
|---|
| 206 |         string code = mText[i]->GetText();
 | 
|---|
| 207 |         filefrstring(mFName[i],code);
 | 
|---|
| 208 |       } else {
 | 
|---|
| 209 |         pfc->AcceptNewFile(true); 
 | 
|---|
| 210 |         pfc->SetMsg(5520+i);
 | 
|---|
| 211 |         dap->SetBlocked();
 | 
|---|
| 212 |         pfc->Show();    
 | 
|---|
| 213 |       }
 | 
|---|
| 214 |       break;
 | 
|---|
| 215 |       }
 | 
|---|
| 216 |     case 5520:  // Return from Save-file dialog for Function
 | 
|---|
| 217 |     case 5521:  // Return from Save-file dialog for Code
 | 
|---|
| 218 |       {
 | 
|---|
| 219 |       int i = msg-5520;
 | 
|---|
| 220 |       dap->SetBusy();
 | 
|---|
| 221 |       if (data) {
 | 
|---|
| 222 |         mFName[i] = pfc->GetFileName();
 | 
|---|
| 223 |         mLab[3+i]->SetLabel(mFName[i]);
 | 
|---|
| 224 |         string code = mText[i]->GetText();
 | 
|---|
| 225 |         filefrstring(mFName[i],code);
 | 
|---|
| 226 |       }
 | 
|---|
| 227 |       dap->SetReady();
 | 
|---|
| 228 |       break;
 | 
|---|
| 229 |       }
 | 
|---|
| 230 |     case 530:  // Reset name for Function
 | 
|---|
| 231 |     case 531:  // Reset name for Code
 | 
|---|
| 232 |       {
 | 
|---|
| 233 |       int i = msg-530;
 | 
|---|
| 234 |       mFName[i] = "";
 | 
|---|
| 235 |       mLab[3+i]->SetLabel(mFName[i]);
 | 
|---|
| 236 |       }
 | 
|---|
| 237 |   }
 | 
|---|
| 238 | 
 | 
|---|
| 239 |   // In case of compile errors, we end-up here !    
 | 
|---|
| 240 |   mBut[8]->SetSensitive();
 | 
|---|
| 241 |   dap->SetReady();
 | 
|---|
| 242 |   return;
 | 
|---|
| 243 | }
 | 
|---|
| 244 | 
 | 
|---|
| 245 | /* --Methode-- */
 | 
|---|
| 246 | void CxxExecWind::filefrstring(string filename,string& code)
 | 
|---|
| 247 | {
 | 
|---|
| 248 | if(filename.size()<1) return;
 | 
|---|
| 249 | if(code.size()<1) return;
 | 
|---|
| 250 | ofstream os(filename.c_str(),ios::out);
 | 
|---|
| 251 | if(!os)
 | 
|---|
| 252 |   {cout<<"CxxExecWind::filefrstring: unable to open "<<filename<<endl;
 | 
|---|
| 253 |    return;}
 | 
|---|
| 254 | os<<code<<endl;
 | 
|---|
| 255 | }
 | 
|---|
| 256 | 
 | 
|---|
| 257 | /* --Methode-- */
 | 
|---|
| 258 | string CxxExecWind::stringfrfile(string filename)
 | 
|---|
| 259 | {
 | 
|---|
| 260 | string code = "";
 | 
|---|
| 261 | if(filename.size()<1) return code;
 | 
|---|
| 262 | ifstream is(filename.c_str(),ios::in);
 | 
|---|
| 263 | if(!is)
 | 
|---|
| 264 |   {cout<<"CxxExecWind::stringfrfile: unable to open "<<filename<<endl;
 | 
|---|
| 265 |    return code;}
 | 
|---|
| 266 | char c;
 | 
|---|
| 267 | while(is.get(c)) code += c;
 | 
|---|
| 268 | return code;
 | 
|---|
| 269 | }
 | 
|---|
| 270 | 
 | 
|---|
| 271 | // --------------------------------------------------------------------
 | 
|---|
| 272 | // --------------------------------------------------------------------
 | 
|---|
| 273 | // --------------- Fenetre d'option pour le CxxExecutor ---------------
 | 
|---|
| 274 | // --------------------------------------------------------------------
 | 
|---|
| 275 | // --------------------------------------------------------------------
 | 
|---|
| 276 | 
 | 
|---|
| 277 | /* --Methode-- */
 | 
|---|
| 278 | CxxOptionWind::CxxOptionWind(PIStdImgApp* par, CxxExecutor * cxxexec)
 | 
|---|
| 279 | : PIWindow((PIMsgHandler *)par, "CxxOption", PIWK_normal, 400, 300, 150, 150)
 | 
|---|
| 280 | {
 | 
|---|
| 281 | 
 | 
|---|
| 282 |   dap = par;
 | 
|---|
| 283 |   cxxex = cxxexec;
 | 
|---|
| 284 | 
 | 
|---|
| 285 |   int bsx, bsy, szx, szy;
 | 
|---|
| 286 |   int px, py, spx, spy;
 | 
|---|
| 287 |   int xtext;
 | 
|---|
| 288 |   // On definit la taille a partir de la taille par defaut des composantes 
 | 
|---|
| 289 |   PIApplicationPrefCompSize(bsx, bsy);
 | 
|---|
| 290 |   // On redefinit la taille de la fenetre
 | 
|---|
| 291 |   spx = bsx/12; if(spx<2) spx=2;
 | 
|---|
| 292 |   spy = bsy/6;
 | 
|---|
| 293 |   xtext = 7*bsx;
 | 
|---|
| 294 |   szx = (int)(xtext+1.5*bsx+3*spx);
 | 
|---|
| 295 |   szy = 7*bsy+8*spy;
 | 
|---|
| 296 |   SetSize(szx, szy);
 | 
|---|
| 297 | 
 | 
|---|
| 298 | // Creation de champs "labels"
 | 
|---|
| 299 |   px = (szx-xtext)/2;
 | 
|---|
| 300 |   py = spy;
 | 
|---|
| 301 |   mTit = new PILabel(this,"CxxExecutor Options",xtext,bsy,px,py);
 | 
|---|
| 302 |   mTit->SetBorderWidth(1);
 | 
|---|
| 303 | 
 | 
|---|
| 304 | // Creation des labels et des champs texte
 | 
|---|
| 305 |   px = spx;
 | 
|---|
| 306 |   py += spy+bsy;
 | 
|---|
| 307 |   mLab[0] = new PILabel(this,"Include Files",1.5*bsx,bsy,px,py);
 | 
|---|
| 308 |   px += (int)(1.5*bsx+spx);
 | 
|---|
| 309 |   mText[0] = new PIText(this,"IncFiles",xtext,bsy,px,py);
 | 
|---|
| 310 |   mText[0]->SetText("");
 | 
|---|
| 311 | 
 | 
|---|
| 312 |   px = spx;
 | 
|---|
| 313 |   py += spy+bsy;
 | 
|---|
| 314 |   mLab[1] = new PILabel(this,"Compile Opt.",1.5*bsx,bsy,px,py);
 | 
|---|
| 315 |   px += (int)(1.5*bsx+spx);
 | 
|---|
| 316 |   mText[1] = new PIText(this,"CompOpt",xtext,bsy,px,py);
 | 
|---|
| 317 |   mText[1]->SetText("");
 | 
|---|
| 318 | 
 | 
|---|
| 319 |   px = spx;
 | 
|---|
| 320 |   py += spy+bsy;
 | 
|---|
| 321 |   mLab[2] = new PILabel(this,"Link Options",1.5*bsx,bsy,px,py);
 | 
|---|
| 322 |   px += (int)(1.5*bsx+spx);
 | 
|---|
| 323 |   mText[2] = new PIText(this,"LinkOpt",xtext,bsy,px,py);
 | 
|---|
| 324 |   mText[2]->SetText("");
 | 
|---|
| 325 | 
 | 
|---|
| 326 |   px = spx;
 | 
|---|
| 327 |   py += spy+bsy;
 | 
|---|
| 328 |   mLab[3] = new PILabel(this,"Libraries",1.5*bsx,bsy,px,py);
 | 
|---|
| 329 |   px += (int)(1.5*bsx+spx);
 | 
|---|
| 330 |   mText[3] = new PIText(this,"LinkLib",xtext,bsy,px,py);
 | 
|---|
| 331 |   mText[3]->SetText("");
 | 
|---|
| 332 | 
 | 
|---|
| 333 |   px = spx;
 | 
|---|
| 334 |   py += spy+bsy;
 | 
|---|
| 335 |   mLab[4] = new PILabel(this,"Modules",1.5*bsx,bsy,px,py);
 | 
|---|
| 336 |   px += (int)(1.5*bsx+spx);
 | 
|---|
| 337 |   mText[4] = new PIText(this,"ModImp",xtext,bsy,px,py);
 | 
|---|
| 338 |   mText[4]->SetText("");
 | 
|---|
| 339 | 
 | 
|---|
| 340 | // Creation de bouton d'action 
 | 
|---|
| 341 | 
 | 
|---|
| 342 |   px = (int)(szx/2 - 1.5*bsx - spx - 1.5*bsx/2.);
 | 
|---|
| 343 |   py += spy+bsy;
 | 
|---|
| 344 |   mBut[0] = new PIButton(this,"Set Options",500,1.5*bsx,bsy,px,py);
 | 
|---|
| 345 |   px += (int)(1.5*bsx+spx);
 | 
|---|
| 346 |   mBut[1] = new PIButton(this,"Get Options",600,1.5*bsx,bsy,px,py);
 | 
|---|
| 347 |   px += (int)(1.5*bsx+spx);
 | 
|---|
| 348 |   mBut[2] = new PIButton(this,"Dismiss",700,1.5*bsx, bsy,px,py);
 | 
|---|
| 349 | 
 | 
|---|
| 350 | //  Taille et position proportionnelles a la taille de la fenetre pour les elements
 | 
|---|
| 351 |   mTit->SetBinding(PIBK_elastic , PIBK_elastic , PIBK_elastic , PIBK_elastic);
 | 
|---|
| 352 |   int i;
 | 
|---|
| 353 |   for(i=0; i<4; i++)
 | 
|---|
| 354 |     mLab[i]->SetBinding(PIBK_elastic , PIBK_elastic , PIBK_elastic , PIBK_elastic);
 | 
|---|
| 355 |   for(i=0; i<4; i++)
 | 
|---|
| 356 |     mText[i]->SetBinding(PIBK_elastic , PIBK_elastic , PIBK_elastic , PIBK_elastic);
 | 
|---|
| 357 |   for(i=0; i<3; i++) 
 | 
|---|
| 358 |     mBut[i]->SetBinding(PIBK_elastic , PIBK_elastic , PIBK_elastic , PIBK_elastic);
 | 
|---|
| 359 | }
 | 
|---|
| 360 | 
 | 
|---|
| 361 | /* --Methode-- */
 | 
|---|
| 362 | CxxOptionWind::~CxxOptionWind()
 | 
|---|
| 363 | {
 | 
|---|
| 364 |   delete mTit;
 | 
|---|
| 365 |   int i;
 | 
|---|
| 366 |   for(i=0; i<5; i++) delete mLab[i];
 | 
|---|
| 367 |   for(i=0; i<3; i++) delete mBut[i];
 | 
|---|
| 368 |   for(i=0; i<5; i++) delete mText[i];
 | 
|---|
| 369 | }
 | 
|---|
| 370 | 
 | 
|---|
| 371 | /* --Methode-- */
 | 
|---|
| 372 | void CxxOptionWind::Show()
 | 
|---|
| 373 | {
 | 
|---|
| 374 |   mText[0]->SetText(cxxex->GetInclude());
 | 
|---|
| 375 |   mText[1]->SetText(cxxex->GetCompileOpt());
 | 
|---|
| 376 |   mText[2]->SetText(cxxex->GetLinkOpt());
 | 
|---|
| 377 |   mText[3]->SetText(cxxex->GetLinkLibs());
 | 
|---|
| 378 |   mText[4]->SetText(cxxex->GetModuleImport());
 | 
|---|
| 379 |   PIWindow::Show();
 | 
|---|
| 380 | }
 | 
|---|
| 381 | 
 | 
|---|
| 382 | /* --Methode-- */
 | 
|---|
| 383 | void CxxOptionWind::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
 | 
|---|
| 384 | {
 | 
|---|
| 385 |   string opt;
 | 
|---|
| 386 |   switch (UserMsg(msg))  {
 | 
|---|
| 387 |     case 500:    // Bouton Set Options
 | 
|---|
| 388 |       opt = mText[0]->GetText();
 | 
|---|
| 389 |       cxxex->FillInclude(opt);
 | 
|---|
| 390 |       opt = mText[1]->GetText();
 | 
|---|
| 391 |       cxxex->FillCompileOpt(opt);
 | 
|---|
| 392 |       opt = mText[2]->GetText();
 | 
|---|
| 393 |       cxxex->FillLinkOpt(opt);
 | 
|---|
| 394 |       opt = mText[3]->GetText();
 | 
|---|
| 395 |       cxxex->FillLinkLibs(opt);
 | 
|---|
| 396 |       opt = mText[4]->GetText();
 | 
|---|
| 397 |       cxxex->FillModuleImport(opt);
 | 
|---|
| 398 |       break;
 | 
|---|
| 399 |     case 600:    // Bouton Get Options
 | 
|---|
| 400 |       mText[0]->SetText(cxxex->GetInclude());
 | 
|---|
| 401 |       mText[1]->SetText(cxxex->GetCompileOpt());
 | 
|---|
| 402 |       mText[2]->SetText(cxxex->GetLinkOpt());
 | 
|---|
| 403 |       mText[3]->SetText(cxxex->GetLinkLibs());
 | 
|---|
| 404 |       mText[4]->SetText(cxxex->GetModuleImport());
 | 
|---|
| 405 |       break;
 | 
|---|
| 406 |     case 700:   // Bouton Dismiss - On cache la fenetre
 | 
|---|
| 407 |       this->Hide();
 | 
|---|
| 408 |       break;
 | 
|---|
| 409 |   }
 | 
|---|
| 410 | return;
 | 
|---|
| 411 | }
 | 
|---|