void phatset(Int_t index = 0, Int_t ival = 0) { // phatic.C brings up a button panel; button presses usually call // phatset with index >= 1 corresponding to which button. This allows // actions which would make a too-long button action string. // // Any button pushed -> set display flag doDisp for loops: if(index >> 0) doDisp = 1; // UNFORTUNATELY 9/3/98... unable to find why dialog boxes crash the // subsequent Phat operations... revert to dialogue in ROOT via stdin // & stdout... leave the nice stuff commented out & return to it later. // Some definitions needed for this kluge: Int_t nevents = 10000; Int_t nruns = 10000; Int_t MaxReply = 100; Char_t reply[MaxReply]; Char_t inF[MaxReply]; Char_t ouF[MaxReply]; // Bring up dialog boxes for input & output file names (using dialog.C): if(index == 1) { // begin temporary patch, copying R.V.'s dialogue which is well tested printf(">>>>>>>>><<<<<<<<<<\nNew input file = ?\n"); if (fgets(reply, MaxReply, stdin)) { if (reply[0] != '\n') { strncpy(inF, reply, MaxReply); // Why not use strcpy?? inF[strlen(reply)-1] = 0; // Robin's construct to fix it } //end temp. fix } // inF = GetStringDialog("New input file =",InFile); strcpy (InFile,inF); printf("Input file set to %s, expanded name = %s\n",InFile, gSystem->ExpandPathName(InFile)); } if(index == 2) { // begin temporary patch, copying R.V.'s dialogue which is well tested printf(">>>>>>>>><<<<<<<<<<\nNew output file = ?\n"); if (fgets(reply, MaxReply, stdin)) { if (reply[0] != '\n') { strncpy(ouF, reply, MaxReply); // Why not use strcpy?? ouF[strlen(reply)-1] = 0; // Robin's construct to fix it } //end temp. fix } // *ouF = GetStringDialog("New output file =",OuFile); strcpy (OuFile,ouF); printf("Output file set to %s, expanded name = %s\n",OuFile, gSystem->ExpandPathName(OuFile)); } if(index == 3) { printf(">>>>>>>>><<<<<<<<<<\nNumber of events to process?\n"); if (fgets(reply, MaxReply, stdin)) { if (reply[0] != '\n') sscanf (reply, "%d", &nevents); } // nevents = GetIntegerDialog("Give number of events:", 10000); nEvents = nevents; printf(" Number of events selected = %d\n",nevents); } if(index == 4) { printf(">>>>>>>>><<<<<<<<<<\nNumber of runs to process?\n"); if (fgets(reply, MaxReply, stdin)) { if (reply[0] != '\n') sscanf (reply, "%d", &nruns); } // nruns = GetIntegerDialog("Give number of runs:", 10000); nRuns = nruns; printf(" Number of runs selected = %d\n",nruns); } if(index == 5) { // If "GO" is pressed w/o any execute buttons pressed, do all by default: if(doVtx == 0 && doMul == 0 && doOut == 0 && doSpc == 0) { doVtx = 1; doMul = 1; doVtx = 1; doSpc = 1; // Add other do*** as needed } doGo = 1; } if((index == 6) && (ival == 1)) doStop = 1; // EXIT button pushed? Can add other actions before final exit here if((index == 6) && (ival == 10)) doGo = 10; if(index == 7) doPause = ival; // doVtx through doOut: Put "EXECUTE" in red letters under the button if((index >= 8) && (index <= 12)) { TText *texec = new TText(0.1,0.1,"EXECUTE"); texec->SetTextSize(0.25); texec->SetTextColor(2); texec->Draw(); if(index == 8) doVtx = 1; if(index == 9) doOnl = 1; if(index == 10) doMul = 1; if(index == 11) doSpc = 1; if(index == 12) doOut = 1; } // flVtx through flSpc: Bring up a dialog box to set the value // (Not bypassed for the dialog.C subsequent crash problem) // if((index >= 13) && (index <= 16)) { // Int_t value = GetIntegerDialog("Display type:", 1); // isav[index] = value; // } }