Changeset 2651 in Sophya for trunk/SophyaPI/PIext/pistdimgapp.cc
- Timestamp:
- Feb 18, 2005, 3:09:47 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pistdimgapp.cc
r2638 r2651 661 661 PIApplication::SetBusy(); 662 662 // Attention : Appel XSync specifique X11 - en attendant multi-thread 663 XSync(PIXDisplay(), False); 663 // XSync(PIXDisplay(), False); RZDEL 664 664 } 665 665 … … 671 671 PIApplication::SetBlocked(); 672 672 // Attention : Appel XSync specifique X11 - en attendant multi-thread 673 XSync(PIXDisplay(), False); 673 // XSync(PIXDisplay(), False); RZDEL 674 674 } 675 675 … … 701 701 /* --Methode-- */ 702 702 int PIStdImgApp::DispImage(P2DArrayAdapter* nouv, string const & name, string const& sop, 703 int oid, bool fglock) 704 { 705 PIImage* pii; 703 bool fgimagnav, int oid, bool fglock) 704 { 705 PIImage* pii=NULL; 706 PIImageNavigator* piin=NULL; 706 707 PIWindow* win; 707 708 int sx, sy, px, py, flag; … … 738 739 px = py = 0; 739 740 win = GetWindow(dwopt, sx, sy, px, py, flag, (char *)name.c_str()); 740 pii = new PIImage(win, (char *)name.c_str(), sx, sy, px,py); 741 pii->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 742 pii->SetZoomWin(zoom, false); 743 pii->SetGloVWin(gimv, false); 744 pii->SetCMapWin(cmapv, false); 745 pii->ShowCursor(true); 746 pii->SetUserData(NULL, oid); 747 741 if (fgimagnav) { // Creation de naviguateur d'image 742 piin = new PIImageNavigator(win, (char *)name.c_str(), sx, sy, px,py); 743 piin->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 744 piin->ImageWdg()->ShowCursor(true); 745 pii = piin->ImageWdg(); 746 pii->SetUserData(NULL, oid); 747 // XSync(PIXDisplay(), False); 748 // cout << " DBG-ImagNav-BBB-BBB Apres XSync() " << endl; 749 750 } 751 else { // Creation de widget PIImage normal 752 pii = new PIImage(win, (char *)name.c_str(), sx, sy, px,py); 753 pii->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 754 pii->SetZoomWin(zoom, false); 755 pii->SetGloVWin(gimv, false); 756 pii->SetCMapWin(cmapv, false); 757 pii->ShowCursor(true); 758 pii->SetUserData(NULL, oid); 759 } 748 760 749 761 // On recalcule la taille de la fenetre si Disp_Win … … 776 788 mBWList[mBWId] = pii; 777 789 // pii->Refresh(); 778 pii->Apply();779 cmapv->Refresh(); 790 pii->Apply(true); 791 // cmapv->Refresh(); Pas besoin ? , Reza Fev 2005 780 792 return(mBWId); 781 793 } … … 1380 1392 PIWdg* nw = mGrW->NextChildPosSize(px, py, sx, sy); 1381 1393 // cerr << "**DBG** PIStdImgApp::GetWindow() DispNext : nw = " << (long)nw << endl; 1382 if (nw) Delete BaseWidget((PIBaseWdg*)nw, false, false);1394 if (nw) DeleteWidget(nw, false, false); 1383 1395 flag = mGrIdx; 1384 1396 mGrIdx = (mGrIdx+1)%(nx*ny); … … 1430 1442 for(k=0; k<mGrW->NbChilds(); k++) { 1431 1443 if ((cwd = mGrW->GetChild(k)) == NULL) continue; 1432 Delete BaseWidget((PIBaseWdg*)cwd, false, false);1444 DeleteWidget(cwd, false, false); 1433 1445 } 1434 1446 mGrW->SetZone(nzx, nzy); … … 1461 1473 for(k=0; k<w->NbChilds(); k++) { 1462 1474 if ((cwd = w->GetChild(k)) == NULL) continue; 1463 Delete BaseWidget((PIBaseWdg*)cwd,false,false);1475 DeleteWidget(cwd,false,false); 1464 1476 } 1465 1477 delete w; … … 1468 1480 1469 1481 /* --Methode-- */ 1470 void PIStdImgApp::Delete BaseWidget(PIBaseWdg* w, bool dw, bool dwin)1482 void PIStdImgApp::DeleteWidget(PIWdg* w, bool dw, bool dwin) 1471 1483 { 1472 1484 if (w == NULL) return; … … 1474 1486 for(it = mBWList.begin(); it != mBWList.end(); it++) 1475 1487 if ((*it).second == w) { mBWList.erase(it); break; } 1476 int k; 1477 PIDrawer* drw; 1478 for(k=0; k<w->NbDrawers(); k++) { 1479 if ((drw = w->GetDrawer(k)) == NULL) continue; 1480 DrwMList::iterator itt; 1481 for(itt = mDrwList.begin(); itt != mDrwList.end(); itt++) 1482 if ((*itt).second == drw) { mDrwList.erase(itt); break; } 1483 } 1484 1485 if (w == mCurWdg) { 1488 PIBaseWdg* bw = dynamic_cast<PIBaseWdg *>(w); 1489 if (bw != NULL) { 1490 PIDrawer* drw; 1491 int k; 1492 for(k=0; k<bw->NbDrawers(); k++) { 1493 if ((drw = bw->GetDrawer(k)) == NULL) continue; 1494 DrwMList::iterator itt; 1495 for(itt = mDrwList.begin(); itt != mDrwList.end(); itt++) 1496 if ((*itt).second == drw) { mDrwList.erase(itt); break; } 1497 } 1498 } 1499 1500 // Reza Fev 2005 - On met systematiquement mCurWdg et mLastWdg a NULL 1501 // Il peuvent en effet etre un des fils du widget qui est supprime 1502 // if (w == mCurWdg) { 1503 if (true) { // Reza Fev 2005 - mCurWdg = NULL systematique 1486 1504 mCurWdg = NULL; 1487 1505 if (mFgCWImg) { … … 1492 1510 } 1493 1511 1494 if (w == mLastWdg) mLastWdg = NULL; 1512 // if (w == mLastWdg) mLastWdg = NULL; 1513 mLastWdg = NULL; // Reza Fev 2005 - mLastWdg = NULL systematique 1495 1514 1496 1515 PIWdg* pw=NULL; 1497 if (dwin) pw = (PIWdg*)(w->Parent()); 1498 //DBG printf("DeleteBaseWidget(%lx)-DBG kind = %d - %d %d \n", (long)w, w->kind(), (int)dw, (int)dwin); 1499 if (dw) delete w; 1500 if (pw && (pw->kind() == PIWindow::ClassId )) { 1501 PIWindow* pww = (PIWindow*) pw; 1502 if ((pww != (PIWindow*)mGrW) && (pww != (PIWindow*)mStW) && (pww->NbChilds()==0)) 1516 pw = (PIWdg*)(w->Parent()); 1517 //DBG printf("DeleteWidget(%lx)-DBG kind = %d - %d %d \n", (long)w, w->kind(), (int)dw, (int)dwin); 1518 if (dw) { 1519 if (pw && (pw->kind() == PIImageNavigator::ClassId) ) { 1520 delete pw; 1521 pw = NULL; 1522 } 1523 else delete w; 1524 } 1525 if (dwin && pw && (pw->kind() == PIWindow::ClassId )) { 1526 PIWindow* pww = dynamic_cast<PIWindow *>(pw); 1527 if (pww && (pww != (PIWindow*)mGrW) && (pww != (PIWindow*)mStW) && (pww->NbChilds()==0)) 1503 1528 DeleteWindow((PIWindow*)pw); 1504 1529 } … … 1516 1541 it = mBWList.find(k); 1517 1542 if (it == mBWList.end()) return; 1518 PI BaseWdg* wd = (*it).second;1543 PIWdg* wd = (*it).second; 1519 1544 //DBG cerr << "-DBG- PIStdImgApp::DelWRsId Deleting BaseWidget " << (long)(wd) << endl ; 1520 Delete BaseWidget(wd, true, true);1545 DeleteWidget(wd, true, true); 1521 1546 } 1522 1547 else { // C'est un drawer … … 1867 1892 if (mCurWdg) { 1868 1893 int oid = mCurWdg->UserFlag(); 1869 Delete BaseWidget(mCurWdg);1894 DeleteWidget(mCurWdg); 1870 1895 mObjMgr->DelObj_Id(oid); 1871 1896 } … … 1964 1989 if (mStW) { 1965 1990 PIWdg* cw = mStW->CurrentWdg(); 1966 if (cw) Delete BaseWidget((PIBaseWdg*)cw);1991 if (cw) DeleteWidget(cw); 1967 1992 } 1968 1993 break;
Note:
See TracChangeset
for help on using the changeset viewer.