Changeset 23 in Sophya


Ignore:
Timestamp:
Oct 17, 1996, 5:06:52 PM (29 years ago)
Author:
ansari
Message:

1) Modifications de PIMsgHandler -

Les messages sont constitues de deux
parties - User, et Modifier (Mod= 8 bits) Propagation de cette modif (en
particulier chngement de syntaxe de Send() dans les differentes classes.
2) Modification ds PIWdgGen , SetBinding() et Ajout de GetScreenPos()
PIWdg::SetBinding() avec 3 possibilites : Free, Fixed, Elastic.
Gestion de CloseWindow() genere par le WindowManager, Cela genere
maintenant un Message. L'action par defaut (ds PIWindow::Process()) fait
Hide().
3) Nouveau type de fenetre - Transient, pour afficher quelque chose en
avant plan. Utilisation de ce type de fenetre pour affichage de
coordonnes ds PIImage et PIScDraw.
4) Amelioration de gestion des fontes pour PIBWdgX:: Les fontes ne sont
chargees que si necessaire.
5) Nouvelles fonctionalites pour PIText:: (Zone de texte non editable,
zone de texte multilignes, Envoi d'un message lors de <CR> pour un texte
a une ligne)
6) petites ameliorations ds le traitement des callbacks

Reza - 17/10/96

