void phghelp(int flag = 0) { // This sets up a canvas of six help buttons, five referring // to local .html files and the sixth to either a local or // root.cern.ch hypertext. Also phghelp(7) is used by the // phgeom main pushbutton "ROOT HELP" DMcL 1/Sep/97 char help2[256]; char *wwwbrow = gSystem->Getenv("BROWSER"); // Must be defined! // For example, set BROWSER=C:\Netscape\program\Netscape.exe char *rootsys = gSystem->Getenv("ROOTSYS"); const char *lhfile[5] = { "/howto.html", "/intro.html", "/ideas.html", "/current.html", "/discov.html", }; // Dispatch according to the argument of phghelp: if(flag == 0) { // Set up a canvas with six help buttons, as start of a "tree". // Form the button pad when top HELP button is pushed // Negative 3rd argument is supposed to remove menu bar. // This works in UNIX but not in W95; perhaps an oversight? bar2 = new TCanvas("HELP","HELP",-10,690,300,170); bar2->SetEditable(0); bar2->Draw(); // Button for Operating Instructions TButton *but1 = new TButton("INSTRUCTIONS", "{phghelp(1);}",.05,.55,.30,.95); but1->SetFillColor(3); but1->SetTextSize(0.32); but1->Draw(); // Button for Introduction TButton *but2 = new TButton("INTRODUCTION", "{phghelp(2);}",.35,.55,.65,.95); but2->SetFillColor(7); but2->SetTextSize(0.35); but2->Draw(); // Button for GUI Ideas TButton *but3 = new TButton("GUI IDEAS", "{phghelp(3);}",.70,.55,.95,.95); but3->SetFillColor(38); but3->SetTextSize(0.40); but3->Draw(); // Button for Current Work TButton *but4 = new TButton("CURRENT", "{phghelp(4);}",.05,.05,.30,.45); but4->SetFillColor(33); but4->SetTextSize(0.40); but4->Draw(); // Button for Bugs and Discoveries TButton *but5 = new TButton("DISCOVERIES", "{phghelp(5);}",.35,.05,.65,.45); but5->SetFillColor(46); but5->SetTextSize(0.35); but5->Draw(); // Button for ROOT Class Index TButton *but6 = new TButton("ROOTCLASSES", "{phghelp(6);}",.70,.05,.95,.45); but6->SetFillColor(6); but6->SetTextSize(0.32); but6->Draw(); bar2->Update(); } // First 5 buttons call hypertext in the current directory if(flag > 0 && flag < 6) { ostrstream out(help2,256); out << "start " << wwwbrow << " " << gSystem->WorkingDirectory() << lhfile[flag - 1] << "\n"; gSystem.Exec(help2); } // Last button and main menu ROOT help call need ROOTDOC: // Do we have a local RootHtmlDoc or do we need root.cern.ch? if(flag > 5 && flag < 8) { ostrstream out(help2,256); out << rootsys << "/RootHtmlDoc/Welcome.html"; // (Notice UNIX syntax dir/dir/... is interpreted as \ in W95/NT) ifstream ifex(help2, ios::in | ios::nocreate); if (ifex) { ifex.close(); if (flag == 7) { ostrstream out(help2,256); out << "start " << wwwbrow << " " << rootsys << "/RootHtmlDoc/Welcome.html"; gSystem.Exec(help2); } if (flag == 6) { ostrstream out(help2,256); out << "start " << wwwbrow << " " << rootsys << "/RootHtmlDoc/html/ClassIndex.html"; gSystem.Exec(help2); } } else { if (flag == 7) { ostrstream out(help2,256); out << "start " << wwwbrow << " http://root.cern.ch/"; gSystem.Exec(help2); } if (flag == 6) { ostrstream out(help2,256); out << "start " << wwwbrow << " http://root.cern.ch/root/html/ClassIndex.html"; gSystem.Exec(help2); } } } c1->cd(); }