Changeset 1883 in Sophya for trunk/SophyaPI/PIext


Ignore:
Timestamp:
Jan 22, 2002, 12:12:51 PM (24 years ago)
Author:
cmv
Message:

petit bug + texte / ATL-K,DX,DY cmv 22/01/02

Location:
trunk/SophyaPI/PIext
Files:
3 edited

Legend:

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

    r1655 r1883  
    13201320usage += "o <Alt>I : Shows (or updates) a text info window on the selected rectangle \n";
    13211321usage += "o <Alt>M : Activate/Deactivate a measurement cursor on Button-1";
     1322usage += "o <Alt>L : Deactivate DX,DY print (see below)";
     1323usage += ">>>> Mouse + Keyboard controls : \n";
     1324usage += "o Button-1 + <Alt>K : Set (reset) the reference point for DX,DY print \n";
    13221325piac->RegisterHelp(kw, usage, grp);
    13231326
  • trunk/SophyaPI/PIext/pihisto2d.cc

    r1880 r1883  
    364364  if(i<0 || i>=h->NBinX() || j<0 || j>=h->NBinY()) info += " ???";
    365365  else {
    366     sprintf(str," v= %g",x,y,(*h)(i,j));
     366    sprintf(str," v= %g",(*h)(i,j));
    367367    info += str;
    368368  }
     
    450450return np;
    451451}
    452 
    453 
    454 /*
    455 // NOT USED ANYMORE... KEEP IT FOR MEMORY
    456 /////////////////////////////////////////////////////////////////
    457 //  Classe PIH2DWdg
    458 /////////////////////////////////////////////////////////////////
    459 
    460 //++
    461 // Class        PIH2DWdg
    462 // Lib          PIext
    463 // include      pihisto2d.h
    464 //
    465 //      Classe de composantes graphiques permettant la manipulation
    466 //      de traceur d'histos 2D ("PIHisto2D")
    467 //--
    468 //++
    469 // Links        Parents
    470 // PIScDrawWdg
    471 //--
    472 //++
    473 // Links        Voir aussi
    474 // PIHisto2D
    475 //--
    476 
    477 //++
    478 // Titre        Constructeur, méthodes
    479 //--
    480 
    481 static H2WinArg* h2dWinArg=NULL;
    482 static int nb_h2dWinArg = 0;
    483 
    484 //++
    485 PIH2DWdg::PIH2DWdg(PIContainerGen *par, const char *nom, int sx, int sy, int px, int py)
    486 //
    487 //      Createur d'un Widget de dessin d'histogramme 2D.
    488 //      Le menu pour choisir les options d'affichage apparait
    489 //      suite a ALT-O (cf H2WinArg::H2WinArg).
    490 //--
    491 : PIScDrawWdg(par,nom,sx,sy,px,py)
    492 {
    493 if(!h2dWinArg) h2dWinArg = new H2WinArg(this);
    494 nb_h2dWinArg++;
    495 if(dbg) printf("PIH2DWdg::PIH2DWdg %p h2dWinArg=%p %d\n"
    496               ,this,h2dWinArg,nb_h2dWinArg);
    497 mPih = NULL;
    498 // Pour afficher le menu option de trace
    499 ActivateButton(3);
    500 }
    501 
    502 //++
    503 PIH2DWdg::~PIH2DWdg()
    504 //
    505 //      Destructeur.
    506 //--
    507 {
    508 nb_h2dWinArg--;
    509 if(nb_h2dWinArg == 0) {
    510   h2dWinArg->Hide();
    511   delete h2dWinArg;
    512   h2dWinArg=NULL;
    513 }
    514 if(dbg) printf("PIH2DWdg::~PIH2DWdg h2dWinArg=%p %d\n"
    515               ,h2dWinArg,nb_h2dWinArg);
    516 if(mPih) delete mPih;
    517 }
    518 
    519 //++
    520 void PIH2DWdg::SetHisto(Histo2D* histo)
    521 //
    522 //      Pour connecter un histogramme 2D au Widget.
    523 //--
    524 {
    525 if(!histo) return;
    526 if(mPih)  delete mPih;
    527 mPih = new PIHisto2D(histo, true);
    528 AddScDrawer(mPih);
    529 if(dbg) printf("PIH2DWdg::SetHisto mPih=%p\n",mPih);
    530 }
    531 
    532 //++
    533 void PIH2DWdg::SetPIHisto(PIHisto2D* pih2)
    534 //
    535 //      Pour connecter un traceur (Drawer) d'histo 2D au Widget.
    536 //--
    537 {
    538 if(!pih2) return;
    539 if(mPih)  delete mPih;
    540 mPih = pih2;
    541 AddScDrawer(mPih);
    542 if(dbg) printf("PIH2DWdg::SetPIHisto mPih=%p\n",mPih);
    543 }
    544 
    545 //++
    546 string  PIH2DWdg::GetClickText(double x, double y)
    547 //
    548 //      Quand on click (and drag) le bouton-1, affichage
    549 //      des positions x,y et de la valeur du bin de l'histogramme 2D.
    550 //--
    551 {
    552 int i,j;
    553 char str[128];
    554 
    555 if((!mPih) || (!mPih->Histogram())) {
    556   sprintf(str,"X=%g Y=%g ???",x,y);
    557   return((string)str);
    558 }
    559 
    560 Histo2D* h = mPih->Histogram();
    561 
    562 h->FindBin(x,y,i,j);
    563 if(i<0 || i>=h->NBinX() || j<0 || j>=h->NBinY())
    564   sprintf(str,"x= %g y= %g ???",x,y);
    565 else sprintf(str,"x= %g y= %g v= %g",x,y,(*h)(i,j));
    566 
    567 return((string)str);
    568 }
    569 
    570 //++
    571 void PIH2DWdg::ActivateSpecializedControls()
    572 //      Pour activer les contrôles spécifiques pour l'affichage Histo-2D       
    573 //--
    574 {
    575 // h2dWinArg->SetPIH2DWdg(this);
    576 h2dWinArg->SetCurrentBaseWdg(this);
    577 h2dWinArg->SetCurrentPIHisto2D(this->GetPIHisto());
    578 h2dWinArg->SetMsgParent((PIMsgHandler*)this);
    579 if(!h2dWinArg->Visible()) h2dWinArg->Show();
    580 }
    581 
    582 //++
    583 void PIH2DWdg::But3Press(int x, int y)
    584 //
    585 //      Gestion de l'utilisation du bouton-3 de la souris.
    586 //      Un seul objet est cree pour tous les histogrammes 2D.
    587 //      Il est connecte a un histogramme donnee par l'action du
    588 //      du bouton-3 de la souris dans la fenetre contenant
    589 //      le dessin de l'histogramme (cf H2WinArg::H2WinArg).
    590 //--
    591 {
    592 ActivateSpecializedControls();
    593 if(dbg) printf("PIH2DWdg::But3Press(%d,%d) h2dWinArg=%p\n"
    594               ,x,y,h2dWinArg);
    595 }
    596 */
    597452
    598453/////////////////////////////////////////////////////////////////
  • trunk/SophyaPI/PIext/pihisto2d.h

    r1880 r1883  
    6767
    6868////////////////////////////////////////////////////////////////////
    69 /*
    70 // NOT USED ANYMORE... KEEP IT FOR MEMORY
    71 class PIH2DWdg : public PIScDrawWdg {
    72 public:
    73   PIH2DWdg(PIContainerGen *par,const char *nom,int sx=300,int sy=300,int px=0,int py=0);
    74   ~PIH2DWdg();
    75   void SetHisto(Histo2D* histo);
    76   void SetPIHisto(PIHisto2D* pih2);
    77   inline PIHisto2D* GetPIHisto() {return mPih;}
    78   virtual string GetClickText(double x, double y);
    79   virtual void   ActivateSpecializedControls(); // Pour activer des controles specifiques
    80   virtual void   But3Press(int x, int y);
    81 protected:
    82   PIHisto2D*  mPih;
    83 };
    84 */
    85 
    86 ////////////////////////////////////////////////////////////////////
    8769class H2WinArg : public PIWindow {
    8870public :
Note: See TracChangeset for help on using the changeset viewer.