Logo ROOT  
Reference Guide
TRootBrowser.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Bertrand Bellenot 26/09/2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12//////////////////////////////////////////////////////////////////////////
13// //
14// TRootBrowser //
15// //
16// This class creates a ROOT object browser, constitued by three main //
17// tabs. //
18// //
19// All tabs can 'swallow' frames, thanks to the new method: //
20// ExecPlugin(const char *name = 0, const char *fname = 0, //
21// const char *cmd = 0, Int_t pos = kRight, //
22// Int_t subpos = -1) //
23// allowing to select plugins (can be a macro or a command) //
24// to be executed, and where to embed the frame created by //
25// the plugin (tab and tab element). Examples: //
26// //
27// create a new browser: //
28// TBrowser b; //
29// //
30// create a new TCanvas in a new top right tab element: //
31// b.ExecPlugin("Canvas", 0, "new TCanvas()"); //
32// //
33// create a new top right tab element embedding the //
34// TGMainFrame created by the macro 'myMacro.C': //
35// b.ExecPlugin("MyPlugin", "myMacro.C"); //
36// //
37// create a new bottom tab element embedding the //
38// TGMainFrame created by the macro 'myMacro.C': //
39// b.ExecPlugin("MyPlugin", "myMacro.C", 0, TRootBrowser::kBottom); //
40// //
41// this browser implementation can be selected via the env //
42// 'Browser.Name' in .rootrc, (TRootBrowser or TRootBrowserLite) //
43// the default being TRootBrowserLite (old browser) //
44// a list of options (plugins) for the new TRootBrowser is also //
45// specified via the env 'Browser.Options' in .rootrc, the default //
46// being: FECI //
47// Here is the list of available options: //
48// F: File browser E: Text Editor H: HTML browser C: Canvas I: I/O //
49// redirection P: Proof G: GL viewer //
50// //
51//////////////////////////////////////////////////////////////////////////
52
53#include "TROOT.h"
54#include "TSystem.h"
55#include "TApplication.h"
56#include "TBrowser.h"
57#include "TClass.h"
58#include "TGClient.h"
59#include "TGFrame.h"
60#include "TGTab.h"
61#include "TGMenu.h"
62#include "TGLayout.h"
63#include "TGSplitter.h"
64#include "TGStatusBar.h"
65#include "Varargs.h"
66#include "TInterpreter.h"
67#include "TGFileDialog.h"
68#include "TObjString.h"
69#include "TVirtualPad.h"
70#include "TEnv.h"
71#include <KeySymbols.h>
72
73#include "RConfigure.h"
74
75#include "TRootBrowser.h"
76#include "TGFileBrowser.h"
77#include "TGInputDialog.h"
78#include "TRootHelpDialog.h"
79#include "TVirtualPadEditor.h"
80#include "HelpText.h"
81#include "Getline.h"
82#include "TVirtualX.h"
83
84
85#ifdef WIN32
86#include <TWin32SplashThread.h>
87#endif
88
89static const char *gOpenFileTypes[] = {
90 "ROOT files", "*.root",
91 "All files", "*",
92 0, 0
93};
94
95static const char *gPluginFileTypes[] = {
96 "ROOT files", "*.C",
97 "All files", "*",
98 0, 0
99};
100
101//_____________________________________________________________________________
102//
103// TRootBrowser
104//
105// The main ROOT object browser.
106//_____________________________________________________________________________
107
109
110////////////////////////////////////////////////////////////////////////////////
111/// Create browser with a specified width and height.
112
114 UInt_t height, Option_t *opt, Bool_t initshow) :
115 TGMainFrame(gClient->GetDefaultRoot(), width, height), TBrowserImp(b)
116{
118 fActBrowser = 0;
119 fIconPic = 0;
121 Resize(width, height);
122 if (initshow) {
123 InitPlugins(opt);
124 MapWindow();
125 }
126 TQObject::Connect("TCanvas", "ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
127 "TRootBrowser", this,
128 "EventInfo(Int_t, Int_t, Int_t, TObject*)");
129 gVirtualX->SetInputFocus(GetId());
130}
131
132////////////////////////////////////////////////////////////////////////////////
133/// Create browser with a specified width and height and at position x, y.
134
136 UInt_t width, UInt_t height, Option_t *opt,
137 Bool_t initshow) :
138 TGMainFrame(gClient->GetDefaultRoot(), width, height), TBrowserImp(b)
139{
141 fActBrowser = 0;
142 fIconPic = 0;
144 MoveResize(x, y, width, height);
145 SetWMPosition(x, y);
146 if (initshow) {
147 InitPlugins(opt);
148 MapWindow();
149 }
150 TQObject::Connect("TCanvas", "ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
151 "TRootBrowser", this,
152 "EventInfo(Int_t, Int_t, Int_t, TObject*)");
153 gVirtualX->SetInputFocus(GetId());
154}
155
156
157////////////////////////////////////////////////////////////////////////////////
158
160{
161 // Create the actual interface.
162
163 fVf = new TGVerticalFrame(this, 100, 100);
164
166 fLH1 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
167 fLH2 = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0, 0, 1, 1);
173
174 // Menubar Frame
175 fTopMenuFrame = new TGHorizontalFrame(fVf, 100, 20);
176
179 fMenuFile = new TGPopupMenu(gClient->GetDefaultRoot());
180 fMenuFile->AddEntry("&Browse...\tCtrl+B", kBrowse);
181 fMenuFile->AddEntry("&Open...\tCtrl+O", kOpenFile);
183
185 fMenuHelp->AddEntry("&About ROOT...", kHelpAbout);
187 fMenuHelp->AddEntry("Help On Browser...", kHelpOnBrowser);
188 fMenuHelp->AddEntry("Help On Canvas...", kHelpOnCanvas);
189 fMenuHelp->AddEntry("Help On Menus...", kHelpOnMenus);
190 fMenuHelp->AddEntry("Help On Graphics Editor...", kHelpOnGraphicsEd);
191 fMenuHelp->AddEntry("Help On Objects...", kHelpOnObjects);
192 fMenuHelp->AddEntry("Help On PostScript...", kHelpOnPS);
193 fMenuHelp->AddEntry("Help On Remote Session...", kHelpOnRemote);
194 fMenuFile->AddPopup("Browser Help...", fMenuHelp);
195
197 fMenuFile->AddEntry("&Clone\tCtrl+N", kClone);
199 fMenuFile->AddEntry("New &Editor\tCtrl+E", kNewEditor);
200 fMenuFile->AddEntry("New &Canvas\tCtrl+C", kNewCanvas);
201 fMenuFile->AddEntry("New &HTML\tCtrl+H", kNewHtml);
205 fMenuExecPlugin->AddEntry("&Command...", kExecPluginCmd);
206 fMenuFile->AddPopup("Execute &Plugin...", fMenuExecPlugin);
208 fMenuFile->AddEntry("Close &Tab\tCtrl+T", kCloseTab);
209 fMenuFile->AddEntry("Close &Window\tCtrl+W", kCloseWindow);
211 fMenuFile->AddEntry("&Quit Root\tCtrl+Q", kQuitRoot);
212 fMenuBar->AddPopup("&Browser", fMenuFile, fLH1);
213 fMenuFile->Connect("Activated(Int_t)", "TRootBrowser", this,
214 "HandleMenu(Int_t)");
217
218 if (!TClass::GetClass("TGHtmlBrowser"))
220
223
226
227 // Toolbar Frame
231
232 fHf = new TGHorizontalFrame(fVf, 100, 100);
233 // Tabs & co...
234#if defined(R__HAS_COCOA)
235 fV1 = new TGVerticalFrame(fHf, 252, 100, kFixedWidth);
236#else
237 fV1 = new TGVerticalFrame(fHf, 250, 100, kFixedWidth);
238#endif
239 fV2 = new TGVerticalFrame(fHf, 600, 100);
240 fH1 = new TGHorizontalFrame(fV2, 100, 100);
241 fH2 = new TGHorizontalFrame(fV2, 100, 100, kFixedHeight);
242
243 // Left tab
244 fTabLeft = new TGTab(fV1,100,100);
245 //fTabLeft->AddTab("Tab 1");
248
249 // Vertical splitter
250 fVSplitter = new TGVSplitter(fHf, 4, 4);
252 fHf->AddFrame(fV1, fLH7);
254
255 // Right tab
256 fTabRight = new TGTab(fH1, 500, 100);
257 //fTabRight->AddTab("Tab 1");
260 fTabRight->Connect("Selected(Int_t)", "TRootBrowser", this, "DoTab(Int_t)");
261 fTabRight->Connect("CloseTab(Int_t)", "TRootBrowser", this, "CloseTab(Int_t)");
262 fV2->AddFrame(fH1, fLH4);
263
264 // Horizontal splitter
265 fHSplitter = new TGHSplitter(fV2, 4, 4);
267
268 // Bottom tab
269 fTabBottom = new TGTab(fH2, 100, 100);
270 //fTabBottom->AddTab("Tab 1");
272 fV2->AddFrame(fH2, fLH3);
273
275 fHf->AddFrame(fV2, fLH5);
276 fVf->AddFrame(fHf, fLH5);
277 AddFrame(fVf, fLH5);
278
279 // status bar
280 fStatusBar = new TGStatusBar(this, 400, 20);
281 int parts[] = { 33, 10, 10, 47 };
282 fStatusBar->SetParts(parts, 4);
284
285 fNbInitPlugins = 0;
286 fEditFrame = 0;
287 fEditTab = 0;
288 fEditPos = -1;
289 fEditSubPos= -1;
290 fNbTab[0] = fNbTab[1] = fNbTab[2] = 0;
291 fCrTab[0] = fCrTab[1] = fCrTab[2] = -1;
292
293 // Set a name to the main frame
296 fIconPic = SetIconPixmap("rootdb_s.xpm");
297 SetClassHints("ROOT", "Browser");
298
299 if (!strcmp(gROOT->GetDefCanvasName(), "c1"))
300 gROOT->SetDefCanvasName("Canvas_1");
301
302 SetWMSizeHints(600, 350, 10000, 10000, 2, 2);
306
308}
309
310////////////////////////////////////////////////////////////////////////////////
311/// Clean up all widgets, frames and layouthints that were used
312
314{
315 if (fIconPic) gClient->FreePicture(fIconPic);
316 delete fLH0;
317 delete fLH1;
318 delete fLH2;
319 delete fLH3;
320 delete fLH4;
321 delete fLH5;
322 delete fLH6;
323 delete fLH7;
324 delete fMenuHelp;
325 delete fMenuExecPlugin;
326 delete fMenuFile;
327 delete fMenuBar;
328 delete fMenuFrame;
329 delete fPreMenuFrame;
330 delete fTopMenuFrame;
331 delete fToolbarFrame;
332 delete fVSplitter;
333 delete fHSplitter;
334 delete fTabLeft;
335 delete fTabRight;
336 delete fTabBottom;
337 delete fH1;
338 delete fH2;
339 delete fV1;
340 delete fV2;
341 delete fHf;
342 delete fStatusBar;
343 delete fVf;
344}
345
346////////////////////////////////////////////////////////////////////////////////
347/// Add items to the actual browser. This function has to be called
348/// by the Browse() member function of objects when they are
349/// called by a browser. If check < 0 (default) no check box is drawn,
350/// if 0 then unchecked checkbox is added, if 1 checked checkbox is added.
351
352void TRootBrowser::Add(TObject *obj, const char *name, Int_t check)
353{
354 if (obj->InheritsFrom("TObjectSpy"))
355 return;
356 if (fActBrowser)
357 fActBrowser->Add(obj, name, check);
358}
359
360////////////////////////////////////////////////////////////////////////////////
361/// Browse object. This, in turn, will trigger the calling of
362/// TRootBrowser::Add() which will fill the IconBox and the tree.
363/// Emits signal "BrowseObj(TObject*)".
364
366{
367 if (fActBrowser)
369 Emit("BrowseObj(TObject*)", (Long_t)obj);
370}
371
372////////////////////////////////////////////////////////////////////////////////
373/// Clone the browser. A new Browser will be created, with the same
374/// plugins executed in the current one.
375
377{
378 Int_t loop = 1;
379 TBrowserPlugin *plugin = 0;
380 TBrowser *b = new TBrowser();
381 TIter next(&fPlugins);
382 while ((plugin = (TBrowserPlugin *)next())) {
383 if (loop > fNbInitPlugins)
384 b->ExecPlugin(plugin->GetName(), "", plugin->fCommand.Data(), plugin->fTab,
385 plugin->fSubTab);
386 ++loop;
387 }
388}
389
390////////////////////////////////////////////////////////////////////////////////
391/// Remove tab element id from right tab.
392
394{
395 RemoveTab(kRight, id);
396}
397
398////////////////////////////////////////////////////////////////////////////////
399/// Properly close the mainframes embedded in the different tabs
400
402{
403 TGFrameElement *el;
404 TGCompositeFrame *container;
405 Int_t i;
406 TQObject::Disconnect("TCanvas", "ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
407 this, "EventInfo(Int_t, Int_t, Int_t, TObject*)");
408 Disconnect(fMenuFile, "Activated(Int_t)", this, "HandleMenu(Int_t)");
409 Disconnect(fTabRight, "Selected(Int_t)", this, "DoTab(Int_t)");
410 if (fPlugins.IsEmpty()) return;
411 fActBrowser = 0;
412 for (i=0;i<fTabLeft->GetNumberOfTabs();i++) {
413 container = fTabLeft->GetTabContainer(i);
414 if (!container) continue;
415 el = (TGFrameElement *)container->GetList()->First();
416 if (el && el->fFrame) {
417 el->fFrame->SetFrameElement(0);
418 if (el->fFrame->InheritsFrom("TVirtualPadEditor")) {
420 }
421 else if (el->fFrame->InheritsFrom("TGMainFrame")) {
422 el->fFrame->UnmapWindow();
423 ((TGMainFrame *)el->fFrame)->CloseWindow();
425 }
426 else
427 delete el->fFrame;
428 el->fFrame = 0;
429 if (el->fLayout && (el->fLayout != fgDefaultHints) &&
430 (el->fLayout->References() > 0)) {
432 if (!el->fLayout->References()) {
433 delete el->fLayout;
434 }
435 }
436 container->GetList()->Remove(el);
437 delete el;
438 }
439 }
440 for (i=0;i<fTabRight->GetNumberOfTabs();i++) {
441 container = fTabRight->GetTabContainer(i);
442 if (!container) continue;
443 el = (TGFrameElement *)container->GetList()->First();
444 if (el && el->fFrame) {
445 el->fFrame->SetFrameElement(0);
446 if (el->fFrame->InheritsFrom("TGMainFrame")) {
447 el->fFrame->UnmapWindow();
448 Bool_t sleep = (el->fFrame->InheritsFrom("TRootCanvas")) ? kTRUE : kFALSE;
449 if (sleep)
450 gSystem->Sleep(150);
451 ((TGMainFrame *)el->fFrame)->CloseWindow();
452 if (sleep)
453 gSystem->Sleep(150);
455 }
456 else
457 delete el->fFrame;
458 el->fFrame = 0;
459 if (el->fLayout && (el->fLayout != fgDefaultHints) &&
460 (el->fLayout->References() > 0)) {
462 if (!el->fLayout->References()) {
463 delete el->fLayout;
464 }
465 }
466 container->GetList()->Remove(el);
467 delete el;
468 }
469 }
470 for (i=0;i<fTabBottom->GetNumberOfTabs();i++) {
471 container = fTabBottom->GetTabContainer(i);
472 if (!container) continue;
473 el = (TGFrameElement *)container->GetList()->First();
474 if (el && el->fFrame) {
475 el->fFrame->SetFrameElement(0);
476 if (el->fFrame->InheritsFrom("TGMainFrame")) {
477 el->fFrame->UnmapWindow();
478 ((TGMainFrame *)el->fFrame)->CloseWindow();
479 gSystem->Sleep(150);
481 }
482 else
483 delete el->fFrame;
484 el->fFrame = 0;
485 if (el->fLayout && (el->fLayout != fgDefaultHints) &&
486 (el->fLayout->References() > 0)) {
488 if (!el->fLayout->References()) {
489 delete el->fLayout;
490 }
491 }
492 container->GetList()->Remove(el);
493 delete el;
494 }
495 }
497 Emit("CloseWindow()");
498}
499
500////////////////////////////////////////////////////////////////////////////////
501/// Called when window is closed via the window manager.
502
504{
505 TQObject::Disconnect("TCanvas", "ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
506 this, "EventInfo(Int_t, Int_t, Int_t, TObject*)");
507 CloseTabs();
508 DeleteWindow();
509}
510
511////////////////////////////////////////////////////////////////////////////////
512/// Handle Tab navigation.
513
515{
516 TGTab *sender = (TGTab *)gTQSender;
517 if ((sender) && (sender == fTabRight)) {
518 SwitchMenus(sender->GetTabContainer(id));
519 }
520}
521
522////////////////////////////////////////////////////////////////////////////////
523/// Display a tooltip with infos about the primitive below the cursor.
524
525void TRootBrowser::EventInfo(Int_t event, Int_t px, Int_t py, TObject *selected)
526{
527 const Int_t kTMAX=256;
528 static char atext[kTMAX];
529 if (selected == 0 || event == kMouseLeave) {
530 SetStatusText("", 0);
531 SetStatusText("", 1);
532 SetStatusText("", 2);
533 SetStatusText("", 3);
534 return;
535 }
536 SetStatusText(selected->GetTitle(), 0);
537 SetStatusText(selected->GetName(), 1);
538 if (event == kKeyPress)
539 snprintf(atext, kTMAX, "%c", (char) px);
540 else
541 snprintf(atext, kTMAX, "%d,%d", px, py);
542 SetStatusText(atext, 2);
543 SetStatusText(selected->GetObjectInfo(px,py), 3);
544}
545
546////////////////////////////////////////////////////////////////////////////////
547/// Execute a macro and embed the created frame in the tab "pos"
548/// and tab element "subpos".
549
550Long_t TRootBrowser::ExecPlugin(const char *name, const char *fname,
551 const char *cmd, Int_t pos, Int_t subpos)
552{
553 Long_t retval = 0;
555 TString command, pname;
556 if (cmd && strlen(cmd)) {
557 command = cmd;
558 if (name) pname = name;
559 else pname = TString::Format("Plugin %d", fPlugins.GetSize());
560 p = new TBrowserPlugin(pname.Data(), command.Data(), pos, subpos);
561 }
562 else if (fname && strlen(fname)) {
563 pname = name ? name : gSystem->BaseName(fname);
564 Ssiz_t t = pname.Last('.');
565 if (t > 0) pname.Remove(t);
566 command.Form("gROOT->Macro(\"%s\");", gSystem->UnixPathName(fname));
567 p = new TBrowserPlugin(pname.Data(), command.Data(), pos, subpos);
568 }
569 else return 0;
570 if (IsWebGUI() && command.Contains("new TCanvas"))
571 return gROOT->ProcessLine(command.Data());
572 StartEmbedding(pos, subpos);
573 fPlugins.Add(p);
574 retval = gROOT->ProcessLine(command.Data());
575 if (command.Contains("new TCanvas")) {
576 pname = gPad->GetName();
577 p->SetName(pname.Data());
578 }
579 SetTabTitle(pname.Data(), pos, subpos);
581 return retval;
582}
583
584////////////////////////////////////////////////////////////////////////////////
585/// Returns drawing option.
586
588{
589 if (fActBrowser)
590 return fActBrowser->GetDrawOption();
591 return 0;
592}
593
594////////////////////////////////////////////////////////////////////////////////
595/// Returns the TGTab at position pos.
596
598{
599 switch (pos) {
600 case kLeft: return fTabLeft;
601 case kRight: return fTabRight;
602 case kBottom: return fTabBottom;
603 default: return 0;
604 }
605}
606
607////////////////////////////////////////////////////////////////////////////////
608/// Handle keyboard events.
609
611{
612 char input[10];
613 UInt_t keysym;
614
615 if (event->fType == kGKeyPress) {
616 gVirtualX->LookupString(event, input, sizeof(input), keysym);
617
618 if (!event->fState && (EKeySym)keysym == kKey_F5) {
619 Refresh(kTRUE);
620 return kTRUE;
621 }
622 switch ((EKeySym)keysym) { // ignore these keys
623 case kKey_Shift:
624 case kKey_Control:
625 case kKey_Meta:
626 case kKey_Alt:
627 case kKey_CapsLock:
628 case kKey_NumLock:
629 case kKey_ScrollLock:
630 return kTRUE;
631 default:
632 break;
633 }
634 if (event->fState & kKeyControlMask) { // Cntrl key modifier pressed
635 switch ((EKeySym)keysym & ~0x20) { // treat upper and lower the same
636 case kKey_B:
638 return kTRUE;
639 case kKey_O:
641 return kTRUE;
642 case kKey_E:
644 return kTRUE;
645 case kKey_C:
647 return kTRUE;
648 case kKey_H:
650 return kTRUE;
651 case kKey_N:
653 return kTRUE;
654 case kKey_T:
656 return kTRUE;
657 case kKey_W:
659 return kTRUE;
660 case kKey_Q:
662 return kTRUE;
663 default:
664 break;
665 }
666 }
667 }
668 return TGMainFrame::HandleKey(event);
669}
670
671////////////////////////////////////////////////////////////////////////////////
672/// Handle menu entries events.
673
675{
676 TRootHelpDialog *hd;
677 TString cmd;
678 static Int_t eNr = 1;
679 TGPopupMenu *sender = (TGPopupMenu *)gTQSender;
680 if (sender != fMenuFile)
681 return;
682 switch (id) {
683 case kBrowse:
684 new TBrowser();
685 break;
686 case kOpenFile:
687 {
688 Bool_t newfile = kFALSE;
689 static TString dir(".");
690 TGFileInfo fi;
692 fi.SetIniDir(dir);
693 new TGFileDialog(gClient->GetDefaultRoot(), this,
694 kFDOpen,&fi);
695 dir = fi.fIniDir;
696 if (fi.fMultipleSelection && fi.fFileNamesList) {
697 TObjString *el;
698 TIter next(fi.fFileNamesList);
699 while ((el = (TObjString *) next())) {
700 gROOT->ProcessLine(Form("new TFile(\"%s\");",
702 }
703 newfile = kTRUE;
704 }
705 else if (fi.fFilename) {
706 gROOT->ProcessLine(Form("new TFile(\"%s\");",
708 newfile = kTRUE;
709 }
710 if (fActBrowser && newfile) {
711 TGFileBrowser *fb = dynamic_cast<TGFileBrowser *>(fActBrowser);
712 if (fb) fb->Selected(0);
713 }
714 }
715 break;
716 // Handle Help menu items...
717 case kHelpAbout:
718 {
719#ifdef R__UNIX
720 TString rootx = TROOT::GetBinDir() + "/root -a &";
721 gSystem->Exec(rootx);
722#else
723#ifdef WIN32
725#else
726 char str[32];
727 sprintf(str, "About ROOT %s...", gROOT->GetVersion());
728 hd = new TRootHelpDialog(this, str, 600, 400);
729 hd->SetText(gHelpAbout);
730 hd->Popup();
731#endif
732#endif
733 }
734 break;
735 case kHelpOnCanvas:
736 hd = new TRootHelpDialog(this, "Help on Canvas...", 600, 400);
737 hd->SetText(gHelpCanvas);
738 hd->Popup();
739 break;
740 case kHelpOnMenus:
741 hd = new TRootHelpDialog(this, "Help on Menus...", 600, 400);
743 hd->Popup();
744 break;
746 hd = new TRootHelpDialog(this, "Help on Graphics Editor...", 600, 400);
748 hd->Popup();
749 break;
750 case kHelpOnBrowser:
751 hd = new TRootHelpDialog(this, "Help on Browser...", 600, 400);
753 hd->Popup();
754 break;
755 case kHelpOnObjects:
756 hd = new TRootHelpDialog(this, "Help on Objects...", 600, 400);
758 hd->Popup();
759 break;
760 case kHelpOnPS:
761 hd = new TRootHelpDialog(this, "Help on PostScript...", 600, 400);
763 hd->Popup();
764 break;
765 case kHelpOnRemote:
766 hd = new TRootHelpDialog(this, "Help on Browser...", 600, 400);
767 hd->SetText(gHelpRemote);
768 hd->Popup();
769 break;
770 case kClone:
771 CloneBrowser();
772 break;
773 case kNewEditor:
774 cmd.Form("new TGTextEditor((const char *)0, gClient->GetRoot())");
775 ++eNr;
776 ExecPlugin(Form("Editor %d", eNr), "", cmd.Data(), 1);
777 break;
778 case kNewCanvas:
779 if (IsWebGUI())
780 gROOT->ProcessLine("new TCanvas()");
781 else
782 ExecPlugin("", "", "new TCanvas()", 1);
783 break;
784 case kNewHtml:
785 cmd.Form("new TGHtmlBrowser(\"%s\", gClient->GetRoot())",
786 gEnv->GetValue("Browser.StartUrl", "http://root.cern.ch"));
787 ExecPlugin("HTML", "", cmd.Data(), 1);
788 break;
789 case kExecPluginMacro:
790 {
791 static TString dir(".");
792 TGFileInfo fi;
794 fi.SetIniDir(dir);
795 new TGFileDialog(gClient->GetDefaultRoot(), this,
796 kFDOpen,&fi);
797 dir = fi.fIniDir;
798 if (fi.fFilename) {
799 ExecPlugin(0, fi.fFilename, 0, kRight);
800 }
801 }
802 break;
803 case kExecPluginCmd:
804 {
805 char command[1024];
806 strlcpy(command, "new TGLSAViewer(gClient->GetRoot(), 0);",
807 sizeof(command));
808 new TGInputDialog(gClient->GetRoot(), this,
809 "Enter plugin command line:",
810 command, command);
811 if (strcmp(command, "")) {
812 ExecPlugin("User", 0, command, kRight);
813 }
814 }
815 break;
816 case kCloseTab:
818 break;
819 case kCloseWindow:
820 CloseWindow();
821 break;
822 case kQuitRoot:
823 CloseWindow();
825 break;
826 default:
827 break;
828 }
829}
830
831////////////////////////////////////////////////////////////////////////////////
832/// Initialize default plugins. Could be also of the form:
833/// StartEmbedding(0);
834/// TPluginHandler *ph;
835/// ph = gROOT->GetPluginManager()->FindHandler("TGClassBrowser");
836/// if (ph && ph->LoadPlugin() != -1) {
837/// ph->ExecPlugin(3, gClient->GetRoot(), 200, 500);
838/// }
839/// StopEmbedding();
840
842{
843 TString cmd;
844
845 if ((opt == 0) || (!opt[0]))
846 return;
847 // --- Left vertical area
848
849 // File Browser plugin
850 if (strchr(opt, 'F')) {
851 cmd.Form("new TGFileBrowser(gClient->GetRoot(), (TBrowser *)0x%lx, 200, 500);", (ULong_t)fBrowser);
852 ExecPlugin("Files", 0, cmd.Data(), 0);
854 }
855
856 // --- Right main area
857
858 Int_t i, len = strlen(opt);
859 for (i=0; i<len; ++i) {
860 // Editor plugin...
861 if (opt[i] == 'E') {
862 cmd.Form("new TGTextEditor((const char *)0, gClient->GetRoot());");
863 ExecPlugin("Editor 1", 0, cmd.Data(), 1);
865 }
866
867 // HTML plugin...
868 if (opt[i] == 'H') {
869 if (gSystem->Load("libGuiHtml") >= 0) {
870 cmd.Form("new TGHtmlBrowser(\"%s\", gClient->GetRoot());",
871 gEnv->GetValue("Browser.StartUrl",
872 "http://root.cern.ch/root/html/ClassIndex.html"));
873 ExecPlugin("HTML", 0, cmd.Data(), 1);
875 }
876 }
877
878 // Canvas plugin...
879 if ((opt[i] == 'C') && !IsWebGUI()) {
880 cmd.Form("new TCanvas();");
881 ExecPlugin("c1", 0, cmd.Data(), 1);
883 }
884
885 // GLViewer plugin...
886 if (opt[i] == 'G') {
887 cmd.Form("new TGLSAViewer(gClient->GetRoot(), 0);");
888 ExecPlugin("OpenGL", 0, cmd.Data(), 1);
890 }
891
892 // PROOF plugin...
893 if (opt[i] == 'P') {
894 cmd.Form("new TSessionViewer();");
895 ExecPlugin("PROOF", 0, cmd.Data(), 1);
897 }
898 }
899 // --- Right bottom area
900
901 // Command plugin...
902 if (strchr(opt, 'I')) {
903 cmd.Form("new TGCommandPlugin(gClient->GetRoot(), 700, 300);");
904 ExecPlugin("Command", 0, cmd.Data(), 2);
906 }
907
908 // --- Select first tab everywhere
909 SetTab(0, 0);
910 SetTab(1, 0);
911 SetTab(2, 0);
912}
913
914////////////////////////////////////////////////////////////////////////////////
915/// Check if the GUI factory is set to use the Web GUI.
916
918{
919 TString factory = gEnv->GetValue("Gui.Factory", "native");
920 return (factory.Contains("web", TString::kIgnoreCase));
921}
922
923////////////////////////////////////////////////////////////////////////////////
924/// Really delete the browser and the this GUI.
925
927{
929 delete this;
930}
931
932////////////////////////////////////////////////////////////////////////////////
933/// Recursively remove object from browser.
934
936{
937 if (fActBrowser)
939}
940
941////////////////////////////////////////////////////////////////////////////////
942/// Recursively reparent TGPopupMenu to gClient->GetDefaultRoot().
943
945{
946 TGMenuEntry *entry = 0;
947 TIter next(popup->GetListOfEntries());
948 while ((entry = (TGMenuEntry *)next())) {
949 if (entry->GetPopup()) {
950 RecursiveReparent(entry->GetPopup());
951 }
952 }
953 popup->ReparentWindow(gClient->GetDefaultRoot());
954}
955
956////////////////////////////////////////////////////////////////////////////////
957/// Refresh the actual browser contents.
958
960{
961 if (fActBrowser)
962 fActBrowser->Refresh(force);
963}
964
965////////////////////////////////////////////////////////////////////////////////
966/// Remove tab element "subpos" from tab "pos".
967
969{
970 TGTab *edit = 0;
971 switch (pos) {
972 case kLeft: // left
973 edit = fTabLeft;
974 break;
975 case kRight: // right
976 edit = fTabRight;
979 fActMenuBar = 0;
980 break;
981 case kBottom: // bottom
982 edit = fTabBottom;
983 break;
984 }
985 if (!edit || !edit->GetTabTab(subpos))
986 return;
987 const char *tabName = edit->GetTabTab(subpos)->GetString();
988 TObject *obj = 0;
989 if ((obj = fPlugins.FindObject(tabName))) {
990 fPlugins.Remove(obj);
991 }
992 TGFrameElement *el = 0;
993 if (edit->GetTabContainer(subpos))
994 el = (TGFrameElement *)edit->GetTabContainer(subpos)->GetList()->First();
995 if (el && el->fFrame) {
996 el->fFrame->Disconnect("ProcessedConfigure(Event_t*)");
997 el->fFrame->SetFrameElement(0);
998 if (el->fFrame->InheritsFrom("TGMainFrame")) {
999 Bool_t sleep = (el->fFrame->InheritsFrom("TRootCanvas")) ? kTRUE : kFALSE;
1000 ((TGMainFrame *)el->fFrame)->CloseWindow();
1001 if (sleep)
1002 gSystem->Sleep(150);
1004 }
1005 else
1006 delete el->fFrame;
1007 el->fFrame = 0;
1008 if (el->fLayout && (el->fLayout != fgDefaultHints) &&
1009 (el->fLayout->References() > 0)) {
1010 el->fLayout->RemoveReference();
1011 if (!el->fLayout->References()) {
1012 delete el->fLayout;
1013 }
1014 }
1015 edit->GetTabContainer(subpos)->GetList()->Remove(el);
1016 delete el;
1017 }
1018 fNbTab[pos]--;
1019 edit->RemoveTab(subpos);
1020 SwitchMenus(edit->GetTabContainer(edit->GetCurrent()));
1021}
1022
1023////////////////////////////////////////////////////////////////////////////////
1024/// Switch to Tab "subpos" in TGTab "pos".
1025
1027{
1028 TGTab *tab = GetTab(pos);
1029 if (subpos == -1)
1030 subpos = fCrTab[pos];
1031
1032 if (tab && tab->SetTab(subpos, kFALSE)) { // Block signal emit
1033 if (pos == kRight)
1034 SwitchMenus(tab->GetTabContainer(subpos));
1035 tab->Layout();
1036 }
1037}
1038
1039////////////////////////////////////////////////////////////////////////////////
1040/// Set text "title" of Tab "subpos" in TGTab "pos".
1041
1042void TRootBrowser::SetTabTitle(const char *title, Int_t pos, Int_t subpos)
1043{
1044 TBrowserPlugin *p = 0;
1045 TGTab *edit = GetTab(pos);
1046 if (!edit) return;
1047 if (subpos == -1)
1048 subpos = fCrTab[pos];
1049
1050 TGTabElement *el = edit->GetTabTab(subpos);
1051 if (el) {
1052 el->SetText(new TGString(title));
1053 edit->Layout();
1054 if ((p = (TBrowserPlugin *)fPlugins.FindObject(title)))
1055 p->SetName(title);
1056 }
1057}
1058
1059////////////////////////////////////////////////////////////////////////////////
1060/// Set text in culumn col in status bar.
1061
1062void TRootBrowser::SetStatusText(const char* txt, Int_t col)
1063{
1064 fStatusBar->SetText(txt, col);
1065}
1066
1067////////////////////////////////////////////////////////////////////////////////
1068/// Show the selected frame's menu and hide previous one.
1069
1071{
1072 TGFrameElement *el = 0;
1073 // temporary solution until I find a proper way to handle
1074 // these bloody menus...
1075 fBindList->Delete();
1076 TIter nextm(fMenuBar->GetList());
1077 while ((el = (TGFrameElement *) nextm())) {
1078 TGMenuTitle *t = (TGMenuTitle *) el->fFrame;
1079 Int_t code = t->GetHotKeyCode();
1088 }
1090 fMenuFrame->ShowFrame(menu);
1091 menu->Layout();
1092 fMenuFrame->Layout();
1093 fActMenuBar = menu;
1094}
1095
1096////////////////////////////////////////////////////////////////////////////////
1097/// Start embedding external frame in the tab "pos" and tab element "subpos".
1098
1100{
1101 fEditTab = GetTab(pos);
1102 if (!fEditTab) return;
1103 fEditPos = pos;
1104 fEditSubPos = subpos;
1105
1106 if (fEditFrame == 0) {
1107 if (subpos == -1) {
1108 fCrTab[pos] = fNbTab[pos]++;
1109 fEditFrame = fEditTab->AddTab(Form("Tab %d",fNbTab[pos]));
1113 if(tabel) {
1114 tabel->MapWindow();
1115 if (fShowCloseTab && (pos == 1))
1116 tabel->ShowClose();
1117 }
1119 fEditTab->Layout();
1120 }
1121 else {
1122 fCrTab[pos] = subpos;
1124 fEditTab->SetTab(subpos);
1125 }
1127 }
1128}
1129
1130////////////////////////////////////////////////////////////////////////////////
1131/// Stop embedding external frame in the current editable frame.
1132
1134{
1135 if (fEditFrame != 0) {
1138 if (el && el->fFrame) {
1139 // let be notified when the inside frame gets resized, and tell its
1140 // container to recompute its layout
1141 el->fFrame->Connect("ProcessedConfigure(Event_t*)", "TGCompositeFrame",
1142 fEditFrame, "Layout()");
1143 }
1144 if (layout) {
1145 el = (TGFrameElement*) fEditFrame->GetList()->Last();
1146 // !!!! MT what to do with the old layout? Leak it for now ...
1147 if (el) el->fLayout = layout;
1148 }
1149 fEditFrame->Layout();
1150 if (fEditTab == fTabRight)
1152 }
1153 if (name && strlen(name)) {
1155 }
1157 fEditFrame = fEditTab = 0;
1158 fEditPos = fEditSubPos = -1;
1159}
1160
1161////////////////////////////////////////////////////////////////////////////////
1162/// Move the menu from original frame to our TGMenuFrame, or display the
1163/// menu associated to the current tab.
1164
1166{
1167 if (from == 0)
1168 return;
1169 TGFrameElement *fe = (TGFrameElement *)from->GetList()->First();
1170 if (!fe) {
1171 if (fActMenuBar != fMenuBar)
1173 return;
1174 }
1176 TGFrameElement *el = 0;
1177 if (embed && embed->GetList()) {
1178 TIter next(embed->GetList());
1179 while ((el = (TGFrameElement *)next())) {
1180 if (el->fFrame->InheritsFrom("TGMenuBar")) {
1181 TGMenuBar *menu = (TGMenuBar *)el->fFrame;
1182 if (fActMenuBar == menu)
1183 return;
1184 TGFrameElement *nw;
1185 TIter nel(fMenuFrame->GetList());
1186 while ((nw = (TGFrameElement *) nel())) {
1187 if (nw->fFrame == menu) {
1188 ShowMenu(menu);
1189 return;
1190 }
1191 }
1192 ((TGCompositeFrame *)menu->GetParent())->HideFrame(menu);
1195 fMenuFrame->AddFrame(menu, fLH2);
1196 TGFrameElement *mel;
1197 TIter mnext(menu->GetList());
1198 while ((mel = (TGFrameElement *) mnext())) {
1199 TGMenuTitle *t = (TGMenuTitle *) mel->fFrame;
1200 TGPopupMenu *popup = menu->GetPopup(t->GetName());
1201 if (popup) {
1202 RecursiveReparent(popup);
1203 if (popup->GetEntry("Close Canvas")) {
1204 TGMenuEntry *exit = popup->GetEntry("Close Canvas");
1205 popup->HideEntry(exit->GetEntryId());
1206 }
1207 if (popup->GetEntry("Close Viewer")) {
1208 TGMenuEntry *exit = popup->GetEntry("Close Viewer");
1209 popup->HideEntry(exit->GetEntryId());
1210 }
1211 if (popup->GetEntry("Quit ROOT")) {
1212 TGMenuEntry *exit = popup->GetEntry("Quit ROOT");
1213 popup->HideEntry(exit->GetEntryId());
1214 }
1215 if (popup->GetEntry("Exit")) {
1216 TGMenuEntry *exit = popup->GetEntry("Exit");
1217 popup->HideEntry(exit->GetEntryId());
1218 }
1219 }
1220 }
1221 ShowMenu(menu);
1222 return;
1223 }
1224 }
1225 }
1226 if (fActMenuBar != fMenuBar)
1228}
1229
1230////////////////////////////////////////////////////////////////////////////////
1231/// Emits signal when double clicking on icon.
1232
1234{
1235 Emit("DoubleClicked(TObject*)", (Long_t)obj);
1236}
1237
1238////////////////////////////////////////////////////////////////////////////////
1239/// Emits signal when double clicking on icon.
1240
1242{
1243 Long_t args[2];
1244
1245 args[0] = (Long_t)obj;
1246 args[1] = checked;
1247
1248 Emit("Checked(TObject*,Bool_t)", args);
1249}
1250
1251////////////////////////////////////////////////////////////////////////////////
1252/// Emits signal "ExecuteDefaultAction(TObject*)".
1253
1255{
1256 Emit("ExecuteDefaultAction(TObject*)", (Long_t)obj);
1257}
1258
1259
1260////////////////////////////////////////////////////////////////////////////////
1261/// static contructor returning TBrowserImp,
1262/// as needed by the plugin mechanism.
1263
1265 UInt_t width, UInt_t height,
1266 Option_t *opt)
1267{
1268 TRootBrowser *browser = new TRootBrowser(b, title, width, height, opt);
1269 return (TBrowserImp *)browser;
1270}
1271
1272////////////////////////////////////////////////////////////////////////////////
1273/// static contructor returning TBrowserImp,
1274/// as needed by the plugin mechanism.
1275
1277 Int_t y, UInt_t width, UInt_t height,
1278 Option_t *opt)
1279{
1280 TRootBrowser *browser = new TRootBrowser(b, title, x, y, width, height, opt);
1281 return (TBrowserImp *)browser;
1282}
@ kKeyPress
Definition: Buttons.h:20
@ kMouseLeave
Definition: Buttons.h:23
@ kGKeyPress
Definition: GuiTypes.h:59
const Mask_t kKeyLockMask
Definition: GuiTypes.h:195
const Mask_t kKeyMod1Mask
Definition: GuiTypes.h:197
const Mask_t kKeyReleaseMask
Definition: GuiTypes.h:159
const Mask_t kKeyPressMask
Definition: GuiTypes.h:158
const Mask_t kKeyShiftMask
Definition: GuiTypes.h:194
@ kRaisedFrame
Definition: GuiTypes.h:384
@ kFixedWidth
Definition: GuiTypes.h:387
@ kHorizontalFrame
Definition: GuiTypes.h:382
@ kFixedHeight
Definition: GuiTypes.h:389
const Mask_t kKeyControlMask
Definition: GuiTypes.h:196
const Mask_t kKeyMod2Mask
Definition: GuiTypes.h:198
R__EXTERN const char gHelpObjects[]
Definition: HelpText.h:23
R__EXTERN const char gHelpPullDownMenus[]
Definition: HelpText.h:21
R__EXTERN const char gHelpRemote[]
Definition: HelpText.h:25
R__EXTERN const char gHelpAbout[]
Definition: HelpText.h:14
R__EXTERN const char gHelpGraphicsEditor[]
Definition: HelpText.h:20
R__EXTERN const char gHelpCanvas[]
Definition: HelpText.h:22
R__EXTERN const char gHelpBrowser[]
Definition: HelpText.h:15
R__EXTERN const char gHelpPostscript[]
Definition: HelpText.h:18
EKeySym
Definition: KeySymbols.h:25
@ kKey_W
Definition: KeySymbols.h:148
@ kKey_Q
Definition: KeySymbols.h:142
@ kKey_Meta
Definition: KeySymbols.h:51
@ kKey_B
Definition: KeySymbols.h:127
@ kKey_N
Definition: KeySymbols.h:139
@ kKey_CapsLock
Definition: KeySymbols.h:53
@ kKey_F5
Definition: KeySymbols.h:61
@ kKey_Alt
Definition: KeySymbols.h:52
@ kKey_C
Definition: KeySymbols.h:128
@ kKey_ScrollLock
Definition: KeySymbols.h:55
@ kKey_O
Definition: KeySymbols.h:140
@ kKey_Shift
Definition: KeySymbols.h:49
@ kKey_E
Definition: KeySymbols.h:130
@ kKey_T
Definition: KeySymbols.h:145
@ kKey_Control
Definition: KeySymbols.h:50
@ kKey_H
Definition: KeySymbols.h:133
@ kKey_NumLock
Definition: KeySymbols.h:54
#define b(i)
Definition: RSha256.hxx:100
const Bool_t kFALSE
Definition: RtypesCore.h:90
unsigned long ULong_t
Definition: RtypesCore.h:53
long Long_t
Definition: RtypesCore.h:52
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassImp(name)
Definition: Rtypes.h:361
R__EXTERN TApplication * gApplication
Definition: TApplication.h:166
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
R__EXTERN TEnv * gEnv
Definition: TEnv.h:171
#define gClient
Definition: TGClient.h:166
@ kFDOpen
Definition: TGFileDialog.h:38
@ kNoCleanup
Definition: TGFrame.h:49
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsNormal
Definition: TGLayout.h:39
@ kLHintsBottom
Definition: TGLayout.h:36
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
char name[80]
Definition: TGX11.cxx:109
R__EXTERN C unsigned int sleep(unsigned int seconds)
R__EXTERN void * gTQSender
Definition: TQObject.h:44
#define gROOT
Definition: TROOT.h:406
static const char * gPluginFileTypes[]
static const char * gOpenFileTypes[]
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
Definition: TSystem.h:556
#define gPad
Definition: TVirtualPad.h:287
#define gVirtualX
Definition: TVirtualX.h:338
#define snprintf
Definition: civetweb.c:1540
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
ABC describing GUI independent browser implementation protocol.
Definition: TBrowserImp.h:29
virtual Option_t * GetDrawOption() const
Definition: TBrowserImp.h:60
virtual void BrowseObj(TObject *)
Definition: TBrowserImp.h:51
virtual void RecursiveRemove(TObject *)
Definition: TBrowserImp.h:56
virtual void Refresh(Bool_t=kFALSE)
Definition: TBrowserImp.h:57
virtual void Add(TObject *, const char *, Int_t)
Definition: TBrowserImp.h:47
TBrowser * fBrowser
Definition: TBrowserImp.h:32
TString fCommand
Definition: TRootBrowser.h:39
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
void SetBrowserImp(TBrowserImp *i)
Definition: TBrowser.h:93
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition: TClass.cxx:2948
virtual Bool_t IsEmpty() const
Definition: TCollection.h:186
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition: TEnv.cxx:491
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition: TGClient.cxx:224
virtual TList * GetList() const
Definition: TGFrame.h:347
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
Definition: TGFrame.cxx:932
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1241
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1056
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:353
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1148
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1188
static TGLayoutHints * fgDefaultHints
Definition: TGFrame.h:334
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1174
void Selected(char *)
A ROOT File has been selected in TGHtmlBrowser.
TList * fFileNamesList
Definition: TGFileDialog.h:67
char * fFilename
Definition: TGFileDialog.h:61
const char ** fFileTypes
Definition: TGFileDialog.h:63
char * fIniDir
Definition: TGFileDialog.h:62
Bool_t fMultipleSelection
Definition: TGFileDialog.h:66
void SetIniDir(const char *inidir)
Set directory name.
TGLayoutHints * fLayout
Definition: TGLayout.h:121
TGFrame * fFrame
Definition: TGLayout.h:119
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:323
virtual void ReparentWindow(const TGWindow *p, Int_t x=0, Int_t y=0)
Reparent window, make p the new parent and position the window at position (x,y) in new parent.
Definition: TGFrame.h:227
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:260
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
void SetFrameElement(TGFrameElement *fe)
Definition: TGFrame.h:261
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
Definition: TGFrame.cxx:613
virtual void MapWindow()
map window
Definition: TGFrame.h:229
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
virtual void SetFrame(TGFrame *frame, Bool_t above)
Set frame to be resized.
Definition: TGSplitter.cxx:340
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
Definition: TGFrame.cxx:1816
TList * fBindList
Definition: TGFrame.h:461
virtual Bool_t BindKey(const TGWindow *w, Int_t keycode, Int_t modifier) const
Bind key to a window.
Definition: TGFrame.cxx:1597
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition: TGFrame.cxx:1761
virtual Bool_t HandleKey(Event_t *event)
Handle keyboard events.
Definition: TGFrame.cxx:1566
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition: TGFrame.cxx:1839
void SetWMSizeHints(UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc)
Give the window manager minimum and maximum size hints.
Definition: TGFrame.cxx:1864
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1748
const TGPicture * SetIconPixmap(const char *iconName)
Set window icon pixmap by name.
Definition: TGFrame.cxx:1776
virtual TGPopupMenu * GetPopup(const char *s)
Return popup menu with the specified name.
Definition: TGMenu.cxx:538
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
Add popup menu to menu bar.
Definition: TGMenu.cxx:416
TGPopupMenu * GetPopup() const
Definition: TGMenu.h:100
Int_t GetEntryId() const
Definition: TGMenu.h:95
const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGMenu.h:288
Int_t GetHotKeyCode() const
Definition: TGMenu.h:286
TGClient * fClient
Definition: TGObject.h:37
Handle_t GetId() const
Definition: TGObject.h:47
virtual void AddPopup(TGHotString *s, TGPopupMenu *popup, TGMenuEntry *before=0, const TGPicture *p=0)
Add a (cascading) popup menu to a popup menu.
Definition: TGMenu.cxx:1150
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=0, const TGPicture *p=0, TGMenuEntry *before=0)
Add a menu entry.
Definition: TGMenu.cxx:988
virtual void AddSeparator(TGMenuEntry *before=0)
Add a menu separator to the menu.
Definition: TGMenu.cxx:1058
virtual void DisableEntry(Int_t id)
Disable entry (disabled entries appear in a sunken relieve).
Definition: TGMenu.cxx:1722
const TList * GetListOfEntries() const
Definition: TGMenu.h:213
virtual void Activated(Int_t id)
Definition: TGMenu.h:232
virtual void SetText(TGString *text, Int_t partidx=0)
Set text in partition partidx in status bar.
virtual void SetParts(Int_t npart)
Divide the status bar in npart equal sized parts.
void SetText(TGString *text)
Set new tab text.
Definition: TGTab.cxx:181
const char * GetString() const
Definition: TGTab.h:159
virtual void ShowClose(Bool_t on=kTRUE)
Show/hide close icon on the tab element, then apply layout to compute correct elements size.
Definition: TGTab.cxx:198
Definition: TGTab.h:62
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Definition: TGTab.cxx:613
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition: TGTab.cxx:659
virtual Bool_t SetTab(Int_t tabIndex, Bool_t emit=kTRUE)
Brings the composite frame with the index tabIndex to the front and generate the following event if t...
Definition: TGTab.cxx:508
Int_t GetCurrent() const
Definition: TGTab.h:105
virtual void RemoveTab(Int_t tabIndex=-1, Bool_t storeRemoved=kTRUE)
Remove container and tab of tab with index tabIndex.
Definition: TGTab.cxx:393
virtual void Selected(Int_t id)
Definition: TGTab.h:122
TGCompositeFrame * GetTabContainer(Int_t tabIndex) const
Return container of tab with index tabIndex.
Definition: TGTab.cxx:564
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition: TGTab.cxx:342
virtual void SetFrame(TGFrame *frame, Bool_t left)
Set frame to be resized.
Definition: TGSplitter.cxx:141
const TGWindow * GetParent() const
Definition: TGWindow.h:84
virtual void Add(TObject *obj)
Definition: TList.h:87
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:821
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:577
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition: TList.cxx:692
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition: TList.cxx:469
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:658
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Collectable string class.
Definition: TObjString.h:28
const TString & GetString() const
Definition: TObjString.h:46
Mother of all ROOT objects.
Definition: TObject.h:37
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:357
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Returns string containing info about the object at position (px,py).
Definition: TObject.cxx:386
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:443
virtual const char * GetTitle() const
Returns title of object.
Definition: TObject.cxx:401
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition: TQObject.cxx:866
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1024
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Definition: TROOT.cxx:2887
UInt_t RemoveReference()
Definition: TRefCnt.h:41
UInt_t References() const
Definition: TRefCnt.h:38
TGPopupMenu * fMenuExecPlugin
Definition: TRootBrowser.h:83
TGHorizontalFrame * fMenuFrame
Definition: TRootBrowser.h:79
TGTab * GetTab(Int_t pos) const
Returns the TGTab at position pos.
TGLayoutHints * fLH4
Definition: TRootBrowser.h:61
Bool_t fShowCloseTab
Definition: TRootBrowser.h:94
virtual void ExecuteDefaultAction(TObject *obj)
Emits signal "ExecuteDefaultAction(TObject*)".
void SetTabTitle(const char *title, Int_t pos=kRight, Int_t subpos=-1)
Set text "title" of Tab "subpos" in TGTab "pos".
TGPopupMenu * fMenuHelp
Definition: TRootBrowser.h:84
Int_t fCrTab[3]
Definition: TRootBrowser.h:92
TGHorizontalFrame * fH2
Definition: TRootBrowser.h:71
Int_t fNbTab[3]
Definition: TRootBrowser.h:91
TGStatusBar * fStatusBar
Definition: TRootBrowser.h:89
Bool_t IsWebGUI()
Check if the GUI factory is set to use the Web GUI.
TGVerticalFrame * fVf
Definition: TRootBrowser.h:68
virtual void DoubleClicked(TObject *obj)
Emits signal when double clicking on icon.
TGLayoutHints * fLH6
Definition: TRootBrowser.h:61
TGHSplitter * fHSplitter
Definition: TRootBrowser.h:75
TBrowserImp * fActBrowser
Definition: TRootBrowser.h:86
TGCompositeFrame * fEditFrame
Definition: TRootBrowser.h:76
virtual void CloseTab(Int_t id)
Remove tab element id from right tab.
virtual void RecursiveRemove(TObject *obj)
Recursively remove object from browser.
TGCompositeFrame * fActMenuBar
Definition: TRootBrowser.h:85
Int_t fEditPos
Definition: TRootBrowser.h:66
TGLayoutHints * fLH1
Definition: TRootBrowser.h:60
virtual void CloseTabs()
Properly close the mainframes embedded in the different tabs.
const TGPicture * fIconPic
Definition: TRootBrowser.h:95
TRootBrowser(const TRootBrowser &)
Int_t fEditSubPos
Definition: TRootBrowser.h:67
TGTab * fEditTab
Definition: TRootBrowser.h:65
TGLayoutHints * fLH2
Definition: TRootBrowser.h:60
static TBrowserImp * NewBrowser(TBrowser *b=0, const char *title="ROOT Browser", UInt_t width=800, UInt_t height=500, Option_t *opt="")
static contructor returning TBrowserImp, as needed by the plugin mechanism.
TGVerticalFrame * fV1
Definition: TRootBrowser.h:72
void DoTab(Int_t id)
Handle Tab navigation.
Option_t * GetDrawOption() const
Returns drawing option.
TGLayoutHints * fLH0
Definition: TRootBrowser.h:60
void CreateBrowser(const char *name)
TGHorizontalFrame * fPreMenuFrame
Definition: TRootBrowser.h:78
TGLayoutHints * fLH5
Definition: TRootBrowser.h:61
void EventInfo(Int_t event, Int_t px, Int_t py, TObject *selected)
Display a tooltip with infos about the primitive below the cursor.
TList fPlugins
Definition: TRootBrowser.h:88
void SetTab(Int_t pos=kRight, Int_t subpos=-1)
Switch to Tab "subpos" in TGTab "pos".
virtual Bool_t HandleKey(Event_t *event)
Handle keyboard events.
void CloneBrowser()
Clone the browser.
TGTab * fTabRight
Definition: TRootBrowser.h:63
void HandleMenu(Int_t id)
Handle menu entries events.
TGVSplitter * fVSplitter
Definition: TRootBrowser.h:74
virtual void StopEmbedding(const char *name=0)
Definition: TRootBrowser.h:152
TGHorizontalFrame * fHf
Definition: TRootBrowser.h:69
void RemoveTab(Int_t pos, Int_t subpos)
Remove tab element "subpos" from tab "pos".
virtual void StartEmbedding(Int_t pos=kRight, Int_t subpos=-1)
Start embedding external frame in the tab "pos" and tab element "subpos".
TGTab * fTabBottom
Definition: TRootBrowser.h:64
TGPopupMenu * fMenuFile
Definition: TRootBrowser.h:82
void SwitchMenus(TGCompositeFrame *from)
Move the menu from original frame to our TGMenuFrame, or display the menu associated to the current t...
TGLayoutHints * fLH7
Definition: TRootBrowser.h:61
virtual void Checked(TObject *obj, Bool_t check)
Emits signal when double clicking on icon.
virtual Long_t ExecPlugin(const char *name=0, const char *fname=0, const char *cmd=0, Int_t pos=kRight, Int_t subpos=-1)
Execute a macro and embed the created frame in the tab "pos" and tab element "subpos".
void ShowMenu(TGCompositeFrame *menu)
Show the selected frame's menu and hide previous one.
TGTab * fTabLeft
Definition: TRootBrowser.h:62
TGHorizontalFrame * fTopMenuFrame
Definition: TRootBrowser.h:77
virtual void BrowseObj(TObject *obj)
Browse object.
TGLayoutHints * fLH3
Definition: TRootBrowser.h:60
TGMenuBar * fMenuBar
Definition: TRootBrowser.h:81
virtual void SetStatusText(const char *txt, Int_t col)
Set text in culumn col in status bar.
virtual void Add(TObject *obj, const char *name=0, Int_t check=-1)
Add items to the actual browser.
virtual void Refresh(Bool_t force=kFALSE)
Refresh the actual browser contents.
Int_t fNbInitPlugins
Definition: TRootBrowser.h:90
void InitPlugins(Option_t *opt="")
Initialize default plugins.
TGVerticalFrame * fV2
Definition: TRootBrowser.h:73
virtual ~TRootBrowser()
Clean up all widgets, frames and layouthints that were used.
void RecursiveReparent(TGPopupMenu *popup)
Recursively reparent TGPopupMenu to gClient->GetDefaultRoot().
virtual void ReallyDelete()
Really delete the browser and the this GUI.
virtual void CloseWindow()
Called when window is closed via the window manager.
TGHorizontalFrame * fH1
Definition: TRootBrowser.h:70
TGHorizontalFrame * fToolbarFrame
Definition: TRootBrowser.h:80
void SetText(const char *helpText)
Set help text from helpText buffer in TGTextView.
void Popup()
Show help dialog.
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364
@ kIgnoreCase
Definition: TString.h:263
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Definition: TString.cxx:892
TString & Remove(Ssiz_t pos)
Definition: TString.h:668
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition: TString.cxx:2311
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:619
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:651
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
Definition: TSystem.cxx:1850
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition: TSystem.cxx:1058
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:930
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
Definition: TSystem.cxx:435
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition: TSystem.cxx:414
static void Terminate()
Close the global pad editor. Static method.
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
EGEventType fType
Definition: GuiTypes.h:174
UInt_t fState
Definition: GuiTypes.h:180