Changeset 402 in Sophya
- Timestamp:
- Sep 10, 1999, 10:39:11 AM (26 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/Tests/pit1.cc
r382 r402 116 116 PIFont f3(14,PI_TimesFont,PI_BoldFont); 117 117 g->SelFont(f3); 118 g->DrawString(20, 170, "Times-Font ");118 g->DrawString(20, 170, "Times-Font-Bold"); 119 119 PIFont f4(14,PI_HelveticaFont,PI_BoldFont); 120 120 g->SelFont(f4); … … 123 123 g->SelFont(f5); 124 124 g->DrawString(20, 210, "Symbol-Font"); 125 g->SelFont(f0); 125 126 126 127 -
trunk/SophyaPI/PI/Tests/pitcons.cc
r365 r402 102 102 PITApp::~PITApp() 103 103 { 104 if (scons) delete scons; 105 if (cons) delete cons; 104 106 } 105 107 -
trunk/SophyaPI/PI/picons.cc
r365 r402 14 14 static PIMenu* opmc=NULL; 15 15 static int nb_opmc = 0; 16 17 static void ActivatePIConsOptionMenu(PIConsole* par) 18 { 19 if (opmc) delete opmc; 20 opmc = NULL; 21 22 opmc = new PIMenu(par, "OptCons", k_PopupMenu); 23 opmc->AppendItem("SmallFont", 3101); 24 opmc->AppendItem("NormalFont", 3102); 25 opmc->AppendItem("LargeFont", 3103); 26 opmc->AppendItem("25L x 80C", 3301); 27 opmc->AppendItem("25L x 132C", 3302); 28 opmc->AppendItem("5L x 80C", 3303); 29 opmc->AppendItem("Bkg White", 3201); 30 opmc->AppendItem("Bkg Black", 3202); 31 32 opmc->SetMsgParent((PIMsgHandler*)par); 33 opmc->Show(); 34 35 } 16 36 17 37 /* --------------------------------------------------------------------------------- */ … … 72 92 mCurC = 0; 73 93 94 74 95 // Pour ajouter un scroll-bar 75 96 AssocScrollBar(par, nom, scb, sx, sy, px, py); 76 97 77 // Pour le menu des options : Fontes, couleur, ...78 if (!opmc) {79 opmc = new PIMenu(this, "OptCons", k_PopupMenu);80 opmc->AppendItem("SmallFont", 3101);81 opmc->AppendItem("NormalFont", 3102);82 opmc->AppendItem("LargeFont", 3103);83 opmc->AppendItem("25L x 80C", 3301);84 opmc->AppendItem("25L x 132C", 3302);85 opmc->AppendItem("5L x 80C", 3303);86 opmc->AppendItem("Bkg White", 3201);87 opmc->AppendItem("Bkg Black", 3202);88 }89 nb_opmc++;90 98 91 99 ActivateKeyboard(); // Gestion de l'edition … … 107 115 delete[] mCmdStr; 108 116 if (mScb) delete mScb; 109 nb_opmc--; 110 if (nb_opmc == 0) { delete opmc; opmc=NULL; } 117 if (opmc) { delete opmc; opmc=NULL; } 111 118 } 112 119 … … 298 305 if (kmod == PIKM_Alt) { 299 306 if (key == 'O' || key == 'o') { // Menu des options 300 opmc->SetMsgParent((PIMsgHandler*)this); 301 opmc->Show(); 307 ActivatePIConsOptionMenu(this); 302 308 return; 303 309 } … … 452 458 void PIConsole::But3Press(int x, int y) 453 459 { 454 opmc->SetMsgParent((PIMsgHandler*)this); 455 opmc->Show((PIWdg*)this, x, y); 460 ActivatePIConsOptionMenu(this); 456 461 } 457 462 … … 862 867 } 863 868 if (fgr) Refresh(); 869 delete opmc; opmc = NULL; 864 870 } 865 871 // Le traitement du scroll-bar -
trunk/SophyaPI/PI/pifontx.cc
r387 r402 230 230 2*sizeof(String) , XtRString, "*-helvetica" } , 231 231 { "timesfontFamilyName", "TimesfontFamilyName", XtRString, sizeof(String), 232 2*sizeof(String) , XtRString, "*-times" } ,232 3*sizeof(String) , XtRString, "*-times" } , 233 233 { "symbolfontFamilyName", "SymbolfontFamilyName", XtRString, sizeof(String), 234 234 4*sizeof(String) , XtRString, "*-symbol" } … … 251 251 char **list; 252 252 253 for (k=0; k<5; k++) // Recherche de la fonte pour tailles croissantes 254 { 253 for (k=0; k<5; k++) { // Recherche de la fonte pour tailles croissantes 255 254 sprintf(buff,"-%s-%s-*-%d-*-*-*-*-*-*-*", apd.fntFam[kfn], fnbi[jat], fntsz[isz]+k); 256 255 list = XListFonts(mdsp, buff, 10, &count); 257 256 XFreeFontNames(list); 258 257 if (count > 0) break; 258 } 259 // certaines fontes n'ont pas de version bold ou italique 260 if ( (count == 0) && (jat > 0) ) { 261 for (k=0; k<5; k++) { // Recherche de la fonte pour tailles croissantes 262 sprintf(buff,"-%s-%s-*-%d-*-*-*-*-*-*-*", apd.fntFam[kfn], fnbi[0], fntsz[isz]+k); 263 list = XListFonts(mdsp, buff, 10, &count); 264 XFreeFontNames(list); 265 if (count > 0) break; 266 } 259 267 } 260 268 if (count > 0)
Note:
See TracChangeset
for help on using the changeset viewer.