Changeset 1589 in Sophya


Ignore:
Timestamp:
Jul 23, 2001, 10:14:36 AM (24 years ago)
Author:
ansari
Message:

Separation gestion configuration des axes et attributs des Drawers - Creation PIAxesTools - Reza 23/7/2001

Location:
trunk/SophyaPI/PI
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/Makefile

    r1117 r1589  
    44 
    55all: $(LIB)libPI.a
    6 $(LIB)libPI.a : $(OBJ)lut.o $(OBJ)parradapter.o $(OBJ)pi3ddrw.o $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapview.o $(OBJ)picmapx.o $(OBJ)picons.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawer.o $(OBJ)pidrawwin.o $(OBJ)pidrwtools.o $(OBJ)pievthandler.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pifontgen.o $(OBJ)pifontx.o $(OBJ)pigraph3d.o $(OBJ)pigraphgen.o $(OBJ)pigraphps.o $(OBJ)pigraphuc.o $(OBJ)pigraphx.o $(OBJ)piimage.o $(OBJ)piimgtools.o $(OBJ)pilistgen.o $(OBJ)pilistx.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)pistzwin.o $(OBJ)pisurfdr.o $(OBJ)pitherm.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o $(OBJ)psfile.o
     6$(LIB)libPI.a : $(OBJ)lut.o $(OBJ)parradapter.o $(OBJ)pi3ddrw.o $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)piaxestools.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapview.o $(OBJ)picmapx.o $(OBJ)picons.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawer.o $(OBJ)pidrawwin.o $(OBJ)pidrwtools.o $(OBJ)pievthandler.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pifontgen.o $(OBJ)pifontx.o $(OBJ)pigraph3d.o $(OBJ)pigraphgen.o $(OBJ)pigraphps.o $(OBJ)pigraphuc.o $(OBJ)pigraphx.o $(OBJ)piimage.o $(OBJ)piimgtools.o $(OBJ)pilistgen.o $(OBJ)pilistx.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)pistzwin.o $(OBJ)pisurfdr.o $(OBJ)pitherm.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o $(OBJ)psfile.o
    77        $(AR) $(ARFLAGS)  $@ $?
    88ifeq ($(CXX),cxx)
     
    1111 
    1212clean:
    13         rm -f $(OBJ)lut.o $(OBJ)parradapter.o $(OBJ)pi3ddrw.o $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapview.o $(OBJ)picmapx.o $(OBJ)picons.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawer.o $(OBJ)pidrawwin.o $(OBJ)pidrwtools.o $(OBJ)pievthandler.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pifontgen.o $(OBJ)pifontx.o $(OBJ)pigraph3d.o $(OBJ)pigraphgen.o $(OBJ)pigraphps.o $(OBJ)pigraphuc.o $(OBJ)pigraphx.o $(OBJ)piimage.o $(OBJ)piimgtools.o $(OBJ)pilistgen.o $(OBJ)pilistx.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)pistzwin.o $(OBJ)pisurfdr.o $(OBJ)pitherm.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o $(OBJ)psfile.o
     13        rm -f $(OBJ)lut.o $(OBJ)parradapter.o $(OBJ)pi3ddrw.o $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)piaxestools.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapview.o $(OBJ)picmapx.o $(OBJ)picons.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawer.o $(OBJ)pidrawwin.o $(OBJ)pidrwtools.o $(OBJ)pievthandler.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pifontgen.o $(OBJ)pifontx.o $(OBJ)pigraph3d.o $(OBJ)pigraphgen.o $(OBJ)pigraphps.o $(OBJ)pigraphuc.o $(OBJ)pigraphx.o $(OBJ)piimage.o $(OBJ)piimgtools.o $(OBJ)pilistgen.o $(OBJ)pilistx.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)pistzwin.o $(OBJ)pisurfdr.o $(OBJ)pitherm.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o $(OBJ)psfile.o
    1414ifeq ($(CXX),cxx)
    1515        cd $(REPM); rm -f *.o
     
    4242 pigraphx.h pigraphgen.h pifontx.h pifontgen.h pigraphuc.h \
    4343 pievthandler.h psfile.h pigraphps.h
     44$(OBJ)piaxestools.o: piaxestools.cc piaxestools.h pisysdep.h \
     45 $(INC)machdefs.h pistdwdgx.h pistdwdggen.h \
     46 piwdgx.h piwdggen.h pimsghandler.h picolist.h pioptmenux.h \
     47 pioptmenugen.h pimenux.h pimenugen.h piwindowx.h piwindowgen.h \
     48 picontainerx.h picontainergen.h piapplx.h piapplgen.h pimenubarx.h \
     49 pimenubargen.h picons.h pibwdgx.h pibwdggen.h picmap.h picmapx.h \
     50 picmapgen.h pigraphx.h pigraphgen.h pifontx.h pifontgen.h pigraphuc.h \
     51 pievthandler.h psfile.h pigraphps.h piscdrawwdg.h pidrawer.h
    4452$(OBJ)pibwdggen.o: pibwdggen.cc pibwdggen.h pisysdep.h \
    4553 $(INC)machdefs.h piwdgx.h piwdggen.h \
     
    219227 picontainergen.h pidrawer.h pidrwtools.h pioptmenux.h pioptmenugen.h \
    220228 pimenux.h pimenugen.h piapplx.h piapplgen.h pimenubarx.h \
    221  pimenubargen.h picons.h parradapter.h lut.h
     229 pimenubargen.h picons.h piaxestools.h parradapter.h lut.h
    222230$(OBJ)pistdwdggen.o: pistdwdggen.cc pistdwdggen.h pisysdep.h \
    223231 $(INC)machdefs.h piwdgx.h piwdggen.h \
  • trunk/SophyaPI/PI/objlist.list

    r1034 r1589  
    44piapplgen.o
    55piapplx.o
     6piaxestools.o
    67pibwdggen.o
    78pibwdgx.o
  • trunk/SophyaPI/PI/pi3ddrw.cc

    r547 r1589  
    117117  if (v3D_obs)  gr3d->Set3DCS_Obs(xO, yO, zO, tO, fO, pO, daxO, dayO, lCO, dlCO);
    118118  else  gr3d->Set3DCS(xC,yC,zC, xO, yO, zO, daxO, dayO, dlCO, pO);
     119  if (mFgHighLight) gr3d->SelGOMode(PI_GOInvert);  // $CHECK$ A changer , Reza 07/2001
    119120  mGrUC = gr3d;
    120121  return(gr3d);
  • trunk/SophyaPI/PI/pidrawer.cc

    r1568 r1589  
    321321  mGrUC->SetUCS(xMin, xMax, yMin, yMax, aXFlg, aYFlg);
    322322  if (aXlog || aYlog) mGrUC->SetLogScale(aXlog, aYlog);
    323   if (mFgHighLight) mGrUC->SelGOMode(PI_GOInvert);
     323  if (mFgHighLight) mGrUC->SelGOMode(PI_GOInvert); // $CHECK$ A changer , Reza 07/2001
    324324  return(mGrUC);
    325325}
  • trunk/SophyaPI/PI/pidrwtools.cc

    r1124 r1589  
    1717//      Classe de fenêtre de dialogue permettant de modifier interactivement
    1818//      Les attributs graphique des "Drawer" attachés aux "PIBaseWdg".
    19 //      Permet aussi de modifier les attributs d'axes pour les "PIScDrawWdg"
    2019//--
    2120// Links        Parents
     
    103102
    104103int wszx = 5*spx+3.5*bsx;
    105 int wszy = (8+3*0.85)*(spy+bsy);
     104int wszy = (1+5*0.85)*bsy+(6+5*0.85)*spy;
    106105SetSize(wszx, wszy);
    107106
    108 int cpx = spx*2;
    109 int cpy = spy*2;
    110 int csx = cpx;
    111 int csy = cpy;
    112 mLab[0] = new PILabel(this, "X Min Max", 1.25*bsx, bsy, cpx, cpy);
    113 cpy += spy+bsy;
    114 mLab[1] = new PILabel(this, "Y Min Max", 1.25*bsx, bsy, cpx, cpy);
    115 mLab[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    116 mLab[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    117 
    118 cpy = spy*2;
    119 cpx += spx+1.25*bsx;
    120 mText[0] = new PIText(this, "x_min_max", 2.25*bsx, bsy, cpx, cpy);
    121 mText[0]->SetText("-1.0  1.0");
    122 cpy += spy+bsy;
    123 mText[1] = new PIText(this, "y_min_max", 2.25*bsx, bsy, cpx, cpy);
    124 mText[1]->SetText("-1.0  1.0");
    125 mText[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    126 mText[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    127 
    128 cpx = spx+0.25*bsx;
    129 cpy += spy+bsy;
    130 mCkb[0] = new PICheckBox(this,"X-RtoL", 2000, bsx, bsy, cpx, cpy);
    131 cpx += spx+bsx;
    132 mCkb[1] = new PICheckBox(this,"Y-UpDn", 2001, bsx, bsy, cpx, cpy);
    133 cpx += spx+bsx;
    134 mCkb[2] = new PICheckBox(this,"Grid", 2002, bsx, bsy, cpx, cpy);
    135 mCkb[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    136 mCkb[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    137 mCkb[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    138 cpy += spy+bsy;
    139 cpx = spx+0.25*bsx;
    140 mCkb[3] = new PICheckBox(this,"LogScale-X", 2003, bsx*1.5, bsy, cpx, cpy);
    141 cpx += bsx*1.5+3*spx;
    142 mCkb[4] = new PICheckBox(this,"LogScale-Y", 2004, bsx*1.5, bsy, cpx, cpy);
    143 mCkb[3]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    144 mCkb[4]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    145 
    146 cpy += spy+bsy;
    147 cpx = spx+0.25*bsx;
    148 mBut[0] = new PIButton(this, "SetAxes", 2600, bsx*1.5, bsy, cpx, cpy);
    149 cpx += bsx*1.5+3*spx;
    150 mBut[1] = new PIButton(this, "AutoLimits", 2700, bsx*1.5, bsy, cpx, cpy);
    151 mBut[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    152 mBut[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    153 
    154 int offy = cpy+bsy+spy*2;
     107//int cpx = spx*2;
     108//int offy = cpy+bsy+spy*2;
    155109
    156110//  Option-Menu  Marker, Line, couleur, etc...
    157 cpx = 2*spx;
    158 cpy += 3*spy+bsy;
     111int cpx = 2*spx;
     112int cpy = 2*spy;
    159113
    160114int bsyo = bsy; 
     
    249203mOpt[4] = new PIOptMenu(this, "bwt-opt-4", bsx*1.75, bsy, cpx, cpy);
    250204mOpt[4]->AppendItem("Def.Font", 500);
    251 mOpt[4]->AppendItem("Normal-Font", 511);
    252 mOpt[4]->AppendItem("Bold", 512);
    253 mOpt[4]->AppendItem("Ital", 513);
    254 mOpt[4]->AppendItem("Small-Font", 521);
    255 mOpt[4]->AppendItem("Small-Bold", 522);
    256 mOpt[4]->AppendItem("Small-Ital", 523);
    257 mOpt[4]->AppendItem("Big-Font", 531);
    258 mOpt[4]->AppendItem("Big-Bold", 532);
    259 mOpt[4]->AppendItem("Big-Ital", 533);
    260 mOpt[4]->AppendItem("Huge-Font", 541);
    261 mOpt[4]->AppendItem("Huge-Bold", 542);
    262 mOpt[4]->AppendItem("Huge-Ital", 543);
     205mOpt[4]->AppendItem("Courier", 501);
     206mOpt[4]->AppendItem("Helvetica", 502);
     207mOpt[4]->AppendItem("Times", 503);
     208mOpt[4]->AppendItem("Symbol-Font", 504);
    263209mOpt[4]->SetValue(500);
    264210mOpt[4]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
     
    280226
    281227cpx = 2*spx;
     228cpy += spy+bsy;
     229mOpt[6] = new PIOptMenu(this, "bwt-opt-6", bsx*1.75, bsy, cpx, cpy);
     230mOpt[6]->AppendItem("Def.FontAtt", 700);
     231mOpt[6]->AppendItem("Roman-Font", 701);
     232mOpt[6]->AppendItem("Bold-Font", 702);
     233mOpt[6]->AppendItem("Italic-Font", 703);
     234mOpt[6]->AppendItem("BoldItalic", 704);
     235mOpt[6]->SetValue(700);
     236mOpt[6]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
     237
     238cpx += spx+1.75*bsx;
     239mOpt[7] = new PIOptMenu(this, "bwt-opt-7", bsx*1.75, bsy, cpx, cpy);
     240mOpt[7]->AppendItem("Def.FontSz", 800);
     241mOpt[7]->AppendItem("Tiny FontSz", 801);
     242mOpt[7]->AppendItem("Small FontSz", 802);
     243mOpt[7]->AppendItem("Normal FontSz", 803);
     244mOpt[7]->AppendItem("Big FontSz", 804);
     245mOpt[7]->AppendItem("Huge FontSz", 805);
     246
     247cpx = 2*spx;
    282248cpy += spy+bsyo;
    283249bsy = bsyo; spy = spyo;
     
    300266mButcf[1]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
    301267
    302 cpx = spx+0.25*bsx;;
    303 cpy += spy+bsy;
    304 mButcf[2] = new PIButton(this, "Refresh", 3000, bsx*1.5, bsy, cpx, cpy);
     268cpx = (wszx-3.2*bsx-2*spx)/2;
     269cpy += 2*spy+bsy;
     270mButcf[2] = new PIButton(this, "Refresh", 3100, bsx*1.2, bsyo, cpx, cpy);
    305271mButcf[2]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
    306 cpx += bsx*1.5+3*spx;
    307 mButcf[3] = new PIButton(this, "Dismiss", 3777, bsx*1.5, bsy, cpx, cpy);
    308 mButcf[2]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
     272cpx += bsx*1.2+spx;
     273mButcf[3] = new PIButton(this, "Select", 3200, bsx*0.8, bsyo, cpx, cpy);
     274mButcf[3]->ActivatePress(true);
    309275mButcf[3]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
     276cpx += bsx*0.8+spx;
     277mButcf[4] = new PIButton(this, "Dismiss", 3777, bsx*1.2, bsyo, cpx, cpy);
     278mButcf[4]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
    310279
    311280cwdrwt = this;
     
    318287if (cwdrwt == this)  cwdrwt = NULL;
    319288int i;
    320 for(i=0; i<2; i++)
    321   {
    322   delete mLab[i];
    323   delete mBut[i];
    324   delete mText[i];
    325   delete mButcf[i];
    326   }
    327 
    328 for(i=0; i<5; i++) delete mCkb[i];
    329 for(i=0; i<3; i++) delete mButcf[i];
    330 delete mButcf[3];
    331 for(i=0; i<6; i++)  delete mOpt[i];
     289for(i=0; i<5; i++) delete mButcf[i];
     290for(i=0; i<2; i++) delete mButdr[i];
     291for(i=0; i<8; i++)  delete mOpt[i];
    332292for(i=0; i<2; i++)  delete mCasc[i];
    333293delete mNlb;
     
    353313                              PI_ThinDottedLine, PI_DottedLine, PI_ThickDottedLine };
    354314
    355 static PIFontAtt fntatt[4] = { PI_NotDefFontAtt, PI_RomanFont, PI_BoldFont, PI_ItalicFont };
    356 static PIFontSize fntsz[5] = { PI_NotDefFontSize, PI_NormalSizeFont, PI_SmallSizeFont,
    357                                PI_BigSizeFont, PI_HugeSizeFont };
     315static PIFontName fntname[5] = { PI_DefaultFont, PI_CourierFont, PI_HelveticaFont,
     316                                 PI_TimesFont, PI_SymbolFont};
     317static PIFontAtt fntatt[5] = { PI_NotDefFontAtt, PI_RomanFont, PI_BoldFont,
     318                               PI_ItalicFont, PI_BoldItalicFont };
     319static PIFontSize fntsz[6] = { PI_NotDefFontSize, PI_TinySizeFont, PI_SmallSizeFont,
     320                               PI_NormalSizeFont, PI_BigSizeFont, PI_HugeSizeFont };
    358321
    359322/* --Methode-- */
     
    361324{
    362325PIWindow::Show();
    363 char buff[92];
     326
    364327mNDr = 0;
    365 
    366328if (mCurBW != NULL)  {
    367329  mNDr = mCurBW->NbDrawers()-1;
    368330  if (mNDr < 0)  mNDr = 0;
    369331  }
     332else mNDr = 0;
     333char buff[32];
     334sprintf(buff,"%d", mNDr);
     335mNlb->SetLabel(buff); 
    370336
    371337UpdateAttFromDrawer();
    372 
    373 mCkb[0]->SetState(false);
    374 mCkb[1]->SetState(false);
    375 mCkb[2]->SetState(false);
    376 mCkb[3]->SetState(false);
    377 mCkb[4]->SetState(false);
    378 
    379 if ((mCurBW != NULL) && ( mCurBW->kind() == PIScDrawWdg::ClassId ) ) {
    380   PIScDrawWdg* scd = ( PIScDrawWdg*)mCurBW;
    381   sprintf(buff, "%g  %g", scd->XMin(), scd->XMax());
    382   mText[0]->SetText(buff);
    383   sprintf(buff, "%g  %g", scd->YMin(), scd->YMax());
    384   mText[1]->SetText(buff);
    385   int xa, ya;
    386   scd->GetAxesConfig(xa, ya);
    387   if (xa & kAxeDirRtoL) mCkb[0]->SetState(true);
    388   if (ya & kAxeDirUpDown)  mCkb[1]->SetState(true);
    389   if (scd->GetAxesFlags() & kGridOn) mCkb[2]->SetState(true);
    390   mCkb[3]->SetState(scd->isLogScaleX());
    391   mCkb[4]->SetState(scd->isLogScaleY());
    392   }
    393 else {
    394   mText[0]->SetText("-1.0  1.0");
    395   mText[1]->SetText("-1.0  1.0");
    396   }
    397 sprintf(buff, "%d", mNDr);
    398 mNlb->SetLabel(buff);
    399 
    400 
    401 
    402338return;
    403339}
     
    415351mOpt[4]->SetValue(500);
    416352mOpt[5]->SetValue(600);
     353mOpt[6]->SetValue(700);
     354mOpt[7]->SetValue(800);
    417355
    418356if ( (mCurBW != NULL) && (mCurBW->NbDrawers() > 0) )
     
    420358
    421359if (!dr)  return;
    422 int jj,kk;
     360int ii,jj,kk;
    423361PIColors fc = dr->GetFgColAtt();
    424362for(kk=0; kk<17; kk++)
     
    436374if (kk%2 == 0) kk++;
    437375mOpt[3]->SetValue(400+kk);
     376PIFontName fnm = dr->GetFontName();
    438377PIFontAtt fat = dr->GetFontAtt();
    439378PIFontSize fsz = dr->GetFontSz();
    440 for(kk=0; kk<4; kk++)
     379for(ii=0; ii<5; ii++)
     380  if (fnm ==  fntname[ii]) break;
     381for(kk=0; kk<5; kk++)
    441382  if (fat ==  fntatt[kk]) break;
    442383for(jj=0; jj<5; jj++)
    443384  if (fsz == fntsz[jj])  break;
    444385
    445 if (kk >= 4) kk = 3;
    446 if (jj >= 5) jj = 4;
    447 mOpt[4]->SetValue(500+jj*10+kk);
     386if (ii >= 5) ii = 1;
     387if (kk >= 5) kk = 1;
     388if (jj >= 6) jj = 3;
     389mOpt[4]->SetValue(500+ii);
     390mOpt[6]->SetValue(700+kk);
     391mOpt[7]->SetValue(800+jj);
     392
    448393PILineAtt lat = dr->GetLineAtt();
    449394for(kk=0; kk<10; kk++)
     
    454399
    455400/* --Methode-- */
     401void PIDrwTools::SetGraphicAtt(bool fgref)
     402{
     403  if (mCurBW == NULL)   return;
     404  PIDrawer* drw = mCurBW->GetDrawer(mNDr);
     405  if (drw == NULL)  return;
     406  int k,ii,jj,kk;
     407  k = mOpt[0]->GetValue()-100;
     408  if ( (k < 0) || (k > 16) )  k = 0;
     409  drw->SetColAtt(cols[k]);
     410  k = mOpt[1]->GetValue()-200;
     411  if (k == 0) drw->SetColMapId(CMAP_OTHER);
     412  else drw->SetColMapId(PIColorMap::GetStandardColorMapId(k-1));
     413  k =  mOpt[2]->GetValue()-300;
     414  if ( (k < 0) || (k > 11) )  k = 0;
     415  kk =  mOpt[3]->GetValue()-400;
     416  if ( (kk < 1) || (kk > 27) )  kk = 1;
     417  //  if ((k > 0) && (kk < 3)) {  // Protection contre Marker taille 1 autre que Dotmarker
     418  //    mOpt[3]->SetValue(403);
     419  //   kk = 3;
     420  //  }
     421  drw->SetMarkerAtt(kk, mrk[k]);
     422  ii =  (mOpt[4]->GetValue()-500);
     423  jj =  (mOpt[6]->GetValue()-700);
     424  kk =  (mOpt[7]->GetValue()-800);
     425  drw->SetFont(fntname[ii], fntsz[kk], fntatt[jj]);
     426
     427  k =  mOpt[5]->GetValue()-600;
     428  if ( (k < 0) || (k > 9) )  k = 0;
     429  drw->SetLineAtt(line[k]);
     430  if (fgref)  mCurBW->Refresh();
     431  else drw->Refresh();
     432}
     433
     434/* --Methode-- */
    456435void PIDrwTools::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
    457436{
    458 
    459 msg = UserMsg(msg);
    460 if (msg == 3777)  { Hide(); return; }
    461 
    462 if (mCurBW == NULL)   return;
    463 
    464 char strg[64];
    465 int k, kk, kkk;
    466 
    467 switch (msg) {
    468 
    469   case 2600 :
    470     {
    471     double xmin, xmax, ymin, ymax;
    472     int axrl = kAxeDirLtoR;
    473     int ayud = kAxeDirDownUp;
    474     PIScDrawWdg* scd=NULL;
    475     scd = dynamic_cast<PIScDrawWdg*>(mCurBW);
    476     if ( scd == NULL ) {
    477       cerr << "PIDrwTools: SetAxes applicable to PIScDrawWdg only ! " << endl;
    478       return;
     437  char strg[64];
     438
     439  PIMessage mod = ModMsg(msg);
     440  msg = UserMsg(msg);
     441
     442  switch (msg) {
     443    case 2800 :
     444      UpdateAttFromDrawer();
     445      break;
     446
     447    case 2900 :
     448      SetGraphicAtt(false);
     449      break;
     450
     451    case 3100 :
     452      SetGraphicAtt(true);
     453      break;
     454
     455    case 3200 :
     456      if ((mCurBW != NULL) && (mCurBW->GetDrawer(mNDr) != NULL) ) {
     457        if (mod == PIMsg_Press)  mCurBW->GetDrawer(mNDr)->HighLight(true);
     458        else  mCurBW->GetDrawer(mNDr)->HighLight(false);
    479459      }
    480     if (mText[0]->GetText().length() > 1) {
    481       xmin = -1.;   xmax = 1.;
    482       sscanf(mText[0]->GetText().c_str(), "%lg %lg" , &xmin, &xmax);
    483     }
    484     else {
    485       xmin = scd->XMin();
    486       xmax = scd->XMax();
    487     }
    488     if (mText[1]->GetText().length() > 1) {
    489       ymin = -1.;   ymax = 1.;
    490       sscanf(mText[1]->GetText().c_str(), "%lg %lg" , &ymin, &ymax);
    491     }
    492     else {
    493       ymin = scd->YMin();
    494       ymax = scd->YMax();
    495     }     
    496     if (mCkb[0]->GetState())  axrl = kAxeDirRtoL ;
    497     if (mCkb[1]->GetState())  ayud = kAxeDirUpDown;
    498     scd->SetLimits(xmin, xmax, ymin, ymax, axrl, ayud);
    499     unsigned int flags = scd->GetAxesFlags();
    500     if (mCkb[2]->GetState()) scd->SetAxesFlags(flags | kGridOn);
    501     else  scd->SetAxesFlags(flags & ~kGridOn);
    502     scd->SetLogScale(mCkb[3]->GetState(), mCkb[4]->GetState() );
    503      
    504     //    else mCurBW->SetDefaultDrawerLimits(xmin, xmax, ymin, ymax, axrl, ayud);
    505     mCurBW->Refresh();
    506     }
    507     break;
    508 
    509   case 2700 :
    510     {
    511     PIScDrawWdg* scd=NULL;
    512     scd = dynamic_cast<PIScDrawWdg*>(mCurBW);
    513     if ( scd != NULL ) scd->UpdateLimits();
    514     else {
    515       PIDraw3DWdg* dr3 = dynamic_cast<PIDraw3DWdg *>(mCurBW);
    516       if (dr3 != NULL) dr3->Update3DView();
    517     }
    518     }
    519     break;
    520 
    521   case 2800 :
    522     UpdateAttFromDrawer();
    523     break;
    524 
    525   case 2900 :
    526   case 3000 :
    527     {
    528     PIDrawer* drw = mCurBW->GetDrawer(mNDr);
    529     if (drw == NULL)  return;
    530     k = mOpt[0]->GetValue()-100;
    531     if ( (k < 0) || (k > 16) )  k = 0;
    532     drw->SetColAtt(cols[k]);
    533     k = mOpt[1]->GetValue()-200;
    534     if (k == 0) drw->SetColMapId(CMAP_OTHER);
    535     else drw->SetColMapId(PIColorMap::GetStandardColorMapId(k-1));
    536     k =  mOpt[2]->GetValue()-300;
    537     if ( (k < 0) || (k > 11) )  k = 0;
    538     kk =  mOpt[3]->GetValue()-400;
    539     if ( (kk < 1) || (kk > 27) )  kk = 1;
    540     if ((k > 0) && (kk < 3)) {  // Protection contre Marker taille 1 autre que Dotmarker
    541       mOpt[3]->SetValue(403);
    542       kk = 3;
    543     }
    544     drw->SetMarkerAtt(kk, mrk[k]);
    545     k =  (mOpt[4]->GetValue()-500);
    546     kk = k/10;   kkk = k%10;
    547     drw->SetFontAtt(fntsz[kk], fntatt[kkk]);
    548     k =  mOpt[5]->GetValue()-600;
    549     if ( (k < 0) || (k > 9) )  k = 0;
    550     drw->SetLineAtt(line[k]);
    551     if (msg == 2900) drw->Refresh();
    552     else mCurBW->Refresh();
    553     }
    554     break;       
    555 
    556   case 3501 :
    557   case 3502 :
    558     if (msg == 3501) {  mNDr--;   if (mNDr < 0)  mNDr = 0; }
    559     else { mNDr++;  if (mNDr >= mCurBW->NbDrawers())  mNDr--; }
    560     sprintf(strg, "%d", mNDr);
    561     mNlb->SetLabel(strg);
    562     /*   On ne change pas les options choisies   Reza+cmv 2/10/98 
    563     mOpt[0]->SetValue(100);
    564     mOpt[1]->SetValue(200);
    565     mOpt[2]->SetValue(300);
    566     mOpt[3]->SetValue(405);
    567     mOpt[4]->SetValue(500);
    568     mOpt[5]->SetValue(600);
     460      break;
     461
     462    case 3777 :
     463      Hide();
     464      break;
     465
     466    case 3501 :
     467    case 3502 :
     468      if (mCurBW) {
     469        if (msg == 3501) {  mNDr--;   if (mNDr < 0)  mNDr = 0; }
     470        else { mNDr++;  if (mNDr >= mCurBW->NbDrawers())  mNDr--; }
     471        sprintf(strg, "%d", mNDr);
     472        mNlb->SetLabel(strg);
     473      }
     474      /*   On ne change pas les options choisies   Reza+cmv 2/10/98 
     475           mOpt[0]->SetValue(100);
     476           mOpt[1]->SetValue(200);
     477           mOpt[2]->SetValue(300);
     478           mOpt[3]->SetValue(405);
     479           mOpt[4]->SetValue(500);
     480           mOpt[5]->SetValue(600);
    569481    */
    570     break;
    571 
    572   default :
    573     break;
     482      break;
     483
     484    default :
     485      break;
    574486  }
    575487
     
    577489}
    578490
     491
     492
  • trunk/SophyaPI/PI/pidrwtools.h

    r1124 r1589  
    3232protected:
    3333  virtual void  UpdateAttFromDrawer();
     34  virtual void  SetGraphicAtt(bool fgref);
    3435  virtual void  Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
    3536
    3637private:
    37 // Pour changer les axes
    38   PILabel* mLab[2];
    39   PIButton* mBut[2];
    40   PIText* mText[2];
    41   PICheckBox* mCkb[5];
    4238// Pour couleur, fontes, etc
    43   PIOptMenu* mOpt[6];
     39  PIOptMenu* mOpt[8];
    4440  PIMenu* mCasc[5];
    4541  PILabel* mNlb;
    4642  PIButton* mButdr[2];
    47   PIButton* mButcf[4];
     43  PIButton* mButcf[5];
    4844  int mNDr;
    4945  int mtyp, msz;
  • trunk/SophyaPI/PI/piscdrawwdg.cc

    r1510 r1589  
    99#include "piscdrawwdg.h"
    1010#include "pidrwtools.h"
     11#include "piaxestools.h"
    1112#include "parradapter.h"
    1213
     
    110111  if (mTrW)  delete mTrW;
    111112  if (mInfoW) delete mInfoW;
     113  if (PIAxesTools::GetCurrentScDrawWdg() == this)
     114    PIAxesTools::SetCurrentScDrawWdg(NULL);
     115  // Pour PIDrwTools, c'est fait par le destructeur de PIBaseWdgGen
    112116}
    113117
     
    125129    PIDrwTools::ShowPIDrwTools();   // Fentre axes et options de trace
    126130    }
     131  else if (key == 'A' || key == 'a') {
     132    PIAxesTools::SetCurrentScDrawWdg(this);
     133    PIAxesTools::ShowPIAxesTools();  // Fenetre de gestion des axes
     134  }
    127135  else if (key == 'I' || key == 'i') UpdateInfoWindow();  // Fenetre Text-Info
    128136  }
     
    316324  Send(Msg(), PIMsg_Active);
    317325  PIDrwTools::SetCurrentBaseWdg(this);
     326  PIAxesTools::SetCurrentScDrawWdg(this);
    318327}
    319328
     
    393402  Send(Msg(), PIMsg_Active);
    394403  PIDrwTools::SetCurrentBaseWdg(this);
     404  PIAxesTools::SetCurrentScDrawWdg(this);
    395405}
    396406
     
    454464  Send(Msg(), PIMsg_Active);
    455465  PIDrwTools::SetCurrentBaseWdg(this);
     466  PIAxesTools::SetCurrentScDrawWdg(this);
    456467}
    457468
Note: See TracChangeset for help on using the changeset viewer.