Changeset 114 in Sophya


Ignore:
Timestamp:
Jul 3, 1998, 12:02:54 PM (27 years ago)
Author:
ansari
Message:

Meilleure gestion des tailles de fontes X Reza 03/07/98

Location:
trunk/SophyaPI/PI
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/Makefile

    r113 r114  
    1818 
    1919$(OBJ)lut.o: lut.cc $(EROSDEVREP)/Include/defs.h lut.h
    20 $(OBJ)parradapter.o: parradapter.cc $(EROSDEVREP)/Include/ctimer.h \
    21  $(EROSDEVREP)/Include/peida.h $(EROSDEVREP)/Include/defs.h \
    22  $(EROSDEVREP)/Include/utils.h $(EROSDEVREP)/Include/machine.h \
    23  $(EROSDEVREP)/Include/perrors.h \
    24  $(EROSDEVREP)/Include/exceptions.h \
    25  $(EROSDEVREP)/Include/peidainit.h $(EROSDEVREP)/Include/fmath.h \
    26  parradapter.h lut.h
     20$(OBJ)parradapter.o: parradapter.cc parradapter.h \
     21 $(EROSDEVREP)/Include/defs.h $(EROSDEVREP)/Include/machine.h \
     22 lut.h
    2723$(OBJ)pi3ddrw.o: pi3ddrw.cc pi3ddrw.h pisysdep.h pidrawer.h pibwdggen.h \
    2824 piwdgx.h piwdggen.h pimsghandler.h picmap.h picmapx.h picmapgen.h \
     
    241237 $(EROSDEVREP)/Include/pixelmap.h \
    242238 $(EROSDEVREP)/Include/transfo.h $(EROSDEVREP)/Include/poly.h \
    243  $(EROSDEVREP)/Include/zfidu.h pidrawer.h pibwdggen.h pisysdep.h \
    244  piwdgx.h piwdggen.h pimsghandler.h picmap.h picmapx.h picmapgen.h \
    245  pigraphx.h pigraphgen.h pigraphuc.h psfile.h
     239 $(EROSDEVREP)/Include/zfidu.h $(EROSDEVREP)/Include/imgalig.h \
     240 $(EROSDEVREP)/Include/fitsimage.h \
     241 $(EROSDEVREP)/Include/fitsheader.h \
     242 $(EROSDEVREP)/Include/erosio.h $(EROSDEVREP)/Include/fitskeys.h \
     243 $(EROSDEVREP)/Include/erostape.h \
     244 $(EROSDEVREP)/Include/strutil.h \
     245 $(EROSDEVREP)/Include/ptrarray.h \
     246 $(EROSDEVREP)/Include/voidptrarray.h \
     247 $(EROSDEVREP)/Include/basearray.h $(EROSDEVREP)/Include/array.h \
     248 $(EROSDEVREP)/Include/lockfile.h \
     249 $(EROSDEVREP)/Include/erostarfile.h \
     250 $(EROSDEVREP)/Include/xstrstream.h \
     251 $(EROSDEVREP)/Include/dates.h $(EROSDEVREP)/Include/tarlib.h \
     252 pidrawer.h pibwdggen.h pisysdep.h piwdgx.h piwdggen.h pimsghandler.h \
     253 picmap.h picmapx.h picmapgen.h pigraphx.h pigraphgen.h pigraphuc.h \
     254 psfile.h
    246255$(OBJ)pisurfdr.o: pisurfdr.cc pisurfdr.h parradapter.h \
    247256 $(EROSDEVREP)/Include/defs.h $(EROSDEVREP)/Include/machine.h \
  • trunk/SophyaPI/PI/parradapter.cc

    r113 r114  
    66#include <math.h>
    77
    8 #include "ctimer.h"
     8// #include "ctimer.h"   Pour mesure TCPU
    99#include "parradapter.h"
    1010
  • trunk/SophyaPI/PI/piapplx.cc

    r111 r114  
    101101topwdg->SetSize(MBCont()->XSize(), MBCont()->YSize());
    102102
    103 int szx, szy;
    104 XtAppContext * appctx = PIXtAppCtx(szx, szy);
     103int szx, szy, szf;
     104XtAppContext * appctx = PIXtAppCtx(szx, szy, szf);
    105105
    106106// Pour appeler FinishCreate() des objets dans la fenetre principale
     
    163163void PIApplicationX::PrefCompSz(int& szx, int& szy)
    164164{
    165 PIXtAppCtx(szx, szy);
     165int szf;
     166PIXtAppCtx(szx, szy, szf);
    166167return;
    167168}
     
    214215setlinebuf(stdout);
    215216
    216 int szx, szy;
    217 XtAppContext * appctx = PIXtAppCtx(szx, szy);
     217int szx, szy, szf;
     218XtAppContext * appctx = PIXtAppCtx(szx, szy, szf);
    218219XtAppAddInput(*appctx, p[0], (XtPointer) XtInputReadMask, redirectstream_callback, (XtPointer) streamno);
    219220}
     
    236237setlinebuf(stderr);
    237238
    238 int szx, szy;
    239 XtAppContext * appctx = PIXtAppCtx(szx, szy);
     239int szx, szy, szf;
     240XtAppContext * appctx = PIXtAppCtx(szx, szy, szf);
    240241XtAppAddInput(*appctx, p[0], (XtPointer) XtInputReadMask, redirectstream_callback, (XtPointer) (streamno+1));
    241242}
  • trunk/SophyaPI/PI/pigraphx.cc

    r113 r114  
    1515static XFontStruct * fntst[NMAXFONTSZ][3];
    1616static int fntsz[NMAXFONTSZ] = {8,10,12,14,16,20,24};
     17static int SmallFontIndex = 1;
     18static int NormalFontIndex = 3;
     19static int BigFontIndex = 5;
    1720static  PIFontAtt fntatt[3] = { PI_RomanFont, PI_BoldFont, PI_ItalicFont };
    1821#define NMAXCOL  10
     
    366369  {
    367370  case PI_SmallSizeFont:
    368     i = 1;
     371    i = SmallFontIndex;
    369372    break;
    370373  case PI_NormalSizeFont:
    371     i = 3;
     374    i = NormalFontIndex;
    372375    break;
    373376  case PI_BigSizeFont:
    374     i = 5;
     377    i = BigFontIndex;
    375378    break;
    376379  default:
    377     i=2;
     380    i = NormalFontIndex;
    378381    break;
    379382  }
     
    642645  for (j=0; j<3; j++)  fntst[i][j] = NULL;
    643646
    644  
     647// Choix des trois tailles de fontes standard en fonction de
     648// la taille de fonte par defaut des composantes standard
     649int szx, szy, szf;
     650PIXtAppCtx(szx, szy, szf);
     651int kkk, kkj, kksel, kkdsz = 9999; 
     652kksel = NMAXFONTSZ/2;
     653for(kkk=NMAXFONTSZ-1; kkk>=0; kkk--) {
     654  kkj = szf - fntsz[kkk];   if (kkj < 0)  kkj = -kkj;
     655  if (kkj < kkdsz)  {  kksel = kkk;  kkdsz = kkj; }
     656  }
     657NormalFontIndex = kksel;
     658SmallFontIndex = (kksel > 1) ? kksel-2 : 0 ;
     659BigFontIndex = (kksel < NMAXFONTSZ-2) ? kksel+2 : NMAXFONTSZ-1 ;
     660
     661printf("PIGraphicX::Init()-DBG- FontIndex= %d %d %d (%d) \n",
     662       SmallFontIndex, NormalFontIndex, BigFontIndex, szf);
     663
    645664/*  Les couleurs  */
    646665cmap = XDefaultColormap (mdsp, scr);
  • trunk/SophyaPI/PI/piimgtools.cc

    r112 r114  
    1515/* --Methode-- */
    1616PIImgLutWind::PIImgLutWind(PIApplication* par)
    17 : PIWindow((PIMsgHandler*)par, "PIImg-ChangeLut", PIWK_dialog, 240, 240, 150, 150)
    18 {
    19 
     17: PIWindow((PIMsgHandler*)par, "PIImageTools", PIWK_dialog, 240, 240, 150, 150)
     18{
     19int bsx, bsy;
     20
     21// On definit la taille a partir de la taille par defaut des composantes
     22// PIApplicationPrefCompSize(bsx, bsy);
     23par->PrefCompSz(bsx, bsy);
    2024mLab[0] = new PILabel(this, "MinPixel", 60, 35, 30, 20);
    2125mLab[1] = new PILabel(this, "MaxPixel", 60, 35, 30, 65);
  • trunk/SophyaPI/PI/pioptmenux.cc

    r112 r114  
    7373void PIOptMenuX::FinishCreate()
    7474{
    75 printf("PIOptMenuX::FinishCreate()/DBG  %s \n", Nom().c_str());
     75// printf("PIOptMenuX::FinishCreate()/DBG  %s \n", Nom().c_str());
    7676if (mSmsg == 0)  SetValue(mMen->ItemMsg(0));
    7777}
  • trunk/SophyaPI/PI/piperiodx.cc

    r91 r114  
    99pip = (PIPeriodX *)usd;
    1010pip->DoPeriodic();
    11 int szx, szy;
    12 XtAppContext * appctx = PIXtAppCtx(szx, szy);
     11int szx, szy, szf;
     12XtAppContext * appctx = PIXtAppCtx(szx, szy, szf);
    1313id = XtAppAddTimeOut(*appctx, pip->Interval()*1000, xttimer_action, pip);
    1414pip->SetTimerId(id);
     
    3535if (dt > 0)  mDt = dt;
    3636
    37 int szx,szy;
    38 XtAppContext * appctx = PIXtAppCtx(szx, szy);
     37int szx,szy,szf;
     38XtAppContext * appctx = PIXtAppCtx(szx, szy, szf);
    3939mTId = XtAppAddTimeOut(*appctx, mDt*1000, xttimer_action, this);
    4040mFgact = true;
  • trunk/SophyaPI/PI/piwdgx.cc

    r106 r114  
    2727static int appSzX = 10;
    2828static int appSzY = 10;
     29static int appSzFont = 10;
    2930static XFontStruct * stdfnt = NULL;
    3031
    3132/* Nouvelle-Fonction */
    32 XtAppContext* PIXtAppCtx(int& szx, int& szy)
     33XtAppContext* PIXtAppCtx(int& szx, int& szy, int& szf)
    3334{
    3435szx = appSzX;  szy = appSzY;
     36szf = appSzFont;
    3537return(&appctx);
    3638}
     
    561563appSzY = (float)(fa+fd)*1.4+10;  // pour les shadow
    562564appSzX = (float)len*1.5;
     565appSzFont = fa+fd;
    563566// Taille multiple de 5 pixels
    564567if ( (appSzX % 5) != 0 )   appSzX = 5*(appSzX/5 + 1);
  • trunk/SophyaPI/PI/piwdgx.h

    r110 r114  
    8585// Utile pour avoir acces au Display et Screen X ...
    8686SysDWdg   PIXtTopWdg();
    87 XtAppContext* PIXtAppCtx(int& szx, int& szy);
     87XtAppContext* PIXtAppCtx(int& szx, int& szy, int& szf);
    8888Display * PIXDisplay();
    8989#define  PIXScreen()  DefaultScreen(PIXDisplay())
  • trunk/SophyaPI/PI/piwindowx.cc

    r90 r114  
    7979    {
    8080    XtActionsRec desact = {"CloseWindow" ,CloseWindow};
    81     int szx, szy;
    82     XtAppContext * appctx = PIXtAppCtx(szx, szy);
     81    int szx, szy, szf;
     82    XtAppContext * appctx = PIXtAppCtx(szx, szy, szf);
    8383    XtAppAddActions(*appctx, &desact, 1);  fgactl = 1;
    8484    }
Note: See TracChangeset for help on using the changeset viewer.