Changeset 1131 in Sophya for trunk


Ignore:
Timestamp:
Aug 22, 2000, 5:09:27 PM (25 years ago)
Author:
ercodmgr
Message:

Introduction de l'option graphique tit/notit (methodes ds PIStdImgApp, modifs ds baseexcut.cc et ds servnobjmgr.cc - Reza 22/08/2000

Location:
trunk/SophyaPI/PIext
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/basexecut.cc

    r1126 r1131  
    103103  int opt = mObjMgr->GetServiceObj()->DecodeDispOption(tokens[2], fgsr);
    104104  mImgApp->AddText(txt, xp, yp);
     105  if (fgsr) mImgApp->RestoreGraphicAtt();
     106  }
     107else 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);
    105115  if (fgsr) mImgApp->RestoreGraphicAtt();
    106116  }
     
    715725usage += ">> XYLimits : xylimits  -> Forces X-Y limits in 2-D plots \n";
    716726usage += ">> stat/nostat or stats/nostats -> Toggle statistic display flag \n";
     727usage += ">> title/notitle or tit/notit -> Toggle Auto AddTitle flag \n";
    717728usage += ">> DisplayWindow: next same win stack inset \n";
    718729usage += "   Related commands: setxylimits setinsetlimits setimgcenter"; 
     
    741752usage += "\n at the specified position (Gr-Object Coordinate) with graphic attribute specification";
    742753usage += "\n  Usage: addtext x y ColFontAtt TextString";
    743 usage += "\n  Related commands: graphicatt"; 
     754usage += "\n  Related commands: settitle graphicatt"; 
     755mpiac->RegisterCommand(kw, usage, this, "Graphics");
     756
     757kw = "settitle";
     758usage = "Set the title string (top title) for the current graphic object";
     759usage += "\n  Usage: settitle FontAtt TopTitle";
     760usage += "\n  Related commands: addtext graphicatt"; 
    744761mpiac->RegisterCommand(kw, usage, this, "Graphics");
    745762
  • trunk/SophyaPI/PIext/piaversion.h

    r374 r1131  
    22#define PIAPPVERSION_H_SEEN
    33
    4 #define PIAPP_VERSIONNUMBER  2.4
     4#define PIAPP_VERSIONNUMBER  2.5
    55
    66#endif
  • trunk/SophyaPI/PIext/pistdimgapp.cc

    r1075 r1131  
    209209mFImgCenter = false;
    210210maXlog = maYlog = false;
     211mAddTitle = true;
    211212SaveGraphicAtt();
    212213
     
    550551else ((PIH2DWdg*)scw)->SetPIHisto((PIHisto2D*)scd);
    551552//   Titre du plot
    552 if (title.length() <= 0)  title = name;  string t2="";   
    553 scw->SetTitles(title, t2);   
     553if (mAddTitle) {
     554  if (title.length() <= 0)  title = name;  string t2="";   
     555  scw->SetTitles(title, t2);   
     556}
    554557// scw->Refresh();   ? Pas necessaire  Reza 19/08/98, 05/05/99 $CHECK$
    555558mCurWin = win;
     
    612615wd3->AddDrawer3D(dr3, true);
    613616//   Titre du plot
    614 if (title.length() <= 0)  title = name;  string t2="";   
    615 wd3->SetTitles(title, t2);   
     617if (mAddTitle) {
     618  if (title.length() <= 0)  title = name;  string t2="";   
     619  wd3->SetTitles(title, t2);   
     620}
    616621// wd3->Refresh();   ?Pas necessaire   $CHECK$ 05/05/99
    617622mCurWin = win;
     
    650655  if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) )     eld->SetFontAtt(mFSz, mFAtt);
    651656  eld->ElAddText(xp,yp,txt.c_str(),mFCol);
     657  eld->Refresh();
     658  }
     659}
     660/* --Methode-- */
     661void PIStdImgApp::SetTitle(string const & titletop, string const & titlebottom)
     662{
     663if (!mLastWdg)  return;
     664PIElDrawer *eld=NULL;
     665PIScDrawWdg* sdw=NULL;
     666PIDraw3DWdg* w3d=NULL;
     667PIImage* imgw;
     668switch(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  }
     684if (eld) {
     685  if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) )     eld->SetFontAtt(mFSz, mFAtt);
     686  eld->SetTitles(titletop, titlebottom);
    652687  eld->Refresh();
    653688  }
     
    14121447  mSaXlog = maXlog;
    14131448  mSaYlog = maYlog;
     1449  mSAddTitle = mAddTitle;
    14141450}
    14151451
     
    14371473  maXlog = mSaXlog;
    14381474  maYlog = mSaYlog;
     1475  mAddTitle = mSAddTitle;
    14391476}
    14401477
  • trunk/SophyaPI/PIext/pistdimgapp.h

    r685 r1131  
    5353  //  Fonction d'ajout de texte (provisoire - Aout 99)
    5454     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);
    5557
    5658
     
    107109     inline void  SetXLogScale(bool logx=false) { maXlog = logx; }
    108110     inline void  SetYLogScale(bool logy=false) { maYlog = logy; }
     111     inline void  SetAutoAddTitle(bool aatit=true) { mAddTitle = aatit; }
    109112
    110113// Pour sauvegarder-restauration de  l'etat des attributs graphiques
     
    184187    bool         maXlog, mSaXlog;
    185188    bool         maYlog, mSaYlog;
     189    bool         mAddTitle, mSAddTitle;
    186190
    187191    PIMessage mFCMsg;  // Message for processing FileOpen
  • trunk/SophyaPI/PIext/servnobjm.cc

    r1126 r1131  
    13531353  mImgapp->SetXLogScale();
    13541354  mImgapp->SetYLogScale();
     1355  mImgapp->SetAutoAddTitle();
    13551356  stats_option = true;
    13561357  return(ropt);
     
    14011402  if ( grt[k] == "logy" )  { mImgapp->SetYLogScale(true); fgsrgr = true;  continue; }
    14021403  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; }
    14031409
    14041410  // Si c'est une couleur
Note: See TracChangeset for help on using the changeset viewer.