Location:
trunk/SophyaPI/PI
Files:
52 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/piapplx.cc

    r18 r23  
    2525                            10, 10, 0, 0);
    2626menubar = new PIMenubar(this, "DefMenubar");
    27 Menubar()->SetBinding(true, true, true, false);
     27Menubar()->SetBinding(PIBK_fixed, PIBK_fixed, PIBK_fixed, PIBK_free);
    2828sxt = ( sx > Menubar()->XSize() ) ? sx : Menubar()->XSize();
    2929syt = ( sy > 0 ) ? sy : 0;
     
    3535  topcont = new PIContainerX(MBCont(), "TopLevelCont",
    3636                             sx, sy, 0, 40);
    37   topcont->SetBinding(true, true, true, true);
     37  topcont->SetBinding(PIBK_fixed, PIBK_fixed, PIBK_fixed, PIBK_fixed);
    3838  topcont->Show();
    3939  }
  • trunk/SophyaPI/PI/pibwdggen.cc

    r18 r23  
    4343void PIBaseWdgGen::But1Press(int /*x*/, int /*y*/)
    4444{
    45 Send(PIMsg_ActiveWdg);
     45Send(Msg(), PIMsg_Active);
    4646#ifdef DEBUG_RZXB
    4747printf ("PIBaseWdgGen::But1Press PosX,Y= %d %d \n", x, y);
  • trunk/SophyaPI/PI/pibwdgx.cc

    r18 r23  
    398398
    399399
    400 /* --Methode-- */
    401 void PIBaseWdgX::SelectFont(int isz, int jat)
    402 {
    403 mFAtt = fntatt[jat];
    404 mFSize = fntsz[isz];
    405 mFSt = fntst[isz][jat];
    406 XSetFont(XtDisplay(XtWdg()), DefGC(), fntst[isz][jat]->fid);
    407 return;
    408 }
    409400
    410401/* --Methode-- */
     
    584575void PIBaseWdgX::But1Release(int x, int y)
    585576{
    586 Send(PIMsg_ActiveWdg);
     577Send(Msg(), PIMsg_Active);
    587578#ifdef DEBUG_PIBWDGX
    588579printf ("PIBaseWdgX::ButReleasePosX,Y= %d %d \n", x, y);
     
    667658                          "medium-o-normal", "medium-i-normal" };
    668659
     660static XFontStruct * defnt = NULL;
     661static char * fnbi[3];
     662
     663
    669664/* --Methode-- */
    670665void PIBaseWdgX::Init()
     
    673668int i,j,k, count;
    674669char **list;
    675 XFontStruct * defnt;
    676 char * fnbi[3];
    677670
    678671if (fgbwdg)  return;
     
    740733else defnt = XLoadQueryFont(mdsp, buff);
    741734
    742 /* Allocation des fonts */
    743735for (i=0; i<NMAXFONTSZ; i++)
    744   for (j=0; j<3; j++)
    745   {
    746   for (k=0; k<5; k++)
    747     {
    748     sprintf(buff,"-%s-%s-*-%d-*-*-*-*-*-*-*", apd.fntFam, fnbi[j], fntsz[i]+k);
    749     list = XListFonts(mdsp, buff, 10, &count);
    750     XFreeFontNames(list);
    751     if (count > 0)  break;
    752     }
    753   if (count > 0)
    754     { 
    755     fntst[i][j] = XLoadQueryFont(mdsp, buff);
    756 //    printf("PIBaseWdgX::Init:  font %s loaded \n", buff);
    757     }
    758   else
    759     {   
    760     printf("PIBaseWdgX::Init: Pb font %s \n", buff);   
    761     fntst[i][j] = defnt;
    762     }
    763   }
     736  for (j=0; j<3; j++)  fntst[i][j] = NULL;
    764737
    765738 
     
    793766return;
    794767}
     768
     769
     770/* --Methode-- */
     771void PIBaseWdgX::SelectFont(int isz, int jat)
     772{
     773
     774if (!fntst[isz][jat])  // Il faut charger la fonte
     775  {
     776  char buff[256];
     777  int count,k;
     778  Display * mdsp = PIXDisplay();
     779  char **list;
     780
     781  for (k=0; k<5; k++)    // Recherche de la fonte pour tailles croissantes
     782    {
     783    sprintf(buff,"-%s-%s-*-%d-*-*-*-*-*-*-*", apd.fntFam, fnbi[jat], fntsz[isz]+k);
     784    list = XListFonts(mdsp, buff, 10, &count);
     785    XFreeFontNames(list);
     786    if (count > 0)  break;
     787    }
     788  if (count > 0)
     789    fntst[isz][jat] = XLoadQueryFont(mdsp, buff);
     790  else
     791    { printf("PIBaseWdgX::SelectFont/ Pb font %s - Using default \n", buff);   
     792    fntst[isz][jat] = defnt; }
     793  }
     794
     795mFAtt = fntatt[jat];
     796mFSize = fntsz[isz];
     797mFSt = fntst[isz][jat];
     798XSetFont(XtDisplay(XtWdg()), DefGC(), fntst[isz][jat]->fid);
     799return;
     800}
  • trunk/SophyaPI/PI/pidemo.cc

    r22 r23  
    202202
    203203/* --Methode-- */
    204 void PIDemoApp::Process(long msg, PIMsgHandler* sender, void* data)
     204void PIDemoApp::Process(PIMessage msg, PIMsgHandler* sender, void* data)
    205205{
    206206PIWdg *sndw;
     207PIMessage tmsg, smm;
     208
     209tmsg = msg;
     210msg = UserMsg(msg);
     211smm = ModMsg(tmsg);
    207212
    208213if  ((GetState()) && (msg > 9999)) { PIBeep(); return; }
     
    213218else if ( (msg >= 10300) && (msg < 10400) )  MBProcess3(msg, sender, data);
    214219else if ( (msg >= 10400) && (msg < 10500) )  MBProcess4(msg, sender, data);
    215 else if (msg == PIMsg_ActiveWdg)
     220else if (smm == PIMsg_Active)
    216221  {
    217222  sndw = (PIWdg *)sender;
     
    226231    }
    227232  }
    228 else printf("PIDemoApp::Process() BUG?? Msg %d  \n", (int)msg);
     233else if (smm == PIMsg_Close)
     234  {
     235  sndw = (PIWdg *)sender;
     236  if(sndw->kind() == PIWindow::ClassId)
     237    {
     238    mCurWin = (PIWindow *)sender;
     239    CloseCurrent();
     240    }
     241  else 
     242    printf("PIDemoApp/Bug ? CloseMsd received from NonWindow (%d %d %lx) \n",
     243           (int)tmsg,  (int)sndw->kind(), (long)sender);       
     244  }
     245
     246else printf("PIDemoApp::Process() BUG?? Msg %d (%d-%d) \n",
     247            (int)tmsg,(int)msg,(int)smm);
    229248
    230249/*   Changement palette outil  */
     
    239258
    240259/* --Methode-- */
    241 void PIDemoApp::MBProcess1(long msg, PIMsgHandler* /*sender*/, void* data)
     260void PIDemoApp::MBProcess1(PIMessage msg, PIMsgHandler* /*sender*/, void* data)
    242261{
    243262
     
    293312
    294313/* --Methode-- */
    295 void PIDemoApp::MBProcess2(long msg, PIMsgHandler* /*sender*/, void* /*data*/)
     314void PIDemoApp::MBProcess2(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
    296315{
    297316int snx,sny,sx,sy,zm,wt;
     
    359378
    360379/* --Methode-- */
    361 void PIDemoApp::MBProcess3(long msg, PIMsgHandler* /*sender*/, void* /*data*/)
     380void PIDemoApp::MBProcess3(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
    362381{
    363382ImageR4 * pim;
     
    415434
    416435/* --Methode-- */
    417 void PIDemoApp::MBProcess4(long msg, PIMsgHandler* /*sender*/, void* /*data*/)
     436void PIDemoApp::MBProcess4(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
    418437{
    419438ImageR4 * pim;
     
    584603  {
    585604  pii[i] = new PIImage(win, "Pave", 160, 160, 5+170*i, 65);
    586   pii[i]->SetBinding(true, true, true, true);
     605  pii[i]->SetBinding(PIBK_fixed, PIBK_fixed, PIBK_fixed, PIBK_fixed);
    587606  pii[i]->SetZoomWin(zoom);
    588607  pii[i]->SetTextWin(labimg);
     
    677696                          sx, sy, 200, 200);
    678697pii = new PIImage(awp[mNwin], (char *)name.c_str(), sx, sy, 0, 0);
    679 pii->SetBinding(true, true, true, true);
     698pii->SetBinding(PIBK_fixed, PIBK_fixed, PIBK_fixed, PIBK_fixed);
    680699pii->SetZoomWin(zoom);
    681700pii->SetTextWin(labimg);
     
    909928
    910929/* --Methode-- */
    911 void VisuTools::Process(long msg, PIMsgHandler* /*sender*/, void* /*data*/)
     930void VisuTools::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
    912931{
    913932CMapId cmap[5] = { CMAP_GREY32, CMAP_GREYINV32, CMAP_COLRJ32,
     
    916935if (dap->CurrentPIImage() == NULL)  return;
    917936dap->SetBusy();
     937msg = UserMsg(msg);
    918938if ((msg < 110) && (msg > 90))  // Zoom
    919939  dap->CurrentPIImage()->SetZoom((int)(msg-100));
     
    10161036
    10171037/* --Methode-- */
    1018 void CutTools::Process(long msg, PIMsgHandler* /*sender*/, void* /*data*/)
     1038void CutTools::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
    10191039{
    10201040if ((fgpb) || (dap->CurrentPIImage() == NULL))
     
    10221042  return; }
    10231043
    1024 
     1044msg = UserMsg(msg);
    10251045switch(msg)
    10261046  {
     
    12381258
    12391259/* --Methode-- */
    1240 void LutWind::Process(long msg, PIMsgHandler* /*sender*/, void* /*data*/)
     1260void LutWind::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
    12411261{
    12421262float min, max;
     
    12441264int typlut[2] = {kLutType_Lin, kLutType_Log} ;
    12451265
     1266msg = UserMsg(msg);
    12461267switch (msg)
    12471268  {
     
    13191340
    13201341/* --Methode-- */
    1321 void UserProcWind::Process(long msg, PIMsgHandler* /*sender*/, void* /*data*/)
     1342void UserProcWind::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
    13221343{
    13231344ImageR4 *mimg, *oimg;
    13241345int xp, yp, dx, dy;
    13251346
     1347msg = UserMsg(msg);
    13261348switch (msg)
    13271349  {
     
    14971519
    14981520/* --Methode-- */
    1499 void OptionWind::Process(long msg, PIMsgHandler* /*sender*/, void* data)
    1500 {
    1501 
     1521void OptionWind::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* data)
     1522{
     1523
     1524msg = UserMsg(msg);
    15021525switch (msg)
    15031526  {
  • trunk/SophyaPI/PI/pidemo.h

    r18 r23  
    2929     ~PIDemoApp();
    3030
    31      virtual void   Process(long msg, PIMsgHandler* sender, void* data=NULL);
     31     virtual void   Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
    3232
    3333     void AddImage(ImageR4 * nouv, string const & name, int zm=0, int typ=3);
     
    5151
    5252private:
    53     void MBProcess1(long msg, PIMsgHandler* sender, void* data=NULL);
    54     void MBProcess2(long msg, PIMsgHandler* sender, void* data=NULL);
    55     void MBProcess3(long msg, PIMsgHandler* sender, void* data=NULL);
    56     void MBProcess4(long msg, PIMsgHandler* sender, void* data=NULL);
     53    void MBProcess1(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
     54    void MBProcess2(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
     55    void MBProcess3(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
     56    void MBProcess4(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
    5757    bool FitPSF_Res(ImageR4 *pim);
    5858
     
    8686  VisuTools(PIDemoApp *par, PIContainer *pw);
    8787  ~VisuTools();
    88   virtual void  Process(long msg, PIMsgHandler* sender, void* data=NULL);
     88  virtual void  Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
    8989
    9090  PIPUMenu * ZoomOptMenu() { return mPum[1]; }
     
    108108  ~CutTools();
    109109  virtual void  Show();
    110   virtual void  Process(long msg, PIMsgHandler* sender, void* data=NULL);
     110  virtual void  Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
    111111
    112112private:
     
    139139  ~LutWind();
    140140  virtual void  Show();
    141   virtual void  Process(long msg, PIMsgHandler* sender, void* data=NULL);
     141  virtual void  Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
    142142
    143143private:
     
    159159                ~UserProcWind();
    160160  virtual void  Show();
    161   virtual void  Process(long msg, PIMsgHandler* sender, void* data=NULL);
     161  virtual void  Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
    162162  void          SelectUP(int n) { mUpr = n; };
    163163
     
    179179  ~OptionWind();
    180180  virtual void  Show();
    181   virtual void  Process(long msg, PIMsgHandler* sender, void* data=NULL);
     181  virtual void  Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
    182182
    183183private:
  • trunk/SophyaPI/PI/pidrawwin.cc

    r18 r23  
    66{
    77   mDrawWdg = new PIScDrawWdg(this, nom, sx-20, sy-20, 10, 10);
    8    mDrawWdg->SetBinding(true, true, true, true);   
     8   mDrawWdg->SetBinding(PIBK_fixed, PIBK_fixed, PIBK_fixed, PIBK_fixed);   
    99}
    1010
  • trunk/SophyaPI/PI/pierrdisp.cc

    r21 r23  
    6767
    6868void
    69 PIErrorDisplay::Process(long msg, PIMsgHandler *sender, void *data)
     69PIErrorDisplay::Process(PIMessage msg, PIMsgHandler *sender, void *data)
    7070{
     71msg = UserMsg(msg);
    7172  switch(msg) {
    7273  case 5000:
  • trunk/SophyaPI/PI/pierrdisp.h

    r15 r23  
    3636 
    3737  void          UpdData();
    38   void          Process(long msg, PIMsgHandler *sender, void *data);
     38  void          Process(PIMessage msg, PIMsgHandler *sender, void *data);
    3939  void          DoPeriodic() {UpdData();}
    4040protected:
  • trunk/SophyaPI/PI/pifilechogen.cc

    r2 r23  
    44/************* PIFileChooserGen ************/
    55
    6 PIFileChooserGen::PIFileChooserGen(PIMsgHandler* par, char* nom, long msg)
     6PIFileChooserGen::PIFileChooserGen(PIMsgHandler* par, char* nom, PIMessage msg)
    77: PIWdg(NULL, nom)
    88{
  • trunk/SophyaPI/PI/pifilechogen.h

    r2 r23  
    1010  enum {ClassId = 2100};
    1111
    12                      PIFileChooserGen(PIMsgHandler* par, char* nom, long msg);
     12                     PIFileChooserGen(PIMsgHandler* par, char* nom, PIMessage msg);
    1313  virtual            ~PIFileChooserGen();
    1414
  • trunk/SophyaPI/PI/pifilechomac.cc

    r9 r23  
    7272
    7373
    74 PIFileChooserMac::PIFileChooserMac(PIMsgHandler* par, char* nom, long msg)
     74PIFileChooserMac::PIFileChooserMac(PIMsgHandler* par, char* nom, PIMessage msg)
    7575: PIFileChooserGen(par, nom, msg)
    7676{
     
    9292// Envoyer un message....
    9393  if (mFileName == "")
    94     Send(Msg(), NULL);
     94    Send(Msg(), PIMsg_Cancel, NULL);
    9595  else
    96     Send(Msg(), (void *) (GetFileName().c_str()));
     96    Send(Msg(), PIMsg_OK, (void *) (GetFileName().c_str()));
    9797}
    9898
  • trunk/SophyaPI/PI/pifilechomac.h

    r9 r23  
    99public:
    1010
    11                    PIFileChooserMac(PIMsgHandler* par, char* nom, long msg);
     11                   PIFileChooserMac(PIMsgHandler* par, char* nom, PIMessage msg);
    1212  virtual          ~PIFileChooserMac();
    1313
  • trunk/SophyaPI/PI/pifilechox.cc

    r18 r23  
    1111#include <Xm/FileSB.h>
    1212
    13 // Fonction prive (CallBack)
    14 static void filesel_okact(Widget w, XtPointer *usd, XtPointer *calld);
     13// Fonctions privees (CallBack)
     14//static void filesel_okact(Widget w, XtPointer *usd, XtPointer *calld);
    1515static void filesel_cancelact(Widget w, XtPointer *usd, XtPointer *calld);
    1616
    1717/* Nouvelle-Fonction */
    18 void  filesel_okact(Widget w, XtPointer *usd, XtPointer *calld)
     18void  filesel_okact(Widget /*w*/, XtPointer *usd,
     19                    XmFileSelectionBoxCallbackStruct *calld)
    1920{
    2021PIFileChooserX *pif;
     
    2223pif->mSt = 1;
    2324pif->MWin()->Unmanage();
    24 pif->Send(pif->Msg(), (void *) (pif->GetFileName().c_str()));
     25//pif->Send(pif->Msg(), (void *) (pif->GetFileName().c_str()));
     26char *flnm;
     27XmStringGetLtoR(calld->value, XmSTRING_DEFAULT_CHARSET, &flnm);
     28strncpy(pif->mFName, flnm, 511);
     29pif->Send( pif->Msg(), PIMsg_OK, (void *) pif->mFName);
    2530return;
    2631}
    2732
    2833/* Nouvelle-Fonction */
    29 void  filesel_cancelact(Widget w, XtPointer *usd, XtPointer *calld)
     34void  filesel_cancelact(Widget /*w*/, XtPointer *usd, XtPointer */*calld*/)
    3035{
    3136PIFileChooserX *pif;
    3237pif = (PIFileChooserX *) usd ;
    3338pif->mSt = 0;
     39pif->mFName[0] = '\0';
    3440pif->MWin()->Unmanage();
    35 pif->Send(pif->Msg(), NULL);
     41pif->Send(pif->Msg(), PIMsg_Cancel, NULL);
    3642return;
    3743}
     
    4147
    4248/* --Methode-- */
    43 PIFileChooserX::PIFileChooserX(PIMsgHandler* par, char* nom, long msg)
     49PIFileChooserX::PIFileChooserX(PIMsgHandler* par, char* nom, PIMessage msg)
    4450: PIFileChooserGen(par, nom, msg)
    4551{
     
    5157
    5258mSt = 0;
     59mFName[0] = mFName[511] = '\0';
    5360
    5461CreateXtWdg(nom, xmFileSelectionBoxWidgetClass, mWin->XtWdg(), PIFC_SzX, PIFC_SzY, 0, 0);
  • trunk/SophyaPI/PI/pifilechox.h

    r8 r23  
    1111public:
    1212
    13                    PIFileChooserX(PIMsgHandler* par, char* nom, long msg);
     13                   PIFileChooserX(PIMsgHandler* par, char* nom, PIMessage msg);
    1414  virtual          ~PIFileChooserX();
    1515
     
    2525  inline PIWdg *   MWin() { return mWin; }
    2626
     27//  Je les declare ici, en public, a cause des callback
    2728  int mSt;
     29  char mFName[512];     
    2830
    2931protected:
  • trunk/SophyaPI/PI/piimage.cc

    r18 r23  
    2525winovis = true;     // $CHECK$ Reza A enlever si possible 17/6/96
    2626zow = NULL;
    27 txw = NULL;
     27trtw = NULL;
     28trtlb = txw = NULL;
     29SetTextWin(NULL);
    2830zpixm = pixm = NULL;
    2931xszpxm = xspxm = 0;
     
    3234offx = offy = 0;
    3335xpav = ypav = 0;
     36xpv0 = ypv0 = 0;
    3437xszpav = yszpav = 1;
    3538xmv0 = ymv0 = -1;
     
    5962if (lut) delete lut;
    6063if (aisup)  delete img;   // Suppression automatique d'image
     64if (trtw)  delete trtw;
    6165}
    6266
     
    9195return;
    9296}
     97
     98/* --Methode-- */
     99void PIImage::SetTextWin(PILabel * tw, bool trw, int tx, int ty)
     100{
     101txw = tw;
     102if (trw)
     103  {
     104  if (trtw)  trtw->SetSize(tx, ty);
     105  else
     106    {
     107    trtw = new PIWindow(this, "PixVal", PIWK_transient, tx, ty, 0, 0);
     108    trtw->SetAutoDelChilds(true);
     109    trtlb = new PILabel(trtw, "PixVal", tx, ty, 0, 0);
     110    trtlb->SetBinding(PIBK_fixed,PIBK_fixed, PIBK_fixed,PIBK_fixed);
     111    }
     112  }
     113else
     114  if (trtw) { delete trtw; trtw = NULL;  trtlb = NULL; }
     115
     116return;
     117}
     118
    93119
    94120/* --Methode-- */
     
    161187
    162188/* --Methode-- */
    163 void PIImage::SetZoom(float fzm, bool refr)
     189void PIImage::SetZoomF(float fzm, bool refr)
    164190{
    165191int zm;
    166192
    167193if (fzm < 0.01) return;
    168 if (fzm < 1.)  zm = -(1./fzm);
     194if (fzm < 1.)  zm = (int)(-(1./fzm));
    169195else zm = (int)(fzm+0.25);
    170196SetZoom(zm, refr);
     
    186212
    187213/* --Methode-- */
    188 float PIImage::GetZoom()
     214float PIImage::GetZoomF()
    189215{
    190216if (zoom >= 1)  return((float)zoom);
     
    248274  {
    249275  ComputePixmap();
    250   Send(PIMsg_ActiveWdg);
     276  Send(Msg(), PIMsg_Active);
    251277  }
    252278if (zow != NULL)
     
    255281  ComputeZoomPixmap();
    256282  }
    257 if (txw)
     283if (txw || trtlb)
    258284  {
    259285  char buff[256];
    260   sprintf(buff,"%s : X= %d , Y= %d  PixVal= %g ",
    261           (char *)Nom().c_str(), xpav, ypav, img->FValue(xpav, ypav));
    262   txw->SetLabel((string)buff);
     286  sprintf(buff,"X= %d , Y= %d  PixVal= %g ",  /*(char *)Nom().c_str(),*/
     287          xpav, ypav, img->FValue(xpav, ypav));
     288  if (txw)  txw->SetLabel((string)buff);
     289  if (trtlb)  trtlb->SetLabel((string)buff);
    263290  }
    264291
     
    296323int xp, yp;
    297324
    298 Send(PIMsg_ActiveWdg);
     325Send(Msg(), PIMsg_Active);
    299326if (img == NULL)  return;
    300327if ( PosW2Img(x, y, &xp, &yp) )  return;
    301328SelPointerShape(PI_CrossPointer);
    302329xpav = xp;  ypav = yp;
     330ShowTrTxW();
    303331Apply(false);
    304332if (curshow)  DrawCursor(-1,-1);
     
    324352SelPointerShape(PI_ArrowPointer);
    325353if (curshow)  DrawCursor();
     354if (trtw)  trtw->Hide();
    326355return;
    327356}
     
    333362int xp, yp;
    334363
    335 Send(PIMsg_ActiveWdg);
    336 if (img == NULL)  return;
    337 if ( PosW2Img(x, y, &xp, &yp) )  { xmv0 = -1;  return; }
     364Send(Msg(), PIMsg_Active);
     365if (img == NULL)  return;
     366if ( PosW2Img(x, y, &xpv0, &ypv0) )  { xmv0 = -1;  return; }
    338367xmv0 = x;  ymv0 = y;  dxmv = dymv = 0;
    339368if (curshow)  DrawCursor(-1,-1);
     
    343372else SelForeground(PI_Magenta);
    344373SelLine(PI_NormalLine);
     374ShowTrTxW();
    345375return;
    346376}
     
    356386dxmv = x-xmv0;  dymv = y-ymv0;
    357387DrawBox(xmv0, ymv0, dxmv, dymv);
     388if (txw || trtlb)
     389  {
     390  char buff[256];
     391  sprintf(buff,"X,Y= %d,%d  PixVal= %g (X,Yc= %d,%d)", 
     392          xp, yp, img->FValue(x, yp), (xp+xpv0)/2, (yp+ypv0)/2);
     393  if (txw)  txw->SetLabel((string)buff);
     394  if (trtlb)  trtlb->SetLabel((string)buff);
     395  }
    358396return;
    359397}
     
    362400void PIImage::But2Release(int x, int y)
    363401{
    364 int xp, yp, xp2, yp2;
     402int xp2, yp2;
    365403
    366404if (img == NULL)  return;
     
    369407SelGOMode(PI_GOCopy);
    370408SelForeground(PI_White);
    371 PosW2Img(xmv0, ymv0, &xp, &yp);
    372409if ( PosW2Img(x, y, &xp2, &yp2) ) 
    373410  PosW2Img(xmv0+dxmv, ymv0+dymv, &xp2, &yp2);
    374 xpav = (xp+xp2)/2;
    375 ypav = (yp+yp2)/2;
    376 xszpav = ((xp2-xp) > 0) ? (xp2-xp) : 1;
    377 yszpav = ((yp2-yp) > 0) ? (yp2-yp) : 1;
     411xpav = (xpv0+xp2)/2;
     412ypav = (ypv0+yp2)/2;
     413xszpav = ((xp2-xpv0) > 0) ? (xp2-xpv0) : 1;
     414yszpav = ((yp2-ypv0) > 0) ? (yp2-ypv0) : 1;
    378415
    379416Apply(false);
    380417if (curshow)  DrawCursor();
     418if (trtw)  trtw->Hide();
    381419return;
    382420}
     
    388426int xp, yp;
    389427
    390 Send(PIMsg_ActiveWdg);
     428Send(Msg(), PIMsg_Active);
    391429if (img == NULL)  return;
    392430if ( PosW2Img(x, y, &xp, &yp) )  { xmv0 = -1;  return; }
    393431if (curshow)  DrawCursor(-1,-1);
     432ShowTrTxW();
    394433SelPointerShape(PI_TDLRArrowPointer);
    395434xmv0 = xp;
     
    406445if (xmv0 < 0)  return;
    407446if ( PosW2Img(x, y, &xp, &yp) )  return;
    408 if (txw)
     447if (txw || trtlb)
    409448  {
    410449  char buff[256];
    411   sprintf(buff,"%s : DelX= %d , DelY= %d ", (char *)Nom().c_str(), xp-xmv0, yp-ymv0);
    412   txw->SetLabel((string)buff);
     450  sprintf(buff,"DelX= %d , DelY= %d ", xp-xmv0, yp-ymv0);
     451  if (txw) txw->SetLabel((string)buff);
     452  if (trtlb) trtlb->SetLabel((string)buff);
    413453  }
    414454}
     
    420460
    421461SelPointerShape(PI_ArrowPointer);
     462if (trtw)  trtw->Hide();
    422463if (img == NULL)  return;
    423464if (xmv0 < 0)  return;
     
    611652  }
    612653else { xcurs = ycurs = -1; }
     654
     655return;
     656}
     657
     658/* --Methode-- */
     659void PIImage::ShowTrTxW()
     660{
     661if (trtw)
     662  {
     663  int tpx, tpy;
     664  GetScreenPos(tpx, tpy);
     665  tpy -= (trtw->YSize()+5);
     666  if (tpy < 0)  tpy = 0;
     667  trtw->SetPos(tpx, tpy);
     668  trtw->Show(); 
     669  }
    613670
    614671return;
  • trunk/SophyaPI/PI/piimage.h

    r18 r23  
    1313#include PIPIXMAP_H
    1414#include PISTDWDG_H
     15#include PIWIN_H
    1516
    1617class PIImage : public PIPixmap
     
    2829
    2930  void SetZoomWin(PIPixmap * zw, bool refr=true);
    30   inline void SetTextWin(PILabel * tw) { txw = tw; };
     31  void SetTextWin(PILabel * tw, bool trw=true, int tx=350, int ty=30);
    3132  void ShowCursor(bool sc=true);
    3233
     
    3637
    3738  void SetZoom(int zm, bool refr=true);
    38   void SetZoom(float fzm, bool refr=true);
    39   float GetZoom();
     39  void SetZoomF(float fzm, bool refr=true);
     40  float GetZoomF();
    4041
    4142  void SetOffset(int ox, int oy, bool refr=true);
     
    7879  void DrawCursor(int xc, int yc);
    7980
     81  void ShowTrTxW();
     82
    8083  int PosW2Img(int xiw, int yiw, int * xp, int * yp);
    8184  int PosImg2W(int xp, int yp, int * xiw, int * yiw);
     
    103106
    104107  PILabel * txw;
     108  PILabel * trtlb;
     109  PIWindow * trtw;
     110
    105111  int xpav, ypav;
     112  int xpv0, ypv0;
    106113  int xmv0, ymv0;
    107114  int dxmv, dymv;
  • trunk/SophyaPI/PI/pimenubarx.cc

    r2 r23  
    2828
    2929SetPos(0,0);
    30 SetBinding(true, true, true, false);
     30SetBinding(PIBK_fixed, PIBK_fixed, PIBK_fixed, PIBK_free);
    3131
    3232Manage();
  • trunk/SophyaPI/PI/pimenugen.h

    r8 r23  
    1414                  ~PIMenuGen();
    1515                                   
    16   virtual void    AppendItem(char* nom, long msg)=0;
     16  virtual void    AppendItem(char* nom, PIMessage msg)=0;
    1717
    1818  virtual void    DeleteItem(char *nom)=0;
    19   virtual void    DeleteItemMsg(long msg)=0;
     19  virtual void    DeleteItemMsg(PIMessage msg)=0;
    2020  virtual void    DeleteItemNum(int n)=0;
    2121
    2222  virtual void    CheckItem(char *nom, bool st=false)=0;
    23   virtual void    CheckItemMsg(long msg, bool st=false)=0;
     23  virtual void    CheckItemMsg(PIMessage msg, bool st=false)=0;
    2424  virtual void    CheckItemNum(int n, bool st=false)=0;
    2525
  • trunk/SophyaPI/PI/pimenumac.cc

    r9 r23  
    2424
    2525int
    26 PIMenuMac::FindItemByMsg(long msg)
     26PIMenuMac::FindItemByMsg(PIMessage msg)
    2727{
    2828  if (mMsgs.size() == 0) return -1;
     
    4343
    4444void
    45 PIMenuMac::AppendItem(char* nom, long msg)
     45PIMenuMac::AppendItem(char* nom, PIMessage msg)
    4646{
    4747  LStr255 titre(nom);
     
    5959
    6060void
    61 PIMenuMac::CheckItemMsg(long msg, bool st)
     61PIMenuMac::CheckItemMsg(PIMessage msg, bool st)
    6262{
    6363  int i = FindItemByMsg(msg);
     
    8383
    8484void
    85 PIMenuMac::DeleteItemMsg(long msg)
     85PIMenuMac::DeleteItemMsg(PIMessage msg)
    8686{
    8787  int i = FindItemByMsg(msg);
     
    104104{
    105105  if (item<0 || item >= mMsgs.size()) return; // $CHECK$ exception ?
    106   Send(mMsgs[item], (void*) GetMenuItemText(item).c_str());
     106  Send(mMsgs[item], PIMsg_Click, (void*) GetMenuItemText(item).c_str());
    107107}
    108108
  • trunk/SophyaPI/PI/pimenumac.h

    r9 r23  
    1313                                   ~PIMenuMac();
    1414                                   
    15         virtual void    AppendItem(char* nom, long msg);
     15        virtual void    AppendItem(char* nom, PIMessage msg);
    1616
    1717    virtual void    DeleteItem(char *nom);
    18     virtual void    DeleteItemMsg(long msg);
     18    virtual void    DeleteItemMsg(PIMessage msg);
    1919    virtual void    DeleteItemNum(int n);
    2020
    2121    virtual void    CheckItem(char *nom, bool st=false);
    22     virtual void    CheckItemMsg(long msg, bool st=false);
     22    virtual void    CheckItemMsg(PIMessage msg, bool st=false);
    2323    virtual void    CheckItemNum(int n, bool st=false);
    2424       
     
    3333        string          GetMenuItemText(int item);
    3434        int             GetMenuItemMsg(int item);
    35         int             FindItemByMsg(long msg);
     35        int             FindItemByMsg(PIMessage msg);
    3636        int             FindItemByName(string const& nom);
    3737       
     
    4040        LMenu*          macMenu;
    4141        int             mMenuId;
    42         vector<long>    mMsgs;
     42        vector<PIMessage>    mMsgs;
    4343        static int      lastId;
    4444        static list<PIMenuMac*> sMenus;
  • trunk/SophyaPI/PI/pimenux.cc

    r8 r23  
    2525
    2626// pim->Hide();
    27 pim->Send(cusd->msg, (void *)pim->ItemNameWdg(cusd->itb).c_str());
     27pim->Send(cusd->msg, PIMsg_Click, (void *)pim->ItemNameWdg(cusd->itb).c_str());
    2828#ifdef DEBUG_PIMenuX
    2929printf("%%%Debug_menub_action: Msg= %d  %lx\n", (int)cusd->msg, (long)pim);
     
    6060
    6161/* --Methode-- */
    62 void PIMenuX::AppendItem(char* nom, long msg)
     62void PIMenuX::AppendItem(char* nom, PIMessage msg)
    6363{
    6464AddItem(nom, msg, false);
     
    7878
    7979/* --Methode-- */
    80 void PIMenuX::DeleteItemMsg(long msg)
     80void PIMenuX::DeleteItemMsg(PIMessage msg)
    8181{
    8282for(int i=0; i<mNItem; i++)
     
    121121
    122122/* --Methode-- */
    123 void PIMenuX::CheckItemMsg(long msg, bool st)
     123void PIMenuX::CheckItemMsg(PIMessage msg, bool st)
    124124{
    125125for(int i=0; i<mNItem; i++)
     
    189189
    190190/* --Methode-- */
    191 long PIMenuX::ItemMsg(int n)
     191PIMessage PIMenuX::ItemMsg(int n)
    192192{
    193193if ( (n < 0) || (n >= mNItem))  return(0);
     
    208208
    209209/* --Methode-- */
    210 int PIMenuX::GetNumItemMsg(long msg)
     210int PIMenuX::GetNumItemMsg(PIMessage msg)
    211211{
    212212for(int i=0; i<mNItem; i++)
     
    224224
    225225/* --Methode-- */
    226 void PIMenuX::AddItem(char* nom, long msg, bool tog)
     226void PIMenuX::AddItem(char* nom, PIMessage msg, bool tog)
    227227{
    228228_pimxit_ *buto;
     
    288288
    289289/* --Methode-- A virer
    290 void PIMenuX::AppendCheckItem(char* nom, long msg)
     290void PIMenuX::AppendCheckItem(char* nom, PIMessage msg)
    291291{
    292292AddItem(nom, msg, true);
  • trunk/SophyaPI/PI/pimenux.h

    r8 r23  
    1111SysDWdg itb;
    1212PIMenuX *pmen;
    13 long msg;
     13PIMessage msg;
    1414bool togg;
    1515};
     
    2222                  ~PIMenuX();
    2323                                   
    24   virtual void    AppendItem(char* nom, long msg);
     24  virtual void    AppendItem(char* nom, PIMessage msg);
    2525
    2626  virtual void    DeleteItem(char *nom);
    27   virtual void    DeleteItemMsg(long msg);
     27  virtual void    DeleteItemMsg(PIMessage msg);
    2828  virtual void    DeleteItemNum(int n);
    2929
    3030  virtual void    CheckItem(char *nom, bool st=false);
    31   virtual void    CheckItemMsg(long msg, bool st=false);
     31  virtual void    CheckItemMsg(PIMessage msg, bool st=false);
    3232  virtual void    CheckItemNum(int n, bool st=false);
    3333
    3434  virtual void    Show();
    35   virtual void   Show(PIWdg *w, int px, int py);
     35  virtual void    Show(PIWdg *w, int px, int py);
    3636  virtual void    Hide();
    3737
    3838// Pour usage prive et par OptionMenu, ...
    39   long            ItemMsg(int n);
     39  PIMessage       ItemMsg(int n);
    4040  int             GetNumItem(char *nom);
    41   int             GetNumItemMsg(long msg);
     41  int             GetNumItemMsg(PIMessage msg);
    4242  SysDWdg         GetItemWdg(int n);
    4343  string          ItemName(int n);
     
    4545
    4646protected:
    47         void      AddItem(char* nom, long msg, bool tog);
     47        void      AddItem(char* nom, PIMessage msg, bool tog);
    4848        void      Check();
    4949
  • trunk/SophyaPI/PI/pimsghandler.cc

    r18 r23  
    1010
    1111void
    12 PIMsgHandler::Process(long msg, PIMsgHandler* sender, void* data)
     12PIMsgHandler::Process(PIMessage msg, PIMsgHandler* sender, void* data)
    1313{
    1414        ReSend(msg, sender, data);
     
    1616
    1717void
    18 PIMsgHandler::Send(long msg, void* data)
     18PIMsgHandler::Send(PIMessage msg, PIMsgMod mm, void* data)
    1919{
    2020//      Process(msg, this, data);  $CHECK$  Reza 12/06/96
    2121// Send par defaut appelle le process du parent $CHECK$
    2222if (msgParent)
    23   msgParent->Process(msg, this, data);
     23  msgParent->Process(BuildMsg(msg, mm), this, data);
    2424
    2525}
    2626
    2727void
    28 PIMsgHandler::ReSend(long msg, PIMsgHandler* sender, void* data)
     28PIMsgHandler::ReSend(PIMessage msg, PIMsgHandler* sender, void* data)
    2929{
    3030  if (msgParent)
    3131    msgParent->Process(msg, sender, data);
    3232}
     33
     34
     35
  • trunk/SophyaPI/PI/pimsghandler.h

    r18 r23  
    77
    88enum {
    9  // Les messages
    10         PIMsg_ActiveWdg     = 1,
    11         PIMsg_OK            = 2,
    12         PIMsg_Cancel        = 3,
    13         PIMsg_Help          = 4,
    14         PIMsg_DataChanged   = 5,
    15         PIMsg_Click         = 6,
    16         PIMsg_Press         = 7
     9 // Les messages reserves systeme (PI)   les 8 premiers bits
     10 // Messages user, les bits restants
     11        PIMsg_Active        = 1,
     12        PIMsg_Close         = 2,
     13
     14        PIMsg_OK            = 11,
     15        PIMsg_Cancel        = 12,
     16        PIMsg_Help          = 13,
     17
     18        PIMsg_DataChanged   = 21,
     19        PIMsg_Click         = 22,
     20        PIMsg_Press         = 23
    1721};
     22
     23
     24// Definition de type pour les messages - Il est peu probable que le typedef change ...
     25//                                      Reza 17/10/96
     26typedef unsigned long PIMessage;
     27typedef unsigned char PIMsgMod;
    1828
    1929class PIMsgHandler {
    2030public:
    21                                         PIMsgHandler(PIMsgHandler* par=NULL);
    22         virtual            ~PIMsgHandler();
     31                             PIMsgHandler(PIMsgHandler* par=NULL);
     32        virtual              ~PIMsgHandler();
    2333       
    24         virtual void    SetMsgParent(PIMsgHandler* par) {msgParent = par;}
     34        virtual void         SetMsgParent(PIMsgHandler* par) {msgParent = par;}
    2535
    26         virtual void    Send(long msg, void* data=NULL);
    27        
    28        
     36        virtual void         Send(PIMessage msg, PIMsgMod mm=0, void* data=NULL);
     37
     38        inline  PIMessage    UserMsg(PIMessage msg) { return (msg >> 8); }
     39        inline  PIMessage    ModMsg(PIMessage msg) { return (msg & 0xFF); }
     40        inline  PIMessage    BuildMsg(PIMessage um, PIMsgMod mm)
     41                                  { return ((um << 8) | mm); }
     42
    2943protected:
    30         virtual void    ReSend(long msg, PIMsgHandler* sender, void* data=NULL);
    31         virtual void    Process(long msg, PIMsgHandler* sender, void* data=NULL);
     44        virtual void    ReSend(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
     45        virtual void    Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
    3246
    3347private:
  • trunk/SophyaPI/PI/pioptmenugen.h

    r8 r23  
    1818
    1919  virtual string     GetValueStr() = 0;    // Option choisie
    20   virtual long       GetValue() = 0;       // Message correspondant a l'option choisie
     20  virtual PIMessage  GetValue() = 0;       // Message correspondant a l'option choisie
    2121  virtual void       SetValueStr(string & s) = 0;
    22   virtual void       SetValue(long msg) = 0;
     22  virtual void       SetValue(PIMessage msg) = 0;
    2323
    2424protected:
  • trunk/SophyaPI/PI/pioptmenumac.cc

    r9 r23  
    3434
    3535/* --Methode-- */
    36 void PIOptMenuMac::Process(long msg, PIMsgHandler* sender, void* data)
     36void PIOptMenuMac::Process(PIMessage msg, PIMsgHandler* sender, void* data)
    3737{
    38 Select((char *)data, msg);
     38Select((char *)data, UserMsg(msg));  //  Reza 17/10/96 $CHECK$ ???
    3939ReSend(msg, sender, data);
    4040}
     
    4848
    4949void
    50 PIOptMenuMac::Select(char *txt, long msg)
     50PIOptMenuMac::Select(char *txt, PIMessage msg)
    5151{ // Ca doit faire quoi ????
    5252mStext = txt;  mSmsg = msg;
     
    6868
    6969/* --Methode-- */
    70 void PIOptMenuMac::SetValue(long msg)
     70void PIOptMenuMac::SetValue(PIMessage msg)
    7171{
    7272int n;
  • trunk/SophyaPI/PI/pioptmenumac.h

    r9 r23  
    1010                       ~PIOptMenuMac();
    1111
    12   virtual void      Process(long msg, PIMsgHandler* sender, void* data=NULL);
     12  virtual void      Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
    1313                                   
    1414  virtual void      ListenToMessage(MessageT inMessage, void *ioParam);
    1515  virtual string    GetValueStr() { return(mStext); }
    16   virtual long      GetValue()    { return(mSmsg); }
     16  virtual PIMessage GetValue()    { return(mSmsg); }
    1717  virtual void      SetValueStr(string & s);
    18   virtual void      SetValue(long msg);
     18  virtual void      SetValue(PIMessage msg);
    1919 
    20   inline void       Select(char *txt, long msg); // public ou protege ???
     20  inline void       Select(char *txt, PIMessage msg); // public ou protege ???
    2121
    2222
    2323protected:
    2424  string    mStext;
    25   long      mSmsg;
     25  PIMessage mSmsg;
    2626  //MenuHandle macMenu;
    2727  PIPUMenu* mPUMenu;
  • trunk/SophyaPI/PI/pioptmenux.cc

    r8 r23  
    2020sy -= 2;
    2121SetBorderWidth(1);
    22 // SetBinding(true, true, true, true);
    2322mAB = new PIButton(this, "?", 0, sy-2, sy-2, 1, 1);
    24 mAB->SetBinding(true, true, false, true);
    25 mAB->SetPressMsg(PIMsg_Press);
     23mAB->SetBinding(PIBK_fixed, PIBK_fixed, PIBK_free, PIBK_fixed);
     24mAB->ActivatePress(true);
    2625mLab = new PILabel(this, "OptLabel", sx-sy-1, sy, sy+1, 0);
    27 mLab->SetBinding(true, true, true, true);
     26mLab->SetBinding(PIBK_fixed, PIBK_fixed, PIBK_fixed, PIBK_fixed);
    2827mMen = pum;
    2928SetValue(mMen->ItemMsg(0));
     
    4039
    4140/* --Methode-- */
    42 void PIOptMenuX::Process(long msg, PIMsgHandler* sender, void* data)
     41void PIOptMenuX::Process(PIMessage msg, PIMsgHandler* sender, void* data)
    4342{
    4443// printf("PIOptMenuX::Process Msg= %d Sender= %lx \n", (int)msg, (long)sender);
    45 if ((sender == mAB) && (msg == PIMsg_Press)) 
     44if ((sender == mAB) && (ModMsg(msg) == PIMsg_Press)) 
    4645  {  mMen->SetMsgParent(this);    mMen->Show(this, 0, YSize()); }
    4746else if (sender == mMen)
    4847  {
    4948  mAB->ReleaseButton();
    50   SetValue(msg);
     49  SetValue(UserMsg(msg));
    5150  ReSend(msg, this, data);
    5251  }
     
    7271
    7372/* --Methode-- */
    74 void PIOptMenuX::SetValue(long msg)
     73void PIOptMenuX::SetValue(PIMessage msg)
    7574{
    7675int n;
  • trunk/SophyaPI/PI/pioptmenux.h

    r8 r23  
    1212                    ~PIOptMenuX();
    1313
    14   virtual void      Process(long msg, PIMsgHandler* sender, void* data=NULL);
     14  virtual void      Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
    1515                                   
    1616  virtual string    GetValueStr() { return(mStext); }
    17   virtual long      GetValue()    { return(mSmsg); }
     17  virtual PIMessage GetValue()    { return(mSmsg); }
    1818  virtual void      SetValueStr(string & s);
    19   virtual void      SetValue(long msg);
     19  virtual void      SetValue(PIMessage msg);
    2020 
    2121 
     
    2626  PIPUMenu *mMen;
    2727  string   mStext;
    28   long    mSmsg;
     28  PIMessage mSmsg;
    2929
    3030};
  • trunk/SophyaPI/PI/piqualmon.cc

    r21 r23  
    8888
    8989void
    90 PIQualiteWin::Process(long msg, PIMsgHandler *sender, void *data)
    91 {
     90PIQualiteWin::Process(PIMessage msg, PIMsgHandler *, void *)
     91{
     92  msg = UserMsg(msg);  // Reza 17/10/96 $CHECK$
    9293  switch (msg) {
    9394  case 80100:
  • trunk/SophyaPI/PI/piqualmon.h

    r21 r23  
    2323  virtual void        UpdateInfo(LImageInfo linfor, LImageInfo linfob,
    2424                                 string labflnmr, string labflnmb);
    25   virtual void        Process(long msg, PIMsgHandler *sender, void *data);
     25  virtual void        Process(PIMessage msg, PIMsgHandler *sender, void *data);
    2626
    2727protected:
  • trunk/SophyaPI/PI/piscdrawwdg.cc

    r18 r23  
    1414  clip = true;
    1515  padsup = false;
    16   mTxw = NULL;
     16  mTrlb = mTxw = NULL;
     17  mTrW = NULL;
     18  SetTextWin(NULL);
    1719  ActivateButton(1);    // Pour pouvoir activer la fenetre et coordonnees
    1820  ActivateMove(1);      //    "         "         "        "
     
    2527{
    2628  DeleteDrawers();
     29  if (mTrW)  delete mTrW;
    2730}
    2831
     
    531534    axesFlags |= kMajTicks;
    532535}
     536void
     537PIScDrawWdg::SetTextWin(PILabel * tw, bool trw, int tx, int ty)
     538{
     539mTxw = tw;
     540if (trw)
     541  {
     542  if (mTrW)  mTrW->SetSize(tx, ty);
     543  else
     544    {
     545    mTrW = new PIWindow(this, "Point", PIWK_transient, tx, ty, 0, 0);
     546    mTrW->SetAutoDelChilds(true);
     547    mTrlb = new PILabel(mTrW, "PixVal", tx, ty, 0, 0);
     548    mTrlb->SetBinding(PIBK_fixed,PIBK_fixed, PIBK_fixed,PIBK_fixed);
     549    }
     550  }
     551else
     552  if (mTrW) { delete mTrW; mTrW = NULL;  mTrlb = NULL; }
     553
     554return;
     555}
    533556
    534557void
     
    547570PIScDrawWdg::But1Press(int x, int y)
    548571{
    549   if (UpdateText(x, y))
     572  if (UpdateText(x, y))
     573     {
     574     if (mTrW)
     575       {
     576       int tpx, tpy;
     577       GetScreenPos(tpx, tpy);       
     578       tpy -= (mTrW->YSize()+5);
     579       if (tpy < 0)  tpy = 0;
     580       mTrW->SetPos(tpx, tpy);
     581       mTrW->Show();
     582       }
    550583     SelPointerShape(PI_CrossPointer);
    551   Send(PIMsg_ActiveWdg);
     584     }
     585  Send(Msg(), PIMsg_Active);
    552586
    553587}
     
    564598  if (UpdateText(x, y))
    565599    SelPointerShape(PI_ArrowPointer);
    566 
     600  if (mTrW)  mTrW->Hide();
    567601}
    568602
     
    570604PIScDrawWdg::UpdateText(int xp, int yp)
    571605{
    572   if (mTxw == NULL) return(false);
     606  if ((mTxw == NULL) && (mTrlb == NULL)) return(false);
    573607
    574608  char buff[128];
     
    576610  Local2Sc(xp, yp, dx, dy);
    577611  sprintf(buff, "X= %g  Y= %g",  dx, dy);
    578   mTxw->SetLabel((string)buff);
     612  if (mTxw)
     613    mTxw->SetLabel((string)buff);
     614  if (mTrlb)
     615    mTrlb->SetLabel((string)buff);
    579616  return(true);
    580617
     
    595632  SelGOMode(PI_GOXOR);
    596633  SelLine(PI_ThinLine);
    597   Send(PIMsg_ActiveWdg);
     634  Send(Msg(), PIMsg_Active);
    598635}
    599636
  • trunk/SophyaPI/PI/piscdrawwdg.h

    r18 r23  
    66#include PIBWDG_H
    77#include PISTDWDG_H
     8#include PIWIN_H
    89
    910#include <list.h>
     
    6869  virtual void       SetAxesFlags(int flags=kAxesDflt);
    6970 
    70   void   SetTextWin(PILabel * tw) {mTxw = tw; }
     71  void               SetTextWin(PILabel * tw, bool trw=true, int tx=200, int ty=30);
    7172
    7273  double XMin() const {return xMin;}
     
    111112  PILineAtt cLatt;
    112113  PILabel * mTxw; 
     114  PILabel * mTrlb;
     115  PIWindow * mTrW;
    113116  bool clip;
    114117  bool padsup;
  • trunk/SophyaPI/PI/pistatmon.cc

    r21 r23  
    6969}
    7070
    71 void PIStatWin::Process(long msg, PIMsgHandler *, void *)
    72 {
     71void PIStatWin::Process(PIMessage msg, PIMsgHandler *, void *)
     72{
     73  msg = UserMsg(msg);  // Reza 17/10/96 $CHECK$
    7374  switch (msg) {
    7475  case 1010:
  • trunk/SophyaPI/PI/pistatmon.h

    r15 r23  
    1919                               int sx, int sy, int px, int py);
    2020  virtual            ~PIStatWin();
    21   virtual void       Process(long msg, PIMsgHandler *sender, void *data);
     21  virtual void       Process(PIMessage msg, PIMsgHandler *sender, void *data);
    2222  void               UpdateInfo(LImageInfo linfoR, LImageInfo linfoB,
    2323                                string var);
  • trunk/SophyaPI/PI/pistdwdggen.cc

    r8 r23  
    1414/************* PIButtonGen ************/
    1515
    16 PIButtonGen::PIButtonGen(PIContainerGen *par, char *nom, long msg,
     16PIButtonGen::PIButtonGen(PIContainerGen *par, char *nom, PIMessage msg,
    1717                         int sx, int sy, int px, int py, PIBtnSign bsgn)
    1818: PIWdg(par, nom, sx, sy, px, py)
    1919{
    2020SetMsg(msg);
    21 mPressMsg = 0;
    2221mSgn = bsgn;
    2322}
     
    2625{}
    2726
    28 void PIButtonGen::SetPressMsg(long prmsg)
    29 {
    30 mPressMsg = prmsg;
    31 }
    3227
    3328/************* PIScaleGen ************/
    3429
    35 PIScaleGen::PIScaleGen(PIContainerGen *par, char *nom, long msg,
     30PIScaleGen::PIScaleGen(PIContainerGen *par, char *nom, PIMessage msg,
    3631                       int /*min*/, int /*max*/, int sx, int sy, int px, int py)
    3732: PIWdg(par, nom, sx, sy, px, py)
     
    5853/************* PICheckBoxGen ************/
    5954
    60 PICheckBoxGen::PICheckBoxGen(PIContainerGen *par, char *nom, long msg,
     55PICheckBoxGen::PICheckBoxGen(PIContainerGen *par, char *nom, PIMessage msg,
    6156                         int sx, int sy, int px, int py)
    6257: PIWdg(par, nom, sx, sy, px, py)
  • trunk/SophyaPI/PI/pistdwdggen.h

    r8 r23  
    2626  enum {ClassId = 1010};
    2727
    28                      PIButtonGen(PIContainerGen* par, char* nom, long msg = PIMsg_Click,
     28                     PIButtonGen(PIContainerGen* par, char* nom,
     29                                 PIMessage msg = PIMsg_Click,
    2930                                 int sx=10, int sy=10, int px=0, int py=0,
    3031                                 PIBtnSign bsgn = PIBtn_Label);
     
    3334  virtual long       kind() {return ClassId; }
    3435
    35   virtual void       SetPressMsg(long prmsg);
    36   inline long        PressMsg() { return(mPressMsg); } 
     36  virtual void       ActivatePress(bool acp=false)=0;
    3737
    3838protected:
    39   long mPressMsg;
    4039  PIBtnSign mSgn;
    4140};
     
    5453  virtual string     GetText() const = 0;
    5554
     55  virtual void       SetMutiLineMode(bool mlm=false) = 0;
     56  virtual void       SetTextEditable(bool te=true) = 0;
     57
    5658  virtual long       kind() {return ClassId; }
    5759};
     
    6365  enum {ClassId = 1030};
    6466
    65                      PIScaleGen(PIContainerGen* par, char* nom, long msg = PIMsg_Click,
     67                     PIScaleGen(PIContainerGen* par, char* nom,
     68                     PIMessage msg = PIMsg_Click,
    6669                     int min=0, int max=10, int sx=100, int sy=10, int px=0, int py=0);
    6770  ~PIScaleGen();
     
    8588
    8689                     PICheckBoxGen(PIContainerGen* par, char* nom,
    87                                    long msg = PIMsg_Click,
     90                                   PIMessage msg = PIMsg_Click,
    8891                                   int sx=10, int sy=10, int px=0, int py=0);
    8992  virtual           ~PICheckBoxGen()=0;
  • trunk/SophyaPI/PI/pistdwdgmac.cc

    r9 r23  
    2222#include <LStdControl.h>
    2323
    24 PIButtonMac::PIButtonMac(PIContainerGen *par, char *nom, long msg,
     24PIButtonMac::PIButtonMac(PIContainerGen *par, char *nom, PIMessage msg,
    2525                         int sx, int sy, int px, int py, PIBtnSign bsgn)
    2626: PIButtonGen(par, nom, msg, sx, sy, px, py, bsgn)
     
    3939{
    4040  if (inMessage == msg_Click)
    41     Send(myMsg);
     41    Send(myMsg, PIMsg_Press);
    4242}
    4343
     
    7777
    7878
    79 PIScaleMac::PIScaleMac(PIContainerGen* par, char* nom, long msg,
     79PIScaleMac::PIScaleMac(PIContainerGen* par, char* nom, PIMessage msg,
    8080                       int min, int max, int sx, int sy, int px, int py)
    8181: PIScaleGen(par, nom, msg, min, max, sx, sy, px, py)
     
    100100{
    101101  if (inMessage == msg_ThumbDragged)
    102     Send(myMsg);
     102    Send(myMsg, PIMsg_DataChanged);
    103103}
    104104
     
    166166#include <LStdControl.h>
    167167
    168 PICheckBoxMac::PICheckBoxMac(PIContainerGen *par, char *nom, long msg,
     168PICheckBoxMac::PICheckBoxMac(PIContainerGen *par, char *nom, PIMessage msg,
    169169                         int sx, int sy, int px, int py)
    170170: PICheckBoxGen(par, nom, msg, sx, sy, px, py)
     
    183183{
    184184  if (inMessage == msg_Click)
    185     Send(myMsg);
     185    Send(myMsg, PIMsg_DataChanged);
    186186}
    187187
  • trunk/SophyaPI/PI/pistdwdgmac.h

    r9 r23  
    1616{
    1717public:
    18                      PIButtonMac(PIContainerGen *par, char *nom, long msg = PIMsg_Click,
     18                     PIButtonMac(PIContainerGen *par, char *nom, PIMessage msg = PIMsg_Click,
    1919                                 int sx=10, int sy=10, int px=0, int py=0,
    2020                                 PIBtnSign bsgn = PIBtn_Label);
     
    3636{
    3737public:
    38                      PIScaleMac(PIContainerGen* par, char* nom, long msg=PIMsg_Click,
     38                     PIScaleMac(PIContainerGen* par, char* nom, PIMessage msg=PIMsg_Click,
    3939                                int min=0, int max=10, int sx=100, int sy=10, int px=0, int py=0);
    4040                    ~PIScaleMac();
     
    5555public:
    5656                     PICheckBoxMac(PIContainerGen* par, char* nom,
    57                                    long msg = PIMsg_Click,
     57                                   PIMessage msg = PIMsg_Click,
    5858                                   int sx=10, int sy=10, int px=0, int py=0);
    5959  virtual           ~PICheckBoxMac();
  • trunk/SophyaPI/PI/pistdwdgx.cc

    r8 r23  
    3737
    3838/* Nouvelle-Fonction */
    39 void  button_action(Widget w, XtPointer *usd, XtPointer *calld)
     39void  button_action(Widget , XtPointer *usd, XtPointer *)
    4040{
    4141PIButtonX *pib;
    4242pib = (PIButtonX *) usd ;
    43 pib->Send(pib->Msg());
     43pib->Send(pib->Msg(),PIMsg_Click,NULL);
    4444return;
    4545}
    4646
    4747/* Nouvelle-Fonction */
    48 void  button_press(Widget w, XtPointer *usd, XmAnyCallbackStruct *calld)
     48void  button_press(Widget, XtPointer *usd, XmAnyCallbackStruct *calld)
    4949{
    5050PIButtonX *pib;
    5151pib = (PIButtonX *) usd ;
    52 pib->Send(pib->PressMsg());
     52pib->Send(pib->Msg(),PIMsg_Press,NULL);
    5353pib->myevt = *(calld->event);
    5454pib->myevt.type = pib->myevt.xbutton.type = ButtonRelease;
     
    6060
    6161/* --Methode-- */
    62 PIButtonX::PIButtonX(PIContainerGen *par, char *nom, long msg,
     62PIButtonX::PIButtonX(PIContainerGen *par, char *nom, PIMessage msg,
    6363                     int sx, int sy, int px, int py, PIBtnSign bsgn)
    6464: PIButtonGen(par, nom, msg, sx, sy, px, py, bsgn)
     
    9696XtAddCallback(XtWdg(), XmNactivateCallback,
    9797              button_action, (XtPointer)this);
     98
     99mAcP = false;
    98100SetBorderWidth(0);
    99101Manage();
     
    105107
    106108/* --Methode-- */
    107 void PIButtonX::SetPressMsg(long prmsg)
    108 {
    109 if (PressMsg() == prmsg)  return;
     109void PIButtonX::ActivatePress(bool acp)
     110{
     111if (mAcP == acp)  return;
    110112   
    111 if ((PressMsg() != 0)  && (prmsg == 0) )   
     113if (mAcP)
    112114  XtRemoveCallback(XtWdg(), XmNarmCallback,
    113115                   button_press, (XtPointer)this);
    114 else if (PressMsg() == 0)
     116else
    115117  XtAddCallback(XtWdg(), XmNarmCallback,
    116118                button_press, (XtPointer)this);
    117 
    118 PIButtonGen::SetPressMsg(prmsg);
    119 
     119mAcP = acp;
    120120return;
    121121}       
     
    138138{
    139139CreateXtWdg(nom, xmTextWidgetClass, NULL, sx, sy, px, py);
     140SetMutiLineMode(false);
     141SetTextEditable(true);
    140142Manage();
    141143}
     
    162164}
    163165
     166/* --Methode-- */
     167void PITextX::SetMutiLineMode(bool mlm)
     168{
     169Arg  warg[2];
     170int n = 0;
     171
     172if (mlm)
     173  { XtSetArg(warg[n],XmNeditMode, XmMULTI_LINE_EDIT);  n++; }
     174else
     175  { XtSetArg(warg[n],XmNeditMode, XmSINGLE_LINE_EDIT);  n++; }
     176
     177XtSetValues(XtWdg(), warg, n);
     178return;
     179}
     180
     181/* --Methode-- */
     182void PITextX::SetTextEditable(bool te)
     183{
     184Arg  warg[2];
     185int n = 0;
     186
     187if (te)
     188  { XtSetArg(warg[n],XmNeditable, TRUE);  n++; }
     189else
     190  { XtSetArg(warg[n],XmNeditable, FALSE);  n++; }
     191
     192XtSetValues(XtWdg(), warg, n);
     193return;
     194}
     195
     196// Fonction privee (CallBack)
     197static void text_action(Widget w, XtPointer *usd, XtPointer *calld);
     198
     199void  text_action(Widget, XtPointer *usd, XtPointer *)
     200{
     201PIText *pit;
     202
     203pit = (PIText *) usd ;
     204pit->Send(pit->Msg(), PIMsg_DataChanged, NULL);
     205}
     206
     207
     208/* --Methode-- */
     209void PITextX::SetMsg(PIMessage msg)
     210{
     211
     212if (Msg() && !msg)
     213  XtRemoveCallback(XtWdg(), XmNactivateCallback,
     214                   text_action, (XtPointer)this);
     215if (!Msg() && msg)
     216  XtAddCallback(XtWdg(), XmNactivateCallback,
     217                text_action, (XtPointer)this);
     218
     219PIWdg::SetMsg(msg);
     220}
     221
    164222
    165223/************* PIScaleX ************/
     
    167225
    168226// Fonction prive (CallBack)
    169 static void scale_action(Widget w, XtPointer *usd, XtPointer *calld);
    170 
    171 void  scale_action(Widget w, XtPointer *usd, XtPointer *calld)
     227static void scale_action(Widget w, XtPointer *usd,
     228                         XmScaleCallbackStruct *calld);
     229
     230void  scale_action(Widget, XtPointer *usd,
     231                         XmScaleCallbackStruct *calld)
    172232{
    173233PIScale *pis;
    174234
    175235pis = (PIScale *) usd ;
    176 pis->Send(pis->Msg(), (void *)pis->GetValue());
    177 
    178 return;
    179 }
    180 
    181 /* --Methode-- */
    182 PIScaleX::PIScaleX(PIContainerGen *par, char *nom, long msg,
     236pis->CBSetVal(calld->value);
     237pis->Send(pis->Msg(), PIMsg_DataChanged, (void *)calld->value);
     238return;
     239}
     240
     241/* --Methode-- */
     242PIScaleX::PIScaleX(PIContainerGen *par, char *nom, PIMessage msg,
    183243                   int min, int max, int sx, int sy, int px, int py)
    184244: PIScaleGen(par, nom, msg, min, max, sx, sy, px, py)
     
    188248CreateXtWdg(nom, xmScaleWidgetClass, NULL, sx, sy, px, py);
    189249XtSetArg(warg[n], XmNshowValue, TRUE); n++;
    190 XtSetArg(warg[n], XmNorientation, XmHORIZONTAL); n++;
     250if (sx > sy)
     251  {
     252  XtSetArg(warg[n], XmNorientation, XmHORIZONTAL); n++;
     253  XtSetArg(warg[n], XmNprocessingDirection, XmMAX_ON_RIGHT); n++;
     254  }
     255else
     256  {
     257  XtSetArg(warg[n], XmNorientation, XmVERTICAL); n++;
     258  XtSetArg(warg[n], XmNprocessingDirection, XmMAX_ON_TOP); n++;
     259  }
    191260XtSetArg(warg[n], XmNscaleWidth, sx); n++;
    192261XtSetArg(warg[n], XmNscaleHeight, sy); n++;
    193262XtSetArg(warg[n], XmNstringDirection, XmSTRING_DIRECTION_R_TO_L); n++;
    194 XtSetArg(warg[n], XmRProcessingDirection, XmMAX_ON_RIGHT); n++;
     263
    195264XtSetValues(XtWdg(), warg, n);
    196265SetMinMax(min, max);
     266SetValue(min);
    197267XtAddCallback(XtWdg(), XmNvalueChangedCallback,
    198268              scale_action, (XtPointer)this);
     
    207277void PIScaleX::SetMinMax(int min, int max)
    208278{
     279if (min >= max)  max = min+10;
     280if (mVal < min)  mVal = min;
     281if (mVal > max)  mVal = max;
    209282int n=0;
    210 Arg warg[2];
     283Arg warg[3];
    211284XtSetArg(warg[n], XmNminimum, min); n++;
    212285XtSetArg(warg[n], XmNmaximum, max); n++;
    213 XtSetValues(XtWdg(), warg, n);
     286XtSetArg(warg[n], XmNvalue, mVal); n++;
     287XtSetValues(XtWdg(), warg, n);
     288mMin = min;   mMax = max;
    214289return;
    215290}
     
    220295{
    221296int n=0;
     297if (val < mMin)  val = mMin;
     298if (val > mMax)  val = mMax;
    222299Arg warg[2];
    223300XtSetArg(warg[n], XmNvalue, val); n++;
     
    234311XtSetArg(warg[n], XmNvalue, &val); n++;
    235312XtGetValues(this->sdw, warg, n);
     313mVal = val;
    236314return(val);
    237315}
    238316
     317/* --Methode-- */
     318void  PIScaleX::CBSetVal(int val)
     319{
     320mVal = val;
     321return;
     322}
    239323
    240324/************* PICheckBoxX ************/
     
    245329
    246330/* Nouvelle-Fonction */
    247 void  toggb_action(Widget w, XtPointer *usd, XtPointer *calld)
     331void  toggb_action(Widget , XtPointer *usd, XtPointer *)
    248332{
    249333PICheckBoxX *picb;
    250334picb = (PICheckBoxX *) usd ;
    251 picb->Send(picb->Msg(), (void *)picb->GetState());
    252 return;
    253 }
    254 
    255 /* --Methode-- */
    256 PICheckBoxX::PICheckBoxX(PIContainerGen *par, char *nom, long msg,
     335picb->Send(picb->Msg(), PIMsg_DataChanged, (void *)picb->GetState());
     336return;
     337}
     338
     339/* --Methode-- */
     340PICheckBoxX::PICheckBoxX(PIContainerGen *par, char *nom, PIMessage msg,
    257341                         int sx, int sy, int px, int py)
    258342: PICheckBoxGen(par, nom, msg, sx, sy, px, py)
  • trunk/SophyaPI/PI/pistdwdgx.h

    r8 r23  
    1717{
    1818public:
    19                      PIButtonX(PIContainerGen *par, char *nom, long msg = PIMsg_Click,
     19                     PIButtonX(PIContainerGen *par, char *nom,
     20                               PIMessage msg = PIMsg_Click,
    2021                               int sx=10, int sy=10, int px=0, int py=0,
    2122                               PIBtnSign bsgn = PIBtn_Label);
    2223  virtual           ~PIButtonX();
    2324
    24   virtual void       SetPressMsg(long prmsg);
     25  virtual void       ActivatePress(bool acp=false);
    2526
    2627  void               ReleaseButton();   // Fonction a utiliser avec attention
    2728
    2829  XEvent myevt;   // Attention - Pour usage interne
     30
     31protected :
     32  bool mAcP;
    2933};
     34
    3035
    3136class PITextX : public PITextGen
     
    3742  virtual void       SetText(string const&);
    3843  virtual string     GetText() const;
     44
     45  virtual void       SetMutiLineMode(bool mlm=false);
     46  virtual void       SetTextEditable(bool te=true);
     47
     48  virtual void       SetMsg(PIMessage msg=0);
    3949};
    4050
     
    4252{
    4353public:
    44   PIScaleX(PIContainerGen* par, char* nom, long msg=PIMsg_Click,
     54  PIScaleX(PIContainerGen* par, char* nom, PIMessage msg=PIMsg_Click,
    4555         int min=0, int max=10, int sx=100, int sy=10, int px=0, int py=0);
    4656  ~PIScaleX();
     
    4858  virtual void SetMinMax(int min, int max);
    4959  virtual void SetValue(int val);
    50   virtual int GetValue();
     60  virtual int  GetValue();
    5161
     62  virtual void CBSetVal(int val);   // A ne pas utiliser pour Callback
    5263protected:
     64  int mVal, mMin, mMax;
    5365};
    5466
     
    5870public:
    5971                     PICheckBoxX(PIContainerGen *par, char *nom,
    60                                  long msg=PIMsg_Click,
     72                                 PIMessage msg=PIMsg_Click,
    6173                                 int sx=10, int sy=10, int px=0, int py=0);
    6274  virtual           ~PICheckBoxX();
  • trunk/SophyaPI/PI/pitestapp.cc

    r18 r23  
    2020#include "piimage.h"
    2121
    22 RzImage * RzReadFits(char *flnm);
     22#include "fitsimage.h"
    2323
    2424int SysBeep(int n)
     
    4848        ~PITestApp();
    4949
    50         virtual void    Process(long msg, PIMsgHandler* sender, void* data=NULL);
     50        virtual void    Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
    5151
    5252//    PIMenubar * menb;
     
    116116  ckb = new PICheckBox(this->MainWin(), "CheckBox", 166, 60, 20, 10, 10);
    117117  text = new PIText(this->MainWin(), "TEXTE", 100, 30, 20,40);
     118  text->SetMsg(7440);
    118119  label  = new PILabel(this->MainWin(), "Label", 140, 20, 20,80);
    119120  label->SetBorderWidth(1);
     
    186187static PIWindow *imgw[5];
    187188static PIImage *cur=NULL;
    188 static ScSample *scs1, *scs2;
     189static ScSample *scs1, *scs2, *scs3;
     190static ExBWdg *exb1;
    189191
    190192static PIWindow * wp3, *wp2, *wp4, *wp5;
     
    197199
    198200void
    199 PITestApp::Process(long msg, PIMsgHandler* sender, void* data)
     201PITestApp::Process(PIMessage msg, PIMsgHandler* sender, void* data)
    200202{
    201203  static int x = 0;
     
    203205
    204206//   SysBeep(1);
    205   char truc[100];
     207  char truc[256];
    206208  sprintf(truc,"< %ld - %d (%d)>",msg,x++, (int)((PIWdgGen *)sender)->kind());
    207209  this->label->SetLabel(truc);
    208 
    209   if (msg == PIMsg_ActiveWdg)
    210     { /* printf("Process: Setting active ImageWindow (%lx) \n", (long)data); */
    211     cur = (PIImage *)data; }
    212 
     210  sprintf(truc,"[%d] Msg= %ld (%d-%d) Kind=(%d)",x, msg, (int)UserMsg(msg),
     211         (int)ModMsg(msg), (int)((PIWdgGen *)sender)->kind());
     212  puts(truc);
     213
     214  if (ModMsg(msg) == PIMsg_Active)
     215    {  printf("Process: Setting active ImageWindow (%lx) \n", (long)sender);
     216    cur = (PIImage *)data; return;}
     217
     218  if (ModMsg(msg) == PIMsg_Close)
     219    {
     220    printf("Close Message received (Sender= %lx)\n", (long)sender);
     221    return;
     222    }
     223
     224  msg = UserMsg(msg);
    213225  if (msg == 33) ckb->SetState(true);
    214226   
     
    278290                                  PIWK_normal, 400, 400, 500, 500);
    279291        pimg[nimg] = new PIImage(imgw[nimg], "MyImage", 400, 400, 0, 0);
    280         pimg[nimg]->SetBinding(true, true, true, true);
     292        pimg[nimg]->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed,PIBK_fixed );
    281293        pimg[nimg]->SetZoomWin(zoom);
    282294        pimg[nimg]->SetTextWin(labimg);
     
    301313  wp2 = new PIWindow(app, "Window-2", PIWK_normal,  150, 150, 250, 250);
    302314  ExBWdg bw(wp2, "BWdg", 150, 150, 0, 0);
    303 //  bw.SetBinding(false, true, true, false);
    304315//  bw.ActivateButton(1);
    305316//  bw.ActivatePtrCross();
    306317//  bw.ActivateKeyboard();
    307318
    308   wp4 = new PIWindow(app, "Window-4", PIWK_dialog,  120, 120, 350, 350);
    309   PIButton bt1(wp4, "OK", 6001, 40, 20, 10, 80);
    310   PIButton bt2(wp4, "Cancel", 6002, 40, 20, 60, 80);
    311   PILabel  lb1(wp4, "Mat_00", 30, 20, 10, 10);
    312   PIText  tx1(wp4, "A00", 50, 20, 50, 10); 
    313   PILabel  lb2(wp4, "Mat_11", 30, 20, 10, 40);
    314   PIText  tx2(wp4, "A11", 50, 20, 50, 40); 
     319
     320  wp4 = new PIWindow(app, "Window-4", PIWK_dialog,  200, 200, 350, 350);
     321  PIButton bt1(wp4, "OK", 6001, 60, 30, 20, 160);
     322  PIButton bt2(wp4, "Cancel", 6002, 60, 30, 100, 160);
     323  bt1.SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic,PIBK_elastic);
     324  bt2.SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic,PIBK_elastic);
     325  PILabel  lb1(wp4, "Editable", 40, 30, 10, 10);
     326    lb1.SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic,PIBK_elastic);
     327  PIText  tx1(wp4, "A00", 100, 30, 60, 10); 
     328    tx1.SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic,PIBK_elastic);
     329  tx1.SetText("Hello");
     330  tx1.SetTextEditable(false);
     331  //  PILabel  lb2(wp4, "", 30, 20, 10, 40);
     332  PIText  tx2(wp4, "A11", 180, 100, 15, 50);
     333  tx2.SetMutiLineMode(true);
     334  tx2.SetText(" Bonjour, \n Comment ca va ? \n A demain. ");
     335    tx2.SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic,PIBK_elastic);
    315336
    316337  wp3 = new PIWindow(app, "Window-3", PIWK_normal, 200, 200, 350, 350);
    317338  pxm = new PIPixmap(wp3, "myPixmap", 150, 150, 10, 10);
    318   pxm->SetBinding(true, true, true, true);
     339  pxm->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed,PIBK_fixed );
    319340  pxm->SetPixmap(pixels, 150, 150);
    320341
    321   wp5 = new PIWindow(app, "Window-5", PIWK_normal,  400, 200, 200, 200);
     342  wp5 = new PIWindow(app, "Window-5", PIWK_normal,  400, 450, 200, 200);
    322343  scs1 = new ScSample(wp5, "ScSample", 200, 200, 0, 0);
    323   scs1->SetBinding(true, true, true, true);
    324   scs2 = new ScSample(wp5, "ScSample", 200, 200, 200, 0);
    325   scs2->SetBinding(true, true, true, true);
    326 
     344  scs1->SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic,PIBK_elastic);
     345  scs2 = new ScSample(wp5, "ScSample", 160, 160, 220, 20);
     346  scs2->SetBinding(PIBK_elastic,PIBK_fixed,PIBK_fixed,PIBK_elastic);
     347
     348  scs3 = new ScSample(wp5, "ScSample", 200, 200, 100, 220);
     349
     350  scs3->SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic,PIBK_elastic);
     351  /* 
     352  exb1 = new ExBWdg(wp5, "ExB1", 200, 200, 100, 220);
     353  exb1->SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic,PIBK_elastic);
     354  */
    327355  //  wp4 = new PIWindow(app, "Open...", PIWK_dialog, 300, 300, 400, 400);
    328356
  • trunk/SophyaPI/PI/piwdggen.cc

    r18 r23  
    2323}
    2424
     25/* --Methode-- */
     26void PIWdgGen::SetMsg(PIMessage msg)
     27{
     28myMsg = msg;
     29}
     30
     31/* --Methode-- */
     32void PIWdgGen::GetScreenPos(int & spx, int & spy)
     33/*  Renvoie la position de la fenetre par rapport a l'ecran */
     34{
     35PIWdgGen * wc;
     36spx = 0;  spy = 0;
     37wc = this;
     38
     39while (wc)
     40  { spx += wc->XPos(); 
     41  spy += wc->YPos();  wc = wc->Parent();
     42  }
     43return;
     44}
     45
    2546
    2647/* --Methode--
  • trunk/SophyaPI/PI/piwdggen.h

    r11 r23  
    1212void PIBeep();
    1313
     14// Les differents types d'accrochage aux containers 
     15
     16enum PIBindingKind {   
     17  PIBK_free = 0,
     18  PIBK_fixed = 1,
     19  PIBK_elastic = 2
     20};
     21
    1422class PIContainerGen;
    1523class PIWdgGen : public PIMsgHandler
     
    2432
    2533  virtual long           kind() {return ClassId; }
     34//  string               kindstr();
    2635
    27 //  string               kindstr();
     36  inline PIWdgGen*       Parent() { return( (PIWdgGen*)parent ); }
    2837
    2938  inline void            SetUserData( void * p, int fg = 0) {pdata=p; flag=fg; }
     
    3241  inline int             UserFlag() { return(flag); };
    3342
    34   inline void            SetMsg(long msg = 0) { myMsg = msg; }
    35   inline long            Msg() { return(myMsg); }
     43
     44  virtual void           SetMsg(PIMessage msg = 0);
     45  inline  PIMessage      Msg() { return (myMsg); }
    3646
    3747  virtual void           SetSize(int sx, int sy)=0;
     
    3949  virtual void           SetBorderWidth(int bw)=0;
    4050  virtual void           SetLabel(string const&) {}
    41   virtual void           SetBinding(bool left, bool top, bool right, bool bottom)=0;
     51  virtual void           SetBinding(PIBindingKind left, PIBindingKind top,
     52                                    PIBindingKind right, PIBindingKind bottom)=0;
    4253
    4354  virtual int            XSize()=0;
     
    4758
    4859  virtual string         Nom()=0;
     60  virtual void           GetScreenPos(int & spx, int & spy);
    4961
    5062protected:
    5163  PIContainerGen        *parent;
    52   long                  myMsg;
     64  PIMessage              myMsg;
    5365
    5466private:
  • trunk/SophyaPI/PI/piwdgmac.cc

    r15 r23  
    8181
    8282void
    83 PIWdgMac::SetBinding(bool left, bool top, bool right, bool bottom)
     83PIWdgMac::SetBinding(PIBindingKind left, PIBindingKind top,
     84                     PIBindingKind right, PIBindingKind bottom)
     85//  $CHECK$ Reza 13/10/96    Code a modifier
    8486{
    8587  SBooleanRect r;
  • trunk/SophyaPI/PI/piwdgmac.h

    r15 r23  
    2020  virtual void           SetPos(int px, int py);
    2121  virtual void           SetBorderWidth(int /*bw*/) {}
    22   virtual void           SetBinding(bool left, bool top, bool right, bool bottom);
     22  virtual void           SetBinding(PIBindingKind left, PIBindingKind top,
     23                                    PIBindingKind right, PIBindingKind bottom);
    2324  virtual int            XSize();
    2425  virtual int            YSize();
  • trunk/SophyaPI/PI/piwdgx.cc

    r8 r23  
    117117#endif
    118118
    119 SetBinding(false, false, false, false);
     119SetBinding(PIBK_free, PIBK_free, PIBK_free, PIBK_free);
    120120return(0);
    121121}
     
    210210
    211211/* --Methode-- */
    212 void PIWdgX::SetBinding(bool left, bool top, bool right, bool bottom)
     212void PIWdgX::SetBinding(PIBindingKind left, PIBindingKind top,
     213                        PIBindingKind right, PIBindingKind bottom)
    213214{
    214215Arg  wargs[3];
     
    217218if (!parent)  return;
    218219
    219 if (left)
    220   {
    221   n = 0;
    222   XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_FORM);  n++;
    223   XtSetArg(wargs[n],XmNleftOffset, XPos() );  n++;
    224   XtSetValues(this->sdw, wargs, n);
    225   }
    226 else
    227   {
    228   n = 0;
    229   XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_NONE);  n++;
    230   XtSetValues(this->sdw, wargs, n);
    231   } 
    232 
    233 if (top)
    234   {
    235   n = 0;
    236   XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_FORM);  n++;
    237   XtSetArg(wargs[n],XmNtopOffset, YPos() );  n++;
    238   XtSetValues(this->sdw, wargs, n);
    239   }
    240 else
    241   {
    242   n = 0;
    243   XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_NONE);  n++;
    244   XtSetValues(this->sdw, wargs, n);
     220/*
     221n = 0;
     222XtSetArg(wargs[n],XmNfractionBase, 500);  n++;
     223XtSetValues(this->sdw, wargs, n);
     224*/
     225switch (left)
     226  {
     227  case PIBK_free :
     228    n = 0;
     229    XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_NONE);  n++;
     230    XtSetValues(this->sdw, wargs, n);
     231    break;
     232  case PIBK_fixed :
     233    n = 0;
     234    XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_FORM);  n++;
     235    XtSetArg(wargs[n],XmNleftOffset, XPos() );  n++;
     236    XtSetValues(this->sdw, wargs, n);
     237    break;
     238  case PIBK_elastic :
     239    n = 0;
     240    XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_POSITION);  n++;
     241    XtSetArg(wargs[n],XmNleftPosition, (XPos()*100/parent->XSize()) );  n++;
     242    XtSetValues(this->sdw, wargs, n);
     243    break;
     244  }
     245
     246switch (top)
     247  {
     248  case PIBK_free :
     249    n = 0;
     250    XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_NONE);  n++;
     251    XtSetValues(this->sdw, wargs, n);
     252    break;
     253  case PIBK_fixed :
     254    n = 0;
     255    XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_FORM);  n++;
     256    XtSetArg(wargs[n],XmNtopOffset, YPos() );  n++;
     257    XtSetValues(this->sdw, wargs, n);
     258    break;
     259  case PIBK_elastic :
     260    n = 0;
     261    XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_POSITION);  n++;
     262    XtSetArg(wargs[n],XmNtopPosition, (YPos()*100/parent->YSize()) );  n++;
     263    XtSetValues(this->sdw, wargs, n);
     264    break;
    245265  }
    246266 
    247 if (right)
    248   {
    249   n = 0;
    250   XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_FORM);  n++;
    251   XtSetArg(wargs[n],XmNrightOffset, parent->XSize()-(XSize()+XPos()) );  n++;
    252   XtSetValues(this->sdw, wargs, n);
    253   }
    254 else
    255   {
    256   n = 0;
    257   XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_NONE);  n++;
    258   XtSetValues(this->sdw, wargs, n);
    259  
    260 
    261 if (right)
    262   {
    263   n = 0;
    264   XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_FORM);  n++;
    265   XtSetArg(wargs[n],XmNrightOffset, parent->XSize()-(XSize()+XPos()) );  n++;
    266   XtSetValues(this->sdw, wargs, n);
    267   }
    268 else
    269   {
    270   n = 0;
    271   XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_NONE);  n++;
    272   XtSetValues(this->sdw, wargs, n);
    273  
    274 
    275 if (bottom)
    276   {
    277   n = 0;
    278   XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_FORM);  n++;
    279   XtSetArg(wargs[n],XmNbottomOffset, parent->YSize()-(YSize()+YPos()) );  n++;
    280   XtSetValues(this->sdw, wargs, n);
    281   }
    282 else
    283   {
    284   n = 0;
    285   XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_NONE);  n++;
    286   XtSetValues(this->sdw, wargs, n);
    287   } 
     267switch (right)
     268  {
     269  case PIBK_free :
     270    n = 0;
     271    XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_NONE);  n++;
     272    XtSetValues(this->sdw, wargs, n);
     273    break;
     274  case PIBK_fixed :
     275    n = 0;
     276    XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_FORM);  n++;
     277    XtSetArg(wargs[n],XmNrightOffset, parent->XSize()-(XSize()+XPos()) );  n++;
     278    XtSetValues(this->sdw, wargs, n);
     279    break;
     280  case PIBK_elastic :
     281    n = 0;
     282    XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_POSITION);  n++;
     283    XtSetArg(wargs[n],XmNrightPosition, ((XPos()+XSize())*100/parent->XSize()) );  n++;
     284    XtSetValues(this->sdw, wargs, n);
     285    break;
     286  }
     287
     288switch (bottom)
     289  {
     290  case PIBK_free :
     291    n = 0;
     292    XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_NONE);  n++;
     293    XtSetValues(this->sdw, wargs, n);
     294    break;
     295  case PIBK_fixed :
     296    n = 0;
     297    XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_FORM);  n++;
     298    XtSetArg(wargs[n],XmNbottomOffset, parent->YSize()-(YSize()+YPos()) );  n++;
     299    XtSetValues(this->sdw, wargs, n);
     300    break;
     301  case PIBK_elastic :
     302    n = 0;
     303    XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_POSITION);  n++;
     304    XtSetArg(wargs[n],XmNbottomPosition, ((YPos()+YSize())*100/parent->YSize()) );  n++;
     305    XtSetValues(this->sdw, wargs, n);
     306    break;
     307  }
    288308
    289309return;
     
    359379return(bw);
    360380}
     381
     382/* --Methode-- */
     383void PIWdgX::GetScreenPos(int & spx, int & spy)
     384{
     385PIWdgX * wc;
     386Display *mdsp;
     387Window w, rw, pw, *cw;
     388unsigned int ncw;
     389Status st;
     390int x,y;
     391unsigned int bw, l, h, d;
     392
     393spx = 0;  spy = 0;
     394wc = this;
     395
     396while (wc)
     397  { spx += wc->XPos();
     398  spy += wc->YPos();  wc = (PIWdgX *)wc->Parent();
     399  }
     400
     401mdsp = XtDisplay(XtWdg());
     402w = XtWindow(XtWdg());
     403ncw = 0;
     404st = XQueryTree(mdsp, w, &rw, &pw, &cw, &ncw);
     405if (st)
     406  { XFree(cw);
     407  if (pw == rw)  return; }
     408
     409while (st && (pw != rw)) 
     410  {
     411  w = pw;
     412  st = XQueryTree(mdsp, w, &rw, &pw, &cw, &ncw);
     413  if (st)   XFree(cw);
     414  XGetGeometry(mdsp, w, &rw, &x, &y, &l, &h, &bw, &d); 
     415  spy += y;  spx += x;
     416  } 
     417return;
     418}
     419
    361420
    362421
  • trunk/SophyaPI/PI/piwdgx.h

    r7 r23  
    4141  virtual void   SetBorderWidth(int bw);
    4242  virtual void   SetLabel(string const & lab);
    43   virtual void   SetBinding(bool left, bool top, bool right, bool bottom);
     43  virtual void   SetBinding(PIBindingKind left, PIBindingKind top,
     44                            PIBindingKind right, PIBindingKind bottom);
    4445
    4546  virtual int    XSize();
     
    5051
    5152  virtual string Nom()  { return mNom; }
     53  virtual void   GetScreenPos(int & spx, int & spy);
    5254
    5355  void Manage();
  • trunk/SophyaPI/PI/piwindowgen.cc

    r18 r23  
    1717
    1818/* --Methode-- */
    19 void PIWindowGen::Process(long msg, PIMsgHandler* sender, void* data)
    20 /*  On intercepte le message ActiveWdg, avant de le renvoyer, */
    21 /*  avec un message ActiveWdg de la part de la fenetre        */
     19void PIWindowGen::Process(PIMessage msg, PIMsgHandler* sender, void* data)
     20/*  On intercepte le message Active, et Close avant de les renvoyer */
     21/*  avec un message ActiveWdg de la part de la fenetre              */
    2222{
    23 if (msg == PIMsg_ActiveWdg)
    24   Send(msg);
     23
     24if ((msg == BuildMsg(Msg(), PIMsg_Close)) && (sender == this))
     25  Hide();   // Action par defaut en cas de MsgClose.
     26
     27if (ModMsg(msg) == PIMsg_Active)
     28  Send(Msg(),PIMsg_Active);
     29
    2530ReSend(msg, sender, data);
    2631return; 
  • trunk/SophyaPI/PI/piwindowgen.h

    r18 r23  
    99  PIWK_normal = 0,
    1010  PIWK_dialog = 1,
    11   PIWK_floating = 2
     11  PIWK_transient = 2,
     12  PIWK_floating = 3
    1213};
    1314
     
    2122  virtual long      kind() {return ClassId; }
    2223
    23   virtual void      Process(long msg, PIMsgHandler* sender, void* data=NULL);
     24  virtual void      Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
    2425 
    2526protected: 
  • trunk/SophyaPI/PI/piwindowx.cc

    r8 r23  
    22
    33#include "piwindowx.h"
     4
     5#include <X11/Xlib.h>
    46
    57#include <X11/Intrinsic.h>
     
    810#include <X11/Shell.h>
    911#include <Xm/Form.h>
    10 // #include <Xm/BulletinB.h>
     12
     13/* Fonctions (Callback et action) pour traiter le message Close de WM  */
     14
     15/* Nouvelle-Fonction */
     16static void popdwn_cb(Widget /*w*/, XtPointer *usd,  XtPointer * )
     17{
     18PIWindowX * dw = (PIWindowX *) usd;
     19dw->Process(dw->BuildMsg(dw->Msg(),PIMsg_Close), dw, NULL) ;
     20}
     21
     22
     23/* Nouvelle-Fonction */
     24static int fgactl = 0;
     25
     26static void CloseWindow (Widget w, XEvent*, String*,Cardinal*)
     27{
     28XtCallCallbacks(w,  XtNpopdownCallback, NULL);
     29}
     30
     31
    1132
    1233/* --Methode-- */
     
    1536: PIWindowGen(par, nom, k, -1, -1, 0, 0)
    1637{
     38XtTranslations trans;
     39
    1740pwm = new PIWdgX(NULL, nom, sx, sy, px, py);
    1841
    19 if (k == PIWK_normal )
    20   pwm->CreateXtWdg(nom, topLevelShellWidgetClass, NULL, sx, sy, px, py);
    21 else
    22   pwm->CreateXtWdg(nom, transientShellWidgetClass, NULL, sx, sy, px, py);
    23 //  pwm->CreateXtWdg(nom, overrideShellWidgetClass, NULL, sx, sy, px, py);
     42switch (k)
     43  {
     44  case PIWK_normal :
     45  case PIWK_floating :
     46    pwm->CreateXtWdg(nom, topLevelShellWidgetClass, NULL, sx, sy, px, py);
     47    break;
     48  case PIWK_dialog :
     49    pwm->CreateXtWdg(nom, transientShellWidgetClass, NULL, sx, sy, px, py);
     50    break;
     51  case PIWK_transient :
     52    pwm->CreateXtWdg(nom, overrideShellWidgetClass, NULL, sx, sy, px, py);
     53    break;
     54  }
     55
     56
     57/*  Il faut "attraper" l'action close, genere par le window-manager       */
     58/*  2 actions sont necessaires, installation d'une action (CloseWindow()) */
     59/*  et j'utilise ensuite un callback ds CloseWindow()                     */
     60/*  Il faut aussi desactiver l'action de destruction du widget par defaut */
     61/*  (XtSetArg(warg, XmNdeleteResponse, ...                                */
     62/*  Attention, voir la fonction Show(), pour l'appel a XSetWMProptocols() */
     63/*  Pour une fenetre donnee, on peut recuperer les Map, UnMap, Destroy,   */
     64/*  etc... il faut appeler XtAddEventHandler( w, Mask, ...)               */
     65/*    Mask =  StructureNotifyMask | SubstructureNotifyMask                */
     66
     67
     68
     69if ((k == PIWK_normal) || (k == PIWK_floating) || (k == PIWK_dialog))
     70  {
     71
     72  /* XtAddEventHandler(pwm->XtWdg(), StructureNotifyMask | SubstructureNotifyMask,
     73                  FALSE, wmaction_evthandler, this);*/
     74
     75  XtAddCallback(pwm->XtWdg(), XtNpopdownCallback,
     76                popdwn_cb, (XtPointer)this);
     77
     78  if (!fgactl)
     79    {
     80    XtActionsRec desact = {"CloseWindow" ,CloseWindow};
     81    XtAddActions(&desact, 1);  fgactl = 1;
     82    }
     83
     84  trans = XtParseTranslationTable("<Message>WM_PROTOCOLS:CloseWindow()");
     85  XtOverrideTranslations(pwm->XtWdg() , trans);
     86  Arg warg[2];
     87  XtSetArg(warg[0], XmNdeleteResponse, XmDO_NOTHING);
     88  XtSetValues(pwm->XtWdg(), warg, 1);
     89  }
    2490
    2591CreateXtWdg(nom, xmFormWidgetClass, pwm->XtWdg(), sx, sy, 0, 0);
     
    3197delete pwm;
    3298}
     99
    33100/* --Methode-- */
    34 void PIWindowX::SetBinding(bool left, bool top, bool right, bool bottom)
     101void PIWindowX::SetBinding(PIBindingKind /*left*/, PIBindingKind /*top*/,
     102                           PIBindingKind /*right*/, PIBindingKind /*bottom*/)
    35103{
    36104// On ne doit rien faire pour les fenetres
     
    56124void PIWindowX::Show()
    57125{
     126int fgr = 0;
     127Display *mdsp;
     128
     129mdsp = XtDisplay(pwm->XtWdg());
     130
    58131PIContainerGen::Show();
    59132Manage();
     133if (!XtIsRealized(pwm->XtWdg()))  fgr = 1;
    60134pwm->Manage();
     135if (fgr)
     136  {
     137  Atom wmd;
     138  if ((mWtyp == PIWK_normal) || (mWtyp == PIWK_floating) || (mWtyp == PIWK_dialog))
     139    {
     140    wmd = XInternAtom(mdsp, "WM_DELETE_WINDOW",False);
     141    XSetWMProtocols(mdsp, XtWindow(pwm->XtWdg()), &wmd, 1);
     142    }
     143  else
     144    XSetTransientForHint(mdsp, XtWindow(PIXtTopWdg()), XtWindow(pwm->XtWdg()));
     145  }
     146
     147// XRaiseWindow est necessaire, sinon la fenetre passe des fois derriere ...
     148if (mWtyp == PIWK_transient) 
     149  XRaiseWindow(mdsp, XtWindow(pwm->XtWdg()));
     150 
     151return;
    61152}
    62153
  • trunk/SophyaPI/PI/piwindowx.h

    r8 r23  
    1212  virtual                ~PIWindowX();
    1313 
    14   virtual void           SetBinding(bool left, bool top, bool right, bool bottom);
    15 
     14  virtual void           SetBinding(PIBindingKind left, PIBindingKind top,
     15                                    PIBindingKind right, PIBindingKind bottom);
    1616  virtual void           SetSize(int sx, int sy);
    1717  virtual void           SetPos(int px, int py); 
Note: See TracChangeset for help on using the changeset viewer.