Changeset 2780 in Sophya for trunk


Ignore:
Timestamp:
May 30, 2005, 9:41:30 AM (20 years ago)
Author:
ansari
Message:

1/ Suite corrections liees a l'appel de FinishCreate() (la bonne methode et au bon moment) dans les PIContainer (picontainergen/xx.cc)
2/ Corrections diverses liees au trace des axes / titre (piaxes.h pieldrw.cc)
3/ Ajout possibilite de faire Refresh() du widget a partir du drawer et bouton Refresh ds PIDrwOptionStringWindow - (pidrawer.h .cc pidrwtools.h .cc)
4/ Petites corrections de gestions des attributs graphiques (pigratt.cc piyfxdrw.cc ...)
5/ Amelioration/corrections PIBarGraph et PITextDrawer

Reza 30 Mai 2005

Location:
trunk/SophyaPI/PI
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/piaxes.h

    r2754 r2780  
    1919  kIntTicks    = 0x0010,
    2020  kExtTicks    = 0x0020,
    21   kMajTicks    = 0x0030,
    22   kMinTicks    = 0x0040,
     21  kMajTicks    = 0x0040,
     22  kMinTicks    = 0x0080,
    2323
    2424  kLabelsH     = 0x1000,
  • trunk/SophyaPI/PI/pibargraph.cc

    r2615 r2780  
    4444  fgValLabel = false;
    4545  packFrac = 0.5;
     46  GetGraphicAtt().SetColAtt(PI_Black, PI_White);
     47  GetGraphicAtt().SetFontAtt(PI_DefaultFont, PI_NormalSizeFont, PI_RomanFont);
     48  GetGraphicAtt().SetLineAtt(PI_NormalLine);
    4649  SetName("BarGraph");
    4750}
  • trunk/SophyaPI/PI/pibwdggen.cc

    r2615 r2780  
    743743
    744744PIGraphic* g = WindowGraphic();
     745g->SaveGraphicAtt();
    745746
    746747if (mDrElastic) {
     
    789790    break;
    790791  }
     792g->RestoreGraphicAtt();
    791793return;
    792794}
  • trunk/SophyaPI/PI/picontainergen.cc

    r2777 r2780  
    202202if (stfcr)  return;
    203203PIWdg::FinishCreate();   
     204if (!stvis) return;
    204205for(int k=0; k<NbChilds(); k++)  GetChild(k)->FinishCreate();
    205206stfcr = true;
  • trunk/SophyaPI/PI/picontainerx.cc

    r2777 r2780  
    3333// Pour gerer le probleme de l'appel a FinishCreate()
    3434// lorsque celui du parent est deja appele
    35 if (finishDone)  FinishCreate();
     35//--- les container sont cree dans l'etat inactif/invisible - FinishCreate() est
     36// donc desormais appele par PIContainerGen::Show() --- Mai 2005 ----
     37//--- plus appele ici  if (finishDone)  FinishCreate(); ----
    3638}
    3739
     
    5557// *************** Reza - Fev 2005 ***************
    5658// Probleme lie a la table des fonctions virtuelles - voir ci-dessus
    57 if (finishDone)  FinishCreate();
     59//--- les container sont cree dans l'etat inactif/invisible - FinishCreate() est
     60// donc desormais appele par PIContainerGen::Show() --- Mai 2005 ----
     61//--- plus appele ici  if (finishDone)  FinishCreate(); ----
    5862}
    5963
  • trunk/SophyaPI/PI/pidrawer.cc

    r2615 r2780  
    214214//      définie par "xmin-xmax" , "ymin-ymax" dans le système de coordonnées du
    215215//      PIDrawer.
    216 //  void  Refresh()
    217 //      Rafraîchit le dessin du PIDrawer sur tous les PIBaseWdg auxquel il est attaché.
     216//  void  Refresh(bool refwdg=false)
     217//      "refwdg==false": Rafraîchit le dessin du PIDrawer sur tous les PIBaseWdg auxquel il est attaché.
     218//      "refwdg==true": Appelle *Refresh()* sur tous les PIBaseWdg auxquel il est attaché.
    218219//  void  HighLight(bool fgh)
    219220//      Rafraichit le dessin du PIDrawer sur tous les PIBaseWdg auxquel il est attaché,
     
    229230
    230231void
    231 PIDrawer::Refresh()
     232PIDrawer::Refresh(bool refwdg)
    232233{
    233234  list<DrwBWId>::iterator it;
    234   for(it = mBWdgList.begin(); it != mBWdgList.end(); it++)
    235          (*it).wdg->CallDrawer((*it).id);
     235  if (refwdg) {
     236    for(it = mBWdgList.begin(); it != mBWdgList.end(); it++)
     237      (*it).wdg->Refresh();
     238  }
     239  else {
     240    for(it = mBWdgList.begin(); it != mBWdgList.end(); it++)
     241      (*it).wdg->CallDrawer((*it).id);
     242  }
    236243
    237244}
  • trunk/SophyaPI/PI/pidrawer.h

    r2530 r2780  
    4747  virtual double     GetDistanceToPoint(double x, double y);
    4848
    49   virtual void       Refresh();      // Recalcule les limites et reaffiche
     49  virtual void       Refresh(bool refwdg=false);      // Recalcule les limites et reaffiche
    5050  virtual void       UpdateLimits();   // Calcule et change les limites 
    5151
  • trunk/SophyaPI/PI/pidrwtools.cc

    r2615 r2780  
    755755  PIApplicationPrefCompSize(bsx, bsy);
    756756  spx = bsx/8;   spy = bsy/6;
    757   tsx = 6*bsx+2*spx;  tsy = 6*bsy+4*spy;
     757  tsx = 7.5*bsx+2*spx;  tsy = 6*bsy+4*spy;
    758758  SetSize(tsx,tsy);
    759759  int cpx = spx;
    760760  int cpy = spy;
    761   mTxt[0] = new PIText(this, "drwoshelp", true, true, bsx*6.0, 4*bsy, cpx, cpy); 
     761  mTxt[0] = new PIText(this, "drwoshelp", true, true, bsx*7.5, 4*bsy, cpx, cpy); 
    762762  mTxt[0]->SetTextEditable(false);
    763763  mTxt[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    764764  mTxt[0]->SetText("");
    765765  cpy += 4*bsy+spy;
    766   mTxt[1] = new PIText(this, "drwosset", bsx*6.0, bsy, cpx, cpy); 
     766  mTxt[1] = new PIText(this, "drwosset", bsx*7.5, bsy, cpx, cpy); 
    767767  mTxt[1]->SetTextEditable(true);
    768768  mTxt[1]->SetMsg(5555);
     
    770770  mTxt[1]->SetText("");
    771771  cpy += bsy+spy;
    772   mLab = new PILabel(this, "drwntyp", bsx*2.2, bsy, cpx, cpy);
     772  int lsx = tsx-4.8*bsx-6*spx;
     773  mLab = new PILabel(this, "drwntyp", lsx, bsy, cpx, cpy);
    773774  mLab->SetBorderWidth(1);
    774775  mLab->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    775776  mLab->SetLabel("");
    776   cpx += 2.3*bsx;
     777  cpx += lsx+spx;
    777778  mBut[0] = new PIButton(this, "SetOption", 555, bsx*1.2, bsy, cpx, cpy);
    778779  mBut[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    779   cpx += 1.25*bsx;
     780  cpx += (1.2*bsx+spx);
    780781  mBut[1] = new PIButton(this, "GetOption", 666, bsx*1.2, bsy, cpx, cpy);
    781782  mBut[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    782   cpx += 1.25*bsx;
    783   mBut[2] = new PIButton(this, "Dimiss", 777, bsx*1.2, bsy, cpx, cpy);
     783  cpx += (1.2*bsx+spx);
     784  mBut[2] = new PIButton(this, "Refresh", 500, bsx*1.2, bsy, cpx, cpy);
    784785  mBut[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
     786  cpx += (1.2*bsx+spx);
     787  mBut[3] = new PIButton(this, "Dimiss", 777, bsx*1.2, bsy, cpx, cpy);
     788  mBut[3]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
    785789}
    786790
     
    794798  delete mBut[1];
    795799  delete mBut[2];
     800  delete mBut[3];
    796801}
    797802/* --Methode-- */
     
    824829    break;
    825830  case 555:
     831  case 500:
    826832  case 5555:
    827833    if (mDrw) {
     
    843849      //        cout << " DBG-C[" << kk << "] " << vops[kk] << endl;
    844850      mDrw->DecodeOptionString(vops, false);
    845       ops = "<< " + ops + " >> Decoded";
     851      //      ops = "<< " + ops + " >> Decoded";
     852      ops = "";
    846853      mTxt[1]->SetText(ops);
    847       mDrw->Refresh();
     854      if (msg == 500) mDrw->Refresh(true);
     855      else mDrw->Refresh(false);
    848856    }
    849857    break;
  • trunk/SophyaPI/PI/pidrwtools.h

    r2539 r2780  
    7777  PIText* mTxt[2];
    7878  PILabel* mLab;
    79   PIButton* mBut[3];
     79  PIButton* mBut[4];
    8080  PIDrawer* mDrw;
    8181};
  • trunk/SophyaPI/PI/pieldrw.cc

    r2754 r2780  
    682682                   
    683683//  fh = g->GetFontHeightUC(gas, gds);
    684   fh = 0.075*(YMax()-YMin());
    685684  if ( titleT.length() > 0) {
     685    fh = 0.04*(YMax()-YMin());
    686686    if (g->isAxeYDirUpDown()) fy = g->DeltaUCY(YMin(), -fh);
    687687    else fy = g->DeltaUCY(YMax(), fh);
    688     g->DrawString(fx, fy, titleT.c_str(), PI_HorizontalCenter | PI_VerticalCenter);
     688    g->DrawString(fx, fy, titleT.c_str(), PI_HorizontalCenter | PI_VerticalBottom);
    689689    //      printf(" PIElDrawer::Draw()/DBG (%g , %g) %s  - %g \n", fx, fy, titleT.c_str(), fh);
    690690  }
    691691  if ( titleB.length() > 0) {
    692     fx = g->CalcStringWidth(titleB.c_str());
    693     if(aXdir) fx = g->DeltaUCX(XMax(), -(XMax()-XMin()-fx)/2.);
    694     else fx = g->DeltaUCX(XMin(), (XMax()-XMin()-fx)/2.);
    695     if (g->isAxeYDirUpDown()) fy =  g->DeltaUCY(YMax(), fh*1.5);
    696     else fy = g->DeltaUCY(YMin(), -fh*1.5);
    697     g->DrawString(fx, fy, titleB.c_str(), PI_HorizontalCenter | PI_VerticalCenter);
     692    fh = 0.075*(YMax()-YMin());
     693    if (g->isAxeYDirUpDown()) fy =  g->DeltaUCY(YMax(), fh);
     694    else fy = g->DeltaUCY(YMin(), -fh);
     695    g->DrawString(fx, fy, titleB.c_str(), PI_HorizontalCenter | PI_VerticalTop);
    698696    //      printf(" PIElDrawer::Draw()/DBG (%g , %g) %s  - %g \n", fx, fy, titleT.c_str(), fh);
    699697  }
  • trunk/SophyaPI/PI/pigratt.cc

    r2754 r2780  
    662662  // A FAIRE - Reza->CMV  Mars 2004
    663663  // On ne vide pas (ne met pas a zero) att, mais on ajoute derriere.
    664   att.push_back("A FAIRE - Reza->CMV  Mars 2004");
     664  att.push_back("??GraphicAtt??");
    665665  return 1;
    666666}
  • trunk/SophyaPI/PI/pitxtdrw.cc

    r2754 r2780  
    4040{
    4141  fgFrame = fgframe;
     42  GetGraphicAtt().SetColAtt(PI_Black, PI_White);
     43  GetGraphicAtt().SetFontAtt(PI_DefaultFont, PI_NormalSizeFont, PI_RomanFont);
     44  GetGraphicAtt().SetLineAtt(PI_NormalLine);
    4245  SetName("TextDrw");
    4346}
     
    8184void PITextDrawer::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
    8285{
    83   if (mLines.size() < 1) return;
     86  if ((mLines.size() < 1) && !fgFrame) return;
    8487  PIGraphicAtt siatt = GetGraphicAtt();
    8588  PIGraphicAtt catt;
     
    9093    catt = siatt;
    9194    catt.UpdateFrom(mLines[k].att);
     95    SetGraphicAtt(catt);
    9296    SelGraAtt(g);
    9397    if (mLines[k].att.GetMarker() != PI_NotDefMarker) {
    94       x = 0.03;
    9598      ym = (double)y-(double)(g->GetFontHeight(fa, fd))*0.5;
    9699      g->DrawMarker(x, ym);
     
    100103      x = (double)x+dxu+0.02;
    101104    }
    102     else x = 0.05;
    103105    // Trace des lignes de texte
    104106    g->DrawString(x,y,mLines[k].line.c_str(),PI_VerticalTop);
    105107    y = (double)y-(double)(g->GetFontHeight(fa, fd))*1.1;
    106108  }
     109  SetGraphicAtt(siatt);
    107110  if (fgFrame) {   // Trace de cadre
    108     SetGraphicAtt(siatt);
    109111    SelGraAtt(g);
    110112    x = y = 0.;
  • trunk/SophyaPI/PI/piyfxdrw.cc

    r2615 r2780  
    107107  PIAxes::ReSizeMinMax(isLogScaleY(),ymin,ymax);
    108108  SetLimits(xmin,xmax,ymin,ymax);
    109   SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
     109  // NE PAS FAIRE - Reza Mai 2005  SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
    110110}
    111111
     
    116116  double xp,yp;
    117117  int i;
     118
     119  if (axesFlags != kAxesNone) DrawAxes(g);
    118120
    119121  if ((mAx == NULL))  mSz = 0;
Note: See TracChangeset for help on using the changeset viewer.