Changeset 150 in Sophya for trunk/SophyaPI
- Timestamp:
- Oct 7, 1998, 7:26:52 PM (27 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pihisto2d.cc
r148 r150 1 1 #include <stdio.h> 2 #include "piapplgen.h" 2 3 #include "pihisto2d.h" 3 4 #include "nbrandom.h" … … 506 507 mH2Wdg = NULL; 507 508 509 // Valeurs par defaut 508 510 mFgCol = false; 509 511 mCmap = CMAP_GREYINV32; … … 517 519 mLogScale = 10.; 518 520 521 // Taille automatique 522 int bsx, bsy; 523 PIApplicationPrefCompSize(bsx, bsy); // environ 6 lettres 524 int spx = (bsx>=10) ? bsx/10 : 1; // intervalle entre lettres X 525 int spy = (bsy>=5) ? bsy/5 : 1; // intervalle entre lettres Y 526 int wszx = 5*spx+bsx+int(2.5*bsx); // Taille fenetre en X 527 int wszy = 11*spy+8*bsy; // Taille fenetre en Y 528 SetSize(wszx, wszy); 529 519 530 // menus bar 520 mOPop[0] = new PIOptMenu(this, "optmen-h2d-1" ,100,25,10,10); 531 int cpx = 2*spx, cpy = 2*spy; 532 mOPop[0] = new PIOptMenu(this, "optmen-h2d-1" ,2*bsx,bsy,cpx,cpy); 521 533 mOPop[0]->AppendItem("Carres Var." , 6101); 522 534 mOPop[0]->AppendItem("....." , 6102); … … 524 536 mOPop[0]->AppendItem("Carres Pleins", 6104); 525 537 sdum = "Carres Var."; mOPop[0]->SetValueStr(sdum); 526 527 mOPop[1] = new PIOptMenu(this, "optmen-h2d-2", 100,25,10,40); 538 mOPop[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 539 540 cpy += bsy+spy; 541 mOPop[1] = new PIOptMenu(this, "optmen-h2d-2",2*bsx,bsy,cpx,cpy); 528 542 mOPop[1]->AppendItem("Lineaire", 6201); 529 543 mOPop[1]->AppendItem("Log10" , 6202); 530 544 sdum = "Lineaire"; mOPop[1]->SetValueStr(sdum); 531 532 mOPop[2] = new PIOptMenu(this, "optmen-h2d-3", 100,25,10,70); 533 mOPop[2]->AppendItem("B&W" , 6301); 545 mOPop[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 546 547 cpy += bsy+spy; 548 mOPop[2] = new PIOptMenu(this, "optmen-h2d-3",2*bsx,bsy,cpx,cpy); 549 mOPop[2]->AppendItem("Black&White", 6301); 534 550 mOPop[2]->AppendItem("Grey32" , 6302); 535 551 mOPop[2]->AppendItem("GreyInv32" , 6303); 536 mOPop[2]->AppendItem(" RJ32", 6304);537 mOPop[2]->AppendItem(" BR32", 6305);538 mOPop[2]->AppendItem(" RV32", 6306);552 mOPop[2]->AppendItem("ColRJ32" , 6304); 553 mOPop[2]->AppendItem("ColBR32" , 6305); 554 mOPop[2]->AppendItem("ColRV32" , 6306); 539 555 mOPop[2]->AppendItem("Grey128" , 6307); 540 556 mOPop[2]->AppendItem("GreyInv128", 6308); 541 mOPop[2]->AppendItem("RJ128" , 6309); 542 mOPop[2]->AppendItem("BR128" , 6310); 543 mOPop[2]->AppendItem("Arc16" , 6311); 544 sdum = "B&W"; mOPop[2]->SetValueStr(sdum); 557 mOPop[2]->AppendItem("ColRJ128" , 6309); 558 mOPop[2]->AppendItem("ColBR128" , 6310); 559 mOPop[2]->AppendItem("Col16" , 6311); 560 sdum = "Black&White"; mOPop[2]->SetValueStr(sdum); 561 mOPop[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 545 562 546 563 // Labels et zone de saisie texte 547 mLab[0] = new PILabel(this, " Dyn: ",60,30,10,110); 548 mLab[1] = new PILabel(this, " Frac: ",60,30,10,145); 549 mLab[2] = new PILabel(this, " LogScal: ",60,30,10,180); 550 551 mText[0] = new PIText(this, "Dynamique",150,30,80,110); 552 mText[1] = new PIText(this, "Fraction" ,150,30,80,145); 553 mText[2] = new PIText(this, "LogScale" ,150,30,80,180); 564 cpy += 2*(bsy+spy); 565 mLab[0] = new PILabel(this, " Dyn: ",bsx,bsy,cpx,cpy); 566 mLab[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 567 mText[0] = new PIText(this, "Dynamique" ,int(2.5*bsx),bsy,cpx+bsx+spx,cpy); 568 mText[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 569 cpy += bsy+spy; 570 mLab[1] = new PILabel(this, " Frac: ",bsx,bsy,cpx,cpy); 571 mLab[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 572 mText[1] = new PIText(this, "Fraction" ,int(2.5*bsx),bsy,cpx+bsx+spx,cpy); 573 mText[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 574 cpy += bsy+spy; 575 mLab[2] = new PILabel(this, " LogScal: ",bsx,bsy,cpx,cpy); 576 mLab[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 577 mText[2] = new PIText(this, "LogScale" ,int(2.5*bsx),bsy,cpx+bsx+spx,cpy); 578 mText[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 554 579 SetText(); 555 580 556 581 // Labels et curseur mobile 557 mLab[3] = new PILabel(this, " PerPt: ",60,30,10,215); 558 mPScal = new PIScale(this,"FracPoints",6401,kSDirLtoR,150,20,80,215); 582 cpy += bsy+spy; 583 mLab[3] = new PILabel(this, " PerPt: ",bsx,bsy,cpx,cpy); 584 mLab[3]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 585 mPScal = new PIScale(this,"FracPoints",6401,kSDirLtoR 586 ,int(2.5*bsx),bsy,cpx+bsx+spx,cpy); 587 mPScal->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 559 588 mPScal->SetMinMax(0,100); 560 int imfp = mFPoints*100.f; 561 mPScal->SetValue(imfp); 589 int imfp = mFPoints*100.f; mPScal->SetValue(imfp); 562 590 563 591 // Boutons 564 mBut[0] = new PIButton(this, "Apply", 6001, 60, 20, 150,10); 565 mBut[1] = new PIButton(this, "Dismiss", 6002, 60, 20, 150,35); 566 mBut[2] = new PIButton(this, "Get" , 6003, 60, 20, 150,60); 567 mBut[3] = new PIButton(this, "Print", 6004, 60, 20, 150,85); 592 cpx = 2*bsx+5*spx, cpy = 2*spy; 593 mBut[0] = new PIButton(this, "Apply", 6001,bsx,bsy,cpx,cpy); 594 mBut[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 595 cpy += bsy+spy; 596 mBut[1] = new PIButton(this, "Dismiss",6002,bsx,bsy,cpx,cpy); 597 mBut[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 598 cpy += bsy+spy; 599 mBut[2] = new PIButton(this, "Get" , 6003,bsx,bsy,cpx,cpy); 600 mBut[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 601 cpy += bsy+spy; 602 mBut[3] = new PIButton(this, "Print", 6004,bsx,bsy,cpx,cpy); 603 mBut[3]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic); 568 604 // FinishCreate(); 569 605 } … … 607 643 else if(mTypScal==1) { sdum="Log10"; mOPop[1]->SetValueStr(sdum);} 608 644 609 if(!mFgCol) { sdum="B &W";mOPop[2]->SetValueStr(sdum);}645 if(!mFgCol) { sdum="Black&White";mOPop[2]->SetValueStr(sdum);} 610 646 else { 611 647 if(mCmap==CMAP_GREY32) { sdum="Grey32"; mOPop[2]->SetValueStr(sdum);} 612 648 else if(mCmap==CMAP_GREYINV32) { sdum="GreyInv32"; mOPop[2]->SetValueStr(sdum);} 613 else if(mCmap==CMAP_COLRJ32) { sdum=" RJ32";mOPop[2]->SetValueStr(sdum);}614 else if(mCmap==CMAP_COLBR32) { sdum=" BR32";mOPop[2]->SetValueStr(sdum);}615 else if(mCmap==CMAP_COLRV32) { sdum=" RV32";mOPop[2]->SetValueStr(sdum);}649 else if(mCmap==CMAP_COLRJ32) { sdum="ColRJ32"; mOPop[2]->SetValueStr(sdum);} 650 else if(mCmap==CMAP_COLBR32) { sdum="ColBR32"; mOPop[2]->SetValueStr(sdum);} 651 else if(mCmap==CMAP_COLRV32) { sdum="ColRV32"; mOPop[2]->SetValueStr(sdum);} 616 652 else if(mCmap==CMAP_GREY128) { sdum="Grey128"; mOPop[2]->SetValueStr(sdum);} 617 653 else if(mCmap==CMAP_GREYINV128) { sdum="GreyInv128"; mOPop[2]->SetValueStr(sdum);} 618 else if(mCmap==CMAP_COLRJ128) { sdum=" RJ128";mOPop[2]->SetValueStr(sdum);}619 else if(mCmap==CMAP_COLBR128) { sdum=" BR128";mOPop[2]->SetValueStr(sdum);}620 else if(mCmap==CMAP_COL16) { sdum=" Arc16"; mOPop[2]->SetValueStr(sdum);}621 } 622 623 printf("H2WinArg::SetText\n");654 else if(mCmap==CMAP_COLRJ128) { sdum="ColRJ128"; mOPop[2]->SetValueStr(sdum);} 655 else if(mCmap==CMAP_COLBR128) { sdum="ColBR128"; mOPop[2]->SetValueStr(sdum);} 656 else if(mCmap==CMAP_COL16) { sdum="Col16"; mOPop[2]->SetValueStr(sdum);} 657 } 658 659 if(dbg)printf("H2WinArg::SetText\n"); 624 660 } 625 661
Note:
See TracChangeset
for help on using the changeset viewer.