Changeset 1640 in Sophya for trunk


Ignore:
Timestamp:
Aug 16, 2001, 2:16:42 PM (24 years ago)
Author:
ansari
Message:

1/ Correction gestion des attributs graphiques ds PIElDrawer::Draw()
2/ Ajout de 4 couleurs violettes (picolist.h pigraphx.cc pidrwtools.cc

et psfile.cc)

3/ Methode PIImage::BaseDrawer() alias de MyElDrawer()
4/ Gestion de copie/Coller avec plusieurs lignes ds PIConsole

Reza 16/8/2001

Location:
trunk/SophyaPI/PI
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/picolist.h

    r1034 r1640  
    1515                 PI_Orange = 11, PI_SiennaRed = 12, PI_Purple = 13, 
    1616                 PI_LimeGreen = 14, PI_Gold = 15,
    17                  PI_ColorAllBits0 = 16, PI_ColorAllBits1 = 17 };
     17                 PI_Violet = 16, PI_VioletRed = 17,
     18                 PI_BlueViolet = 18, PI_DarkViolet = 19,
     19                 PI_ColorAllBits0 = 19, PI_ColorAllBits1 = 20 };
    1820
    1921#endif
  • trunk/SophyaPI/PI/picons.cc

    r1264 r1640  
    461461    case PIK_Return :   
    462462    case PIK_Enter :
    463       mCmdStr[mCLC] = '\0';
    464 //      printf("Keyb()-Debug- <CR/Enter> CmdStr= %s (L=%d)\n", mCmdStr, strlen(mCmdStr) );
    465 // Gestion de rappel des commandes
    466       if (mCLC > 0) {
    467         mRStr[mRCindx] = mCmdStr;
    468         mRCindx++;  mNComm++;
    469         if (mRCindx >= NMxRecall)  mRCindx = 0;
    470         mRindx = mRCindx;
    471         }
    472       mChangeFg = false;
    473       mCmd = mCmdStr;
    474       ClrCmd();
    475       Send( Msg(), PIMsg_OK, NULL);
     463      SendCmd();
    476464      break;
    477465
     
    583571int i;
    584572char *pc = (char *)pdata;
    585 for(i=0; i<l; i++) CmdAddChar(pc[i]);
     573for(i=0; i<l; i++) {
     574  if ((i > 0) && (pc[i] == '\n'))  SendCmd();
     575  else CmdAddChar(pc[i]);
     576}
    586577UpdCmdLine();
    587578}
     
    831822
    832823/* --Methode-- */
     824void PIConsole::SendCmd()
     825{
     826  mCmdStr[mCLC] = '\0';
     827  //      printf("Keyb()-Debug- <CR/Enter> CmdStr= %s (L=%d)\n", mCmdStr, strlen(mCmdStr) );
     828  // Gestion de rappel des commandes
     829  if (mCLC > 0) {
     830    mRStr[mRCindx] = mCmdStr;
     831    mRCindx++;  mNComm++;
     832    if (mRCindx >= NMxRecall)  mRCindx = 0;
     833    mRindx = mRCindx;
     834  }
     835  mChangeFg = false;
     836  mCmd = mCmdStr;
     837  ClrCmd();
     838  Send( Msg(), PIMsg_OK, NULL);
     839  return;
     840}
     841
     842/* --Methode-- */
    833843void PIConsole::CmdAddChar(int key)
    834844{
  • trunk/SophyaPI/PI/picons.h

    r329 r1640  
    7171          void       UpdCmdLine();
    7272          void       ClrCmd();
     73          void       SendCmd();
    7374          void       CmdAddChar(int key);
    7475          void       SelFgBgCol(PIColors fc=PI_Black, PIColors bc=PI_White);
  • trunk/SophyaPI/PI/pidrawer.cc

    r1631 r1640  
    779779SelGraAtt(g);   // DrawAxes change certains attributs graphiques
    780780DrawAxes(g);   // Trace des axes
     781g->SelFont(PI_NormalSizeFont, mFAtt);
    781782SelGraAtt(g);   // DrawAxes change certains attributs graphiques
    782783
    783 if (mFSz == PI_NotDefFontSize) g->SelFont(PI_NormalSizeFont);
    784784// Trace des titres
    785785if ( (titleT.length() > 0) || (titleB.length() > 0) ) {
  • trunk/SophyaPI/PI/pidrwtools.cc

    r1592 r1640  
    134134mOpt[0]->AppendItem("LimeGreen", 115);
    135135mOpt[0]->AppendItem("Gold", 116);
     136mOpt[0]->AppendItem("Violet", 117);
     137mOpt[0]->AppendItem("VioletRed", 118);
     138mOpt[0]->AppendItem("BlueViolet", 119);
     139mOpt[0]->AppendItem("DarkViolet", 120);
    136140mOpt[0]->SetValue(100);
    137141mOpt[0]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
     
    295299
    296300//  Declaration des differents attributs graphiques
    297 static PIColors cols[17] = { PI_NotDefColor,
     301#define MYNMXCOLORS 21
     302static PIColors cols[MYNMXCOLORS] = { PI_NotDefColor,
    298303                     PI_Black, PI_White, PI_Grey,
    299304                     PI_Red, PI_Blue, PI_Green,
     
    301306                     PI_Cyan , PI_Turquoise, PI_NavyBlue,
    302307                     PI_Orange, PI_SiennaRed, PI_Purple,
    303                      PI_LimeGreen, PI_Gold };
     308                     PI_LimeGreen, PI_Gold, PI_Violet, PI_VioletRed,
     309                     PI_BlueViolet, PI_DarkViolet };
    304310
    305311static PIMarker mrk[12] = { PI_NotDefMarker, PI_DotMarker,
     
    360366int ii,jj,kk;
    361367PIColors fc = dr->GetFgColAtt();
    362 for(kk=0; kk<17; kk++)
     368for(kk=0; kk<MYNMXCOLORS; kk++)
    363369  if (fc == cols[kk])  { mOpt[0]->SetValue(100+kk);  break; }   
    364370CMapId cmi = dr->GetColMapId();
     
    406412  int k,ii,jj,kk;
    407413  k = mOpt[0]->GetValue()-100;
    408   if ( (k < 0) || (k > 16) )  k = 0;
     414  if ( (k < 0) || (k >= MYNMXCOLORS) )  k = 0;
    409415  drw->SetColAtt(cols[k]);
    410416  k = mOpt[1]->GetValue()-200;
  • trunk/SophyaPI/PI/pigraphx.cc

    r1034 r1640  
    1313
    1414/*  Variables globales pour modifier les GC  */
    15 #define NMAXCOL  18
     15#define NMAXCOL  24
    1616static  PIXColor colpix[NMAXCOL];
    1717
     
    699699if ( XAllocNamedColor (mdsp, cmap, "gold", &mycol, &exact) )
    700700  colpix[PI_Gold] = mycol.pixel;
     701if ( XAllocNamedColor (mdsp, cmap, "violet", &mycol, &exact) )
     702  colpix[PI_Violet] = mycol.pixel;
     703if ( XAllocNamedColor (mdsp, cmap, "VioletRed", &mycol, &exact) )
     704  colpix[PI_VioletRed] = mycol.pixel;
     705if ( XAllocNamedColor (mdsp, cmap, "BlueViolet", &mycol, &exact) )
     706  colpix[PI_BlueViolet] = mycol.pixel;
     707if ( XAllocNamedColor (mdsp, cmap, "DarkViolet", &mycol, &exact) )
     708  colpix[PI_DarkViolet] = mycol.pixel;
    701709
    702710
  • trunk/SophyaPI/PI/piimage.h

    r1503 r1640  
    8181
    8282  inline PIElDrawer* MyElDrawer() { return (mdrw); }
     83  inline PIElDrawer* BaseDrawer() { return (mdrw); }
    8384
    8485// Rafraichissement des widgets auxiliaires (zoom, ...)
  • trunk/SophyaPI/PI/psfile.cc

    r1592 r1640  
    5454  PI_Cyan, PI_Turquoise, PI_NavyBlue,\
    5555  PI_Orange, PI_SiennaRed, PI_Purple,\
    56   PI_LimeGreen, PI_Gold,\
     56  PI_LimeGreen, PI_Gold, PI_Violet, PI_VioletRed, PI_BlueViolet, PI_DarkViolet, \
    5757  \
    5858  PI_RomanFont, PI_BoldFont, PI_ItalicFont, PI_NotDefFontAtt,\
     
    8383/C%-2d  {0.195 0.800 0.195 setrgbcolor} bind def %% PI_LimeGreen\n\
    8484/C%-2d  {0.996 0.840 0.0   setrgbcolor} bind def %% PI_Gold\n\
     85/C%-2d  {0.933 0.510 0.933 setrgbcolor} bind def %% PI_Violet\n\
     86/C%-2d  {0.816 0.125 0.565 setrgbcolor} bind def %% PI_VioletRed\n\
     87/C%-2d  {0.541 0.167 0.886 setrgbcolor} bind def %% PI_BlueViolet\n\
     88/C%-2d  {0.580 0.000 0.827 setrgbcolor} bind def %% PI_DarkViolet\n\
    8589/F%-2d  {/Courier   findfont} bind def           %% PI_RomanFont\n\
    8690/F%-2d  {/Courier-Bold    findfont} bind def     %% PI_BoldFont\n\
Note: See TracChangeset for help on using the changeset viewer.