Index: /trunk/SophyaPI/PI/Tests/pist.cc
===================================================================
--- /trunk/SophyaPI/PI/Tests/pist.cc	(revision 1846)
+++ /trunk/SophyaPI/PI/Tests/pist.cc	(revision 1847)
@@ -38,5 +38,24 @@
   PIFontAtt mFAtt,mSFAtt;
   PIFontSize mFSize, mSFSize;
+  PIFontName mFName, mSFName;
   int mSL[10], mSH[10];
+};
+
+
+// ---- Declaration de la classe StringDrawWdg --------
+class StringPosDrawWdg : public StringDrawWdg
+{
+public:
+// Les methodes ...
+
+                  StringPosDrawWdg(PIContainerGen *par, char *nom,
+                         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:
 };
 
@@ -56,4 +75,5 @@
   mSFAtt = PI_NotDefFontAtt;
   mSFSize = PI_NotDefFontSize;
+  mSFName = mFName = PI_CourierFont;
   for(int k=0; k<10; k++) 
     mSL[k] = mSH[k] = 0;
@@ -173,4 +193,6 @@
 void StringDrawWdg::Keyboard(int key, PIKeyModifier kmod)
 {
+PIFontName fn[4] = { PI_CourierFont, PI_HelveticaFont, 
+		     PI_TimesFont, PI_SymbolFont};
 
 bool fgref = true;
@@ -188,4 +210,16 @@
    mFAtt = PI_BoldItalicFont;
    break;
+ case 'C':
+   mFName = PI_CourierFont;
+   break;
+ case 'H':
+   mFName = PI_HelveticaFont;
+   break;
+ case 'T':
+   mFName = PI_TimesFont;
+   break;
+ case 'S':
+   mFName = PI_SymbolFont;
+   break;
  case '1':
    mFSize = PI_TinySizeFont;
@@ -215,4 +249,146 @@
 {
   Send(Msg(), PIMsg_Active);
+}
+
+/* ........................................................... */
+/*     Classe StringPosDrawWdg (Implementation des methodes)             */
+/* ........................................................... */
+
+/* --Methode-- */
+StringPosDrawWdg::StringPosDrawWdg(PIContainerGen *par, char *nom,
+                       int sx, int sy, int px, int py) 
+: StringDrawWdg(par, nom, sx, sy, px, py)
+
+{
+}
+
+/* --Methode-- */
+StringPosDrawWdg::~StringPosDrawWdg()
+{
+}
+ 
+
+/* --Methode-- */
+void StringPosDrawWdg::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,"StringPosDraw");
+g->DrawString(XSize()/3,24,attstr[ia]);
+g->DrawString(2*XSize()/3,24,fszstr[js]);
+
+int fh,fa,fd;
+fh = f.GetFontHeight(fa, fd);
+cout << " FontSize= " << f.GetFontSize() << " FontHeight= " << fh << endl;
+
+
+
+int xpos, ypos;
+char * s1;
+
+// --------------- Vertical Top -----------------
+
+xpos = 30;  ypos = 75;
+s1 = "V_Top-H_Left";
+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->DrawString(xpos, ypos, s1, PI_HorizontalLeft|PI_VerticalTop);
+
+xpos = 250;  ypos = 75;
+s1 = "V_Top-H_Center";
+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->DrawString(xpos, ypos, s1, PI_HorizontalCenter|PI_VerticalTop);
+
+xpos = 470;  ypos = 75;
+s1 = "V_Top-H_Center";
+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->DrawString(xpos, ypos, s1, PI_HorizontalRight|PI_VerticalTop);
+
+// --------------- Vertical Center ----------------- 
+xpos = 30;  ypos = 150;
+s1 = "V_Center-H_Left";
+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->DrawString(xpos, ypos, s1, PI_HorizontalLeft|PI_VerticalCenter);
+
+xpos = 250;  ypos = 150;
+s1 = "V_Center-H_Center";
+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->DrawString(xpos, ypos, s1, PI_HorizontalCenter|PI_VerticalCenter);
+
+xpos = 470;  ypos = 150;
+s1 = "V_Center-H_Right";
+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->DrawString(xpos, ypos, s1, PI_HorizontalRight|PI_VerticalCenter);
+ 
+// --------------- Vertical Bottom -----------------
+xpos = 30;  ypos = 250;
+s1 = "V_Bottom-H_Left";
+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->DrawString(xpos, ypos, s1, PI_HorizontalLeft|PI_VerticalBottom);
+
+xpos = 250;  ypos = 250;
+s1 = "V_Bottom-H_Center";
+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->DrawString(xpos, ypos, s1, PI_HorizontalCenter|PI_VerticalBottom);
+
+xpos = 470;  ypos = 250;
+s1 = "V_Bottom-H_Center";
+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->DrawString(xpos, ypos, s1, PI_HorizontalRight|PI_VerticalBottom);
+ 
+return;
 }
 
@@ -245,4 +421,5 @@
 m[0] = new PIMenu(Menubar(),"Actions");
 m[0]->AppendItem("StringDrawWdg", 10101);
+m[0]->AppendItem("StringPosDrawWdg", 10102);
 m[0]->AppendItem("->eps", 10111);
 m[0]->AppendItem("->ps", 10112);
@@ -258,5 +435,5 @@
 txt->SetTextEditable(false);
 txt->SetText("");
-txt->SetText("StringDrawWdg/Keyboard: \n r,b,i,I (Roman,bold,italic,bolditalic) \n Size 1,2,3,4,5");
+txt->SetText("StringDrawWdg/Keyboard: \n r,b,i,I (Roman,bold,italic,bolditalic) \n Size 1,2,3,4,5\n C,H,T,S (Courier,Helvetica,Times,Symbol)");
 
 mcurwin = NULL;
@@ -304,5 +481,19 @@
       PIWindow* wp = new PIWindow(this, strg, PIWK_normal,  400, 400, 150, 150);
       wp->SetAutoDelChilds(true);
-      StringDrawWdg* exb  = new StringDrawWdg(wp, "bwdg", 400, 400, 0, 0);
+      StringDrawWdg* exb  = new StringDrawWdg(wp, "sdrawwdg", 400, 400, 0, 0);
+      exb->SetBinding(PIBK_fixed,PIBK_elastic,PIBK_elastic,PIBK_elastic);
+      wp->SetUserData(exb);
+      wp->Show();
+      }
+    break;
+
+    case 10102: // Creation d'un StringPosDrawWdg
+      {
+      nbwin++;
+      sprintf(strg, "Creation StringPosDrawWdg   \n Fenetre No %d ", nbwin);
+      sprintf(strg,"StringPosDrawWdg - %d", nbwin);
+      PIWindow* wp = new PIWindow(this, strg, PIWK_normal,  500, 300, 150, 150);
+      wp->SetAutoDelChilds(true);
+      StringPosDrawWdg* exb  = new StringPosDrawWdg(wp, "sposdrawwdg", 500, 300, 0, 0);
       exb->SetBinding(PIBK_fixed,PIBK_elastic,PIBK_elastic,PIBK_elastic);
       wp->SetUserData(exb);
