Changeset 1970 in Sophya


Ignore:
Timestamp:
Apr 30, 2002, 2:32:25 PM (23 years ago)
Author:
ansari
Message:

1/ Correction bug gestion UpdateFrom ds PIGraphicAtt
2/ Amelioration gestion DecodeOptionString -
3/ Prise en compte PIDrawer::DeactivateControlWindow() lors de delete et detach

Reza 30/4/2002

Location:
trunk/SophyaPI/PI
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/pidrawer.cc

    r1946 r1970  
    6868PIDrawer::~PIDrawer()
    6969{
     70  // Desactivation totale de la fenetre de controle specialise
     71  // ---> parametre d'appel PIBaseWdgGen* wdg=NULL
     72  DeactivateControlWindow(NULL);
     73
    7074  list<DrwBWId>::iterator it;
    7175  mDndfg = true;
     
    265269  if (mDndfg) return;
    266270  if (!wdg) return;
     271
     272  // Desactivation de la fenetre de controle specialisee pour la
     273  // base-widget duquel on se detache
     274  DeactivateControlWindow(wdg);
     275
    267276  list<DrwBWId>::iterator it;
    268277  for(it = mBWdgList.begin(); it != mBWdgList.end(); it++)
     
    279288}
    280289
     290//--------------------------------------------------------------
     291// Methode de desactivation de la fenetre de controle specialise
     292// Cette methode est appellee dans deux cas :
     293// 1/ lors de la destruction du drawer
     294//    Dans ce cas, le parametre PIBaseWdgGen* wdg = NULL
     295// 2/ Lorsque le drawer est detache d'un PIBaseWdg
     296//    Dans ce cas, le parametre PIBaseWdgGen* wdg pointe vers le
     297//    PIBaseWdg duquel le drawer est detache
     298// Evidemment, "this" pointe toujours sur le drawer qui est
     299// en cours de destruction ou de detachement
     300//--------------------------------------------------------------
    281301void
    282302PIDrawer::DeactivateControlWindow(PIBaseWdgGen* wdg)
    283303{
    284   // On affiche par defaut la fenetre de gestion des attributs graphiques
     304  // Par defaut, il n'y a pas de fenetre de controle specialise
     305  // Donc, on ne fait rien
    285306}
    286307
     
    288309PIDrawer::DecodeOptionString(vector<string> & opt, bool rmdecop)
    289310{
    290   if (opt.size() == 0)  return(0); 
     311  if (opt.size() < 1)  return(0); 
    291312  PIGraphicAtt gratt;
    292313  int ndec = gratt.DecodeAttStrings(opt, rmdecop);
  • trunk/SophyaPI/PI/pieldrw.cc

    r1922 r1970  
    4545mEn = 0;
    4646titleT = titleB = "";
     47ShowTitles();
    4748}
    4849
     
    7677int PIElDrawer::DecodeOptionString(vector<string> & opt, bool rmdecopt)
    7778{
    78   if (opt.size() == 0)  return(0); 
     79  if (opt.size() < 1)  return(0); 
    7980  int ndec1 = PIDrawer::DecodeOptionString(opt, rmdecopt);
     81  if ((opt.size() - ndec1) < 1) return(ndec1);  // si tout a ete decode
    8082  vector<string> udopt;
    8183  unsigned int k = 0;
     
    8385  for( k=0; k<opt.size(); k++ ) {
    8486    string opts = opt[k];
    85     if ( (opts == "stdaxes") || (opts == "defaxes") || (opts == "boxaxes") ) {
     87    if ( (opts == "stdaxes") || (opts == "defaxes") || (opts == "boxaxes") )
    8688      SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
    87       continue;
    88     }
    89     if (opts == "simpleaxes") {
     89    else if (opts == "simpleaxes")
    9090      SetAxesFlags(kAxesDflt);
    91       continue;     
    92     }
    93     if (opts == "boxaxesgrid") {
     91    else if (opts == "boxaxesgrid")
    9492      SetAxesFlags(kBoxAxes | kExtTicks | kLabels | kGridOn);
    95       continue;     
    96     }
    97     if (opts == "fineaxes") {
     93    else if (opts == "fineaxes")
    9894      SetAxesFlags(kBoxAxes | kTicks | kLabels | kMinTicks | kMajTicks);
    99       continue;     
    100     }
    101     if ((opts == "grid") || (opts == "fineaxesgrid")) {
     95    else if ((opts == "grid") || (opts == "fineaxesgrid"))
    10296      SetAxesFlags(kBoxAxes | kTicks | kLabels | kMinTicks | kMajTicks | kGridOn);
    103       continue;     
    104     }
    105     if (opts == "autofontsize") {
     97    else if (opts == "autofontsize")
    10698      SetAxesAutoFontSize(true);
    107       continue;     
    108     }
    109     if (opts == "fixedfontsize") {
     99    else if (opts == "fixedfontsize")
    110100      SetAxesAutoFontSize(false);
    111       continue;     
    112     }
    113 
    114     ndec--;
    115     if (rmdecopt)  udopt.push_back(opts);
     101    else if (opts == "title") ShowTitles(true);
     102    else if (opts == "notitle") ShowTitles(false);
     103
     104    else {
     105      ndec--;
     106      if (rmdecopt)  udopt.push_back(opts);
     107    }
    116108  } 
    117109
     
    158150
    159151// Trace des titres
    160 if ( (titleT.length() > 0) || (titleB.length() > 0) ) {
     152if ( showTitles && ((titleT.length() > 0) || (titleB.length() > 0)) ) {
    161153  aXdir = false;  // Vrai si Axe X de Droite vers Gauche
    162154  aYdir = false;  // Vrai si Axe Y de Haut vers Bas
  • trunk/SophyaPI/PI/pieldrw.h

    r1914 r1970  
    2222  virtual void       SetTitles(const char* tt=NULL, const char* tb=NULL);
    2323  virtual void       SetTitles(string const & tt, string const & tb);
     24 
     25  inline void        ShowTitles(bool fg=true) { showTitles = fg; }
    2426
    2527//   Methode de decodage des options
     
    6971
    7072  string titleT, titleB;       // Titre Haut - Bas
     73  bool showTitles;              // Affichage des titres si true
    7174
    7275};
  • trunk/SophyaPI/PI/pigratt.cc

    r1935 r1970  
    1010PIGraphicAtt::PIGraphicAtt()
    1111{
     12  InitGrAttStrings();   // Init attributes decoding maps
    1213  SetDefaultAtt();
    1314}
     
    1516PIGraphicAtt::PIGraphicAtt(PIGraphicAtt const & att)
    1617{
     18  InitGrAttStrings();   // Init attributes decoding maps
    1719  CopyFrom(att);
    1820}
     
    2022PIGraphicAtt::PIGraphicAtt(vector<string> & att, bool rmdecatt)
    2123{
     24  InitGrAttStrings();   // Init attributes decoding maps
    2225  // Initialize attributes
    2326  SetDefaultAtt();
     
    3639  SetLineAtt();
    3740  SetFontAtt();
     41  mNotDefFnt = false;
    3842  SetMarkerAtt(1);
    3943  SetArrowMarkerAtt(5);
     
    4751  mLAtt = att.mLAtt;
    4852  mFnt = att.mFnt;
     53  mNotDefFnt = att.mNotDefFnt;
    4954  mMSz = att.mMSz;
    5055  mMrk = att.mMrk;
     
    8186  if (att.mBCol != PI_NotDefColor)  mBCol = att.mBCol;
    8287  if (att.mLAtt != PI_NotDefLineAtt)  mLAtt = att.mLAtt;
    83   if ( (att.mFnt.GetFontName() != PI_DefaultFont) ||
    84        (att.mFnt.GetFontAtt() != PI_NotDefFontAtt) ||
    85        (att.mFnt.GetFontSize() != PI_NotDefFontSize) )  mFnt = att.mFnt;
     88  if (att.mNotDefFnt) mFnt = att.mFnt;
     89  //  if ( (att.mFnt.GetFontName() != PI_DefaultFont) ||
     90  //       (att.mFnt.GetFontAtt() != PI_NotDefFontAtt) ||
     91  //     (att.mFnt.GetFontSize() != PI_NotDefFontSize) )  mFnt = att.mFnt;
    8692  if (att.mMrk != PI_NotDefMarker) {
    8793    mMSz = att.mMSz;
     
    101107void PIGraphicAtt::SetFontAtt(PIFontSize fsz, PIFontAtt fat)
    102108{
     109  mNotDefFnt = true;
    103110  mFnt.SetFontAtt(fat);
    104111  mFnt.SetFontSz(fsz);
     
    107114void PIGraphicAtt::SetFontAtt(PIFontName fn, PIFontSize fsz, PIFontAtt fat)
    108115{
     116  mNotDefFnt = true;
    109117  mFnt.SetFont(fn);
    110118  mFnt.SetFontAtt(fat);
     
    404412    GrAttFontNames::const_iterator itfn = GrAfontnm.find(gratt);
    405413    if (itfn != GrAfontnm.end()) {
    406       mFnt.SetFont((*itfn).second);  continue;
     414      mFnt.SetFont((*itfn).second); 
     415      mNotDefFnt = true;  continue;
    407416    }
    408417    // Si c'est un attribut de fontes
     
    411420    if (itfa != GrAfnt.end()) {
    412421      mFnt.SetFontAtt((*itfa).second.fatt); 
    413       mFnt.SetFontSz((*itfa).second.fsz);  
    414       continue;
     422      mFnt.SetFontSz((*itfa).second.fsz);
     423      mNotDefFnt = true;  continue;
    415424    }
    416425    // Si c'est un attribut de markers
  • trunk/SophyaPI/PI/pigratt.h

    r1914 r1970  
    3939  inline void    SetLineAtt(PILineAtt const & lat)  { mLAtt = lat; }
    4040  inline void    SetLineAtt(PILineTypes ltyp=PI_NotDefLineAtt)  { mLAtt = ltyp; }
    41   inline void    SetFont(PIFont const & fnt)  { mFnt = fnt; }
     41  inline void    SetFont(PIFont const & fnt)  { mNotDefFnt = true; mFnt = fnt; }
    4242         void    SetFontAtt(PIFontSize fsz=PI_NotDefFontSize,
    4343                            PIFontAtt fat=PI_NotDefFontAtt);
     
    8282  PILineAtt          mLAtt;
    8383  PIFont             mFnt;
     84  bool               mNotDefFnt;    // Si True --> Pas la fonte par defaut
    8485  int                mMSz;
    8586  PIMarker           mMrk; 
  • trunk/SophyaPI/PI/piscdrawwdg.cc

    r1946 r1970  
    245245      continue;
    246246    }
     247    /*
     248    les attributs d'axes sont decodes par PIElDrawer
     249    if (opts == "simpleaxes")  {
     250      SetAxesFlags(kAxesDflt);
     251      continue;
     252    }
     253    if ( (opts == "stdaxes")  || (opts == "boxaxes") ) {
     254      SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
     255      continue;
     256    }
     257    if (opts == "boxaxesgrid")  {
     258      SetAxesFlags(kBoxAxes | kExtTicks | kLabels | kGridOn);
     259      continue;
     260    }
     261    if (opts == "fineaxes")  {
     262      SetAxesFlags(kBoxAxes | kTicks | kLabels | kMinTicks | kMajTicks);
     263      continue;
     264    }
     265    if (opts == "fineaxesgrid")  {
     266      SetAxesFlags(kBoxAxes | kTicks | kLabels | kMinTicks | kMajTicks | kGridOn);
     267      continue;
     268    }
     269    */
    247270
    248271    ndec--;
  • trunk/SophyaPI/PI/piversion.h

    r1951 r1970  
    22#define PIVERSION_H_SEEN
    33
    4 #define PI_VERSIONNUMBER  3.63
     4#define PI_VERSIONNUMBER  3.65
    55
    66#endif
Note: See TracChangeset for help on using the changeset viewer.