Changeset 1921 in Sophya
- Timestamp:
- Mar 6, 2002, 5:53:29 PM (24 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pidrwtools.cc
r1907 r1921 2 2 // Outils de manipulation des PIDrawer R. Ansari 06/98 3 3 // LAL (Orsay) / IN2P3-CNRS DAPNIA/SPP (Saclay) / CEA 4 4 // modifs pour 5 5 #include <stdlib.h> 6 6 … … 103 103 104 104 int wszx = 5*spx+3.5*bsx; 105 int wszy = (2+ 5*0.85)*bsy+(7+5*0.85)*spy;105 int wszy = (2+6*0.85)*bsy+(7+6*0.85)*spy; 106 106 SetSize(wszx, wszy); 107 107 … … 254 254 mOpt[7]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 255 255 256 int kb;257 256 cpx = 2*spx; 258 257 cpy += spy+bsyo; 258 // OP 03/2002 259 260 mOpt[8] = new PIOptMenu(this, "bwt-opt-8", bsx*1.75, bsy, cpx, cpy); 261 mOpt[8]->AppendItem("Def.ArrowMrk", 900); 262 mOpt[8]->AppendItem("Basic-Arrow", 901); 263 mOpt[8]->AppendItem("Triangle-Arrow", 902); 264 mOpt[8]->AppendItem("FTriangle-Arrow", 903); 265 mOpt[8]->AppendItem("ShapedArrow", 904); 266 mOpt[8]->AppendItem("FShapedArrow", 905); 267 mOpt[8]->SetValue(900); 268 mOpt[8]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 269 270 cpx += spx+1.75*bsx; 271 mOpt[9] = new PIOptMenu(this, "bwt-opt-9", bsx*1.75, bsy, cpx, cpy); 272 mOpt[9]->AppendItem("Arrow-1pt ", 951); 273 mOpt[9]->AppendItem("Arrow-3pt ", 952); 274 mOpt[9]->AppendItem("Arrow-5pt", 953); 275 mOpt[9]->AppendItem("Arrow-7pt", 954); 276 mOpt[9]->AppendItem("Arrow-9pt", 955); 277 mOpt[9]->AppendItem("Arrow-11pt", 956); 278 mOpt[9]->AppendItem("Arrow-13pt", 957); 279 mOpt[9]->AppendItem("Arrow-15pt", 958); 280 mOpt[9]->AppendItem("Arrow-17pt", 959); 281 mOpt[9]->SetValue(952 ); 282 mOpt[9]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 283 284 cpx = 2*spx; 285 cpy += spy+bsyo; 286 287 // end OP 288 int kb; 259 289 bsy = bsyo; spy = spyo; 260 290 mButdr[0] = new PIButton(this, "-", 1501, bsy, bsy, cpx, cpy); … … 315 345 for(i=0; i<6; i++) delete mButcf[i]; 316 346 for(i=0; i<2; i++) delete mButdr[i]; 317 for(i=0; i< 8; i++) delete mOpt[i];347 for(i=0; i<10 ; i++) delete mOpt[i]; 318 348 for(i=0; i<2; i++) delete mCasc[i]; 319 349 delete mNlb; … … 349 379 static PIFontSize fntsz[6] = { PI_NotDefFontSize, PI_TinySizeFont, PI_SmallSizeFont, 350 380 PI_NormalSizeFont, PI_LargeSizeFont, PI_HugeSizeFont }; 381 382 static PIArrowMarker arrmrk[6]= { PI_NotDefArrowMarker, PI_BasicArrowMarker, 383 PI_TriangleArrowMarker, PI_FTriangleArrowMarker, 384 PI_ArrowShapedArrowMarker, PI_FArrowShapedArrowMarker }; 385 351 386 352 387 /* --Methode-- */ … … 475 510 for(kk=0; kk<13; kk++) 476 511 if (lat == line[kk]) { mOpt[5]->SetValue(600+kk); break; } 512 513 PIArrowMarker arr = gratt.GetArrowMarker(); 514 for(kk==0 ; kk<6 ; kk++) 515 if(arr == arrmrk[kk]) {mOpt[8]->SetValue(900+kk);} 516 517 kk = gratt.GetArrowMarkerSize(); 518 if(kk<1) kk=1; 519 if(kk>17) kk=17; 520 kk = (kk+1)/2; 521 mOpt[9]->SetValue(950 + kk); 477 522 478 523 return; … … 511 556 if ( (k < 0) || (k > 12) ) k = 0; 512 557 gratt.SetLineAtt(PILineAtt(line[k])); 558 559 ii=mOpt[8]->GetValue()-900; 560 jj=mOpt[9]->GetValue()-950; 561 562 gratt.SetArrowMarkerAtt(2*jj-1,arrmrk[ii]); 563 513 564 drw->SetGraphicAtt(gratt); 565 514 566 if (fgref) mCurBW->Refresh(); 515 567 else drw->Refresh(); -
trunk/SophyaPI/PI/pidrwtools.h
r1851 r1921 39 39 private: 40 40 // Pour couleur, fontes, etc 41 PIOptMenu* mOpt[ 8];41 PIOptMenu* mOpt[10]; 42 42 PIMenu* mCasc[5]; 43 43 PILabel* mNlb; -
trunk/SophyaPI/PI/pigraphuc.cc
r1914 r1921 806 806 807 807 /* --Methode-- */ 808 void PIGraphicUC::SelArrowMarker(int arrsz, PIArrowMarker arrmrk) 809 { 810 if (!mGrC) return; 811 mGrC->SelArrowMarker(arrsz, arrmrk); 812 } 813 814 /* --Methode-- */ 808 815 void PIGraphicUC::SelFontSz(PIGrCoord sz) 809 816 { … … 837 844 838 845 /* --Methode-- */ 846 void PIGraphicUC::SelArrowMarkerSz(PIGrCoord arrsz, PIArrowMarker arrmrk) 847 { 848 if (!mGrC) return; 849 double fx, fy; 850 DUC2GrC((double)arrsz, (double)arrsz, fx, fy); 851 int asz = int(0.5*(fx+fy+1)); 852 mGrC->SelArrowMarker(asz, arrmrk); 853 } 854 855 /* --Methode-- */ 839 856 void PIGraphicUC::SetClipRectangle(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy) 840 857 { … … 891 908 return(mGrC->GetMarkerSize()); 892 909 } 910 911 /* --Methode-- */ 912 PIArrowMarker PIGraphicUC::GetArrowMarker() 913 { 914 if (!mGrC) return(PI_NotDefArrowMarker); 915 return(mGrC->GetArrowMarker()); 916 } 917 918 /* --Methode-- */ 919 int PIGraphicUC::GetArrowMarkerSize() 920 { 921 if (!mGrC) return(0); 922 return(mGrC->GetArrowMarkerSize()); 923 } 924 925 893 926 /* --Methode-- */ 894 927 PIGrCoord PIGraphicUC::GetFontHeight(PIGrCoord& asc, PIGrCoord& desc) -
trunk/SophyaPI/PI/pigraphuc.h
r1914 r1921 84 84 virtual void SelLine(PILineAtt const& att); 85 85 virtual void SelMarker(int msz=3, PIMarker mrk=PI_DotMarker); 86 virtual void SelArrowMarker(int arrsz=5, 87 PIArrowMarker arrmrk=PI_BasicArrowMarker); 86 88 87 89 // Modification de fonte … … 94 96 virtual void SelFontSz(PIGrCoord sz, PIFontAtt att); 95 97 virtual void SelMarkerSz(PIGrCoord msz, PIMarker mrk=PI_DotMarker); 98 virtual void SelArrowMarkerSz(PIGrCoord arrsz, 99 PIArrowMarker arrmrk=PI_BasicArrowMarker); 96 100 97 101 // Selection de zone de trace (clip) … … 106 110 virtual PIMarker GetMarker(); 107 111 virtual int GetMarkerSize(); 112 virtual PIArrowMarker GetArrowMarker(); 113 virtual int GetArrowMarkerSize(); 108 114 115 116 inline PIFont GetFont() { return (mGrC->GetFont()) ; } 109 117 virtual PIGrCoord GetFontHeight(PIGrCoord& asc, PIGrCoord& desc); 110 118 virtual PIGrCoord CalcStringWidth(char const* s);
Note:
See TracChangeset
for help on using the changeset viewer.