Changeset 138 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Aug 21, 1998, 7:56:08 PM (27 years ago)
Author:
ercodmgr
Message:

Nouvelles couleurs et correction petits bugs, Reza 21/08/98

Location:
trunk/SophyaPI/PI
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/Makefile

    r132 r138  
    8888$(OBJ)pifilechogen.o: pifilechogen.cc pifilechogen.h pisysdep.h piwdgx.h \
    8989 piwdggen.h pimsghandler.h
    90 $(OBJ)pifilechox.o: pifilechox.cc pisysdep.h pifilechox.h pifilechogen.h \
    91  piwdgx.h piwdggen.h pimsghandler.h piwindowx.h piwindowgen.h \
    92  picontainerx.h picontainergen.h
     90$(OBJ)pifilechox.o: pifilechox.cc pisysdep.h piapplx.h piapplgen.h \
     91 pimsghandler.h picontainerx.h picontainergen.h piwdgx.h piwdggen.h \
     92 pimenubarx.h pimenubargen.h pimenux.h pimenugen.h picons.h \
     93 pistdwdgx.h pistdwdggen.h pibwdgx.h pibwdggen.h picmap.h picmapx.h \
     94 picmapgen.h pigraphx.h pigraphgen.h pigraphuc.h psfile.h \
     95 $(EROSDEVREP)/Include/defs.h pigraphps.h pifilechox.h \
     96 pifilechogen.h piwindowx.h piwindowgen.h
    9397$(OBJ)pigraph3d.o: pigraph3d.cc pigraph3d.h pisysdep.h pigraphuc.h \
    9498 pigraphgen.h piwdgx.h piwdggen.h pimsghandler.h picmap.h picmapx.h \
     
    270274 picmap.h picmapx.h picmapgen.h pigraphx.h pigraphgen.h pigraphuc.h \
    271275 psfile.h
    272 $(OBJ)pistzwin.o: pistzwin.cc pistzwin.h pisysdep.h piwindowx.h \
    273  piwindowgen.h picontainerx.h picontainergen.h piwdgx.h piwdggen.h \
    274  pimsghandler.h psfile.h $(EROSDEVREP)/Include/defs.h pigraphgen.h \
    275  picmap.h picmapx.h picmapgen.h
     276$(OBJ)pistzwin.o: pistzwin.cc \
     277 /usr/local/lib/gcc-lib/alphaev56-dec-osf4.0d/2.8.1/include/stdio.h \
     278 pistzwin.h pisysdep.h piwindowx.h piwindowgen.h picontainerx.h \
     279 picontainergen.h piwdgx.h piwdggen.h pimsghandler.h piperiodx.h \
     280 $(EROSDEVREP)/Include/periodic.h $(EROSDEVREP)/Include/defs.h \
     281 psfile.h pigraphgen.h picmap.h picmapx.h picmapgen.h
    276282$(OBJ)pisurfdr.o: pisurfdr.cc pisurfdr.h parradapter.h \
    277283 $(EROSDEVREP)/Include/defs.h $(EROSDEVREP)/Include/machine.h \
  • trunk/SophyaPI/PI/parradapter.cc

    r129 r138  
    9797}
    9898
    99 printf(" -> vit=%d \n", vit);
     99// printf(" -> vit=%d \n", vit);
    100100for(int j=0; j<sY; j++)
    101101  for(int i=0; i<sX; i++)   {
  • trunk/SophyaPI/PI/piapplgen.h

    r128 r138  
    66#include PICONT_H
    77#include PIMENUBAR_H
     8#include "picons.h"
    89
    9 #include "picons.h"
    1010
    1111class PIApplicationGen : public PIMsgHandler {
  • trunk/SophyaPI/PI/piapplx.cc

    r136 r138  
    154154void PIApplicationX::SetReady()
    155155{
     156Display * mdsp = XtDisplay (topwdg->XtWdg());
    156157if (mState != kReadyState)
    157158  {
    158   Display * mdsp;
    159159  mState = kReadyState;
    160160  Menubar()->SetSensitive();
    161   mdsp = XtDisplay (topwdg->XtWdg());
    162161  XDefineCursor(mdsp, XtWindow(topwdg->XtWdg()), a_curs[0]);
    163   XFlush(mdsp);
    164   }
     162  }
     163XFlush(mdsp);
    165164}
    166165
     
    168167void PIApplicationX::SetBusy()
    169168{
     169Display * mdsp = XtDisplay (topwdg->XtWdg());
    170170if (mState != kBusyState)
    171171  {
    172   Display * mdsp;
    173172  mState = kBusyState;
    174173  Menubar()->SetSensitive();
    175   mdsp = XtDisplay (topwdg->XtWdg());
    176174//  if ( XtIsRealized(topwdg->XtWdg()) )
    177175  XDefineCursor(mdsp, XtWindow(topwdg->XtWdg()), a_curs[2]);
    178   XFlush(mdsp);
    179   }
    180 return;
     176  }
     177XFlush(mdsp);
    181178}
    182179
     
    184181void PIApplicationX::SetBlocked()
    185182{
     183Display * mdsp = XtDisplay (topwdg->XtWdg());
    186184if (mState != kBlockedState)
    187185  {
    188   Display * mdsp;
    189186  mState = kBlockedState;
    190187  Menubar()->SetUnSensitive();
    191   mdsp = XtDisplay (topwdg->XtWdg());
    192188  XDefineCursor(mdsp, XtWindow(topwdg->XtWdg()), a_curs[1]);
    193   XFlush(mdsp);
    194   }
     189  }
     190XFlush(mdsp);
     191return;
    195192}
    196193
  • trunk/SophyaPI/PI/picons.cc

    r128 r138  
    4848mOffL = 0;
    4949mNCmdL = 0;
     50mCmd = "";
    5051
    5152// Pile de rappel des commandes
     
    125126
    126127if (mCurL >= (mNL-mNCmdL) ) { // Il faut scroller
    127   ScrollUp();
     128  ScrollUp(); 
    128129  mCurL = mNL-mNCmdL-1;
    129130  l1 = mNL-mWSzL-1;
    130 }
     131  }
    131132if (l2 < mCurL) l2 = mCurL;
    132133if (ref) DisplayLines(mWGrC, l1, l2);
     
    136137
    137138/* --Methode-- */
    138 void PIConsole::AddStr(char* strg, unsigned char va, bool ref)
     139void PIConsole::AddStr(const char* strg, unsigned char va, bool ref)
    139140{
    140141int l1, l2;
     
    152153  else { mCurL++; mCurC = 0; }
    153154  if (mCurL >= (mNL-mNCmdL) ) { // Il faut scroller
    154     ScrollUp();
     155    ScrollUp(); 
    155156    mCurL = mNL-mNCmdL-1;
     157    l1 = mNL-mWSzL-1;
    156158    }
    157159  strg++;
     
    248250
    249251/* --Methode-- */
    250 void PIConsole::SetPrompt(char* prompt)
     252void PIConsole::SetPrompt(const char* prompt)
    251253{
    252254strncpy(mPrompt, prompt, 31); 
     
    342344        }
    343345      mChangeFg = false;
    344       Send( Msg(), PIMsg_OK, mCmdStr);
     346      mCmd = mCmdStr;
    345347      ClrCmd();
     348      Send( Msg(), PIMsg_OK, NULL);
    346349      break;
    347350
  • trunk/SophyaPI/PI/picons.h

    r128 r138  
    3535// Interface d utilisation :
    3636          void       AddChar(char c, unsigned char va= PIVA_Def, bool ref=true);
    37           void       AddStr(char* strg, unsigned char va= PIVA_Def, bool ref=true);
     37          void       AddStr(const char* strg, unsigned char va= PIVA_Def, bool ref=true);
    3838
    3939          void       SelectFont(PIFontSize sz=PI_NormalSizeFont);
     
    4141          void       PreferedSize(int& sx, int& sy);
    4242          void       AcceptCmd(bool acc=true, int nrecmx=20);
    43           void       SetPrompt(char* prompt);
     43          void       SetPrompt(const char* prompt);
    4444
    4545  inline  int        WindNbLines() { return mWSzL; }
    4646  inline  int        NbLines() { return mNL; }         
    47   inline  string     GetCmdString() { mCmdStr[mCLC] = '\0'; return((string)mCmdStr); }
     47  inline  string     GetCmdString() { return(mCmd); }
    4848
    4949// Gestion des evenements input/draw
     
    9494  char* mCmdStr;        // La commande
    9595  int mCCP, mCLC;       // Position du curseur, longeur de la commande
     96  string mCmd;          // Le string de la derniere commande validee
    9697
    9798// Pour le rappel des commandes
  • trunk/SophyaPI/PI/pidrwtools.cc

    r127 r138  
    117117mOpt[0]->AppendItem("Yellow", 107);
    118118mOpt[0]->AppendItem("Magenta", 108);
     119mOpt[0]->AppendItem("Cyan", 109);
     120mOpt[0]->AppendItem("Turquoise", 110);
     121mOpt[0]->AppendItem("NavyBlue", 111);
     122mOpt[0]->AppendItem("Orange", 112);
     123mOpt[0]->AppendItem("SiennaRed", 113);
     124mOpt[0]->AppendItem("Purple", 114);
     125mOpt[0]->AppendItem("LimeGreen", 115);
     126mOpt[0]->AppendItem("Gold", 116);
    119127mOpt[0]->SetValue(100);
    120128mOpt[0]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
     
    276284void PIDrwTools::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
    277285{
    278 PIColors cols[9] = { PI_NotDefColor, PI_Black, PI_White, 
    279                      PI_Grey, PI_Red, PI_Blue,
    280                      PI_Green, PI_Yellow, PI_Magenta};
     286PIColors cols[17] = { PI_NotDefColor,
     287                     PI_Black, PI_White, PI_Grey,
     288                     PI_Red, PI_Blue, PI_Green,
     289                     PI_Yellow, PI_Magenta,
     290                     PI_Cyan , PI_Turquoise, PI_NavyBlue,
     291                     PI_Orange, PI_SiennaRed, PI_Purple,
     292                     PI_LimeGreen, PI_Gold };
    281293
    282294PIMarker mrk[12] = { PI_NotDefMarker, PI_DotMarker,
     
    328340    if (drw == NULL)  return;
    329341    k = mOpt[0]->GetValue()-100;
    330     if ( (k < 0) || (k > 8) )  k = 0;
     342    if ( (k < 0) || (k > 16) )  k = 0;
    331343    drw->SetColAtt(cols[k]);
    332344    k = mOpt[1]->GetValue()-200;
  • trunk/SophyaPI/PI/pigraphgen.h

    r113 r138  
    1515                 PI_Black = 0, PI_White = 1,  PI_Grey = 2,
    1616                 PI_Red = 3, PI_Blue = 4, PI_Green = 5, 
    17                  PI_Yellow = 6, PI_Magenta = 7 };
     17                 PI_Yellow = 6, PI_Magenta = 7,
     18                 PI_Cyan = 8, PI_Turquoise = 9, PI_NavyBlue = 10,
     19                 PI_Orange = 11, PI_SiennaRed = 12, PI_Purple = 13, 
     20                 PI_LimeGreen = 14, PI_Gold = 15 };
    1821
    1922enum PIFontSize { PI_NotDefFontSize = -1,
  • trunk/SophyaPI/PI/pigraphx.cc

    r117 r138  
    1919static int BigFontIndex = 5;
    2020static  PIFontAtt fntatt[3] = { PI_RomanFont, PI_BoldFont, PI_ItalicFont };
    21 #define NMAXCOL  10
     21#define NMAXCOL  16
    2222static  PIXColor colpix[NMAXCOL];
    2323
     
    680680if ( XAllocNamedColor (mdsp, cmap, "magenta", &mycol, &exact) )
    681681  colpix[PI_Magenta] = mycol.pixel;
     682if ( XAllocNamedColor (mdsp, cmap, "cyan", &mycol, &exact) )
     683  colpix[PI_Cyan] = mycol.pixel;
     684if ( XAllocNamedColor (mdsp, cmap, "turquoise", &mycol, &exact) )
     685  colpix[PI_Turquoise] = mycol.pixel;
     686if ( XAllocNamedColor (mdsp, cmap, "NavyBlue", &mycol, &exact) )
     687  colpix[PI_NavyBlue] = mycol.pixel;
     688if ( XAllocNamedColor (mdsp, cmap, "orange", &mycol, &exact) )
     689  colpix[PI_Orange] = mycol.pixel;
     690if ( XAllocNamedColor (mdsp, cmap, "sienna", &mycol, &exact) )
     691  colpix[PI_SiennaRed] = mycol.pixel;
     692if ( XAllocNamedColor (mdsp, cmap, "purple", &mycol, &exact) )
     693  colpix[PI_Purple] = mycol.pixel;
     694if ( XAllocNamedColor (mdsp, cmap, "LimeGreen", &mycol, &exact) )
     695  colpix[PI_LimeGreen] = mycol.pixel;
     696if ( XAllocNamedColor (mdsp, cmap, "gold", &mycol, &exact) )
     697  colpix[PI_Gold] = mycol.pixel;
     698
    682699
    683700/*  le GC pour DrawPixmap  */
  • trunk/SophyaPI/PI/pihisto2d.cc

    r131 r138  
    179179  if(mTypDisp==3) fracmin=-1.;
    180180}
     181
     182// gestion epaisseur de ligne
     183if (mLAtt == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
    181184
    182185// gestion Markers ou plot avec des points.
     
    278281{
    279282  // Une boite dans le coin superieur droit
     283  if (mLAtt == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
    280284  float cellHeight = (YMax() - YMin()) * 0.05;
    281285  float cellWidth  = (XMax() - XMin()) * 0.23;
  • trunk/SophyaPI/PI/piimage.cc

    r130 r138  
    7777AddDrawer(mdrw, true, false, false);
    7878
     79SetLut(0., 32000., kLutType_Lin, 0, false);
    7980SetColMapId(CMAP_COLRJ32);
    80 
    8181// pour le copier-coller
    8282cpbuffer = NULL;
  • trunk/SophyaPI/PI/pintup3d.cc

    r133 r138  
    9090#endif
    9191
     92if (mLAtt == PI_NotDefLineAtt)  g3->SelLine(PI_ThinLine);
     93
    9294nok = 0; 
    9395for (int i=0; i<mNT->NEntry(); i++) {
  • trunk/SophyaPI/PI/pintuple.cc

    r136 r138  
    7070if (!mNT) return;
    7171if ( (xK < 0) || (yK < 0) )  return;
    72 
     72if (mLAtt == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
    7373nok = 0; 
    7474for (int i=0; i<mNT->NEntry(); i++) {
  • trunk/SophyaPI/PI/pistzwin.cc

    r137 r138  
    115115void PIZoneWindow::SetZone(int nzx, int nzy)
    116116{
     117int i;
     118if (mZWdg) {
     119  for(i=0; i<mZx*mZy; i++)
     120    if (mZWdg[i]) delete mZWdg[i]; 
     121  delete[]  mZWdg;
     122  }
     123
    117124if (nzx < 1) nzx = 1;
    118125if (nzy < 1) nzy = 1;
     
    121128mZx = nzx;  mZy = nzy;   mZc = 0;
    122129
    123 int i;
    124 if (mZWdg) {
    125   for(i=0; i<mZx*mZy; i++)
    126     if (mZWdg[i]) delete mZWdg[i]; 
    127   delete[]  mZWdg;
    128   }
    129130mZWdg = new PIWdgGen*[nzx*nzy];
    130131for(i=0; i<mZx*mZy; i++) mZWdg[i] = NULL;
     
    136137{
    137138if (!child) return;
    138 // printf("-DBG-PIZoneWindow::ChildAdd(%lx) deleteing Wdg %lx \n", (long)child, (long)mZWdg[mZc]);
    139139int nx = mZc%mZx;
    140140int ny = mZc/mZx;
     
    146146child->SetSize(sx, sy);
    147147child->SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic, PIBK_elastic);
    148 // printf("--DBG-- PIZoneWindow::ChildAdd() %d , Nx,y=%d %d , S= %d %d \n", mZc, nx, ny, sx, sy);
    149 // printf("--DBG-- ... Child Pos= %d %d, Size= %d %d \n", child->XPos(), child->YPos(),child->XSize(),child->YSize()   );
     148//  Il faut faire le delete a cet endroit, sinon probleme avec widget motif XmForm  Reza 18/08/98
    150149if (mZWdg[mZc])  delete mZWdg[mZc];
    151150mZWdg[mZc] = child;
     
    178177int ny = mZc/mZx;
    179178px = nx*sx;  py = ny*sy;
    180 // printf("--DBG-- PIZoneWindow::NextChildPosSize() %d , P=%d %d , S= %d %d \n", mZc, px,py, sx, sy);
    181179}
  • trunk/SophyaPI/PI/piwdggen.cc

    r132 r138  
    179179PIWdgGen::~PIWdgGen()
    180180{
    181 if (parent)  parent->ChildDel(this);   //  On previent le container parent
     181//  ChildDel() doit etre appele par la classe qui implemente le widget
     182// if (parent)  parent->ChildDel(this);   //  On previent le container parent
    182183}
    183184
  • trunk/SophyaPI/PI/piwdgx.cc

    r136 r138  
    182182printf("Debug_PIWdgX::~PIWdgX()  %lx %lx \n", (long)this, (long)sdw);
    183183#endif
     184if (parent) parent->ChildDel(this);
    184185UnManage();
    185186if (curselwdg == this)  { SelectionLost(); curselwdg = NULL; }
Note: See TracChangeset for help on using the changeset viewer.