Changeset 333 in Sophya for trunk/SophyaPI/PIext/pisiadw.cc
- Timestamp:
- Jul 12, 1999, 1:12:29 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pisiadw.cc
r332 r333 34 34 // On definit la taille a partir de la taille par defaut des composantes 35 35 PIApplicationPrefCompSize(bsx, bsy); 36 spx = bsx/4; spy = bsy/ 3;37 tsx = 5*bsx+6*spx; tsy = 7*bsy+4*spy;36 spx = bsx/4; spy = bsy/4; 37 tsx = 4.0*bsx+3*spx; tsy = 6*bsy+7*spy; 38 38 SetSize(tsx,tsy); 39 objlist = new PIList(this, "objlist", tsx-spx, tsy-4*spy-bsy, spx/2, spy/2); 39 dirlist = new PIOptMenu(this, "dirlist", 2.5*bsx, bsy, spx+0.25*bsx, spy); 40 dirlist->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 41 objlist = new PIList(this, "objlist", 3*bsx, tsy-3*spy-bsy, spx, 2*spy+bsy); 40 42 objlist->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 45 int py = spy; 46 int px = 2*spx+3*bsx; 47 mBut[0] = new PIButton(this, "SetCurDir", 20, bsx, bsy, px, py); py += (bsy+spy); 48 mBut[1] = new PIButton(this, "Display", 20, bsx, bsy, px, py); py += (bsy+spy); 49 mBut[2] = new PIButton(this, "Print", 30, bsx, bsy, px, py); py += (bsy+spy); 50 mBut[3] = new PIButton(this, "SavePPF", 40, bsx, bsy, px, py); py += (bsy+spy); 51 mBut[4] = new PIButton(this, "Delete", 50, bsx, bsy, px, py); py += (bsy+spy); 52 mBut[5] = new PIButton(this, "Dismiss", 90, bsx, bsy, px, py); py += (bsy+spy); 50 53 51 54 for(i=0; i<5; i++) … … 59 62 { 60 63 int i; 64 delete dirlist; 61 65 delete objlist; 62 for(i=0; i< 5; i++) delete mBut[i];66 for(i=0; i<6; i++) delete mBut[i]; 63 67 } 64 68 … … 67 71 { 68 72 dap->SetBlocked(); 73 string cdir; 74 dap->ObjMgr()->GetCurrentDir(cdir); 75 cdir = '/' + cdir; 76 dirlist->SetValueStr(cdir); 77 dap->ObjMgr()->UpdateObjMgrWindow(dirlist->GetValue()-30000); 69 78 PIWindow::Show(); 70 79 return; … … 77 86 // PIMessage ssg = ModMsg(msg); 78 87 msg = UserMsg(msg); 79 if (msg == 90 0) {88 if (msg == 90) { 80 89 dap->SetReady(); 81 90 this->Hide(); 82 91 return; 83 } 92 } 93 else if (msg >= 30000) { 94 dap->ObjMgr()->UpdateObjMgrWindow(msg-30000); 95 return; 96 } 97 else if (msg == 10) { 98 string cdir = dirlist->GetValueStr(); 99 dap->ObjMgr()->SetCurrentDir(cdir); 100 return; 101 } 84 102 85 103 string nom = ""; 86 if ( (msg == 100) || (msg == 200) || (msg == 300) || (msg == 400) ) {104 if ( (msg == 20) || (msg == 30) || (msg == 40) || (msg == 50) ) { 87 105 string sel = objlist->GetSelectionStr(); 88 106 // size_t p = sel.find_first_not_of(" \t"); … … 91 109 size_t q = sel.find_first_of(" \t"); 92 110 if (q > l) q = l; 93 nom = sel.substr(0, q);94 }111 nom = dirlist->GetValueStr() + '/' + sel.substr(0, q); 112 } 95 113 96 114 NamedObjMgr* om = dap->ObjMgr(); 97 115 if (om == NULL) return; 98 if (nom == "") return;116 if (nom.length() < 1) return; 99 117 100 118 switch (msg) 101 119 { 102 case 100:120 case 20: 103 121 om->DisplayObj(nom); 104 122 break; 105 case 200:123 case 30: 106 124 om->PrintObj(nom); 107 125 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: 112 130 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); 118 133 break; 119 134 … … 218 233 if (ln <= 0) nom = "?"; 219 234 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 222 237 objlist->AppendItem(strg, 5000+i); 223 238 }
Note:
See TracChangeset
for help on using the changeset viewer.