Index: trunk/SophyaPI/PI/Tests/pist.cc
===================================================================
--- trunk/SophyaPI/PI/Tests/pist.cc	(revision 1854)
+++ trunk/SophyaPI/PI/Tests/pist.cc	(revision 1896)
@@ -48,4 +48,21 @@
                          int sx=10, int sy=10, int px=0, int py=0);
   virtual         ~StringPosDrawWdg();
+
+// Traitement des evenements   
+//  virtual void   Resize();
+  virtual void   Draw(PIGraphic* g, int x0, int y0, int dx, int dy);
+
+protected:
+};
+
+// ---- Declaration de la classe CompStringDrawWdg --------
+class CompStringDrawWdg : public StringDrawWdg
+{
+public:
+// Les methodes ...
+
+                  CompStringDrawWdg(PIContainerGen *par, char *nom,
+				    int sx=10, int sy=10, int px=0, int py=0);
+  virtual         ~CompStringDrawWdg();
 
 // Traitement des evenements   
@@ -419,4 +436,202 @@
 
 /* ........................................................... */
+/*     Classe CompStringDrawWdg (Implementation des methodes)             */
+/* ........................................................... */
+
+/* --Methode-- */
+CompStringDrawWdg::CompStringDrawWdg(PIContainerGen *par, char *nom,
+                       int sx, int sy, int px, int py) 
+: StringDrawWdg(par, nom, sx, sy, px, py)
+
+{
+}
+
+/* --Methode-- */
+CompStringDrawWdg::~CompStringDrawWdg()
+{
+}
+ 
+
+/* --Methode-- */
+void CompStringDrawWdg::Draw(PIGraphicGen* g, int /*x0*/, int /*y0*/, int /*dx*/, int /*dy*/)
+{
+PIFontAtt att[4] = { PI_RomanFont, PI_BoldFont, PI_ItalicFont, PI_BoldItalicFont};
+PIFontSize fsz[5] = { PI_TinySizeFont, PI_SmallSizeFont, PI_NormalSizeFont, 
+		      PI_BigSizeFont, PI_HugeSizeFont };
+PIFontName fn[4] = { PI_CourierFont, PI_HelveticaFont, 
+		     PI_TimesFont, PI_SymbolFont};
+char * fnstr[4] = { "Courier-Font", "Helvetica-Font", 
+		     "Times-Font", "Symbol-Font"};
+char * attstr[4] = { "RomanFont" , "BoldFont", "ItalicFont", "BoldItalicFont"};
+char * fszstr[5] = { "TinySizeFont", "SmallSizeFont", "NormalSizeFont", 
+		      "BigSizeFont", "HugeSizeFont" };
+
+if (g->kind() != PI_PSFileGraphics ) EraseWindow();
+
+
+int ia=0, js=0;
+int k;
+for(k=0; k<4; k++)
+  if (att[k] == mFAtt)  {ia = k; break; }
+for(k=0; k<5; k++)
+  if (fsz[k] == mFSize)  {js = k; break; }
+
+if ((mFSize != mSFSize) || (mFAtt != mSFAtt))
+  for(k=0; k<10; k++)
+    mSL[k] = mSH[k] = 0;
+PIFont f(14, PI_DefaultFont, mFAtt);
+g->SelFont(f);
+g->SelForeground(PI_Black);
+g->SelLine(PI_ThinLine);
+
+g->DrawString(20,24,"StringDraw");
+g->DrawString(XSize()/5,24,attstr[ia]);
+g->DrawString(XSize()/3,24,fszstr[js]);
+
+
+PIFont fx(14,fn[2]);
+fx.SetFontSz(mFSize);
+fx.SetFontAtt(mFAtt);
+g->SelFont(fx);
+int fh,fa,fd;
+fh = fx.GetFontHeight(fa, fd);
+cout << " FontSize= " << f.GetFontSize() << " FontHeight= " << fh << endl;
+
+g->DrawCompString(XSize()/2,40,"10","-34",NULL);
+g->DrawCompString(XSize()/2+60,40,"10","+78",NULL);
+g->DrawCompString(XSize()/2+120,40, "10", NULL, "a");
+
+int xpos, ypos;
+char *s, *su, *sd;
+
+// --------------- Vertical Top -----------------
+
+xpos = 30;  ypos = 75;
+s = "HLeftVTop";
+su = "824";
+sd = "ij";
+g->SelForeground(PI_Red);
+g->DrawLine(xpos-50, ypos, xpos+50, ypos); 
+g->DrawLine(xpos, ypos-10, xpos, ypos+10);
+g->SelForeground(PI_Black);
+g->DrawCompString(xpos, ypos, s, su, sd, PI_HorizontalLeft|PI_VerticalTop);
+
+xpos = XSize()/2;  ypos = 75;
+s = "HCenVTop";
+su = "76843";
+sd = "abc";
+g->SelForeground(PI_Red);
+g->DrawLine(xpos-50, ypos, xpos+50, ypos); 
+g->DrawLine(xpos, ypos-10, xpos, ypos+10);
+g->SelForeground(PI_Black);
+g->DrawCompString(xpos, ypos, s, su, sd, PI_HorizontalCenter|PI_VerticalTop);
+
+xpos = XSize()-30;  ypos = 75;
+s = "HRigVTop";
+su = "76843";
+sd = "abc";
+g->SelForeground(PI_Red);
+g->DrawLine(xpos-50, ypos, xpos+50, ypos); 
+g->DrawLine(xpos, ypos-10, xpos, ypos+10);
+g->SelForeground(PI_Black);
+g->DrawCompString(xpos, ypos, s, su, sd, PI_HorizontalRight|PI_VerticalTop);
+
+// --------------- Vertical Center ----------------- 
+xpos = 30;  ypos = 150;
+s = "HLeftVCen";
+su = "32987";
+sd = NULL;
+g->SelForeground(PI_Red);
+g->DrawLine(xpos-50, ypos, xpos+50, ypos); 
+g->DrawLine(xpos, ypos-10, xpos, ypos+10);
+g->SelForeground(PI_Black);
+g->DrawCompString(xpos, ypos, s, su, sd, PI_HorizontalLeft|PI_VerticalCenter);
+
+xpos = XSize()/2;  ypos = 150;
+s = "HCenVCen";
+su = "32987";
+sd = "klm";
+g->SelForeground(PI_Red);
+g->DrawLine(xpos-50, ypos, xpos+50, ypos); 
+g->DrawLine(xpos, ypos-10, xpos, ypos+10);
+g->SelForeground(PI_Black);
+g->DrawCompString(xpos, ypos, s, su, sd, PI_HorizontalCenter|PI_VerticalCenter);
+
+xpos = XSize()-30;  ypos = 150;
+s = "HRigVCen";
+su = "2";
+sd = "alpha";
+g->SelForeground(PI_Red);
+g->DrawLine(xpos-50, ypos, xpos+50, ypos); 
+g->DrawLine(xpos, ypos-10, xpos, ypos+10);
+g->SelForeground(PI_Black);
+g->DrawCompString(xpos, ypos, s, su, sd, PI_HorizontalRight|PI_VerticalCenter);
+
+// --------------- Vertical BaseLine -----------------
+xpos = 30;  ypos = 250;
+s = "HLeftVBas";
+su = "3";
+sd = "beta";
+g->SelForeground(PI_Red);
+g->DrawLine(xpos-50, ypos, xpos+50, ypos); 
+g->DrawLine(xpos, ypos-10, xpos, ypos+10);
+g->SelForeground(PI_Black);
+g->DrawCompString(xpos, ypos, s, su, sd, PI_HorizontalLeft|PI_VerticalBaseLine);
+
+xpos = XSize()/2;  ypos = 250;
+s = "HCenVBas";
+su = "gamma";
+sd = "44";
+g->SelForeground(PI_Red);
+g->DrawLine(xpos-50, ypos, xpos+50, ypos); 
+g->DrawLine(xpos, ypos-10, xpos, ypos+10);
+g->SelForeground(PI_Black);
+g->DrawCompString(xpos, ypos, s, su, sd, PI_HorizontalCenter|PI_VerticalBaseLine);
+
+xpos = XSize()-30;  ypos = 250;
+s = "HRigVBas";
+su = "55";
+sd = "alpha";
+g->SelForeground(PI_Red);
+g->DrawLine(xpos-50, ypos, xpos+50, ypos); 
+g->DrawLine(xpos, ypos-10, xpos, ypos+10);
+g->SelForeground(PI_Black);
+g->DrawCompString(xpos, ypos, s, su, sd, PI_HorizontalRight|PI_VerticalBaseLine);
+
+// --------------- Vertical Bottom -----------------
+xpos = 30;  ypos = 325;
+s = "HLeftVBot";
+su = "abc";
+sd = "6";
+g->SelForeground(PI_Red);
+g->DrawLine(xpos-50, ypos, xpos+50, ypos); 
+g->DrawLine(xpos, ypos-10, xpos, ypos+10);
+g->SelForeground(PI_Black);
+g->DrawCompString(xpos, ypos, s, su, sd, PI_HorizontalLeft|PI_VerticalBottom);
+
+xpos = XSize()/2;  ypos = 325;
+s = "HCentVBot";
+su = NULL;
+sd = "lm";
+g->SelForeground(PI_Red);
+g->DrawLine(xpos-50, ypos, xpos+50, ypos); 
+g->DrawLine(xpos, ypos-10, xpos, ypos+10);
+g->SelForeground(PI_Black);
+g->DrawCompString(xpos, ypos, s, su, sd, PI_HorizontalCenter|PI_VerticalBottom);
+
+xpos = XSize()-30;  ypos = 325;
+s = "HLeftVBot";
+su = NULL;
+sd = NULL;
+g->SelForeground(PI_Red);
+g->DrawLine(xpos-50, ypos, xpos+50, ypos); 
+g->DrawLine(xpos, ypos-10, xpos, ypos+10);
+g->SelForeground(PI_Black);
+g->DrawCompString(xpos, ypos, s, su, sd, PI_HorizontalRight|PI_VerticalBottom);
+ 
+return;
+}
+
+/* ........................................................... */
 /*                       Classe PITApp                         */
 /* ........................................................... */
@@ -447,4 +662,5 @@
 m[0]->AppendItem("StringDrawWdg", 10101);
 m[0]->AppendItem("StringPosDrawWdg", 10102);
+m[0]->AppendItem("CompStringDrawWdg", 10103);
 m[0]->AppendItem("->eps", 10111);
 m[0]->AppendItem("->ps", 10112);
@@ -521,4 +737,18 @@
       wp->SetAutoDelChilds(true);
       StringPosDrawWdg* exb  = new StringPosDrawWdg(wp, "sposdrawwdg", 600, 400, 0, 0);
+      exb->SetBinding(PIBK_fixed,PIBK_elastic,PIBK_elastic,PIBK_elastic);
+      wp->SetUserData(exb);
+      wp->Show();
+      }
+    break;
+
+    case 10103: // Creation d'un StringPosDrawWdg
+      {
+      nbwin++;
+      sprintf(strg, "Creation CompStringDrawWdg   \n Fenetre No %d ", nbwin);
+      sprintf(strg,"CompStringDrawWdg - %d", nbwin);
+      PIWindow* wp = new PIWindow(this, strg, PIWK_normal,  600, 400, 150, 150);
+      wp->SetAutoDelChilds(true);
+      CompStringDrawWdg* exb  = new CompStringDrawWdg(wp, "compposdrawwdg", 600, 400, 0, 0);
       exb->SetBinding(PIBK_fixed,PIBK_elastic,PIBK_elastic,PIBK_elastic);
       wp->SetUserData(exb);
