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