Changeset 1879 in Sophya
- Timestamp:
- Jan 21, 2002, 6:11:31 PM (24 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pidrawer.cc
r1855 r1879 534 534 535 535 void 536 PIDrawer::GetClickInfo(string& info, double x, double y) 537 { 538 } 539 540 void 536 541 PIDrawer::DrawHTicks(PIGraphicUC* g, double y, double tickUp, double tickDown, double xBeg, double xStep) 537 542 { -
trunk/SophyaPI/PI/pidrawer.h
r1851 r1879 39 39 40 40 virtual void Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax); 41 41 42 // Rajoute l'information concernant la zone xmin,ymin ---> xmax,ymax au string info 42 43 virtual void AppendTextInfo(string& info, double xmin, double ymin, double xmax, double ymax); 44 45 // Renvoie une information liee au drawer pour une position x,y 46 virtual void GetClickInfo(string& info, double x, double y); 43 47 44 48 virtual void Refresh(); // Recalcule les limites et reaffiche … … 93 97 virtual void ShowControlWindow(PIBaseWdgGen* wdg); 94 98 inline bool HasSpecificControlWindow() const { return mFgSpecContWind; } 95 96 99 97 100 // Methode permettant de decoder des options a partir de chaines -
trunk/SophyaPI/PI/piscdrawwdg.cc
r1855 r1879 80 80 mPSz[0] = mPSz[1] = 0.; 81 81 mFormatOpt[0] = "%-g"; mFormatOpt[1] = "%-g"; 82 mFgDeltaPos = false; 83 mPosForDelta[0] = mPosForDelta[1] = 0.; 84 mPosForDeltaX = mPosForDeltaY = 0; 82 85 83 86 mBDrw = new PIElDrawer; … … 125 128 if (key == 'R' || key == 'r') Refresh(); // rafraichir l'affichage 126 129 else if (key == 'M' || key == 'm') mFgReticule = !mFgReticule; // reticule de mesure 130 else if (key == 'K' || key == 'k') UpdatePosForDeltaMarker(true); 131 else if (key == 'L' || key == 'l') UpdatePosForDeltaMarker(false); 127 132 else if (key == 'V' || key == 'v') RequestSelection(); // Pour coller (copier/coller) 128 133 else if (key == 'Z' || key == 'z') { mBDrw->ElDelAll(); Refresh(); } // Pour supprimer tous les signes … … 232 237 // Gestion affichage coordonnees du point 233 238 234 string 235 PIScDrawWdg::GetClickText( double x, double y)239 void 240 PIScDrawWdg::GetClickText(string& info, double x, double y) 236 241 // Donne le texte a afficher pour position x,y 237 242 { 238 243 char buff[128]; 239 string format = "X= "; format += mFormatOpt[0].c_str(); 240 format += " Y= "; format += mFormatOpt[1].c_str(); 241 sprintf(buff,format.c_str(),x,y); 242 return((string)buff); 244 PIDrawer* dr = GetActiveDrawer(); 245 strcpy(buff,"X= "); sprintf(buff+3, mFormatOpt[0].c_str(), x); 246 info += buff; 247 strcpy(buff," Y= "); sprintf(buff+4, mFormatOpt[1].c_str(), y); 248 if (mFgDeltaPos) 249 sprintf(buff+strlen(buff)," (dX=%g, dY=%g)", 250 x-mPosForDelta[0], y-mPosForDelta[1]); 251 info += buff; 252 253 if (dr) { 254 info += " "; info += dr->Name(); 255 dr->GetClickInfo(info, x, y); 256 } 257 return; 243 258 } 244 259 … … 400 415 mPPos[0] = dx; mPPos[1] = dy; 401 416 402 string ctxt = GetClickText(dx, dy); 417 string ctxt; 418 GetClickText(ctxt, dx, dy); 403 419 //DEBUG char buff[32]; sprintf(buff, " %d:%d",xp,yp); ctxt += buff; 404 420 if (mTxw) … … 409 425 410 426 } 427 428 void 429 PIScDrawWdg::UpdatePosForDeltaMarker(bool fg) 430 { 431 if (!mFgDeltaPos && !fg ) return; 432 cForCol = mWGrC->GetForeground(); 433 cGOmod = mWGrC->GetGOMode(); 434 cLatt = mWGrC->GetLineAtt(); 435 mWGrC->SelForeground(PI_Magenta); 436 mWGrC->SelGOMode(PI_GOXOR); 437 mWGrC->SelLine(PI_NormalLine); 438 if (mFgDeltaPos) { 439 mWGrC->DrawLine(mPosForDeltaX-7, mPosForDeltaY, mPosForDeltaX+7, mPosForDeltaY); 440 mWGrC->DrawLine(mPosForDeltaX, mPosForDeltaY-7, mPosForDeltaX, mPosForDeltaY+7); 441 } 442 mFgDeltaPos = fg; 443 if (mFgDeltaPos) { 444 mPosForDelta[0] = mPPos[0]; 445 mPosForDelta[1] = mPPos[1]; 446 mPosForDeltaX = mCPosX; 447 mPosForDeltaY = mCPosY; 448 mWGrC->DrawLine(mPosForDeltaX-7, mPosForDeltaY, mPosForDeltaX+7, mPosForDeltaY); 449 mWGrC->DrawLine(mPosForDeltaX, mPosForDeltaY-7, mPosForDeltaX, mPosForDeltaY+7); 450 } 451 mWGrC->SelForeground(cForCol); 452 mWGrC->SelGOMode(cGOmod); 453 mWGrC->SelLine(cLatt); 454 return; 455 } 456 411 457 412 458 // ............................. -
trunk/SophyaPI/PI/piscdrawwdg.h
r1631 r1879 61 61 62 62 63 virtual string GetClickText(double x, double y); // Donne le texte a afficher pour position x,y63 virtual void GetClickText(string& info, double x, double y); // Donne le texte a afficher pour position x,y 64 64 virtual void ActivateSpecializedControls(); // Pour activer des controles specifiques 65 65 … … 91 91 double mPSz[2]; // Taille courant du pave info 92 92 int mCPosX, mCPosY; // Position click souris X,Y 93 bool mFgDeltaPos; // affichage de l'ecart par rapport a la position memorisee 94 double mPosForDelta[2]; // Position memorisee - Pour affichage d'ecart 95 int mPosForDeltaX, mPosForDeltaY; // Position click memorisee - Pour affichage d'ecart 93 96 bool mFgReticule; // Controle l'affiche d'une réticule (Bouton-1) 94 97 string mFormatOpt[2]; // Format optimal d'impression des textes … … 112 115 private: 113 116 void UpdateText(int xp, int yp); 117 void UpdatePosForDeltaMarker(bool fg); 114 118 }; 115 119 -
trunk/SophyaPI/PI/piversion.h
r1827 r1879 2 2 #define PIVERSION_H_SEEN 3 3 4 #define PI_VERSIONNUMBER 3. 354 #define PI_VERSIONNUMBER 3.40 5 5 6 6 #endif
Note:
See TracChangeset
for help on using the changeset viewer.