Changeset 202 in Sophya for trunk/SophyaPI
- Timestamp:
- Feb 26, 1999, 3:18:35 PM (27 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pidrawer.cc
r201 r202 245 245 { 246 246 BestTicks(xMin,xMax,7,xMajTickStep); 247 xMinTickStep = xMajTickStep/ 10;247 xMinTickStep = xMajTickStep/5; 248 248 xFirstMajTick = int(xMin / xMajTickStep) * xMajTickStep; 249 249 if (xFirstMajTick < xMin) xFirstMajTick += xMajTickStep; … … 252 252 253 253 BestTicks(yMin,yMax,12,yMajTickStep); 254 yMinTickStep = yMajTickStep/ 10;254 yMinTickStep = yMajTickStep/5; 255 255 yFirstMajTick = int(yMin / yMajTickStep) * yMajTickStep; 256 256 if (yFirstMajTick < yMin) yFirstMajTick += yMajTickStep; … … 291 291 g->DrawLine(xMin, 0, xMax, 0); 292 292 g->DrawLine(0, yMin, 0, yMax); 293 294 // La grille en pointilles 295 296 if (flags & kGridOn) DrawGrid(g); 293 297 294 298 // Les ticks majeurs -
trunk/SophyaPI/PI/pidrawer.h
r201 r202 49 49 float YMin() const {return yMin;} 50 50 float YMax() const {return yMax;} 51 inline unsigned int GetAxesFlags() { return(axesFlags); } 51 52 52 53 inline PIGraphicUC* GetGraphicUC() { return(mGrUC); } -
trunk/SophyaPI/PI/pidrwtools.cc
r201 r202 78 78 mText[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 79 79 80 cpx = 2*spx+0.25*bsx;80 cpx = spx+0.25*bsx; 81 81 cpy += spy+bsy; 82 mCkb[0] = new PICheckBox(this,"AxeX-RtoL", 2000, 1.5*bsx, bsy, cpx, cpy); 83 cpx += spx+1.5*bsx; 84 mCkb[1] = new PICheckBox(this,"AxeY-UpDown", 2000, 1.5*bsx, bsy, cpx, cpy); 82 mCkb[0] = new PICheckBox(this,"X-RtoL", 2000, bsx, bsy, cpx, cpy); 83 cpx += spx+bsx; 84 mCkb[1] = new PICheckBox(this,"Y-UpDn", 2000, bsx, bsy, cpx, cpy); 85 cpx += spx+bsx; 86 mCkb[2] = new PICheckBox(this,"Grid", 2000, bsx, bsy, cpx, cpy); 85 87 mCkb[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 86 88 mCkb[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 89 mCkb[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 87 90 88 91 cpy += spy+bsy; … … 248 251 delete mButcf[i]; 249 252 } 253 for(i=0; i<3; i++) delete mCkb[i]; 250 254 delete mBut[2]; 251 255 for(i=0; i<6; i++) delete mOpt[i]; … … 305 309 mCkb[0]->SetState(false); 306 310 mCkb[1]->SetState(false); 311 mCkb[2]->SetState(false); 307 312 308 313 mOpt[0]->SetValue(100); … … 339 344 if (mCkb[0]->GetState()) axrl = kAxeDirRtoL ; 340 345 if (mCkb[1]->GetState()) ayud = kAxeDirUpDown; 341 if ( mCurBW->kind() == PIScDrawWdg::ClassId ) ((PIScDrawWdg*)mCurBW)-> SetLimits(xmin, xmax, ymin, ymax, axrl, ayud); 346 if ( mCurBW->kind() == PIScDrawWdg::ClassId ) { 347 ((PIScDrawWdg*)mCurBW)->SetLimits(xmin, xmax, ymin, ymax, axrl, ayud); 348 unsigned int flags = ((PIScDrawWdg*)mCurBW)->GetAxesFlags(); 349 if (mCkb[2]->GetState()) ((PIScDrawWdg*)mCurBW)->SetAxesFlags(flags | kGridOn); 350 else ((PIScDrawWdg*)mCurBW)->SetAxesFlags(flags & ~kGridOn); 351 } 342 352 else mCurBW->SetDefaultDrawerLimits(xmin, xmax, ymin, ymax, axrl, ayud); 343 353 mCurBW->Refresh(); -
trunk/SophyaPI/PI/pidrwtools.h
r120 r202 37 37 PIButton* mBut[3]; 38 38 PIText* mText[2]; 39 PICheckBox* mCkb[ 2];39 PICheckBox* mCkb[3]; 40 40 // Pour couleur, fontes, etc 41 41 PIOptMenu* mOpt[6]; -
trunk/SophyaPI/PI/pigraphuc.cc
r197 r202 167 167 void PIGraphicUC::UC2GrC(float x, float y, float& xpix, float& ypix) 168 168 { 169 xpix = (float)(xOrg + x*xScale); // $CHECK$ Reza 21/06/98 ? + .5);170 ypix = (float)(yOrg + y*yScale); // $CHECK$ Reza 21/06/98 ?+ .5);169 xpix = (float)(xOrg + x*xScale); 170 ypix = (float)(yOrg + y*yScale); 171 171 } 172 172 -
trunk/SophyaPI/PI/piimage.cc
r163 r202 421 421 } 422 422 423 if (showinfo ) {423 if (showinfo && img) { 424 424 char buff[256]; 425 425 float x,y; … … 443 443 444 444 // ---- Le copier ---- 445 if ( key == 'C' || key == 'c') {445 if ((key == 'C' || key == 'c') && img) { 446 446 // On limite la taille a 48x48 447 447 int i1 = XPave(); … … 664 664 void PIImage::PasteSelection(unsigned int typ, void *pdata, unsigned int l) 665 665 { 666 if (!img) return; 666 667 if (typ != PICP_string) return; 667 668 int ll = (l<256) ? l+1 : 256; … … 917 918 int PIImage::PosW2Img(int xiw, int yiw, int * xp, int * yp) 918 919 { 920 if (!img) { *xp = *yp = 0; return(1); } 919 921 xiw -= ofx; yiw -= ofy; // Offset d'affichage du pixmap 920 922 if (zoom > 0) … … 938 940 int PIImage::PosImg2W(int xp, int yp, int * xiw, int * yiw) 939 941 { 942 if (!img) { *xiw = *yiw = -1; return(1); } 940 943 if (zoom > 0) 941 944 { … … 961 964 void PIImage::SetOffsetFromPave() 962 965 { 966 if (!img) { offx = offy = 0; return; } 963 967 if (zoom > 0) 964 968 { … … 991 995 { xwsz = -(XSize()*zoom); 992 996 ywsz = -(YSize()*zoom); } 993 994 if (xwsz > (img->XSize()-offx)) xwsz = (img->XSize()-offx); 995 if (ywsz > (img->YSize()-offy)) ywsz = (img->YSize()-offy); 997 998 if (img) { 999 if (xwsz > (img->XSize()-offx)) xwsz = (img->XSize()-offx); 1000 if (ywsz > (img->YSize()-offy)) ywsz = (img->YSize()-offy); 1001 } 996 1002 xpav = offx+xwsz/2; 997 1003 ypav = offx+ywsz/2; -
trunk/SophyaPI/PI/piscdrawwdg.cc
r190 r202 182 182 char buff[128]; 183 183 sprintf(buff, "X= %g Y= %g", x, y); 184 // sprintf(buff, "%.3f,%.3f ", x, y); 184 185 return((string)buff); 185 186 } … … 229 230 230 231 string ctxt = GetClickText(dx, dy); 231 232 //DEBUG char buff[32]; sprintf(buff, " %d:%d",xp,yp); ctxt += buff; 232 233 if (mTxw) 233 234 mTxw->SetLabel(ctxt); -
trunk/SophyaPI/PI/piscdrawwdg.h
r180 r202 30 30 virtual void UpdateLimits(); // Calcule et change les limites a partir de Drawer-No-1 31 31 32 inline void SetAxesFlags(unsigned int flags=kAxesDflt) { mBDrw->SetAxesFlags(flags); } 32 inline void SetAxesFlags(unsigned int flags=kBoxAxes | kExtTicks | kLabels) 33 { mBDrw->SetAxesFlags(flags); } 34 inline unsigned int GetAxesFlags() { return(mBDrw->GetAxesFlags()); } 33 35 34 36 inline void SetTitles(const char* tt=NULL, const char* tb=NULL)
Note:
See TracChangeset
for help on using the changeset viewer.