Changeset 333 in Sophya for trunk/SophyaPI/PIext/pisiadw.cc


Ignore:
Timestamp:
Jul 12, 1999, 1:12:29 PM (26 years ago)
Author:
ercodmgr
Message:

Trace de NTuple en 2D avec Marker de taille proportionnelle a Weight
Introduction des repertoires dans la gestion d'objets NameObjMgr
Reorganisation NamedObjMgr et Services2NObjMgr, ajout de commandes , ...
Reza 12/7/99

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/pisiadw.cc

    r332 r333  
    3434// On definit la taille a partir de la taille par defaut des composantes
    3535PIApplicationPrefCompSize(bsx, bsy);
    36 spx = bsx/4;   spy = bsy/3;
    37 tsx = 5*bsx+6*spx;  tsy = 7*bsy+4*spy;
     36spx = bsx/4;   spy = bsy/4;
     37tsx = 4.0*bsx+3*spx;  tsy = 6*bsy+7*spy;
    3838SetSize(tsx,tsy);
    39 objlist = new PIList(this, "objlist", tsx-spx, tsy-4*spy-bsy, spx/2, spy/2);
     39dirlist = new PIOptMenu(this, "dirlist", 2.5*bsx, bsy, spx+0.25*bsx, spy);
     40dirlist->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
     41objlist = new PIList(this, "objlist", 3*bsx, tsy-3*spy-bsy, spx, 2*spy+bsy);
    4042objlist->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    41 objlist->SetBorderWidth(2);
    42 
    43 int py = tsy-2*spy-bsy;
    44 int px = spx;
    45 mBut[0] = new PIButton(this, "Display", 100, bsx, bsy, px, py);   px += (bsx+spx);
    46 mBut[1] = new PIButton(this, "Print",   200, bsx, bsy, px, py);   px += (bsx+spx);
    47 mBut[2] = new PIButton(this, "SavePPF", 300, bsx, bsy, px, py);   px += (bsx+spx);
    48 mBut[3] = new PIButton(this, "Delete",  400, bsx, bsy, px, py);   px += (bsx+spx);
    49 mBut[4] = new PIButton(this, "Dismiss", 900, bsx, bsy, px, py);   px += (bsx+spx);
     43// objlist->SetBorderWidth(2);
     44
     45int py = spy;
     46int px = 2*spx+3*bsx;
     47mBut[0] = new PIButton(this, "SetCurDir", 20, bsx, bsy, px, py);   py += (bsy+spy);
     48mBut[1] = new PIButton(this, "Display", 20, bsx, bsy, px, py);   py += (bsy+spy);
     49mBut[2] = new PIButton(this, "Print",   30, bsx, bsy, px, py);   py += (bsy+spy);
     50mBut[3] = new PIButton(this, "SavePPF", 40, bsx, bsy, px, py);   py += (bsy+spy);
     51mBut[4] = new PIButton(this, "Delete",  50, bsx, bsy, px, py);   py += (bsy+spy);
     52mBut[5] = new PIButton(this, "Dismiss", 90, bsx, bsy, px, py);   py += (bsy+spy);
    5053
    5154for(i=0; i<5; i++)
     
    5962{
    6063int i;
     64delete dirlist;
    6165delete objlist;
    62 for(i=0; i<5; i++)  delete mBut[i];
     66for(i=0; i<6; i++)  delete mBut[i];
    6367}
    6468
     
    6771{
    6872dap->SetBlocked();
     73string cdir;
     74dap->ObjMgr()->GetCurrentDir(cdir);
     75cdir = '/' + cdir;
     76dirlist->SetValueStr(cdir);
     77dap->ObjMgr()->UpdateObjMgrWindow(dirlist->GetValue()-30000);
    6978PIWindow::Show();
    7079return;
     
    7786  // PIMessage ssg = ModMsg(msg);
    7887msg = UserMsg(msg);
    79 if (msg == 900)  {
     88if (msg == 90)  {
    8089  dap->SetReady();
    8190  this->Hide();
    8291  return;
    83 }
     92  }
     93else if (msg >= 30000) {
     94  dap->ObjMgr()->UpdateObjMgrWindow(msg-30000);
     95  return;
     96  }
     97else if (msg == 10) {
     98  string cdir = dirlist->GetValueStr();
     99  dap->ObjMgr()->SetCurrentDir(cdir);
     100  return;
     101  }
    84102
    85103string nom = "";
    86 if ( (msg == 100) || (msg == 200) || (msg == 300) || (msg == 400) ) {
     104if ( (msg == 20) || (msg == 30) || (msg == 40) || (msg == 50) ) {
    87105  string sel = objlist->GetSelectionStr();
    88106  //  size_t p = sel.find_first_not_of(" \t");
     
    91109  size_t q = sel.find_first_of(" \t");
    92110  if (q > l)   q = l;
    93   nom = sel.substr(0, q);
    94 }
     111  nom = dirlist->GetValueStr() + '/' + sel.substr(0, q);
     112  }
    95113
    96114NamedObjMgr* om = dap->ObjMgr();
    97115if (om == NULL)  return;
    98 if (nom == "")  return;
     116if (nom.length() < 1)  return;
    99117
    100118switch (msg)
    101119  {
    102   case 100:
     120  case 20:
    103121    om->DisplayObj(nom);
    104122    break;
    105   case 200:
     123  case 30:
    106124    om->PrintObj(nom);
    107125    break;
    108   case 300:
    109     if (dap->mPpfout)  om->SaveObj(nom, *(dap->mPpfout));
    110     break;
    111   case 400:
     126  case 40:
     127    if (dap->mPpfout)  om->SaveObj(nom, *(dap->mPpfout), false);
     128    break;
     129  case 50:
    112130    om->DelObj(nom);
    113     break;
    114 
    115   case 900:
    116     dap->SetReady();
    117     Hide();
     131    objlist->DeleteItemMsg(objlist->GetSelection());
     132    //    dap->ObjMgr()->UpdateObjMgrWindow(dirlist->GetValue()-30000);
    118133    break;
    119134
     
    218233  if (ln <= 0)  nom = "?";
    219234  else { strncpy(noms, mPin->TagName(i).c_str(), 31);  noms[31] = '\0'; nom = noms; }
    220 //  sprintf(strg, "%s  (T=%s, Key=%d)",  nom, dap->ObjMgr()->GetServiceObj()->PClassIdToClassName(cid), key);
    221   sprintf(strg, "%s  (T=%s, Key=%d)",  nom, " DataObject ?", key);
     235  sprintf(strg, "%s  (T=%s, Key=%d)",  nom, dap->ObjMgr()->GetServiceObj()->PClassIdToClassName(cid), key);
     236  //  sprintf(strg, "%s  (T=%s, Key=%d)",  nom, " DataObject ?", key);  Attention SANS_EVOLPLANCK
    222237  objlist->AppendItem(strg, 5000+i);
    223238}
Note: See TracChangeset for help on using the changeset viewer.