Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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-2021, 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#include "strlcpy.h"
84#include "snprintf.h"
85
86#ifdef WIN32
87#include <TWin32SplashThread.h>
88#endif
89
90static const char *gOpenFileTypes[] = {
91 "ROOT files", "*.root",
92 "All files", "*",
93 0, 0
94};
95
96static const char *gPluginFileTypes[] = {
97 "ROOT files", "*.C",
98 "All files", "*",
99 0, 0
100};
101
102//_____________________________________________________________________________
103//
104// TRootBrowser
105//
106// The main ROOT object browser.
107//_____________________________________________________________________________
108
110
111////////////////////////////////////////////////////////////////////////////////
112/// Create browser with a specified width and height.
113
115 UInt_t height, Option_t *opt, Bool_t initshow) :
116 TGMainFrame(gClient->GetDefaultRoot(), width, height), TBrowserImp(b)
117{
119 fActBrowser = 0;
120 fIconPic = 0;
122 Resize(width, height);
123 if (initshow) {
124 InitPlugins(opt);
125 MapWindow();
126 }
127 TQObject::Connect("TCanvas", "ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
128 "TRootBrowser", this,
129 "EventInfo(Int_t, Int_t, Int_t, TObject*)");
130 gVirtualX->SetInputFocus(GetId());
131}
132
133////////////////////////////////////////////////////////////////////////////////
134/// Create browser with a specified width and height and at position x, y.
135
137 UInt_t width, UInt_t height, Option_t *opt,
138 Bool_t initshow) :
139 TGMainFrame(gClient->GetDefaultRoot(), width, height), TBrowserImp(b)
140{
142 fActBrowser = 0;
143 fIconPic = 0;
145 MoveResize(x, y, width, height);
146 SetWMPosition(x, y);
147 if (initshow) {
148 InitPlugins(opt);
149 MapWindow();
150 }
151 TQObject::Connect("TCanvas", "ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
152 "TRootBrowser", this,
153 "EventInfo(Int_t, Int_t, Int_t, TObject*)");
154 gVirtualX->SetInputFocus(GetId());
155}
156
157
158////////////////////////////////////////////////////////////////////////////////
159
161{
162 // Create the actual interface.
163
164 fVf = new TGVerticalFrame(this, 100, 100);
165
167 fLH1 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
168 fLH2 = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0, 0, 1, 1);
174
175 // Menubar Frame
176 fTopMenuFrame = new TGHorizontalFrame(fVf, 100, 20);
177
180 fMenuFile = new TGPopupMenu(gClient->GetDefaultRoot());
181 fMenuFile->AddEntry("&Browse...\tCtrl+B", kBrowse);
182 fMenuFile->AddEntry("&Open...\tCtrl+O", kOpenFile);
184
186 fMenuHelp->AddEntry("&About ROOT...", kHelpAbout);
188 fMenuHelp->AddEntry("Help On Browser...", kHelpOnBrowser);
189 fMenuHelp->AddEntry("Help On Canvas...", kHelpOnCanvas);
190 fMenuHelp->AddEntry("Help On Menus...", kHelpOnMenus);
191 fMenuHelp->AddEntry("Help On Graphics Editor...", kHelpOnGraphicsEd);
192 fMenuHelp->AddEntry("Help On Objects...", kHelpOnObjects);
193 fMenuHelp->AddEntry("Help On PostScript...", kHelpOnPS);
194 fMenuHelp->AddEntry("Help On Remote Session...", kHelpOnRemote);
195 fMenuFile->AddPopup("Browser Help...", fMenuHelp);
196
198 fMenuFile->AddEntry("&Clone\tCtrl+N", kClone);
200 fMenuFile->AddEntry("New &Editor\tCtrl+E", kNewEditor);
201 fMenuFile->AddEntry("New &Canvas\tCtrl+C", kNewCanvas);
202 fMenuFile->AddEntry("New &HTML\tCtrl+H", kNewHtml);
206 fMenuExecPlugin->AddEntry("&Command...", kExecPluginCmd);
207 fMenuFile->AddPopup("Execute &Plugin...", fMenuExecPlugin);
209 fMenuFile->AddEntry("Close &Tab\tCtrl+T", kCloseTab);
210 fMenuFile->AddEntry("Close &Window\tCtrl+W", kCloseWindow);
212 fMenuFile->AddEntry("&Quit Root\tCtrl+Q", kQuitRoot);
213 fMenuBar->AddPopup("&Browser", fMenuFile, fLH1);
214 fMenuFile->Connect("Activated(Int_t)", "TRootBrowser", this,
215 "HandleMenu(Int_t)");
218
219 if (!TClass::GetClass("TGHtmlBrowser"))
221
224
227
228 // Toolbar Frame
232
233 fHf = new TGHorizontalFrame(fVf, 100, 100);
234 // Tabs & co...
235#if defined(R__HAS_COCOA)
236 fV1 = new TGVerticalFrame(fHf, 252, 100, kFixedWidth);
237#else
238 fV1 = new TGVerticalFrame(fHf, 250, 100, kFixedWidth);
239#endif
240 fV2 = new TGVerticalFrame(fHf, 600, 100);
241 fH1 = new TGHorizontalFrame(fV2, 100, 100);
242 fH2 = new TGHorizontalFrame(fV2, 100, 100, kFixedHeight);
243
244 // Left tab
245 fTabLeft = new TGTab(fV1,100,100);
246 //fTabLeft->AddTab("Tab 1");
249
250 // Vertical splitter
251 fVSplitter = new TGVSplitter(fHf, 4, 4);
253 fHf->AddFrame(fV1, fLH7);
255
256 // Right tab
257 fTabRight = new TGTab(fH1, 500, 100);
258 //fTabRight->AddTab("Tab 1");
261 fTabRight->Connect("Selected(Int_t)", "TRootBrowser", this, "DoTab(Int_t)");
262 fTabRight->Connect("CloseTab(Int_t)", "TRootBrowser", this, "CloseTab(Int_t)");
263 fV2->AddFrame(fH1, fLH4);
264
265 // Horizontal splitter
266 fHSplitter = new TGHSplitter(fV2, 4, 4);
268
269 // Bottom tab
270 fTabBottom = new TGTab(fH2, 100, 100);
271 //fTabBottom->AddTab("Tab 1");
273 fV2->AddFrame(fH2, fLH3);
274
276 fHf->AddFrame(fV2, fLH5);
277 fVf->AddFrame(fHf, fLH5);
278 AddFrame(fVf, fLH5);
279
280 // status bar
281 fStatusBar = new TGStatusBar(this, 400, 20);
282 int parts[] = { 33, 10, 10, 47 };
283 fStatusBar->SetParts(parts, 4);
285
286 fNbInitPlugins = 0;
287 fEditFrame = 0;
288 fEditTab = 0;
289 fEditPos = -1;
290 fEditSubPos= -1;
291 fNbTab[0] = fNbTab[1] = fNbTab[2] = 0;
292 fCrTab[0] = fCrTab[1] = fCrTab[2] = -1;
293
294 // Set a name to the main frame
297 fIconPic = SetIconPixmap("rootdb_s.xpm");
298 SetClassHints("ROOT", "Browser");
299
300 if (!strcmp(gROOT->GetDefCanvasName(), "c1"))
301 gROOT->SetDefCanvasName("Canvas_1");
302
303 SetWMSizeHints(600, 350, 10000, 10000, 2, 2);
307
309}
310
311////////////////////////////////////////////////////////////////////////////////
312/// Clean up all widgets, frames and layouthints that were used
313
315{
316 if (fIconPic) gClient->FreePicture(fIconPic);
317 delete fLH0;
318 delete fLH1;
319 delete fLH2;
320 delete fLH3;
321 delete fLH4;
322 delete fLH5;
323 delete fLH6;
324 delete fLH7;
325 delete fMenuHelp;
326 delete fMenuExecPlugin;
327 delete fMenuFile;
328 delete fMenuBar;
329 delete fMenuFrame;
330 delete fPreMenuFrame;
331 delete fTopMenuFrame;
332 delete fToolbarFrame;
333 delete fVSplitter;
334 delete fHSplitter;
335 delete fTabLeft;
336 delete fTabRight;
337 delete fTabBottom;
338 delete fH1;
339 delete fH2;
340 delete fV1;
341 delete fV2;
342 delete fHf;
343 delete fStatusBar;
344 delete fVf;
345}
346
347////////////////////////////////////////////////////////////////////////////////
348/// Add items to the actual browser. This function has to be called
349/// by the Browse() member function of objects when they are
350/// called by a browser. If check < 0 (default) no check box is drawn,
351/// if 0 then unchecked checkbox is added, if 1 checked checkbox is added.
352
353void TRootBrowser::Add(TObject *obj, const char *name, Int_t check)
354{
355 if (obj->InheritsFrom("TObjectSpy"))
356 return;
357 if (fActBrowser)
358 fActBrowser->Add(obj, name, check);
359}
360
361////////////////////////////////////////////////////////////////////////////////
362/// Browse object. This, in turn, will trigger the calling of
363/// TRootBrowser::Add() which will fill the IconBox and the tree.
364/// Emits signal "BrowseObj(TObject*)".
365
367{
368 if (fActBrowser)
370 Emit("BrowseObj(TObject*)", (Long_t)obj);
371}
372
373////////////////////////////////////////////////////////////////////////////////
374/// Clone the browser. A new Browser will be created, with the same
375/// plugins executed in the current one.
376
378{
379 Int_t loop = 1;
380 TBrowserPlugin *plugin = 0;
381 TBrowser *b = new TBrowser();
382 TIter next(&fPlugins);
383 while ((plugin = (TBrowserPlugin *)next())) {
384 if (loop > fNbInitPlugins)
385 b->ExecPlugin(plugin->GetName(), "", plugin->fCommand.Data(), plugin->fTab,
386 plugin->fSubTab);
387 ++loop;
388 }
389}
390
391////////////////////////////////////////////////////////////////////////////////
392/// Remove tab element id from right tab.
393
395{
396 RemoveTab(kRight, id);
397}
398
399////////////////////////////////////////////////////////////////////////////////
400/// Properly close the mainframes embedded in the different tabs
401
403{
404 TGFrameElement *el;
405 TGCompositeFrame *container;
406 Int_t i;
407 TQObject::Disconnect("TCanvas", "ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
408 this, "EventInfo(Int_t, Int_t, Int_t, TObject*)");
409 Disconnect(fMenuFile, "Activated(Int_t)", this, "HandleMenu(Int_t)");
410 Disconnect(fTabRight, "Selected(Int_t)", this, "DoTab(Int_t)");
411 if (fPlugins.IsEmpty()) return;
412 fActBrowser = 0;
413 for (i=0;i<fTabLeft->GetNumberOfTabs();i++) {
414 container = fTabLeft->GetTabContainer(i);
415 if (!container) continue;
416 el = (TGFrameElement *)container->GetList()->First();
417 if (el && el->fFrame) {
418 el->fFrame->SetFrameElement(0);
419 if (el->fFrame->InheritsFrom("TVirtualPadEditor")) {
421 }
422 else if (el->fFrame->InheritsFrom("TGMainFrame")) {
423 el->fFrame->UnmapWindow();
424 ((TGMainFrame *)el->fFrame)->CloseWindow();
426 }
427 else
428 delete el->fFrame;
429 el->fFrame = 0;
430 if (el->fLayout && (el->fLayout != fgDefaultHints) &&
431 (el->fLayout->References() > 0)) {
433 if (!el->fLayout->References()) {
434 delete el->fLayout;
435 }
436 }
437 container->GetList()->Remove(el);
438 delete el;
439 }
440 }
441 for (i=0;i<fTabRight->GetNumberOfTabs();i++) {
442 container = fTabRight->GetTabContainer(i);
443 if (!container) continue;
444 el = (TGFrameElement *)container->GetList()->First();
445 if (el && el->fFrame) {
446 el->fFrame->SetFrameElement(0);
447 if (el->fFrame->InheritsFrom("TGMainFrame")) {
448 el->fFrame->UnmapWindow();
449 Bool_t sleep = (el->fFrame->InheritsFrom("TRootCanvas")) ? kTRUE : kFALSE;
450 if (sleep)
451 gSystem->Sleep(150);
452 ((TGMainFrame *)el->fFrame)->CloseWindow();
453 if (sleep)
454 gSystem->Sleep(150);
456 }
457 else
458 delete el->fFrame;
459 el->fFrame = 0;
460 if (el->fLayout && (el->fLayout != fgDefaultHints) &&
461 (el->fLayout->References() > 0)) {
463 if (!el->fLayout->References()) {
464 delete el->fLayout;
465 }
466 }
467 container->GetList()->Remove(el);
468 delete el;
469 }
470 }
471 for (i=0;i<fTabBottom->GetNumberOfTabs();i++) {
472 container = fTabBottom->GetTabContainer(i);
473 if (!container) continue;
474 el = (TGFrameElement *)container->GetList()->First();
475 if (el && el->fFrame) {
476 el->fFrame->SetFrameElement(0);
477 if (el->fFrame->InheritsFrom("TGMainFrame")) {
478 el->fFrame->UnmapWindow();
479 ((TGMainFrame *)el->fFrame)->CloseWindow();
480 gSystem->Sleep(150);
482 }
483 else
484 delete el->fFrame;
485 el->fFrame = 0;
486 if (el->fLayout && (el->fLayout != fgDefaultHints) &&
487 (el->fLayout->References() > 0)) {
489 if (!el->fLayout->References()) {
490 delete el->fLayout;
491 }
492 }
493 container->GetList()->Remove(el);
494 delete el;
495 }
496 }
498 Emit("CloseWindow()");
499}
500
501////////////////////////////////////////////////////////////////////////////////
502/// Called when window is closed via the window manager.
503
505{
506 TQObject::Disconnect("TCanvas", "ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
507 this, "EventInfo(Int_t, Int_t, Int_t, TObject*)");
508 CloseTabs();
509 DeleteWindow();
510}
511
512////////////////////////////////////////////////////////////////////////////////
513/// Handle Tab navigation.
514
516{
517 TGTab *sender = (TGTab *)gTQSender;
518 if ((sender) && (sender == fTabRight)) {
519 SwitchMenus(sender->GetTabContainer(id));
520 }
521}
522
523////////////////////////////////////////////////////////////////////////////////
524/// Display a tooltip with infos about the primitive below the cursor.
525
526void TRootBrowser::EventInfo(Int_t event, Int_t px, Int_t py, TObject *selected)
527{
528 const Int_t kTMAX=256;
529 static char atext[kTMAX];
530 if (selected == 0 || event == kMouseLeave) {
531 SetStatusText("", 0);
532 SetStatusText("", 1);
533 SetStatusText("", 2);
534 SetStatusText("", 3);
535 return;
536 }
537 SetStatusText(selected->GetTitle(), 0);
538 SetStatusText(selected->GetName(), 1);
539 if (event == kKeyPress)
540 snprintf(atext, kTMAX, "%c", (char) px);
541 else
542 snprintf(atext, kTMAX, "%d,%d", px, py);
543 SetStatusText(atext, 2);
544 SetStatusText(selected->GetObjectInfo(px,py), 3);
545}
546
547////////////////////////////////////////////////////////////////////////////////
548/// Execute a macro and embed the created frame in the tab "pos"
549/// and tab element "subpos".
550
551Long_t TRootBrowser::ExecPlugin(const char *name, const char *fname,
552 const char *cmd, Int_t pos, Int_t subpos)
553{
554 Long_t retval = 0;
556 TString command, pname;
557 if (cmd && strlen(cmd)) {
558 command = cmd;
559 if (name) pname = name;
560 else pname = TString::Format("Plugin %d", fPlugins.GetSize());
561 p = new TBrowserPlugin(pname.Data(), command.Data(), pos, subpos);
562 }
563 else if (fname && strlen(fname)) {
564 pname = name ? name : gSystem->BaseName(fname);
565 Ssiz_t t = pname.Last('.');
566 if (t > 0) pname.Remove(t);
567 command.Form("gROOT->Macro(\"%s\");", gSystem->UnixPathName(fname));
568 p = new TBrowserPlugin(pname.Data(), command.Data(), pos, subpos);
569 }
570 else return 0;
571 if (IsWebGUI() && command.Contains("new TCanvas"))
572 return gROOT->ProcessLine(command.Data());
573 StartEmbedding(pos, subpos);
574 fPlugins.Add(p);
575 retval = gROOT->ProcessLine(command.Data());
576 if (command.Contains("new TCanvas")) {
577 pname = gPad->GetName();
578 p->SetName(pname.Data());
579 }
580 SetTabTitle(pname.Data(), pos, subpos);
582 return retval;
583}
584
585////////////////////////////////////////////////////////////////////////////////
586/// Returns drawing option.
587
589{
590 if (fActBrowser)
591 return fActBrowser->GetDrawOption();
592 return 0;
593}
594
595////////////////////////////////////////////////////////////////////////////////
596/// Returns the TGTab at position pos.
597
599{
600 switch (pos) {
601 case kLeft: return fTabLeft;
602 case kRight: return fTabRight;
603 case kBottom: return fTabBottom;
604 default: return 0;
605 }
606}
607
608////////////////////////////////////////////////////////////////////////////////
609/// Handle keyboard events.
610
612{
613 char input[10];
614 UInt_t keysym;
615
616 if (event->fType == kGKeyPress) {
617 gVirtualX->LookupString(event, input, sizeof(input), keysym);
618
619 if (!event->fState && (EKeySym)keysym == kKey_F5) {
620 Refresh(kTRUE);
621 return kTRUE;
622 }
623 switch ((EKeySym)keysym) { // ignore these keys
624 case kKey_Shift:
625 case kKey_Control:
626 case kKey_Meta:
627 case kKey_Alt:
628 case kKey_CapsLock:
629 case kKey_NumLock:
630 case kKey_ScrollLock:
631 return kTRUE;
632 default:
633 break;
634 }
635 if (event->fState & kKeyControlMask) { // Cntrl key modifier pressed
636 switch ((EKeySym)keysym & ~0x20) { // treat upper and lower the same
637 case kKey_B:
639 return kTRUE;
640 case kKey_O:
642 return kTRUE;
643 case kKey_E:
645 return kTRUE;
646 case kKey_C:
648 return kTRUE;
649 case kKey_H:
651 return kTRUE;
652 case kKey_N:
654 return kTRUE;
655 case kKey_T:
657 return kTRUE;
658 case kKey_W:
660 return kTRUE;
661 case kKey_Q:
663 return kTRUE;
664 default:
665 break;
666 }
667 }
668 }
669 return TGMainFrame::HandleKey(event);
670}
671
672////////////////////////////////////////////////////////////////////////////////
673/// Handle menu entries events.
674
676{
677 TRootHelpDialog *hd;
678 TString cmd;
679 static Int_t eNr = 1;
680 TGPopupMenu *sender = (TGPopupMenu *)gTQSender;
681 if (sender != fMenuFile)
682 return;
683 switch (id) {
684 case kBrowse:
685 new TBrowser();
686 break;
687 case kOpenFile:
688 {
689 Bool_t newfile = kFALSE;
690 static TString dir(".");
691 TGFileInfo fi;
693 fi.SetIniDir(dir);
694 new TGFileDialog(gClient->GetDefaultRoot(), this,
695 kFDOpen,&fi);
696 dir = fi.fIniDir;
697 if (fi.fMultipleSelection && fi.fFileNamesList) {
698 TObjString *el;
699 TIter next(fi.fFileNamesList);
700 while ((el = (TObjString *) next())) {
701 gROOT->ProcessLine(Form("new TFile(\"%s\");",
703 }
704 newfile = kTRUE;
705 }
706 else if (fi.fFilename) {
707 gROOT->ProcessLine(Form("new TFile(\"%s\");",
709 newfile = kTRUE;
710 }
711 if (fActBrowser && newfile) {
712 TGFileBrowser *fb = dynamic_cast<TGFileBrowser *>(fActBrowser);
713 if (fb) fb->Selected(0);
714 }
715 }
716 break;
717 // Handle Help menu items...
718 case kHelpAbout:
719 {
720#ifdef R__UNIX
721 TString rootx = TROOT::GetBinDir() + "/root -a &";
722 gSystem->Exec(rootx);
723#else
724#ifdef WIN32
726#else
727 char str[32];
728 sprintf(str, "About ROOT %s...", gROOT->GetVersion());
729 hd = new TRootHelpDialog(this, str, 600, 400);
730 hd->SetText(gHelpAbout);
731 hd->Popup();
732#endif
733#endif
734 }
735 break;
736 case kHelpOnCanvas:
737 hd = new TRootHelpDialog(this, "Help on Canvas...", 600, 400);
738 hd->SetText(gHelpCanvas);
739 hd->Popup();
740 break;
741 case kHelpOnMenus:
742 hd = new TRootHelpDialog(this, "Help on Menus...", 600, 400);
744 hd->Popup();
745 break;
747 hd = new TRootHelpDialog(this, "Help on Graphics Editor...", 600, 400);
749 hd->Popup();
750 break;
751 case kHelpOnBrowser:
752 hd = new TRootHelpDialog(this, "Help on Browser...", 600, 400);
754 hd->Popup();
755 break;
756 case kHelpOnObjects:
757 hd = new TRootHelpDialog(this, "Help on Objects...", 600, 400);
759 hd->Popup();
760 break;
761 case kHelpOnPS:
762 hd = new TRootHelpDialog(this, "Help on PostScript...", 600, 400);
764 hd->Popup();
765 break;
766 case kHelpOnRemote:
767 hd = new TRootHelpDialog(this, "Help on Browser...", 600, 400);
768 hd->SetText(gHelpRemote);
769 hd->Popup();
770 break;
771 case kClone:
772 CloneBrowser();
773 break;
774 case kNewEditor:
775 cmd.Form("new TGTextEditor((const char *)0, gClient->GetRoot())");
776 ++eNr;
777 ExecPlugin(Form("Editor %d", eNr), "", cmd.Data(), 1);
778 break;
779 case kNewCanvas:
780 if (IsWebGUI())
781 gROOT->ProcessLine("new TCanvas()");
782 else
783 ExecPlugin("", "", "new TCanvas()", 1);
784 break;
785 case kNewHtml:
786 cmd.Form("new TGHtmlBrowser(\"%s\", gClient->GetRoot())",
787 gEnv->GetValue("Browser.StartUrl", "http://root.cern.ch"));
788 ExecPlugin("HTML", "", cmd.Data(), 1);
789 break;
790 case kExecPluginMacro:
791 {
792 static TString dir(".");
793 TGFileInfo fi;
795 fi.SetIniDir(dir);
796 new TGFileDialog(gClient->GetDefaultRoot(), this,
797 kFDOpen,&fi);
798 dir = fi.fIniDir;
799 if (fi.fFilename) {
800 ExecPlugin(0, fi.fFilename, 0, kRight);
801 }
802 }
803 break;
804 case kExecPluginCmd:
805 {
806 char command[1024];
807 strlcpy(command, "new TGLSAViewer(gClient->GetRoot(), 0);",
808 sizeof(command));
809 new TGInputDialog(gClient->GetRoot(), this,
810 "Enter plugin command line:",
811 command, command);
812 if (strcmp(command, "")) {
813 ExecPlugin("User", 0, command, kRight);
814 }
815 }
816 break;
817 case kCloseTab:
819 break;
820 case kCloseWindow:
821 CloseWindow();
822 break;
823 case kQuitRoot:
824 CloseWindow();
826 break;
827 default:
828 break;
829 }
830}
831
832////////////////////////////////////////////////////////////////////////////////
833/// Initialize default plugins. Could be also of the form:
834/// StartEmbedding(0);
835/// TPluginHandler *ph;
836/// ph = gROOT->GetPluginManager()->FindHandler("TGClassBrowser");
837/// if (ph && ph->LoadPlugin() != -1) {
838/// ph->ExecPlugin(3, gClient->GetRoot(), 200, 500);
839/// }
840/// StopEmbedding();
841
843{
844 TString cmd;
845
846 if ((opt == 0) || (!opt[0]))
847 return;
848 // --- Left vertical area
849
850 // File Browser plugin
851 if (strchr(opt, 'F')) {
852 cmd.Form("new TGFileBrowser(gClient->GetRoot(), (TBrowser *)0x%lx, 200, 500);", (ULong_t)fBrowser);
853 ExecPlugin("Files", 0, cmd.Data(), 0);
855 }
856
857 // --- Right main area
858
859 Int_t i, len = strlen(opt);
860 for (i=0; i<len; ++i) {
861 // Editor plugin...
862 if (opt[i] == 'E') {
863 cmd.Form("new TGTextEditor((const char *)0, gClient->GetRoot());");
864 ExecPlugin("Editor 1", 0, cmd.Data(), 1);
866 }
867
868 // HTML plugin...
869 if (opt[i] == 'H') {
870 if (gSystem->Load("libGuiHtml") >= 0) {
871 cmd.Form("new TGHtmlBrowser(\"%s\", gClient->GetRoot());",
872 gEnv->GetValue("Browser.StartUrl",
873 "http://root.cern.ch/root/html/ClassIndex.html"));
874 ExecPlugin("HTML", 0, cmd.Data(), 1);
876 }
877 }
878
879 // Canvas plugin...
880 if ((opt[i] == 'C') && !IsWebGUI()) {
881 cmd.Form("new TCanvas();");
882 ExecPlugin("c1", 0, cmd.Data(), 1);
884 }
885
886 // GLViewer plugin...
887 if (opt[i] == 'G') {
888 cmd.Form("new TGLSAViewer(gClient->GetRoot(), 0);");
889 ExecPlugin("OpenGL", 0, cmd.Data(), 1);
891 }
892
893 // PROOF plugin...
894 if (opt[i] == 'P') {
895 cmd.Form("new TSessionViewer();");
896 ExecPlugin("PROOF", 0, cmd.Data(), 1);
898 }
899 }
900 // --- Right bottom area
901
902 // Command plugin...
903 if (strchr(opt, 'I')) {
904 cmd.Form("new TGCommandPlugin(gClient->GetRoot(), 700, 300);");
905 ExecPlugin("Command", 0, cmd.Data(), 2);
907 }
908
909 // --- Select first tab everywhere
910 SetTab(0, 0);
911 SetTab(1, 0);
912 SetTab(2, 0);
913}
914
915////////////////////////////////////////////////////////////////////////////////
916/// Check if the GUI factory is set to use the Web GUI.
917
919{
920 TString factory = gEnv->GetValue("Gui.Factory", "native");
921 return (factory.Contains("web", TString::kIgnoreCase));
922}
923
924////////////////////////////////////////////////////////////////////////////////
925/// Really delete the browser and the this GUI.
926
928{
930 delete this;
931}
932
933////////////////////////////////////////////////////////////////////////////////
934/// Recursively remove object from browser.
935
937{
938 if (fActBrowser)
940}
941
942////////////////////////////////////////////////////////////////////////////////
943/// Recursively reparent TGPopupMenu to gClient->GetDefaultRoot().
944
946{
947 TGMenuEntry *entry = 0;
948 TIter next(popup->GetListOfEntries());
949 while ((entry = (TGMenuEntry *)next())) {
950 if (entry->GetPopup()) {
951 RecursiveReparent(entry->GetPopup());
952 }
953 }
954 popup->ReparentWindow(gClient->GetDefaultRoot());
955}
956
957////////////////////////////////////////////////////////////////////////////////
958/// Refresh the actual browser contents.
959
961{
962 if (fActBrowser)
963 fActBrowser->Refresh(force);
964}
965
966////////////////////////////////////////////////////////////////////////////////
967/// Remove tab element "subpos" from tab "pos".
968
970{
971 TGTab *edit = 0;
972 switch (pos) {
973 case kLeft: // left
974 edit = fTabLeft;
975 break;
976 case kRight: // right
977 edit = fTabRight;
980 fActMenuBar = 0;
981 break;
982 case kBottom: // bottom
983 edit = fTabBottom;
984 break;
985 }
986 if (!edit || !edit->GetTabTab(subpos))
987 return;
988 const char *tabName = edit->GetTabTab(subpos)->GetString();
989 TObject *obj = 0;
990 if ((obj = fPlugins.FindObject(tabName))) {
991 fPlugins.Remove(obj);
992 }
993 TGFrameElement *el = 0;
994 if (edit->GetTabContainer(subpos))
995 el = (TGFrameElement *)edit->GetTabContainer(subpos)->GetList()->First();
996 if (el && el->fFrame) {
997 el->fFrame->Disconnect("ProcessedConfigure(Event_t*)");
998 el->fFrame->SetFrameElement(0);
999 if (el->fFrame->InheritsFrom("TGMainFrame")) {
1000 Bool_t sleep = (el->fFrame->InheritsFrom("TRootCanvas")) ? kTRUE : kFALSE;
1001 ((TGMainFrame *)el->fFrame)->CloseWindow();
1002 if (sleep)
1003 gSystem->Sleep(150);
1005 }
1006 else
1007 delete el->fFrame;
1008 el->fFrame = 0;
1009 if (el->fLayout && (el->fLayout != fgDefaultHints) &&
1010 (el->fLayout->References() > 0)) {
1011 el->fLayout->RemoveReference();
1012 if (!el->fLayout->References()) {
1013 delete el->fLayout;
1014 }
1015 }
1016 edit->GetTabContainer(subpos)->GetList()->Remove(el);
1017 delete el;
1018 }
1019 fNbTab[pos]--;
1020 edit->RemoveTab(subpos);
1021 SwitchMenus(edit->GetTabContainer(edit->GetCurrent()));
1022}
1023
1024////////////////////////////////////////////////////////////////////////////////
1025/// Switch to Tab "subpos" in TGTab "pos".
1026
1028{
1029 TGTab *tab = GetTab(pos);
1030 if (subpos == -1)
1031 subpos = fCrTab[pos];
1032
1033 if (tab && tab->SetTab(subpos, kFALSE)) { // Block signal emit
1034 if (pos == kRight)
1035 SwitchMenus(tab->GetTabContainer(subpos));
1036 tab->Layout();
1037 }
1038}
1039
1040////////////////////////////////////////////////////////////////////////////////
1041/// Set text "title" of Tab "subpos" in TGTab "pos".
1042
1043void TRootBrowser::SetTabTitle(const char *title, Int_t pos, Int_t subpos)
1044{
1045 TBrowserPlugin *p = 0;
1046 TGTab *edit = GetTab(pos);
1047 if (!edit) return;
1048 if (subpos == -1)
1049 subpos = fCrTab[pos];
1050
1051 TGTabElement *el = edit->GetTabTab(subpos);
1052 if (el) {
1053 el->SetText(new TGString(title));
1054 edit->Layout();
1055 if ((p = (TBrowserPlugin *)fPlugins.FindObject(title)))
1056 p->SetName(title);
1057 }
1058}
1059
1060////////////////////////////////////////////////////////////////////////////////
1061/// Set text in culumn col in status bar.
1062
1063void TRootBrowser::SetStatusText(const char* txt, Int_t col)
1064{
1065 fStatusBar->SetText(txt, col);
1066}
1067
1068////////////////////////////////////////////////////////////////////////////////
1069/// Show the selected frame's menu and hide previous one.
1070
1072{
1073 TGFrameElement *el = 0;
1074 // temporary solution until I find a proper way to handle
1075 // these bloody menus...
1076 fBindList->Delete();
1077 TIter nextm(fMenuBar->GetList());
1078 while ((el = (TGFrameElement *) nextm())) {
1079 TGMenuTitle *t = (TGMenuTitle *) el->fFrame;
1080 Int_t code = t->GetHotKeyCode();
1089 }
1091 fMenuFrame->ShowFrame(menu);
1092 menu->Layout();
1093 fMenuFrame->Layout();
1094 fActMenuBar = menu;
1095}
1096
1097////////////////////////////////////////////////////////////////////////////////
1098/// Start embedding external frame in the tab "pos" and tab element "subpos".
1099
1101{
1102 fEditTab = GetTab(pos);
1103 if (!fEditTab) return;
1104 fEditPos = pos;
1105 fEditSubPos = subpos;
1106
1107 if (fEditFrame == 0) {
1108 if (subpos == -1) {
1109 fCrTab[pos] = fNbTab[pos]++;
1110 fEditFrame = fEditTab->AddTab(Form("Tab %d",fNbTab[pos]));
1114 if(tabel) {
1115 tabel->MapWindow();
1116 if (fShowCloseTab && (pos == 1))
1117 tabel->ShowClose();
1118 }
1120 fEditTab->Layout();
1121 }
1122 else {
1123 fCrTab[pos] = subpos;
1125 fEditTab->SetTab(subpos);
1126 }
1128 }
1129}
1130
1131////////////////////////////////////////////////////////////////////////////////
1132/// Stop embedding external frame in the current editable frame.
1133
1135{
1136 if (fEditFrame != 0) {
1139 if (el && el->fFrame) {
1140 // let be notified when the inside frame gets resized, and tell its
1141 // container to recompute its layout
1142 el->fFrame->Connect("ProcessedConfigure(Event_t*)", "TGCompositeFrame",
1143 fEditFrame, "Layout()");
1144 }
1145 if (layout) {
1146 el = (TGFrameElement*) fEditFrame->GetList()->Last();
1147 // !!!! MT what to do with the old layout? Leak it for now ...
1148 if (el) el->fLayout = layout;
1149 }
1150 fEditFrame->Layout();
1151 if (fEditTab == fTabRight)
1153 }
1154 if (name && strlen(name)) {
1156 }
1158 fEditFrame = fEditTab = 0;
1159 fEditPos = fEditSubPos = -1;
1160}
1161
1162////////////////////////////////////////////////////////////////////////////////
1163/// Move the menu from original frame to our TGMenuFrame, or display the
1164/// menu associated to the current tab.
1165
1167{
1168 if (from == 0)
1169 return;
1170 TGFrameElement *fe = (TGFrameElement *)from->GetList()->First();
1171 if (!fe) {
1172 if (fActMenuBar != fMenuBar)
1174 return;
1175 }
1177 TGFrameElement *el = 0;
1178 if (embed && embed->GetList()) {
1179 TIter next(embed->GetList());
1180 while ((el = (TGFrameElement *)next())) {
1181 if (el->fFrame->InheritsFrom("TGMenuBar")) {
1182 TGMenuBar *menu = (TGMenuBar *)el->fFrame;
1183 if (fActMenuBar == menu)
1184 return;
1185 TGFrameElement *nw;
1186 TIter nel(fMenuFrame->GetList());
1187 while ((nw = (TGFrameElement *) nel())) {
1188 if (nw->fFrame == menu) {
1189 ShowMenu(menu);
1190 return;
1191 }
1192 }
1193 ((TGCompositeFrame *)menu->GetParent())->HideFrame(menu);
1196 fMenuFrame->AddFrame(menu, fLH2);
1197 TGFrameElement *mel;
1198 TIter mnext(menu->GetList());
1199 while ((mel = (TGFrameElement *) mnext())) {
1200 TGMenuTitle *t = (TGMenuTitle *) mel->fFrame;
1201 TGPopupMenu *popup = menu->GetPopup(t->GetName());
1202 if (popup) {
1203 RecursiveReparent(popup);
1204 if (popup->GetEntry("Close Canvas")) {
1205 TGMenuEntry *exit = popup->GetEntry("Close Canvas");
1206 popup->HideEntry(exit->GetEntryId());
1207 }
1208 if (popup->GetEntry("Close Viewer")) {
1209 TGMenuEntry *exit = popup->GetEntry("Close Viewer");
1210 popup->HideEntry(exit->GetEntryId());
1211 }
1212 if (popup->GetEntry("Quit ROOT")) {
1213 TGMenuEntry *exit = popup->GetEntry("Quit ROOT");
1214 popup->HideEntry(exit->GetEntryId());
1215 }
1216 if (popup->GetEntry("Exit")) {
1217 TGMenuEntry *exit = popup->GetEntry("Exit");
1218 popup->HideEntry(exit->GetEntryId());
1219 }
1220 }
1221 }
1222 ShowMenu(menu);
1223 return;
1224 }
1225 }
1226 }
1227 if (fActMenuBar != fMenuBar)
1229}
1230
1231////////////////////////////////////////////////////////////////////////////////
1232/// Emits signal when double clicking on icon.
1233
1235{
1236 Emit("DoubleClicked(TObject*)", (Long_t)obj);
1237}
1238
1239////////////////////////////////////////////////////////////////////////////////
1240/// Emits signal when double clicking on icon.
1241
1243{
1244 Long_t args[2];
1245
1246 args[0] = (Long_t)obj;
1247 args[1] = checked;
1248
1249 Emit("Checked(TObject*,Bool_t)", args);
1250}
1251
1252////////////////////////////////////////////////////////////////////////////////
1253/// Emits signal "ExecuteDefaultAction(TObject*)".
1254
1256{
1257 Emit("ExecuteDefaultAction(TObject*)", (Long_t)obj);
1258}
1259
1260
1261////////////////////////////////////////////////////////////////////////////////
1262/// static contructor returning TBrowserImp,
1263/// as needed by the plugin mechanism.
1264
1266 UInt_t width, UInt_t height,
1267 Option_t *opt)
1268{
1269 TRootBrowser *browser = new TRootBrowser(b, title, width, height, opt);
1270 return (TBrowserImp *)browser;
1271}
1272
1273////////////////////////////////////////////////////////////////////////////////
1274/// static contructor returning TBrowserImp,
1275/// as needed by the plugin mechanism.
1276
1278 Int_t y, UInt_t width, UInt_t height,
1279 Option_t *opt)
1280{
1281 TRootBrowser *browser = new TRootBrowser(b, title, x, y, width, height, opt);
1282 return (TBrowserImp *)browser;
1283}
@ kKeyPress
Definition Buttons.h:20
@ kMouseLeave
Definition Buttons.h:23
@ kGKeyPress
Definition GuiTypes.h:60
const Mask_t kKeyLockMask
Definition GuiTypes.h:196
const Mask_t kKeyMod1Mask
typically the Alt key
Definition GuiTypes.h:198
const Mask_t kKeyReleaseMask
Definition GuiTypes.h:160
const Mask_t kKeyPressMask
Definition GuiTypes.h:159
const Mask_t kKeyShiftMask
Definition GuiTypes.h:195
@ 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:197
const Mask_t kKeyMod2Mask
typically mod on numeric keys
Definition GuiTypes.h:199
R__EXTERN const char gHelpObjects[]
Definition HelpText.h:26
R__EXTERN const char gHelpPullDownMenus[]
Definition HelpText.h:24
R__EXTERN const char gHelpRemote[]
Definition HelpText.h:28
R__EXTERN const char gHelpAbout[]
Definition HelpText.h:17
R__EXTERN const char gHelpGraphicsEditor[]
Definition HelpText.h:23
R__EXTERN const char gHelpCanvas[]
Definition HelpText.h:25
R__EXTERN const char gHelpBrowser[]
Definition HelpText.h:18
R__EXTERN const char gHelpPostscript[]
Definition HelpText.h:21
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:92
unsigned long ULong_t
Definition RtypesCore.h:55
long Long_t
Definition RtypesCore.h:54
const Bool_t kTRUE
Definition RtypesCore.h:91
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:364
R__EXTERN TApplication * gApplication
include TDocParser_001 C image html pict1_TDocParser_001 png width
R__EXTERN TEnv * gEnv
Definition TEnv.h:171
#define gClient
Definition TGClient.h:166
@ kFDOpen
@ kNoCleanup
Definition TGFrame.h:48
@ 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:110
R__EXTERN C unsigned int sleep(unsigned int seconds)
R__EXTERN void * gTQSender
Definition TQObject.h:46
#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:559
#define gPad
#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:57
virtual void BrowseObj(TObject *)
Definition TBrowserImp.h:48
virtual void RecursiveRemove(TObject *)
Definition TBrowserImp.h:53
virtual void Refresh(Bool_t=kFALSE)
Definition TBrowserImp.h:54
virtual void Add(TObject *, const char *, Int_t)
Definition TBrowserImp.h:44
TBrowser * fBrowser
TBrowser associated with this implementation.
Definition TBrowserImp.h:32
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
void SetBrowserImp(TBrowserImp *i)
Definition TBrowser.h:95
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:2957
virtual Bool_t IsEmpty() const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
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:223
virtual TList * GetList() const
Definition TGFrame.h:346
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1102
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
Definition TGFrame.cxx:933
virtual void Layout()
Layout the elements of the composite frame.
Definition TGFrame.cxx:1242
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1057
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition TGFrame.h:352
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1149
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1189
static TGLayoutHints * fgDefaultHints
Definition TGFrame.h:333
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1175
void Selected(char *)
A ROOT File has been selected in TGHtmlBrowser.
TList * fFileNamesList
char * fFilename
const char ** fFileTypes
char * fIniDir
Bool_t fMultipleSelection
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:324
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:226
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:261
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition TGFrame.cxx:590
void SetFrameElement(TGFrameElement *fe)
Definition TGFrame.h:260
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:614
virtual void MapWindow()
map window
Definition TGFrame.h:228
virtual void UnmapWindow()
unmap window
Definition TGFrame.h:230
virtual void SetFrame(TGFrame *frame, Bool_t above)
Set frame to be resized.
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
Definition TGFrame.cxx:1817
TList * fBindList
Definition TGFrame.h:460
virtual Bool_t BindKey(const TGWindow *w, Int_t keycode, Int_t modifier) const
Bind key to a window.
Definition TGFrame.cxx:1598
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition TGFrame.cxx:1762
virtual Bool_t HandleKey(Event_t *event)
Handle keyboard events.
Definition TGFrame.cxx:1567
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition TGFrame.cxx:1840
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:1865
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1749
const TGPicture * SetIconPixmap(const char *iconName)
Set window icon pixmap by name.
Definition TGFrame.cxx:1777
virtual TGPopupMenu * GetPopup(const char *s)
Return popup menu with the specified name.
Definition TGMenu.cxx:539
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
Add popup menu to menu bar.
Definition TGMenu.cxx:417
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 HideEntry(Int_t id)
Hide entry (hidden entries are not shown in the menu).
Definition TGMenu.cxx:1750
virtual TGMenuEntry * GetEntry(Int_t id)
Find entry with specified id.
Definition TGMenu.cxx:1896
virtual void AddPopup(TGHotString *s, TGPopupMenu *popup, TGMenuEntry *before=nullptr, const TGPicture *p=nullptr)
Add a (cascading) popup menu to a popup menu.
Definition TGMenu.cxx:1151
virtual void DisableEntry(Int_t id)
Disable entry (disabled entries appear in a sunken relieve).
Definition TGMenu.cxx:1723
virtual void AddSeparator(TGMenuEntry *before=nullptr)
Add a menu separator to the menu.
Definition TGMenu.cxx:1059
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=nullptr, const TGPicture *p=nullptr, TGMenuEntry *before=nullptr)
Add a menu entry.
Definition TGMenu.cxx:989
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:182
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:199
Definition TGTab.h:62
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Definition TGTab.cxx:614
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition TGTab.cxx:660
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:509
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:394
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:565
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition TGTab.cxx:343
virtual void SetFrame(TGFrame *frame, Bool_t left)
Set frame to be resized.
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:822
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition TList.cxx:578
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition TList.cxx:693
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition TList.cxx:470
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:659
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:359
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Returns string containing info about the object at position (px,py).
Definition TObject.cxx:388
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:445
virtual const char * GetTitle() const
Returns title of object.
Definition TObject.cxx:403
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.
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Definition TROOT.cxx:2917
UInt_t RemoveReference()
Definition TRefCnt.h:41
UInt_t References() const
Definition TRefCnt.h:38
TGPopupMenu * fMenuExecPlugin
TGHorizontalFrame * fMenuFrame
TGTab * GetTab(Int_t pos) const
Returns the TGTab at position pos.
TGLayoutHints * fLH4
void StartEmbedding(Int_t pos=kRight, Int_t subpos=-1) override
Start embedding external frame in the tab "pos" and tab element "subpos".
Bool_t fShowCloseTab
void SetTabTitle(const char *title, Int_t pos=kRight, Int_t subpos=-1)
Set text "title" of Tab "subpos" in TGTab "pos".
TGPopupMenu * fMenuHelp
Int_t fCrTab[3]
void ExecuteDefaultAction(TObject *obj) override
Emits signal "ExecuteDefaultAction(TObject*)".
TRootBrowser(const TRootBrowser &)=delete
TGHorizontalFrame * fH2
Int_t fNbTab[3]
TGStatusBar * fStatusBar
Bool_t IsWebGUI()
Check if the GUI factory is set to use the Web GUI.
TGVerticalFrame * fVf
virtual void DoubleClicked(TObject *obj)
Emits signal when double clicking on icon.
TGLayoutHints * fLH6
TGHSplitter * fHSplitter
TBrowserImp * fActBrowser
TGCompositeFrame * fEditFrame
virtual void CloseTab(Int_t id)
Remove tab element id from right tab.
static TBrowserImp * NewBrowser(TBrowser *b=nullptr, 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.
TGCompositeFrame * fActMenuBar
TGLayoutHints * fLH1
void ReallyDelete() override
Really delete the browser and the this GUI.
void StopEmbedding(const char *name=nullptr) override
const TGPicture * fIconPic
Int_t fEditSubPos
TGTab * fEditTab
TGLayoutHints * fLH2
TGVerticalFrame * fV1
void DoTab(Int_t id)
Handle Tab navigation.
TGLayoutHints * fLH0
void RecursiveRemove(TObject *obj) override
Recursively remove object from browser.
void CreateBrowser(const char *name)
TGHorizontalFrame * fPreMenuFrame
TGLayoutHints * fLH5
void EventInfo(Int_t event, Int_t px, Int_t py, TObject *selected)
Display a tooltip with infos about the primitive below the cursor.
Bool_t HandleKey(Event_t *event) override
Handle keyboard events.
void SetTab(Int_t pos=kRight, Int_t subpos=-1)
Switch to Tab "subpos" in TGTab "pos".
void CloneBrowser()
Clone the browser.
TGTab * fTabRight
void HandleMenu(Int_t id)
Handle menu entries events.
TGVSplitter * fVSplitter
TGHorizontalFrame * fHf
Long_t ExecPlugin(const char *name=nullptr, const char *fname=nullptr, const char *cmd=nullptr, Int_t pos=kRight, Int_t subpos=-1) override
Execute a macro and embed the created frame in the tab "pos" and tab element "subpos".
void RemoveTab(Int_t pos, Int_t subpos)
Remove tab element "subpos" from tab "pos".
TGTab * fTabBottom
void Refresh(Bool_t force=kFALSE) override
Refresh the actual browser contents.
TGPopupMenu * fMenuFile
void SwitchMenus(TGCompositeFrame *from)
Move the menu from original frame to our TGMenuFrame, or display the menu associated to the current t...
void BrowseObj(TObject *obj) override
Browse object.
TGLayoutHints * fLH7
virtual void Checked(TObject *obj, Bool_t check)
Emits signal when double clicking on icon.
void ShowMenu(TGCompositeFrame *menu)
Show the selected frame's menu and hide previous one.
void SetStatusText(const char *txt, Int_t col) override
Set text in culumn col in status bar.
void CloseWindow() override
Called when window is closed via the window manager.
TGTab * fTabLeft
void Add(TObject *obj, const char *name=nullptr, Int_t check=-1) override
Add items to the actual browser.
TGHorizontalFrame * fTopMenuFrame
TGLayoutHints * fLH3
TGMenuBar * fMenuBar
Int_t fNbInitPlugins
void InitPlugins(Option_t *opt="")
Initialize default plugins.
TGVerticalFrame * fV2
virtual ~TRootBrowser()
Clean up all widgets, frames and layouthints that were used.
void RecursiveReparent(TGPopupMenu *popup)
Recursively reparent TGPopupMenu to gClient->GetDefaultRoot().
void CloseTabs() override
Properly close the mainframes embedded in the different tabs.
Option_t * GetDrawOption() const override
Returns drawing option.
TGHorizontalFrame * fH1
TGHorizontalFrame * fToolbarFrame
void SetText(const char *helpText)
Set help text from helpText buffer in TGTextView.
void Popup()
Show help dialog.
Basic string class.
Definition TString.h:136
const char * Data() const
Definition TString.h:369
@ kIgnoreCase
Definition TString.h:268
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Definition TString.cxx:912
TString & Remove(Ssiz_t pos)
Definition TString.h:673
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:2331
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition TString.cxx:2309
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:624
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition TSystem.cxx:654
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
Definition TSystem.cxx:1853
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition TSystem.cxx:1061
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition TSystem.cxx:933
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
Definition TSystem.cxx:438
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition TSystem.cxx:417
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
Event structure.
Definition GuiTypes.h:174
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:175
UInt_t fState
key or button mask
Definition GuiTypes.h:181