Index: /trunk/SophyaPI/PI/pi.rsc
===================================================================
--- /trunk/SophyaPI/PI/pi.rsc	(revision 6)
+++ /trunk/SophyaPI/PI/pi.rsc	(revision 7)
@@ -26,4 +26,6 @@
 PeidaInt*XmText*XmNhighlightThickness:          2
 
+PeidaInt*DefMenubar*XtNwidth:           250
+PeidaInt*DefMenubar*XtNheight:          30
 
 PeidaInt*fontList:           -*-helvetica-bold-r-normal-*-12-*-*-*-*-*-ISO8859-1
Index: /trunk/SophyaPI/PI/piapplx.cc
===================================================================
--- /trunk/SophyaPI/PI/piapplx.cc	(revision 6)
+++ /trunk/SophyaPI/PI/piapplx.cc	(revision 7)
@@ -21,14 +21,15 @@
                             10, 10, 0, 0);
 menubar = new PIMenubar(this, "DefMenubar");
-Menubar()->SetBinding(true, false, true, false);
+Menubar()->SetBinding(true, true, true, false);
 sxt = ( sx > Menubar()->XSize() ) ? sx : Menubar()->XSize();
 syt = ( sy > 0 ) ? sy : 0;
-syt += Menubar()->YSize();
+//syt += Menubar()->YSize();
+syt += 40;
 MBCont()->SetSize(sxt, syt);
 if ( (sx > 0) && (sy > 0) )
   {
   topcont = new PIContainerX(MBCont(), "TopLevelCont", 
-                             sx, sy, 0, Menubar()->YSize());
-  topcont->SetBinding(true, false, true, true);
+                             sx, sy, 0, 40);
+  topcont->SetBinding(true, true, true, true);
   topcont->Show();
   }
