Changeset 1898 in Sophya


Ignore:
Timestamp:
Feb 12, 2002, 4:15:48 PM (24 years ago)
Author:
ansari
Message:

Implementation trace texte en vertical pour PIGraphicX11 - Reza 12/2/2002

Location:
trunk/SophyaPI/PI
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/Tests/pist.cc

    r1896 r1898  
    4848                         int sx=10, int sy=10, int px=0, int py=0);
    4949  virtual         ~StringPosDrawWdg();
     50  inline void     SetTextDirection(PIGrTextDirection txtdir) { mTxtDir = txtdir; }
    5051
    5152// Traitement des evenements   
     
    5455
    5556protected:
     57  PIGrTextDirection mTxtDir; 
    5658};
    5759
     
    6567                                    int sx=10, int sy=10, int px=0, int py=0);
    6668  virtual         ~CompStringDrawWdg();
    67 
    6869// Traitement des evenements   
    6970//  virtual void   Resize();
     
    274275
    275276{
     277  mTxtDir = PI_TextDirectionHorizontal;
    276278}
    277279
     
    331333char * s1;
    332334
     335if (mTxtDir != PI_TextDirectionHorizontal) {
     336  xpos = 50;  ypos = 350;
     337  s1 = "V_Top-H_Left-TxDUp";
     338  g->SelForeground(PI_Red);
     339  g->DrawLine(xpos-10, ypos, xpos+10, ypos);
     340  g->DrawLine(xpos, ypos-50, xpos, ypos+50);
     341  g->SelForeground(PI_Black);
     342  g->DrawString(xpos, ypos, s1,
     343                PI_HorizontalLeft|PI_VerticalTop|PI_TextDirectionVerticalUp); 
     344
     345  xpos = 100;  ypos = 300;
     346  s1 = "V_Top-H_Center-TxDUp";
     347  g->SelForeground(PI_Red);
     348  g->DrawLine(xpos-10, ypos, xpos+10, ypos);
     349  g->DrawLine(xpos, ypos-50, xpos, ypos+50);
     350  g->SelForeground(PI_Black);
     351  g->DrawString(xpos, ypos, s1,
     352                PI_HorizontalCenter|PI_VerticalTop|PI_TextDirectionVerticalUp);
     353
     354  xpos = 150;  ypos = 250;
     355  s1 = "V_Top-H_Right-TxDUp";
     356  g->SelForeground(PI_Red);
     357  g->DrawLine(xpos-10, ypos, xpos+10, ypos);
     358  g->DrawLine(xpos, ypos-50, xpos, ypos+50);
     359  g->SelForeground(PI_Black);
     360  g->DrawString(xpos, ypos, s1,
     361                PI_HorizontalRight|PI_VerticalTop|PI_TextDirectionVerticalUp);
     362
     363  xpos = 200;  ypos = 50;
     364  s1 = "V_Top-H_Left-TxDown";
     365  g->SelForeground(PI_Red);
     366  g->DrawLine(xpos-10, ypos, xpos+10, ypos);
     367  g->DrawLine(xpos, ypos-50, xpos, ypos+50);
     368  g->SelForeground(PI_Black);
     369  g->DrawString(xpos, ypos, s1,
     370                PI_HorizontalLeft|PI_VerticalTop|PI_TextDirectionVerticalDown); 
     371
     372  xpos = 250;  ypos = 100;
     373  s1 = "V_Top-H_Center-TxDown";
     374  g->SelForeground(PI_Red);
     375  g->DrawLine(xpos-10, ypos, xpos+10, ypos);
     376  g->DrawLine(xpos, ypos-50, xpos, ypos+50);
     377  g->SelForeground(PI_Black);
     378  g->DrawString(xpos, ypos, s1,
     379                PI_HorizontalCenter|PI_VerticalTop|PI_TextDirectionVerticalDown);
     380
     381  xpos = 300;  ypos = 150;
     382  s1 = "V_Top-H_Right-TxDown";
     383  g->SelForeground(PI_Red);
     384  g->DrawLine(xpos-10, ypos, xpos+10, ypos);
     385  g->DrawLine(xpos, ypos-50, xpos, ypos+50);
     386  g->SelForeground(PI_Black);
     387  g->DrawString(xpos, ypos, s1,
     388                PI_HorizontalRight|PI_VerticalTop|PI_TextDirectionVerticalDown);
     389
     390  return;
     391}
    333392// --------------- Vertical Top -----------------
    334393
     
    350409
    351410xpos = XSize()-30;  ypos = 75;
    352 s1 = "V_Top-H_Center";
     411s1 = "V_Top-H_Right";
    353412g->SelForeground(PI_Red);
    354413g->DrawLine(xpos-50, ypos, xpos+50, ypos);
     
    663722m[0]->AppendItem("StringPosDrawWdg", 10102);
    664723m[0]->AppendItem("CompStringDrawWdg", 10103);
     724m[0]->AppendItem("StringPosVertical", 10104);
     725
    665726m[0]->AppendItem("->eps", 10111);
    666727m[0]->AppendItem("->ps", 10112);
     
    751812      wp->SetAutoDelChilds(true);
    752813      CompStringDrawWdg* exb  = new CompStringDrawWdg(wp, "compposdrawwdg", 600, 400, 0, 0);
     814      exb->SetBinding(PIBK_fixed,PIBK_elastic,PIBK_elastic,PIBK_elastic);
     815      wp->SetUserData(exb);
     816      wp->Show();
     817      }
     818    break;
     819
     820    case 10104: // Creation d'un StringPosDrawWdg-VerticalStringDir
     821      {
     822      nbwin++;
     823      sprintf(strg, "Creation StringPosDrawWdg-Vertical   \n Fenetre No %d ", nbwin);
     824      sprintf(strg,"StringPosDrawWdg-Vertical - %d", nbwin);
     825      PIWindow* wp = new PIWindow(this, strg, PIWK_normal,  400, 600, 150, 150);
     826      wp->SetAutoDelChilds(true);
     827      StringPosDrawWdg* exb  = new StringPosDrawWdg(wp, "sposdrawwdgvert", 400, 600, 0, 0);
     828      exb->SetTextDirection(PI_TextDirectionVerticalUp);
    753829      exb->SetBinding(PIBK_fixed,PIBK_elastic,PIBK_elastic,PIBK_elastic);
    754830      wp->SetUserData(exb);
  • trunk/SophyaPI/PI/pigraphgen.cc

    r1897 r1898  
    172172//--
    173173//++
    174 // void  DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0)
     174// void  DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0)
    175175//      Trace la chaîne de caractères "s" à la position "x,y",
    176176//      en utilisant la couleur d'avant-plan (Foreground)
     
    194194void
    195195PIGraphicGen::DrawCompString(PIGrCoord x, PIGrCoord y, const char* s,
    196                              const char* s_up, const char* s_dn, int pos)
     196                             const char* s_up, const char* s_dn, unsigned long pos)
    197197{
    198198  if ((s_up == NULL) && (s_dn == NULL)) {
     
    567567
    568568/* --Methode-- */
    569 bool PIGraphicGen::CalcStringPositionShift(char const* s, int pos,
     569bool PIGraphicGen::CalcStringPositionShift(char const* s, unsigned long pos,
    570570                                           int& dx, int& dy)
    571571{
  • trunk/SophyaPI/PI/pigraphgen.h

    r1893 r1898  
    5151       PI_VerticalCenter = 0x30, PI_VerticalTop = 0x40,
    5252       PI_VerticalPosition = 0xF0 };
     53
     54// Orientation de trace de chaines
     55enum PIGrTextDirection 
     56     { PI_TextDirectionHorizontal = 0,
     57       PI_TextDirectionVerticalUp = 0x100,
     58       PI_TextDirectionVerticalDown = 0x200,
     59       PI_TextDirection = 0xF00};
    5360
    5461// Les differents modes de trace graphique disponible
     
    154161  virtual void       Erase(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy)     = 0;
    155162
    156   virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0)        = 0;
    157   virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0) = 0;
     163  virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0) = 0;
     164  virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0) = 0;
    158165  virtual void       DrawCompString(PIGrCoord x, PIGrCoord y, const char* s,
    159                                     const char* s_up, const char* s_dn, int pos = 0);
     166                                    const char* s_up, const char* s_dn, unsigned long pos = 0);
    160167
    161168  virtual void       DrawLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2)  = 0;
     
    217224  virtual PIGrCoord  GetFontHeight(PIGrCoord& asc, PIGrCoord& desc);
    218225  virtual PIGrCoord  CalcStringWidth(char const* s);
    219   virtual bool       CalcStringPositionShift(char const* s, int pos, 
     226  virtual bool       CalcStringPositionShift(char const* s, unsigned long pos, 
    220227                                             int& dx, int& dy);
    221228
  • trunk/SophyaPI/PI/pigraphps.cc

    r1890 r1898  
    112112
    113113/* --Methode-- */
    114 void PIGraphicPS::DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos)
     114void PIGraphicPS::DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos)
    115115{
    116116if(mPSOut) {
     
    128128
    129129/* --Methode-- */
    130 void PIGraphicPS::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos)
     130void PIGraphicPS::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos)
    131131{
    132132if(mPSOut) {
  • trunk/SophyaPI/PI/pigraphps.h

    r1890 r1898  
    2121//  Trace graphiques
    2222  virtual void       Erase(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy);
    23   virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0);
    24   virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0);
     23  virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0);
     24  virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0);
    2525  virtual void       DrawLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2);
    2626  virtual void       DrawBox(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy);
  • trunk/SophyaPI/PI/pigraphuc.cc

    r1890 r1898  
    392392
    393393/* --Methode-- */
    394 void PIGraphicUC::DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos)
     394void PIGraphicUC::DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos)
    395395{
    396396  if (!mGrC) return;
     
    401401
    402402/* --Methode-- */
    403 void PIGraphicUC::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos)
     403void PIGraphicUC::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos)
    404404{
    405405  if (!mGrC) return;
     
    411411/* --Methode-- */
    412412void PIGraphicUC::DrawCompString(PIGrCoord x, PIGrCoord y, const char* s,
    413                                  const char* s_up, const char* s_dn, int pos)
     413                                 const char* s_up, const char* s_dn, unsigned long pos)
    414414{
    415415  if (!mGrC) return;
  • trunk/SophyaPI/PI/pigraphuc.h

    r1890 r1898  
    4343//  Trace graphiques
    4444  virtual void       Erase(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy);
    45   virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0);
    46   virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0);
     45  virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0);
     46  virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0);
    4747  virtual void       DrawCompString(PIGrCoord x, PIGrCoord y, const char* s,
    48                                     const char* s_up, const char* s_dn, int pos = 0);
     48                                    const char* s_up, const char* s_dn, unsigned long pos = 0);
    4949  virtual void       DrawLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2);
    5050  virtual void       DrawBox(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy);
  • trunk/SophyaPI/PI/pigraphx.cc

    r1897 r1898  
    88#include <X11/Intrinsic.h>
    99#include <X11/StringDefs.h>
     10#include <X11/Xutil.h>
    1011
    1112#include "pigraphx.h"
     
    108109
    109110/* --Methode-- */
    110 void PIGraphicX::DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos)
     111void PIGraphicX::DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos)
    111112{
    112113int dx, dy, xi, yi;
    113114xi = x;  yi = y;
    114 if (CalcStringPositionShift(s, pos, dx, dy)) {
    115   xi -= dx;  yi -= dy; }
    116 XDrawString (XtDisplay (MyWdg()),mWId,
    117                   DefGC(), xi, yi, s, strlen(s));
    118 return;
    119 }
    120 
    121 /* --Methode-- */
    122 void PIGraphicX::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos)
     115bool fgcsps = CalcStringPositionShift(s, pos, dx, dy);
     116unsigned long txtdir = pos&PI_TextDirection;
     117if (txtdir == PI_TextDirectionHorizontal) {
     118  if (fgcsps) { xi -= dx;  yi -= dy; }
     119  XDrawString (mDisp, mWId, DefGC(), xi, yi, s, strlen(s));
     120}
     121else {
     122  if (txtdir == PI_TextDirectionVerticalDown) { xi += dy; yi -= dx; }
     123  else {   xi -= dy; yi += dx; }
     124  DrawVerticalString(xi, yi, s, txtdir, false);
     125}
     126return;
     127}
     128
     129/* --Methode-- */
     130void PIGraphicX::DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos)
    123131{
    124132int dx, dy, xi, yi;
    125133xi = x;  yi = y;
    126 if (CalcStringPositionShift(s, pos, dx, dy)) {
    127   xi -= dx;  yi -= dy; }
    128 XDrawImageString (XtDisplay (MyWdg()),mWId,
    129                   DefGC(), xi, yi, s, strlen(s));
     134bool fgcsps = CalcStringPositionShift(s, pos, dx, dy);
     135unsigned long txtdir = pos&PI_TextDirection;
     136if (txtdir == PI_TextDirectionHorizontal) {
     137  if (fgcsps) { xi -= dx;  yi -= dy; }
     138  XDrawImageString (mDisp, mWId, DefGC(), xi, yi, s, strlen(s));
     139}
     140else {
     141  if (txtdir == PI_TextDirectionVerticalDown) { xi += dy; yi -= dx; }
     142  else {   xi -= dy; yi += dx; }
     143  DrawVerticalString(xi, yi, s, txtdir, true);
     144}
    130145return;
    131146}
     
    135150void PIGraphicX::DrawLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2)
    136151{
    137 XDrawLine(XtDisplay (MyWdg()), mWId, DefGC(), (int)x1, (int)y1, (int)x2, (int)y2);
     152XDrawLine(mDisp, mWId, DefGC(), (int)x1, (int)y1, (int)x2, (int)y2);
    138153return;
    139154}
     
    149164if (idx < 0)  { ix0 += idx;  idx = -idx; }
    150165if (idy < 0)  { iy0 += idy;  idy = -idy; }
    151 XDrawRectangle(XtDisplay (MyWdg()), mWId,
     166XDrawRectangle(mDisp, mWId,
    152167               DefGC(), ix0, iy0, idx, idy);
    153168return;
     
    163178if (idx < 0)  { ix0 += idx;  idx = -idx; }
    164179if (idy < 0)  { iy0 += idy;  idy = -idy; }
    165 XFillRectangle(XtDisplay (MyWdg()), mWId,
     180XFillRectangle(mDisp, mWId,
    166181               DefGC(), ix0, iy0, idx, idy);
    167182return;
     
    171186void PIGraphicX::DrawCircle(PIGrCoord x0, PIGrCoord y0, PIGrCoord r)
    172187{
    173 XDrawArc(XtDisplay (MyWdg()), mWId, DefGC(),
     188XDrawArc(mDisp, mWId, DefGC(),
    174189         (int)x0-(int)r, (int)y0-(int)r, 2*(int)r, 2*(int)r, 0, 360*64);
    175190return;
     
    179194void PIGraphicX::DrawFCircle(PIGrCoord x0, PIGrCoord y0, PIGrCoord r)
    180195{
    181 XFillArc(XtDisplay (MyWdg()), mWId, DefGC(),
     196XFillArc(mDisp, mWId, DefGC(),
    182197         (int)x0-(int)r, (int)y0-(int)r, 2*(int)r, 2*(int)r, 0, 360*64);
    183198return;
     
    187202void PIGraphicX::DrawOval(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy)
    188203{
    189 XDrawArc(XtDisplay (MyWdg()), mWId, DefGC(),
     204XDrawArc(mDisp, mWId, DefGC(),
    190205         (int)x0, (int)y0, (int)dx, (int)dy, 0, 360*64);
    191206return;
     
    195210void PIGraphicX::DrawFOval(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy)
    196211{
    197 XFillArc(XtDisplay (MyWdg()), mWId, DefGC(),
     212XFillArc(mDisp, mWId, DefGC(),
    198213         (int)x0, (int)y0, (int)dx, (int)dy, 0, 360*64);
    199214return;
     
    236251int mode = CoordModeOrigin;
    237252if (cinc) mode =  CoordModePrevious;
    238 XFillPolygon(XtDisplay (MyWdg()), mWId, DefGC(), pxp, n,
     253XFillPolygon(mDisp, mWId, DefGC(), pxp, n,
    239254                        Complex, mode);
    240255if (n > NMXXPOINTS)  delete[] pxp;
     
    248263                         double degdeb, double degfin)
    249264{
    250 XDrawArc(XtDisplay (MyWdg()), mWId, DefGC(),
     265XDrawArc(mDisp, mWId, DefGC(),
    251266         (int)x0, (int)y0, (int)dx, (int)dy, (int)(degdeb*64.), (int)(degfin*64.));
    252267return;
     
    257272                         double degdeb, double degfin)
    258273{
    259 XFillArc(XtDisplay (MyWdg()), mWId, DefGC(),
     274XFillArc(mDisp, mWId, DefGC(),
    260275         (int)x0, (int)y0, (int)dx, (int)dy, (int)(degdeb*64.), (int)(degfin*64.));
    261276return;
     
    284299      x1 = (float)x0-hmsz;   y1 = y0;
    285300      x2 = (float)x0+dmsz;   y2 = y1;
    286       XDrawLine(XtDisplay (MyWdg()), mWId, mMrkGC, x1, y1, x2, y2);
     301      XDrawLine(mDisp, mWId, mMrkGC, x1, y1, x2, y2);
    287302      x1 = x0;  y1 = (float)y0-hmsz;
    288303      x2 = x1;  y2 = (float)y0+dmsz;
    289       XDrawLine(XtDisplay (MyWdg()), mWId, mMrkGC, x1, y1, x2, y2);
     304      XDrawLine(mDisp, mWId, mMrkGC, x1, y1, x2, y2);
    290305      break;
    291306    case  PI_CrossMarker :
    292307      x1 = (float)x0-hmsz;   y1 = (float)y0-hmsz;
    293308      x2 = (float)x0+dmsz;   y2 = (float)y0+dmsz;
    294       XDrawLine(XtDisplay (MyWdg()), mWId, mMrkGC, x1, y1, x2, y2);
    295       XDrawLine(XtDisplay (MyWdg()), mWId, mMrkGC, x1, y2, x2, y1);
     309      XDrawLine(mDisp, mWId, mMrkGC, x1, y1, x2, y2);
     310      XDrawLine(mDisp, mWId, mMrkGC, x1, y2, x2, y1);
    296311      break; 
    297312    case PI_CircleMarker :
     
    300315      x1 = (int)x0-r;  y1 = (int)y0-r;
    301316      if (mMrk == PI_CircleMarker)
    302         XDrawArc(XtDisplay (MyWdg()), mWId, mMrkGC, x1, y1, 2*r, 2*r, 0, 360*64);
    303       else XFillArc(XtDisplay (MyWdg()), mWId, mMrkGC, x1, y1, 2*r, 2*r, 0, 360*64);
     317        XDrawArc(mDisp, mWId, mMrkGC, x1, y1, 2*r, 2*r, 0, 360*64);
     318      else XFillArc(mDisp, mWId, mMrkGC, x1, y1, 2*r, 2*r, 0, 360*64);
    304319      break;
    305320    case PI_BoxMarker :
     
    432447int mode = CoordModeOrigin;
    433448if (cinc) mode =  CoordModePrevious;
    434 XFillPolygon(XtDisplay (MyWdg()), mWId, mMrkGC, pxp, n,
     449XFillPolygon(mDisp, mWId, mMrkGC, pxp, n,
    435450                        Complex, mode);
    436451return;
     
    438453
    439454
     455/* --Methode-- */
     456void PIGraphicX::DrawVerticalString(int x, int y, const char* s, unsigned long pos, bool imgs)
     457{
     458  int fh, fasc, fdes;
     459  fh = GetFont().GetFontHeight(fasc, fdes);
     460  int sw = GetFont().GetStringWidth(s);
     461
     462  Display * dsx = mDisp;
     463  Window rw = DefaultRootWindow(dsx);
     464  Pixmap pxm = XCreatePixmap(dsx, rw, sw, fh, 1 );
     465
     466  XGCValues  xgv;
     467  xgv.function = GXcopy;
     468  xgv.plane_mask = ~0;
     469  GC gcbm = XCreateGC (dsx, pxm, GCFunction | GCPlaneMask, &xgv);
     470  XSetForeground(dsx, gcbm, ~0);
     471  XSetBackground(dsx, gcbm, 0);
     472  XSetFont(mDisp, gcbm, myFont.GetXFontId());
     473 
     474  XDrawImageString (dsx, pxm, gcbm, 0, fasc, s, strlen(s));
     475  XImage* ximg = XGetImage(dsx, pxm, 0, 0, sw, fh, 0xFFFFFFFF, ZPixmap);
     476
     477  Pixmap pxm2 = XCreatePixmap(dsx, rw, fh, sw, 1 );
     478  XImage* ximg2 =  XGetImage(dsx, pxm2, 0, 0, fh, sw, 0xFFFFFFFF, ZPixmap);
     479  //  On recopie de ximg -> ximg2 en echangeant x,y
     480  int i,j;
     481  bool fgdown = ((pos&PI_TextDirection) == PI_TextDirectionVerticalDown);
     482  if (fgdown) {
     483    for(i=0; i<sw; i++)
     484      for(j=0; j<fh; j++)
     485        XPutPixel(ximg2, fh-j-1, i, XGetPixel(ximg, i, j));
     486  }
     487  else {
     488    for(i=0; i<sw; i++)
     489      for(j=0; j<fh; j++)
     490        XPutPixel(ximg2, j, sw-i-1, XGetPixel(ximg, i, j));
     491  }
     492  XPutImage(dsx, pxm2, gcbm, ximg2, 0, 0, 0, 0, fh, sw);
     493  GC gcvs = XCreateGC (dsx, mWId, GCFunction | GCPlaneMask, &xgv);
     494  XCopyGC(dsx, DefGC(), ~0, gcvs);
     495  XSetStipple(dsx, gcvs, pxm2);
     496  XSetFillStyle(dsx, gcvs, FillStippled);
     497  if (fgdown) {
     498    XSetTSOrigin(dsx, gcvs, x, y);
     499    XFillRectangle(dsx, mWId, gcvs, x, y, fh, sw);
     500  }
     501  else {
     502    XSetTSOrigin(dsx, gcvs, x-fh, y-sw);
     503    XFillRectangle(dsx, mWId, gcvs, x-fh, y-sw, fh, sw);
     504  }
     505  // Cleaning 
     506  XDestroyImage(ximg);
     507  XDestroyImage(ximg2);
     508  XFreeGC(dsx, gcvs);
     509  XFreeGC(dsx, gcbm);
     510  XFreePixmap(dsx, pxm);                             
     511  XFreePixmap(dsx, pxm2);                           
     512 
     513}
    440514
    441515
  • trunk/SophyaPI/PI/pigraphx.h

    r1897 r1898  
    2121//  Trace graphiques
    2222  virtual void       Erase(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy);
    23   virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0);
    24   virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, int pos = 0);
     23  virtual void       DrawString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0);
     24  virtual void       DrawOpaqueString(PIGrCoord x, PIGrCoord y, const char* s, unsigned long pos = 0);
    2525  virtual void       DrawLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2);
    2626  virtual void       DrawBox(PIGrCoord x0, PIGrCoord y0, PIGrCoord dx, PIGrCoord dy);
     
    9494  void           MrkDrawPolygon(XPoint* pxp, int n, bool cinc);
    9595  void           MrkDrawFPolygon(XPoint* pxp, int n, bool cinc);
     96  void           DrawVerticalString(int x, int y, const char* s, unsigned long pos, bool imgs=false);
    9697
    9798//  Structure et identificateur XWindow  associe
  • trunk/SophyaPI/PI/psfile.cc

    r1893 r1898  
    877877                           PIFontAtt FontAtt,
    878878                           int FontSize,
    879                            int pos) {
     879                           unsigned long pos) {
    880880    bool change = false;
    881881
  • trunk/SophyaPI/PI/psfile.h

    r1887 r1898  
    116116                               PIFontAtt FontAtt   = PI_NotDefFontAtt,
    117117                               int FontSize        = 8,
    118                                int pos = 0);
     118                               unsigned long pos = 0);
    119119    virtual void  DrawLine    (double x1, double y1, double x2, double y2,
    120120                               PIColors DrawColor  = PI_NotDefColor,
Note: See TracChangeset for help on using the changeset viewer.