Changeset 1131 in Sophya
- Timestamp:
- Aug 22, 2000, 5:09:27 PM (25 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r1126 r1131 103 103 int opt = mObjMgr->GetServiceObj()->DecodeDispOption(tokens[2], fgsr); 104 104 mImgApp->AddText(txt, xp, yp); 105 if (fgsr) mImgApp->RestoreGraphicAtt(); 106 } 107 else if (kw == "settitle") { 108 if (tokens.size() < 2) { cout << "Usage: addtitle fontatt titleup " << endl; return(0); } 109 bool fgsr = true; 110 int opt = mObjMgr->GetServiceObj()->DecodeDispOption(tokens[0], fgsr); 111 string txt = tokens[1]; 112 for(int k=2; k<tokens.size(); k++) txt += (' ' + tokens[k]); 113 string td = ""; 114 mImgApp->SetTitle(txt, td); 105 115 if (fgsr) mImgApp->RestoreGraphicAtt(); 106 116 } … … 715 725 usage += ">> XYLimits : xylimits -> Forces X-Y limits in 2-D plots \n"; 716 726 usage += ">> stat/nostat or stats/nostats -> Toggle statistic display flag \n"; 727 usage += ">> title/notitle or tit/notit -> Toggle Auto AddTitle flag \n"; 717 728 usage += ">> DisplayWindow: next same win stack inset \n"; 718 729 usage += " Related commands: setxylimits setinsetlimits setimgcenter"; … … 741 752 usage += "\n at the specified position (Gr-Object Coordinate) with graphic attribute specification"; 742 753 usage += "\n Usage: addtext x y ColFontAtt TextString"; 743 usage += "\n Related commands: graphicatt"; 754 usage += "\n Related commands: settitle graphicatt"; 755 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 756 757 kw = "settitle"; 758 usage = "Set the title string (top title) for the current graphic object"; 759 usage += "\n Usage: settitle FontAtt TopTitle"; 760 usage += "\n Related commands: addtext graphicatt"; 744 761 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 745 762 -
trunk/SophyaPI/PIext/piaversion.h
r374 r1131 2 2 #define PIAPPVERSION_H_SEEN 3 3 4 #define PIAPP_VERSIONNUMBER 2. 44 #define PIAPP_VERSIONNUMBER 2.5 5 5 6 6 #endif -
trunk/SophyaPI/PIext/pistdimgapp.cc
r1075 r1131 209 209 mFImgCenter = false; 210 210 maXlog = maYlog = false; 211 mAddTitle = true; 211 212 SaveGraphicAtt(); 212 213 … … 550 551 else ((PIH2DWdg*)scw)->SetPIHisto((PIHisto2D*)scd); 551 552 // Titre du plot 552 if (title.length() <= 0) title = name; string t2=""; 553 scw->SetTitles(title, t2); 553 if (mAddTitle) { 554 if (title.length() <= 0) title = name; string t2=""; 555 scw->SetTitles(title, t2); 556 } 554 557 // scw->Refresh(); ? Pas necessaire Reza 19/08/98, 05/05/99 $CHECK$ 555 558 mCurWin = win; … … 612 615 wd3->AddDrawer3D(dr3, true); 613 616 // Titre du plot 614 if (title.length() <= 0) title = name; string t2=""; 615 wd3->SetTitles(title, t2); 617 if (mAddTitle) { 618 if (title.length() <= 0) title = name; string t2=""; 619 wd3->SetTitles(title, t2); 620 } 616 621 // wd3->Refresh(); ?Pas necessaire $CHECK$ 05/05/99 617 622 mCurWin = win; … … 650 655 if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) ) eld->SetFontAtt(mFSz, mFAtt); 651 656 eld->ElAddText(xp,yp,txt.c_str(),mFCol); 657 eld->Refresh(); 658 } 659 } 660 /* --Methode-- */ 661 void PIStdImgApp::SetTitle(string const & titletop, string const & titlebottom) 662 { 663 if (!mLastWdg) return; 664 PIElDrawer *eld=NULL; 665 PIScDrawWdg* sdw=NULL; 666 PIDraw3DWdg* w3d=NULL; 667 PIImage* imgw; 668 switch(mLastWdg->kind()) { 669 case PIScDrawWdg::ClassId : 670 sdw = dynamic_cast<PIScDrawWdg *>(mLastWdg); 671 if (sdw) eld = sdw->BaseDrawer(); 672 break; 673 case PIDraw3DWdg::ClassId : 674 w3d = dynamic_cast<PIDraw3DWdg *>(mLastWdg); 675 if (w3d) eld = w3d->BaseDrawer(); 676 break; 677 case PIImage::ClassId : 678 imgw = dynamic_cast<PIImage *>(mLastWdg); 679 if (imgw) eld = imgw->MyElDrawer(); 680 break; 681 default : 682 break; 683 } 684 if (eld) { 685 if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) ) eld->SetFontAtt(mFSz, mFAtt); 686 eld->SetTitles(titletop, titlebottom); 652 687 eld->Refresh(); 653 688 } … … 1412 1447 mSaXlog = maXlog; 1413 1448 mSaYlog = maYlog; 1449 mSAddTitle = mAddTitle; 1414 1450 } 1415 1451 … … 1437 1473 maXlog = mSaXlog; 1438 1474 maYlog = mSaYlog; 1475 mAddTitle = mSAddTitle; 1439 1476 } 1440 1477 -
trunk/SophyaPI/PIext/pistdimgapp.h
r685 r1131 53 53 // Fonction d'ajout de texte (provisoire - Aout 99) 54 54 void AddText(string const & txt, double xp, double yp); 55 // Fonction Ajout de titre de trace 56 void SetTitle(string const & titleup, string const & titledown); 55 57 56 58 … … 107 109 inline void SetXLogScale(bool logx=false) { maXlog = logx; } 108 110 inline void SetYLogScale(bool logy=false) { maYlog = logy; } 111 inline void SetAutoAddTitle(bool aatit=true) { mAddTitle = aatit; } 109 112 110 113 // Pour sauvegarder-restauration de l'etat des attributs graphiques … … 184 187 bool maXlog, mSaXlog; 185 188 bool maYlog, mSaYlog; 189 bool mAddTitle, mSAddTitle; 186 190 187 191 PIMessage mFCMsg; // Message for processing FileOpen -
trunk/SophyaPI/PIext/servnobjm.cc
r1126 r1131 1353 1353 mImgapp->SetXLogScale(); 1354 1354 mImgapp->SetYLogScale(); 1355 mImgapp->SetAutoAddTitle(); 1355 1356 stats_option = true; 1356 1357 return(ropt); … … 1401 1402 if ( grt[k] == "logy" ) { mImgapp->SetYLogScale(true); fgsrgr = true; continue; } 1402 1403 if ( grt[k] == "liny" ) { mImgapp->SetYLogScale(false); fgsrgr = true; continue; } 1404 // Ajout automatique de titre 1405 if ( ( grt[k] == "tit" ) || ( grt[k] == "title" ) ) 1406 { mImgapp->SetAutoAddTitle(true); fgsrgr = true; continue; } 1407 if ( ( grt[k] == "notit" ) || ( grt[k] == "notitle" ) ) 1408 { mImgapp->SetAutoAddTitle(false); fgsrgr = true; continue; } 1403 1409 1404 1410 // Si c'est une couleur
Note:
See TracChangeset
for help on using the changeset viewer.