Index: /trunk/SophyaPI/PI/piimage.cc
===================================================================
--- /trunk/SophyaPI/PI/piimage.cc	(revision 6)
+++ /trunk/SophyaPI/PI/piimage.cc	(revision 7)
@@ -256,5 +256,5 @@
 {
 unsigned char *pix, *pp, ucp;
-int zmm;
+int zmm=1;
 int npx, npy, nppx, nppy, nszp, oszp;
 int i,j,k,l;
@@ -274,6 +274,6 @@
 if (zm >= 1)
   {
-  if ((npx*zm) > xwsz)  npx = xwsz/zm; 
-  if ((npy*zm) > ywsz)  npy = ywsz/zm;
+  if (npx > (xwsz/zm))  npx = xwsz/zm; 
+  if (npy > (ywsz/zm))  npy = ywsz/zm;
   nppx = npx*zm;   nppy = npy*zm;
   }
@@ -281,7 +281,8 @@
   {
   zmm = -zm;
-  if ((npx/zmm) > xwsz)  npx = xwsz*zmm; 
-  if ((npy/zmm) > ywsz)  npy = ywsz*zmm; 
   nppx = npx/zmm;   nppy = npy/zmm;
+  if (nppx > xwsz)  nppx = xwsz; 
+  if (nppy > ywsz)  nppy = ywsz;
+  npx = nppx*zmm;   npy = nppy*zmm; 
   }
 
@@ -423,6 +424,6 @@
 else
   {
-  offx = xpav-XSize()/2*zoom;
-  offy = ypav-YSize()/2*zoom;
+  offx = xpav+XSize()/2*zoom;
+  offy = ypav+YSize()/2*zoom;
   }
 
Index: /trunk/SophyaPI/PI/pioptmenux.cc
===================================================================
--- /trunk/SophyaPI/PI/pioptmenux.cc	(revision 6)
+++ /trunk/SophyaPI/PI/pioptmenux.cc	(revision 7)
@@ -21,9 +21,17 @@
 xmstr = XmStringLtoRCreate(pdm->Nom().c_str(), XmSTRING_DEFAULT_CHARSET);
 
-Arg  warg[2];
-XtSetArg(warg[0], XmNsubMenuId, pdm->XtWdg());
-XtSetArg(warg[1],XmNlabelString, xmstr);
+Arg  warg[7];
+int n = 0;
+XtSetArg(warg[n], XmNsubMenuId, pdm->XtWdg());   n++;
+XtSetArg(warg[n],XmNlabelString, xmstr);    n++;
+XtSetArg(warg[n],XmNresizeWidth, FALSE);   n++;
+XtSetArg(warg[n],XmNresizeHeight, FALSE);   n++;
+if ((sx > 0) && (sy > 0)) 
+  {
+  XtSetArg(warg[n],XtNwidth,sx);   n++;  
+  XtSetArg(warg[n],XtNheight,sy);   n++;
+  }
 
-XtWdg() = XmCreateOptionMenu( par->XtWdg(), pdm->Nom().c_str(), warg, 2); 
+XtWdg() = XmCreateOptionMenu( par->XtWdg(), pdm->Nom().c_str(), warg, n); 
 wmis == k_wmi_normal ;
 stmng = 0;
@@ -33,8 +41,15 @@
 XtSetArg(warg[0],XmNhighlightThickness, 0);
 XtSetValues(cb, warg, 1);
+if ((sx > 0) && (sy > 0)) 
+  {
+  cb = XmOptionLabelGadget (XtWdg());
+  XtSetArg(warg[0],XtNwidth,sx/2);   n++;  
+  XtSetArg(warg[1],XtNheight,sy);   n++;
+  XtSetValues(cb, warg, 2);
+  }
 
 SetPos(px,py);
-if ((sx > 0) && (sy > 0))  SetSize(sx, sy);
-// SetLabel(pdm->Nom());
+SetSize(sx, sy);
+SetBinding(false, false, false, false);
 
 mMen->SetMsgParent(this);
Index: /trunk/SophyaPI/PI/piwdgx.cc
===================================================================
--- /trunk/SophyaPI/PI/piwdgx.cc	(revision 6)
+++ /trunk/SophyaPI/PI/piwdgx.cc	(revision 7)
@@ -176,119 +176,119 @@
 
 if (!sdw)  return;
+/*
+Arg  wargs[2];
+XtSetArg(wargs[0],XtNwidth,sx); 
+XtSetArg(wargs[1],XtNheight,sy); 
+XtSetValues(this->sdw, wargs, 2);
+*/
+XtResizeWidget(sdw, sx, sy, BorderWidth());
+
+return;
+} 
+
+/* --Methode-- */
+void PIWdgX::SetPos(int px, int py)
+{
+if (!sdw)  return;
+/*
+Arg  wargs[2];
+XtSetArg(wargs[0],XtNx,px);  
+XtSetArg(wargs[1],XtNy,py);  
+XtSetValues(this->sdw, wargs, 2);
+*/
+XtMoveWidget(sdw, px, py);
+
+return;
+} 
+
+/* --Methode-- */
+void PIWdgX::SetBinding(bool left, bool top, bool right, bool bottom)
+{
+Arg  wargs[3];
+int n=0;
+if (!sdw)  return;
+if (!parent)  return;
+
+if (left) 
+  {
+  n = 0;
+  XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_FORM);  n++;
+  XtSetArg(wargs[n],XmNleftOffset, XPos() );  n++;
+  XtSetValues(this->sdw, wargs, n);
+  }
+else 
+  {
+  n = 0;
+  XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_NONE);  n++;
+  XtSetValues(this->sdw, wargs, n);
+  }  
+
+if (top)
+  {
+  n = 0;
+  XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_FORM);  n++;
+  XtSetArg(wargs[n],XmNtopOffset, YPos() );  n++;
+  XtSetValues(this->sdw, wargs, n);
+  }
+else 
+  {
+  n = 0;
+  XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_NONE);  n++;
+  XtSetValues(this->sdw, wargs, n);
+  }
+  
+if (right) 
+  {
+  n = 0;
+  XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_FORM);  n++;
+  XtSetArg(wargs[n],XmNrightOffset, parent->XSize()-(XSize()+XPos()) );  n++;
+  XtSetValues(this->sdw, wargs, n);
+  }
+else 
+  {
+  n = 0;
+  XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_NONE);  n++;
+  XtSetValues(this->sdw, wargs, n);
+  }  
+
+if (right) 
+  {
+  n = 0;
+  XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_FORM);  n++;
+  XtSetArg(wargs[n],XmNrightOffset, parent->XSize()-(XSize()+XPos()) );  n++;
+  XtSetValues(this->sdw, wargs, n);
+  }
+else 
+  {
+  n = 0;
+  XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_NONE);  n++;
+  XtSetValues(this->sdw, wargs, n);
+  }  
+
+if (bottom) 
+  {
+  n = 0;
+  XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_FORM);  n++;
+  XtSetArg(wargs[n],XmNbottomOffset, parent->YSize()-(YSize()+YPos()) );  n++;
+  XtSetValues(this->sdw, wargs, n);
+  }
+else 
+  {
+  n = 0;
+  XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_NONE);  n++;
+  XtSetValues(this->sdw, wargs, n);
+  }  
+
+return;
+}
+
+
+/* --Methode-- */
+void PIWdgX::SetBorderWidth(int bw)
+{
+if (!sdw)  return;
 
 Arg  wargs[2];
 int n=0;
-XtSetArg(wargs[n],XtNwidth,sx);  n++;
-XtSetArg(wargs[n],XtNheight,sy);  n++;
-XtSetValues(this->sdw, wargs, n);
-
-return;
-} 
-
-/* --Methode-- */
-void PIWdgX::SetPos(int px, int py)
-{
-if (!sdw)  return;
-
-Arg  wargs[2];
-int n=0;
-
-XtSetArg(wargs[n],XtNx,px);  n++;
-XtSetArg(wargs[n],XtNy,py);  n++;
-
-XtSetValues(this->sdw, wargs, n);
-return;
-} 
-
-/* --Methode-- */
-void PIWdgX::SetBinding(bool left, bool top, bool right, bool bottom)
-{
-Arg  wargs[3];
-int n=0;
-if (!sdw)  return;
-if (!parent)  return;
-
-if (left) 
-  {
-  n = 0;
-  XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_FORM);  n++;
-  XtSetArg(wargs[n],XmNleftOffset, XPos() );  n++;
-  XtSetValues(this->sdw, wargs, n);
-  }
-else 
-  {
-  n = 0;
-  XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_NONE);  n++;
-  XtSetValues(this->sdw, wargs, n);
-  }  
-
-if (top)
-  {
-  n = 0;
-  XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_FORM);  n++;
-  XtSetArg(wargs[n],XmNtopOffset, YPos() );  n++;
-  XtSetValues(this->sdw, wargs, n);
-  }
-else 
-  {
-  n = 0;
-  XtSetArg(wargs[n],XmNtopAttachment, XmATTACH_NONE);  n++;
-  XtSetValues(this->sdw, wargs, n);
-  }
-  
-if (right) 
-  {
-  n = 0;
-  XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_FORM);  n++;
-  XtSetArg(wargs[n],XmNrightOffset, parent->XSize()-(XSize()+XPos()) );  n++;
-  XtSetValues(this->sdw, wargs, n);
-  }
-else 
-  {
-  n = 0;
-  XtSetArg(wargs[n],XmNleftAttachment, XmATTACH_NONE);  n++;
-  XtSetValues(this->sdw, wargs, n);
-  }  
-
-if (right) 
-  {
-  n = 0;
-  XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_FORM);  n++;
-  XtSetArg(wargs[n],XmNrightOffset, parent->XSize()-(XSize()+XPos()) );  n++;
-  XtSetValues(this->sdw, wargs, n);
-  }
-else 
-  {
-  n = 0;
-  XtSetArg(wargs[n],XmNrightAttachment, XmATTACH_NONE);  n++;
-  XtSetValues(this->sdw, wargs, n);
-  }  
-
-if (bottom) 
-  {
-  n = 0;
-  XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_FORM);  n++;
-  XtSetArg(wargs[n],XmNbottomOffset, parent->YSize()-(YSize()+YPos()) );  n++;
-  XtSetValues(this->sdw, wargs, n);
-  }
-else 
-  {
-  n = 0;
-  XtSetArg(wargs[n],XmNbottomAttachment, XmATTACH_NONE);  n++;
-  XtSetValues(this->sdw, wargs, n);
-  }  
-
-return;
-}
-
-
-/* --Methode-- */
-void PIWdgX::SetBorderWidth(int bw)
-{
-if (!sdw)  return;
-
-Arg  wargs[2];
-int n=0;
-if (!sdw)  return;
 
 XtSetArg(wargs[n],XtNborderWidth,bw);  n++;
@@ -339,4 +339,16 @@
 if (!sdw)  return(-1);
 else return((int)this->sdw->core.y);
+}
+
+
+/* --Methode-- */
+int PIWdgX::BorderWidth()
+{
+if (!sdw)  return(-1);
+Arg  wargs[2];
+int bw;
+XtSetArg(wargs[0],XtNborderWidth, &bw);  
+XtGetValues(this->sdw, wargs, 1);
+return(bw);
 }
 
Index: /trunk/SophyaPI/PI/piwdgx.h
===================================================================
--- /trunk/SophyaPI/PI/piwdgx.h	(revision 6)
+++ /trunk/SophyaPI/PI/piwdgx.h	(revision 7)
@@ -47,4 +47,5 @@
   virtual int    XPos();
   virtual int    YPos();
+  virtual int    BorderWidth();
 
   virtual string Nom()  { return mNom; }
