Changeset 1899 in Sophya for trunk/SophyaPI/PI/pigraphx.cc


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

Fin implementation trace texte vertical (PIGraphX, PIGraphPS, PSFile)
Debut de modification de gestion des Drawer (AutoDeleteOndetach, ...)

Reza 13/02/2002

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/pigraphx.cc

    r1898 r1899  
    1414
    1515/*  Variables globales pour modifier les GC  */
    16 #define NMAXCOL  24
     16#define NMAXCOL  32
    1717static  PIXColor colpix[NMAXCOL];
    1818
     
    491491  }
    492492  XPutImage(dsx, pxm2, gcbm, ximg2, 0, 0, 0, 0, fh, sw);
     493  GC gcvis;
    493494  GC gcvs = XCreateGC (dsx, mWId, GCFunction | GCPlaneMask, &xgv);
    494495  XCopyGC(dsx, DefGC(), ~0, gcvs);
    495496  XSetStipple(dsx, gcvs, pxm2);
    496497  XSetFillStyle(dsx, gcvs, FillStippled);
     498  if (imgs) {
     499    gcvis = XCreateGC (dsx, mWId, GCFunction | GCPlaneMask, &xgv);
     500    XCopyGC(dsx, DefGC(), ~0, gcvis);
     501    if (mBCol == PI_ColorFromMap)  XSetForeground(mDisp, gcvis, mBCfMap);
     502    else  XSetForeground(mDisp, gcvis, colpix[mBCol]);
     503  }
    497504  if (fgdown) {
    498     XSetTSOrigin(dsx, gcvs, x, y);
    499     XFillRectangle(dsx, mWId, gcvs, x, y, fh, sw);
     505    XSetTSOrigin(dsx, gcvs, x-fdes, y);
     506    if (imgs)  XFillRectangle(dsx, mWId, gcvis, x-fdes, y, fh, sw);
     507    XFillRectangle(dsx, mWId, gcvs, x-fdes, y, fh, sw);
    500508  }
    501509  else {
    502     XSetTSOrigin(dsx, gcvs, x-fh, y-sw);
    503     XFillRectangle(dsx, mWId, gcvs, x-fh, y-sw, fh, sw);
     510    XSetTSOrigin(dsx, gcvs, x-fasc, y-sw);
     511    if (imgs) XFillRectangle(dsx, mWId, gcvis, x-fasc, y-sw, fh, sw);
     512    XFillRectangle(dsx, mWId, gcvs, x-fasc, y-sw, fh, sw);
    504513  }
    505514  // Cleaning 
    506515  XDestroyImage(ximg);
    507516  XDestroyImage(ximg2);
     517  XFreeGC(dsx, gcbm);
    508518  XFreeGC(dsx, gcvs);
    509   XFreeGC(dsx, gcbm);
     519  if (imgs) XFreeGC(dsx, gcvis);
    510520  XFreePixmap(dsx, pxm);                             
    511521  XFreePixmap(dsx, pxm2);                           
     
    517527void PIGraphicX::SelForeground(PIColors col)
    518528{
     529if (myLockFCol)  return;
    519530if (col == mFCol)  return;
    520531if ( (col < 0) || (col >= NMAXCOL))  return;
     
    537548void PIGraphicX::SelForeground(PIColorMap& cmap, int cid)
    538549{
     550if (myLockFCol)  return;
    539551SelectFCol(cmap.Color(cid));
    540552}
     
    849861  colpix[PI_DarkViolet] = mycol.pixel;
    850862
     863mycol.red = 0;
     864mycol.blue = 65000;
     865mycol.green = 45000;
     866if ( XAllocColor (mdsp, cmap, &mycol) )  colpix[PI_HighlightBlue] = mycol.pixel;
    851867
    852868/*  le GC pour DrawPixmap  */
Note: See TracChangeset for help on using the changeset viewer.