Logo ROOT   6.16/01
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 "TBrowser.h"
68#include "TGFileDialog.h"
69#include "TObjString.h"
70#include "TVirtualPad.h"
71#include "TEnv.h"
72#include <KeySymbols.h>
73
74#include "RConfigure.h"
75
76#include "TRootBrowser.h"
77#include "TGFileBrowser.h"
78#include "TGInputDialog.h"
79#include "TRootHelpDialog.h"
80#include "TVirtualPadEditor.h"
81#include "HelpText.h"
82#include "Getline.h"
83
84#ifdef WIN32
85#include <TWin32SplashThread.h>
86#endif
87
88static const char *gOpenFileTypes[] = {
89 "ROOT files", "*.root",
90 "All files", "*",
91 0, 0
92};
93
94static const char *gPluginFileTypes[] = {
95 "ROOT files", "*.C",
96 "All files", "*",
97 0, 0
98};
99
100//_____________________________________________________________________________
101//
102// TRootBrowser
103//
104// The main ROOT object browser.
105//_____________________________________________________________________________
106
108
109////////////////////////////////////////////////////////////////////////////////
110/// Create browser with a specified width and height.
111
113 UInt_t height, Option_t *opt, Bool_t initshow) :
114 TGMainFrame(gClient->GetDefaultRoot(), width, height), TBrowserImp(b)
115{
117 fActBrowser = 0;
118 fIconPic = 0;
120 Resize(width, height);
121 if (initshow) {
122 InitPlugins(opt);
123 MapWindow();
124 }
125 TQObject::Connect("TCanvas", "ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
126 "TRootBrowser", this,
127 "EventInfo(Int_t, Int_t, Int_t, TObject*)");
128 gVirtualX->SetInputFocus(GetId());
129}
130
131////////////////////////////////////////////////////////////////////////////////
132/// Create browser with a specified width and height and at position x, y.
133
135 UInt_t width, UInt_t height, Option_t *opt,
136 Bool_t initshow) :
137 TGMainFrame(gClient->GetDefaultRoot(), width, height), TBrowserImp(b)
138{
140 fActBrowser = 0;
141 fIconPic = 0;
143 MoveResize(x, y, width, height);
144 SetWMPosition(x, y);
145 if (initshow) {
146 InitPlugins(opt);
147 MapWindow();
148 }
149 TQObject::Connect("TCanvas", "ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
150 "TRootBrowser", this,
151 "EventInfo(Int_t, Int_t, Int_t, TObject*)");
152 gVirtualX->SetInputFocus(GetId());
153}
154
155
156////////////////////////////////////////////////////////////////////////////////
157
159{
160 // Create the actual interface.
161
162 fVf = new TGVerticalFrame(this, 100, 100);
163
165 fLH1 = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0);
166 fLH2 = new TGLayoutHints(kLHintsTop | kLHintsExpandX, 0, 0, 1, 1);
172
173 // Menubar Frame
174 fTopMenuFrame = new TGHorizontalFrame(fVf, 100, 20);
175
178 fMenuFile = new TGPopupMenu(gClient->GetDefaultRoot());
179 fMenuFile->AddEntry("&Browse...\tCtrl+B", kBrowse);
180 fMenuFile->AddEntry("&Open...\tCtrl+O", kOpenFile);
182
184 fMenuHelp->AddEntry("&About ROOT...", kHelpAbout);
186 fMenuHelp->AddEntry("Help On Browser...", kHelpOnBrowser);
187 fMenuHelp->AddEntry("Help On Canvas...", kHelpOnCanvas);
188 fMenuHelp->AddEntry("Help On Menus...", kHelpOnMenus);
189 fMenuHelp->AddEntry("Help On Graphics Editor...", kHelpOnGraphicsEd);
190 fMenuHelp->AddEntry("Help On Objects...", kHelpOnObjects);
191 fMenuHelp->AddEntry("Help On PostScript...", kHelpOnPS);
192 fMenuHelp->AddEntry("Help On Remote Session...", kHelpOnRemote);
193 fMenuFile->AddPopup("Browser Help...", fMenuHelp);
194
196 fMenuFile->AddEntry("&Clone\tCtrl+N", kClone);
198 fMenuFile->AddEntry("New &Editor\tCtrl+E", kNewEditor);
199 fMenuFile->AddEntry("New &Canvas\tCtrl+C", kNewCanvas);
200 fMenuFile->AddEntry("New &HTML\tCtrl+H", kNewHtml);
204 fMenuExecPlugin->AddEntry("&Command...", kExecPluginCmd);
205 fMenuFile->AddPopup("Execute &Plugin...", fMenuExecPlugin);
207 fMenuFile->AddEntry("Close &Tab\tCtrl+T", kCloseTab);
208 fMenuFile->AddEntry("Close &Window\tCtrl+W", kCloseWindow);
210 fMenuFile->AddEntry("&Quit Root\tCtrl+Q", kQuitRoot);
211 fMenuBar->AddPopup("&Browser", fMenuFile, fLH1);
212 fMenuFile->Connect("Activated(Int_t)", "TRootBrowser", this,
213 "HandleMenu(Int_t)");
216
217 if (!TClass::GetClass("TGHtmlBrowser"))
219
222
225
226 // Toolbar Frame
230
231 fHf = new TGHorizontalFrame(fVf, 100, 100);
232 // Tabs & co...
233#if defined(R__HAS_COCOA)
234 fV1 = new TGVerticalFrame(fHf, 252, 100, kFixedWidth);
235#else
236 fV1 = new TGVerticalFrame(fHf, 250, 100, kFixedWidth);
237#endif
238 fV2 = new TGVerticalFrame(fHf, 600, 100);
239 fH1 = new TGHorizontalFrame(fV2, 100, 100);
240 fH2 = new TGHorizontalFrame(fV2, 100, 100, kFixedHeight);
241
242 // Left tab
243 fTabLeft = new TGTab(fV1,100,100);
244 //fTabLeft->AddTab("Tab 1");
247
248 // Vertical splitter
249 fVSplitter = new TGVSplitter(fHf, 4, 4);
251 fHf->AddFrame(fV1, fLH7);
253
254 // Right tab
255 fTabRight = new TGTab(fH1, 500, 100);
256 //fTabRight->AddTab("Tab 1");
259 fTabRight->Connect("Selected(Int_t)", "TRootBrowser", this, "DoTab(Int_t)");
260 fTabRight->Connect("CloseTab(Int_t)", "TRootBrowser", this, "CloseTab(Int_t)");
261 fV2->AddFrame(fH1, fLH4);
262
263 // Horizontal splitter
264 fHSplitter = new TGHSplitter(fV2, 4, 4);
266
267 // Bottom tab
268 fTabBottom = new TGTab(fH2, 100, 100);
269 //fTabBottom->AddTab("Tab 1");
271 fV2->AddFrame(fH2, fLH3);
272
274 fHf->AddFrame(fV2, fLH5);
275 fVf->AddFrame(fHf, fLH5);
276 AddFrame(fVf, fLH5);
277
278 // status bar
279 fStatusBar = new TGStatusBar(this, 400, 20);
280 int parts[] = { 33, 10, 10, 47 };
281 fStatusBar->SetParts(parts, 4);
283
284 fNbInitPlugins = 0;
285 fEditFrame = 0;
286 fEditTab = 0;
287 fEditPos = -1;
288 fEditSubPos= -1;
289 fNbTab[0] = fNbTab[1] = fNbTab[2] = 0;
290 fCrTab[0] = fCrTab[1] = fCrTab[2] = -1;
291
292 // Set a name to the main frame
295 fIconPic = SetIconPixmap("rootdb_s.xpm");
296 SetClassHints("ROOT", "Browser");
297
298 if (!strcmp(gROOT->GetDefCanvasName(), "c1"))
299 gROOT->SetDefCanvasName("Canvas_1");
300
301 SetWMSizeHints(600, 350, 10000, 10000, 2, 2);
305
307}
308
309////////////////////////////////////////////////////////////////////////////////
310/// Clean up all widgets, frames and layouthints that were used
311
313{
314 if (fIconPic) gClient->FreePicture(fIconPic);
315 delete fLH0;
316 delete fLH1;
317 delete fLH2;
318 delete fLH3;
319 delete fLH4;
320 delete fLH5;
321 delete fLH6;
322 delete fLH7;
323 delete fMenuHelp;
324 delete fMenuExecPlugin;
325 delete fMenuFile;
326 delete fMenuBar;
327 delete fMenuFrame;
328 delete fPreMenuFrame;
329 delete fTopMenuFrame;
330 delete fToolbarFrame;
331 delete fVSplitter;
332 delete fHSplitter;
333 delete fTabLeft;
334 delete fTabRight;
335 delete fTabBottom;
336 delete fH1;
337 delete fH2;
338 delete fV1;
339 delete fV2;
340 delete fHf;
341 delete fStatusBar;
342 delete fVf;
343}
344
345////////////////////////////////////////////////////////////////////////////////
346/// Add items to the actual browser. This function has to be called
347/// by the Browse() member function of objects when they are
348/// called by a browser. If check < 0 (default) no check box is drawn,
349/// if 0 then unchecked checkbox is added, if 1 checked checkbox is added.
350
351void TRootBrowser::Add(TObject *obj, const char *name, Int_t check)
352{
353 if (obj->InheritsFrom("TObjectSpy"))
354 return;
355 if (fActBrowser)
356 fActBrowser->Add(obj, name, check);
357}
358
359////////////////////////////////////////////////////////////////////////////////
360/// Browse object. This, in turn, will trigger the calling of
361/// TRootBrowser::Add() which will fill the IconBox and the tree.
362/// Emits signal "BrowseObj(TObject*)".
363
365{
366 if (fActBrowser)
368 Emit("BrowseObj(TObject*)", (Long_t)obj);
369}
370
371////////////////////////////////////////////////////////////////////////////////
372/// Clone the browser. A new Browser will be created, with the same
373/// plugins executed in the current one.
374
376{
377 Int_t loop = 1;
378 TBrowserPlugin *plugin = 0;
379 TBrowser *b = new TBrowser();
380 TIter next(&fPlugins);
381 while ((plugin = (TBrowserPlugin *)next())) {
382 if (loop > fNbInitPlugins)
383 b->ExecPlugin(plugin->GetName(), "", plugin->fCommand.Data(), plugin->fTab,
384 plugin->fSubTab);
385 ++loop;
386 }
387}
388
389////////////////////////////////////////////////////////////////////////////////
390/// Remove tab element id from right tab.
391
393{
394 RemoveTab(kRight, id);
395}
396
397////////////////////////////////////////////////////////////////////////////////
398/// Properly close the mainframes embedded in the different tabs
399
401{
402 TGFrameElement *el;
403 TGCompositeFrame *container;
404 Int_t i;
405 TQObject::Disconnect("TCanvas", "ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
406 this, "EventInfo(Int_t, Int_t, Int_t, TObject*)");
407 Disconnect(fMenuFile, "Activated(Int_t)", this, "HandleMenu(Int_t)");
408 Disconnect(fTabRight, "Selected(Int_t)", this, "DoTab(Int_t)");
409 if (fPlugins.IsEmpty()) return;
410 fActBrowser = 0;
411 for (i=0;i<fTabLeft->GetNumberOfTabs();i++) {
412 container = fTabLeft->GetTabContainer(i);
413 if (!container) continue;
414 el = (TGFrameElement *)container->GetList()->First();
415 if (el && el->fFrame) {
416 el->fFrame->SetFrameElement(0);
417 if (el->fFrame->InheritsFrom("TVirtualPadEditor")) {
419 }
420 else if (el->fFrame->InheritsFrom("TGMainFrame")) {
421 el->fFrame->UnmapWindow();
422 ((TGMainFrame *)el->fFrame)->CloseWindow();
424 }
425 else
426 delete el->fFrame;
427 el->fFrame = 0;
428 if (el->fLayout && (el->fLayout != fgDefaultHints) &&
429 (el->fLayout->References() > 0)) {
431 if (!el->fLayout->References()) {
432 delete el->fLayout;
433 }
434 }
435 container->GetList()->Remove(el);
436 delete el;
437 }
438 }
439 for (i=0;i<fTabRight->GetNumberOfTabs();i++) {
440 container = fTabRight->GetTabContainer(i);
441 if (!container) continue;
442 el = (TGFrameElement *)container->GetList()->First();
443 if (el && el->fFrame) {
444 el->fFrame->SetFrameElement(0);
445 if (el->fFrame->InheritsFrom("TGMainFrame")) {
446 el->fFrame->UnmapWindow();
447 Bool_t sleep = (el->fFrame->InheritsFrom("TRootCanvas")) ? kTRUE : kFALSE;
448 if (sleep)
449 gSystem->Sleep(150);
450 ((TGMainFrame *)el->fFrame)->CloseWindow();
451 if (sleep)
452 gSystem->Sleep(150);
454 }
455 else
456 delete el->fFrame;
457 el->fFrame = 0;
458 if (el->fLayout && (el->fLayout != fgDefaultHints) &&
459 (el->fLayout->References() > 0)) {
461 if (!el->fLayout->References()) {
462 delete el->fLayout;
463 }
464 }
465 container->GetList()->Remove(el);
466 delete el;
467 }
468 }
469 for (i=0;i<fTabBottom->GetNumberOfTabs();i++) {
470 container = fTabBottom->GetTabContainer(i);
471 if (!container) continue;
472 el = (TGFrameElement *)container->GetList()->First();
473 if (el && el->fFrame) {
474 el->fFrame->SetFrameElement(0);
475 if (el->fFrame->InheritsFrom("TGMainFrame")) {
476 el->fFrame->UnmapWindow();
477 ((TGMainFrame *)el->fFrame)->CloseWindow();
478 gSystem->Sleep(150);
480 }
481 else
482 delete el->fFrame;
483 el->fFrame = 0;
484 if (el->fLayout && (el->fLayout != fgDefaultHints) &&
485 (el->fLayout->References() > 0)) {
487 if (!el->fLayout->References()) {
488 delete el->fLayout;
489 }
490 }
491 container->GetList()->Remove(el);
492 delete el;
493 }
494 }
496 Emit("CloseWindow()");
497}
498
499////////////////////////////////////////////////////////////////////////////////
500/// Called when window is closed via the window manager.
501
503{
504 TQObject::Disconnect("TCanvas", "ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
505 this, "EventInfo(Int_t, Int_t, Int_t, TObject*)");
506 CloseTabs();
507 DeleteWindow();
508}
509
510////////////////////////////////////////////////////////////////////////////////
511/// Handle Tab navigation.
512
514{
515 TGTab *sender = (TGTab *)gTQSender;
516 if ((sender) && (sender == fTabRight)) {
517 SwitchMenus(sender->GetTabContainer(id));
518 }
519}
520
521////////////////////////////////////////////////////////////////////////////////
522/// Display a tooltip with infos about the primitive below the cursor.
523
524void TRootBrowser::EventInfo(Int_t event, Int_t px, Int_t py, TObject *selected)
525{
526 const Int_t kTMAX=256;
527 static char atext[kTMAX];
528 if (selected == 0 || event == kMouseLeave) {
529 SetStatusText("", 0);
530 SetStatusText("", 1);
531 SetStatusText("", 2);
532 SetStatusText("", 3);
533 return;
534 }
535 SetStatusText(selected->GetTitle(), 0);
536 SetStatusText(selected->GetName(), 1);
537 if (event == kKeyPress)
538 snprintf(atext, kTMAX, "%c", (char) px);
539 else
540 snprintf(atext, kTMAX, "%d,%d", px, py);
541 SetStatusText(atext, 2);
542 SetStatusText(selected->GetObjectInfo(px,py), 3);
543}
544
545////////////////////////////////////////////////////////////////////////////////
546/// Execute a macro and embed the created frame in the tab "pos"
547/// and tab element "subpos".
548
549Long_t TRootBrowser::ExecPlugin(const char *name, const char *fname,
550 const char *cmd, Int_t pos, Int_t subpos)
551{
552 Long_t retval = 0;
554 TString command, pname;
555 StartEmbedding(pos, subpos);
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 fPlugins.Add(p);
571 retval = gROOT->ProcessLine(command.Data());
572 if (command.Contains("new TCanvas")) {
573 pname = gPad->GetName();
574 p->SetName(pname.Data());
575 }
576 SetTabTitle(pname.Data(), pos, subpos);
578 return retval;
579}
580
581////////////////////////////////////////////////////////////////////////////////
582/// Returns drawing option.
583
585{
586 if (fActBrowser)
587 return fActBrowser->GetDrawOption();
588 return 0;
589}
590
591////////////////////////////////////////////////////////////////////////////////
592/// Returns the TGTab at position pos.
593
595{
596 switch (pos) {
597 case kLeft: return fTabLeft;
598 case kRight: return fTabRight;
599 case kBottom: return fTabBottom;
600 default: return 0;
601 }
602}
603
604////////////////////////////////////////////////////////////////////////////////
605/// Handle keyboard events.
606
608{
609 char input[10];
610 UInt_t keysym;
611
612 if (event->fType == kGKeyPress) {
613 gVirtualX->LookupString(event, input, sizeof(input), keysym);
614
615 if (!event->fState && (EKeySym)keysym == kKey_F5) {
616 Refresh(kTRUE);
617 return kTRUE;
618 }
619 switch ((EKeySym)keysym) { // ignore these keys
620 case kKey_Shift:
621 case kKey_Control:
622 case kKey_Meta:
623 case kKey_Alt:
624 case kKey_CapsLock:
625 case kKey_NumLock:
626 case kKey_ScrollLock:
627 return kTRUE;
628 default:
629 break;
630 }
631 if (event->fState & kKeyControlMask) { // Cntrl key modifier pressed
632 switch ((EKeySym)keysym & ~0x20) { // treat upper and lower the same
633 case kKey_B:
635 return kTRUE;
636 case kKey_O:
638 return kTRUE;
639 case kKey_E:
641 return kTRUE;
642 case kKey_C:
644 return kTRUE;
645 case kKey_H:
647 return kTRUE;
648 case kKey_N:
650 return kTRUE;
651 case kKey_T:
653 return kTRUE;
654 case kKey_W:
656 return kTRUE;
657 case kKey_Q:
659 return kTRUE;
660 default:
661 break;
662 }
663 }
664 }
665 return TGMainFrame::HandleKey(event);
666}
667
668////////////////////////////////////////////////////////////////////////////////
669/// Handle menu entries events.
670
672{
673 TRootHelpDialog *hd;
674 TString cmd;
675 static Int_t eNr = 1;
676 TGPopupMenu *sender = (TGPopupMenu *)gTQSender;
677 if (sender != fMenuFile)
678 return;
679 switch (id) {
680 case kBrowse:
681 new TBrowser();
682 break;
683 case kOpenFile:
684 {
685 Bool_t newfile = kFALSE;
686 static TString dir(".");
687 TGFileInfo fi;
689 fi.fIniDir = StrDup(dir);
690 new TGFileDialog(gClient->GetDefaultRoot(), this,
691 kFDOpen,&fi);
692 dir = fi.fIniDir;
693 if (fi.fMultipleSelection && fi.fFileNamesList) {
694 TObjString *el;
695 TIter next(fi.fFileNamesList);
696 while ((el = (TObjString *) next())) {
697 gROOT->ProcessLine(Form("new TFile(\"%s\");",
699 }
700 newfile = kTRUE;
701 }
702 else if (fi.fFilename) {
703 gROOT->ProcessLine(Form("new TFile(\"%s\");",
705 newfile = kTRUE;
706 }
707 if (fActBrowser && newfile) {
708 TGFileBrowser *fb = dynamic_cast<TGFileBrowser *>(fActBrowser);
709 if (fb) fb->Selected(0);
710 }
711 }
712 break;
713 // Handle Help menu items...
714 case kHelpAbout:
715 {
716#ifdef R__UNIX
717 TString rootx = TROOT::GetBinDir() + "/root -a &";
718 gSystem->Exec(rootx);
719#else
720#ifdef WIN32
722#else
723 char str[32];
724 sprintf(str, "About ROOT %s...", gROOT->GetVersion());
725 hd = new TRootHelpDialog(this, str, 600, 400);
726 hd->SetText(gHelpAbout);
727 hd->Popup();
728#endif
729#endif
730 }
731 break;
732 case kHelpOnCanvas:
733 hd = new TRootHelpDialog(this, "Help on Canvas...", 600, 400);
734 hd->SetText(gHelpCanvas);
735 hd->Popup();
736 break;
737 case kHelpOnMenus:
738 hd = new TRootHelpDialog(this, "Help on Menus...", 600, 400);
740 hd->Popup();
741 break;
743 hd = new TRootHelpDialog(this, "Help on Graphics Editor...", 600, 400);
745 hd->Popup();
746 break;
747 case kHelpOnBrowser:
748 hd = new TRootHelpDialog(this, "Help on Browser...", 600, 400);
750 hd->Popup();
751 break;
752 case kHelpOnObjects:
753 hd = new TRootHelpDialog(this, "Help on Objects...", 600, 400);
755 hd->Popup();
756 break;
757 case kHelpOnPS:
758 hd = new TRootHelpDialog(this, "Help on PostScript...", 600, 400);
760 hd->Popup();
761 break;
762 case kHelpOnRemote:
763 hd = new TRootHelpDialog(this, "Help on Browser...", 600, 400);
764 hd->SetText(gHelpRemote);
765 hd->Popup();
766 break;
767 case kClone:
768 CloneBrowser();
769 break;
770 case kNewEditor:
771 cmd.Form("new TGTextEditor((const char *)0, gClient->GetRoot())");
772 ++eNr;
773 ExecPlugin(Form("Editor %d", eNr), "", cmd.Data(), 1);
774 break;
775 case kNewCanvas:
776 ExecPlugin("", "", "new TCanvas()", 1);
777 break;
778 case kNewHtml:
779 cmd.Form("new TGHtmlBrowser(\"%s\", gClient->GetRoot())",
780 gEnv->GetValue("Browser.StartUrl", "http://root.cern.ch"));
781 ExecPlugin("HTML", "", cmd.Data(), 1);
782 break;
783 case kExecPluginMacro:
784 {
785 static TString dir(".");
786 TGFileInfo fi;
788 fi.fIniDir = StrDup(dir);
789 new TGFileDialog(gClient->GetDefaultRoot(), this,
790 kFDOpen,&fi);
791 dir = fi.fIniDir;
792 if (fi.fFilename) {
793 ExecPlugin(0, fi.fFilename, 0, kRight);
794 }
795 }
796 break;
797 case kExecPluginCmd:
798 {
799 char command[1024];
800 strlcpy(command, "new TGLSAViewer(gClient->GetRoot(), 0);",
801 sizeof(command));
802 new TGInputDialog(gClient->GetRoot(), this,
803 "Enter plugin command line:",
804 command, command);
805 if (strcmp(command, "")) {
806 ExecPlugin("User", 0, command, kRight);
807 }
808 }
809 break;
810 case kCloseTab:
812 break;
813 case kCloseWindow:
814 CloseWindow();
815 break;
816 case kQuitRoot:
817 CloseWindow();
819 break;
820 default:
821 break;
822 }
823}
824
825////////////////////////////////////////////////////////////////////////////////
826/// Initialize default plugins. Could be also of the form:
827/// StartEmbedding(0);
828/// TPluginHandler *ph;
829/// ph = gROOT->GetPluginManager()->FindHandler("TGClassBrowser");
830/// if (ph && ph->LoadPlugin() != -1) {
831/// ph->ExecPlugin(3, gClient->GetRoot(), 200, 500);
832/// }
833/// StopEmbedding();
834
836{
837 TString cmd;
838
839 if ((opt == 0) || (!opt[0]))
840 return;
841 // --- Left vertical area
842
843 // File Browser plugin
844 if (strchr(opt, 'F')) {
845 cmd.Form("new TGFileBrowser(gClient->GetRoot(), (TBrowser *)0x%lx, 200, 500);", (ULong_t)fBrowser);
846 ExecPlugin("Files", 0, cmd.Data(), 0);
848 }
849
850 // --- Right main area
851
852 Int_t i, len = strlen(opt);
853 for (i=0; i<len; ++i) {
854 // Editor plugin...
855 if (opt[i] == 'E') {
856 cmd.Form("new TGTextEditor((const char *)0, gClient->GetRoot());");
857 ExecPlugin("Editor 1", 0, cmd.Data(), 1);
859 }
860
861 // HTML plugin...
862 if (opt[i] == 'H') {
863 if (gSystem->Load("libGuiHtml") >= 0) {
864 cmd.Form("new TGHtmlBrowser(\"%s\", gClient->GetRoot());",
865 gEnv->GetValue("Browser.StartUrl",
866 "http://root.cern.ch/root/html/ClassIndex.html"));
867 ExecPlugin("HTML", 0, cmd.Data(), 1);
869 }
870 }
871
872 // Canvas plugin...
873 if (opt[i] == 'C') {
874 cmd.Form("new TCanvas();");
875 ExecPlugin("c1", 0, cmd.Data(), 1);
877 }
878
879 // GLViewer plugin...
880 if (opt[i] == 'G') {
881 cmd.Form("new TGLSAViewer(gClient->GetRoot(), 0);");
882 ExecPlugin("OpenGL", 0, cmd.Data(), 1);
884 }
885
886 // PROOF plugin...
887 if (opt[i] == 'P') {
888 cmd.Form("new TSessionViewer();");
889 ExecPlugin("PROOF", 0, cmd.Data(), 1);
891 }
892 }
893 // --- Right bottom area
894
895 // Command plugin...
896 if (strchr(opt, 'I')) {
897 cmd.Form("new TGCommandPlugin(gClient->GetRoot(), 700, 300);");
898 ExecPlugin("Command", 0, cmd.Data(), 2);
900 }
901
902 // --- Select first tab everywhere
903 SetTab(0, 0);
904 SetTab(1, 0);
905 SetTab(2, 0);
906}
907
908////////////////////////////////////////////////////////////////////////////////
909/// Really delete the browser and the this GUI.
910
912{
914 delete this;
915}
916
917////////////////////////////////////////////////////////////////////////////////
918/// Recursively remove object from browser.
919
921{
922 if (fActBrowser)
924}
925
926////////////////////////////////////////////////////////////////////////////////
927/// Recursively reparent TGPopupMenu to gClient->GetDefaultRoot().
928
930{
931 TGMenuEntry *entry = 0;
932 TIter next(popup->GetListOfEntries());
933 while ((entry = (TGMenuEntry *)next())) {
934 if (entry->GetPopup()) {
935 RecursiveReparent(entry->GetPopup());
936 }
937 }
938 popup->ReparentWindow(gClient->GetDefaultRoot());
939}
940
941////////////////////////////////////////////////////////////////////////////////
942/// Refresh the actual browser contents.
943
945{
946 if (fActBrowser)
947 fActBrowser->Refresh(force);
948}
949
950////////////////////////////////////////////////////////////////////////////////
951/// Remove tab element "subpos" from tab "pos".
952
954{
955 TGTab *edit = 0;
956 switch (pos) {
957 case kLeft: // left
958 edit = fTabLeft;
959 break;
960 case kRight: // right
961 edit = fTabRight;
964 fActMenuBar = 0;
965 break;
966 case kBottom: // bottom
967 edit = fTabBottom;
968 break;
969 }
970 if (!edit || !edit->GetTabTab(subpos))
971 return;
972 const char *tabName = edit->GetTabTab(subpos)->GetString();
973 TObject *obj = 0;
974 if ((obj = fPlugins.FindObject(tabName))) {
975 fPlugins.Remove(obj);
976 }
977 TGFrameElement *el = 0;
978 if (edit->GetTabContainer(subpos))
979 el = (TGFrameElement *)edit->GetTabContainer(subpos)->GetList()->First();
980 if (el && el->fFrame) {
981 el->fFrame->Disconnect("ProcessedConfigure(Event_t*)");
982 el->fFrame->SetFrameElement(0);
983 if (el->fFrame->InheritsFrom("TGMainFrame")) {
984 Bool_t sleep = (el->fFrame->InheritsFrom("TRootCanvas")) ? kTRUE : kFALSE;
985 ((TGMainFrame *)el->fFrame)->CloseWindow();
986 if (sleep)
987 gSystem->Sleep(150);
989 }
990 else
991 delete el->fFrame;
992 el->fFrame = 0;
993 if (el->fLayout && (el->fLayout != fgDefaultHints) &&
994 (el->fLayout->References() > 0)) {
996 if (!el->fLayout->References()) {
997 delete el->fLayout;
998 }
999 }
1000 edit->GetTabContainer(subpos)->GetList()->Remove(el);
1001 delete el;
1002 }
1003 fNbTab[pos]--;
1004 edit->RemoveTab(subpos);
1005 SwitchMenus(edit->GetTabContainer(edit->GetCurrent()));
1006}
1007
1008////////////////////////////////////////////////////////////////////////////////
1009/// Switch to Tab "subpos" in TGTab "pos".
1010
1012{
1013 TGTab *tab = GetTab(pos);
1014 if (subpos == -1)
1015 subpos = fCrTab[pos];
1016
1017 if (tab && tab->SetTab(subpos, kFALSE)) { // Block signal emit
1018 if (pos == kRight)
1019 SwitchMenus(tab->GetTabContainer(subpos));
1020 tab->Layout();
1021 }
1022}
1023
1024////////////////////////////////////////////////////////////////////////////////
1025/// Set text "title" of Tab "subpos" in TGTab "pos".
1026
1027void TRootBrowser::SetTabTitle(const char *title, Int_t pos, Int_t subpos)
1028{
1029 TBrowserPlugin *p = 0;
1030 TGTab *edit = GetTab(pos);
1031 if (!edit) return;
1032 if (subpos == -1)
1033 subpos = fCrTab[pos];
1034
1035 TGTabElement *el = edit->GetTabTab(subpos);
1036 if (el) {
1037 el->SetText(new TGString(title));
1038 edit->Layout();
1039 if ((p = (TBrowserPlugin *)fPlugins.FindObject(title)))
1040 p->SetName(title);
1041 }
1042}
1043
1044////////////////////////////////////////////////////////////////////////////////
1045/// Set text in culumn col in status bar.
1046
1047void TRootBrowser::SetStatusText(const char* txt, Int_t col)
1048{
1049 fStatusBar->SetText(txt, col);
1050}
1051
1052////////////////////////////////////////////////////////////////////////////////
1053/// Show the selected frame's menu and hide previous one.
1054
1056{
1057 TGFrameElement *el = 0;
1058 // temporary solution until I find a proper way to handle
1059 // these bloody menus...
1060 fBindList->Delete();
1061 TIter nextm(fMenuBar->GetList());
1062 while ((el = (TGFrameElement *) nextm())) {
1063 TGMenuTitle *t = (TGMenuTitle *) el->fFrame;
1064 Int_t code = t->GetHotKeyCode();
1073 }
1075 fMenuFrame->ShowFrame(menu);
1076 menu->Layout();
1077 fMenuFrame->Layout();
1078 fActMenuBar = menu;
1079}
1080
1081////////////////////////////////////////////////////////////////////////////////
1082/// Start embedding external frame in the tab "pos" and tab element "subpos".
1083
1085{
1086 fEditTab = GetTab(pos);
1087 if (!fEditTab) return;
1088 fEditPos = pos;
1089 fEditSubPos = subpos;
1090
1091 if (fEditFrame == 0) {
1092 if (subpos == -1) {
1093 fCrTab[pos] = fNbTab[pos]++;
1094 fEditFrame = fEditTab->AddTab(Form("Tab %d",fNbTab[pos]));
1098 if(tabel) {
1099 tabel->MapWindow();
1100 if (fShowCloseTab && (pos == 1))
1101 tabel->ShowClose();
1102 }
1104 fEditTab->Layout();
1105 }
1106 else {
1107 fCrTab[pos] = subpos;
1109 fEditTab->SetTab(subpos);
1110 }
1112 }
1113}
1114
1115////////////////////////////////////////////////////////////////////////////////
1116/// Stop embedding external frame in the current editable frame.
1117
1119{
1120 if (fEditFrame != 0) {
1123 if (el && el->fFrame) {
1124 // let be notified when the inside frame gets resized, and tell its
1125 // container to recompute its layout
1126 el->fFrame->Connect("ProcessedConfigure(Event_t*)", "TGCompositeFrame",
1127 fEditFrame, "Layout()");
1128 }
1129 if (layout) {
1130 el = (TGFrameElement*) fEditFrame->GetList()->Last();
1131 // !!!! MT what to do with the old layout? Leak it for now ...
1132 if (el) el->fLayout = layout;
1133 }
1134 fEditFrame->Layout();
1135 if (fEditTab == fTabRight)
1137 }
1138 if (name && strlen(name)) {
1140 }
1142 fEditFrame = fEditTab = 0;
1143 fEditPos = fEditSubPos = -1;
1144}
1145
1146////////////////////////////////////////////////////////////////////////////////
1147/// Move the menu from original frame to our TGMenuFrame, or display the
1148/// menu associated to the current tab.
1149
1151{
1152 if (from == 0)
1153 return;
1154 TGFrameElement *fe = (TGFrameElement *)from->GetList()->First();
1155 if (!fe) {
1156 if (fActMenuBar != fMenuBar)
1158 return;
1159 }
1161 TGFrameElement *el = 0;
1162 if (embed && embed->GetList()) {
1163 TIter next(embed->GetList());
1164 while ((el = (TGFrameElement *)next())) {
1165 if (el->fFrame->InheritsFrom("TGMenuBar")) {
1166 TGMenuBar *menu = (TGMenuBar *)el->fFrame;
1167 if (fActMenuBar == menu)
1168 return;
1169 TGFrameElement *nw;
1170 TIter nel(fMenuFrame->GetList());
1171 while ((nw = (TGFrameElement *) nel())) {
1172 if (nw->fFrame == menu) {
1173 ShowMenu(menu);
1174 return;
1175 }
1176 }
1177 ((TGCompositeFrame *)menu->GetParent())->HideFrame(menu);
1180 fMenuFrame->AddFrame(menu, fLH2);
1181 TGFrameElement *mel;
1182 TIter mnext(menu->GetList());
1183 while ((mel = (TGFrameElement *) mnext())) {
1184 TGMenuTitle *t = (TGMenuTitle *) mel->fFrame;
1185 TGPopupMenu *popup = menu->GetPopup(t->GetName());
1186 if (popup) {
1187 RecursiveReparent(popup);
1188 if (popup->GetEntry("Close Canvas")) {
1189 TGMenuEntry *exit = popup->GetEntry("Close Canvas");
1190 popup->HideEntry(exit->GetEntryId());
1191 }
1192 if (popup->GetEntry("Close Viewer")) {
1193 TGMenuEntry *exit = popup->GetEntry("Close Viewer");
1194 popup->HideEntry(exit->GetEntryId());
1195 }
1196 if (popup->GetEntry("Quit ROOT")) {
1197 TGMenuEntry *exit = popup->GetEntry("Quit ROOT");
1198 popup->HideEntry(exit->GetEntryId());
1199 }
1200 if (popup->GetEntry("Exit")) {
1201 TGMenuEntry *exit = popup->GetEntry("Exit");
1202 popup->HideEntry(exit->GetEntryId());
1203 }
1204 }
1205 }
1206 ShowMenu(menu);
1207 return;
1208 }
1209 }
1210 }
1211 if (fActMenuBar != fMenuBar)
1213}
1214
1215////////////////////////////////////////////////////////////////////////////////
1216/// Emits signal when double clicking on icon.
1217
1219{
1220 Emit("DoubleClicked(TObject*)", (Long_t)obj);
1221}
1222
1223////////////////////////////////////////////////////////////////////////////////
1224/// Emits signal when double clicking on icon.
1225
1227{
1228 Long_t args[2];
1229
1230 args[0] = (Long_t)obj;
1231 args[1] = checked;
1232
1233 Emit("Checked(TObject*,Bool_t)", args);
1234}
1235
1236////////////////////////////////////////////////////////////////////////////////
1237/// Emits signal "ExecuteDefaultAction(TObject*)".
1238
1240{
1241 Emit("ExecuteDefaultAction(TObject*)", (Long_t)obj);
1242}
1243
1244
1245////////////////////////////////////////////////////////////////////////////////
1246/// static contructor returning TBrowserImp,
1247/// as needed by the plugin mechanism.
1248
1250 UInt_t width, UInt_t height,
1251 Option_t *opt)
1252{
1253 TRootBrowser *browser = new TRootBrowser(b, title, width, height, opt);
1254 return (TBrowserImp *)browser;
1255}
1256
1257////////////////////////////////////////////////////////////////////////////////
1258/// static contructor returning TBrowserImp,
1259/// as needed by the plugin mechanism.
1260
1262 Int_t y, UInt_t width, UInt_t height,
1263 Option_t *opt)
1264{
1265 TRootBrowser *browser = new TRootBrowser(b, title, x, y, width, height, opt);
1266 return (TBrowserImp *)browser;
1267}
@ 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
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
int Int_t
Definition: RtypesCore.h:41
int Ssiz_t
Definition: RtypesCore.h:63
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
unsigned long ULong_t
Definition: RtypesCore.h:51
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassImp(name)
Definition: Rtypes.h:363
R__EXTERN TApplication * gApplication
Definition: TApplication.h:165
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
@ kRaisedFrame
Definition: TGFrame.h:62
@ kFixedWidth
Definition: TGFrame.h:65
@ kHorizontalFrame
Definition: TGFrame.h:60
@ kFixedHeight
Definition: TGFrame.h:67
@ 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
R__EXTERN C unsigned int sleep(unsigned int seconds)
R__EXTERN void * gTQSender
Definition: TQObject.h:45
#define gROOT
Definition: TROOT.h:410
static const char * gPluginFileTypes[]
static const char * gOpenFileTypes[]
char * Form(const char *fmt,...)
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2465
R__EXTERN TSystem * gSystem
Definition: TSystem.h:540
#define gPad
Definition: TVirtualPad.h:286
#define gVirtualX
Definition: TVirtualX.h:345
#define snprintf
Definition: civetweb.c:1540
virtual void Terminate(Int_t status=0)
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:2885
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:369
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
Definition: TGFrame.cxx:930
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1239
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1054
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:375
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1146
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1186
static TGLayoutHints * fgDefaultHints
Definition: TGFrame.h:356
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1172
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
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:321
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:249
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:258
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
void SetFrameElement(TGFrameElement *fe)
Definition: TGFrame.h:283
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:611
virtual void MapWindow()
Definition: TGFrame.h:251
virtual void UnmapWindow()
Definition: TGFrame.h:253
virtual void SetFrame(TGFrame *frame, Bool_t above)
Set frame to be resized.
Definition: TGSplitter.cxx:339
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
Definition: TGFrame.cxx:1814
TList * fBindList
Definition: TGFrame.h:483
virtual Bool_t BindKey(const TGWindow *w, Int_t keycode, Int_t modifier) const
Bind key to a window.
Definition: TGFrame.cxx:1595
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
Definition: TGFrame.cxx:1759
virtual Bool_t HandleKey(Event_t *event)
Handle keyboard events.
Definition: TGFrame.cxx:1564
void SetWMPosition(Int_t x, Int_t y)
Give the window manager a window position hint.
Definition: TGFrame.cxx:1837
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:1862
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1746
const TGPicture * SetIconPixmap(const char *iconName)
Set window icon pixmap by name.
Definition: TGFrame.cxx:1774
virtual TGPopupMenu * GetPopup(const char *s)
Return popup menu with the specified name.
Definition: TGMenu.cxx:537
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=0)
Add popup menu to menu bar.
Definition: TGMenu.cxx:415
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:1149
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:987
virtual void AddSeparator(TGMenuEntry *before=0)
Add a menu separator to the menu.
Definition: TGMenu.cxx:1057
virtual void DisableEntry(Int_t id)
Disable entry (disabled entries appear in a sunken relieve).
Definition: TGMenu.cxx:1714
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:180
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:197
Definition: TGTab.h:62
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Definition: TGTab.cxx:612
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition: TGTab.cxx:658
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:507
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:392
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:563
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition: TGTab.cxx:341
virtual void SetFrame(TGFrame *frame, Bool_t left)
Set frame to be resized.
Definition: TGSplitter.cxx:140
const TGWindow * GetParent() const
Definition: TGWindow.h:85
virtual void Add(TObject *obj)
Definition: TList.h:87
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:818
virtual TObject * FindObject(const char *name) const
Delete a TObjLink object.
Definition: TList.cxx:574
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition: TList.cxx:689
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition: TList.cxx:467
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:655
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:47
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:165
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:867
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:1025
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Definition: TROOT.cxx:2947
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
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
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Definition: TString.cxx:876
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:2286
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2264
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:662
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
Definition: TSystem.cxx:1843
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
Definition: TSystem.cxx:1053
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:941
virtual void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
Definition: TSystem.cxx:446
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition: TSystem.cxx:425
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