Logo ROOT   6.18/05
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 if (cmd && strlen(cmd)) {
556 command = cmd;
557 if (name) pname = name;
558 else pname = TString::Format("Plugin %d", fPlugins.GetSize());
559 p = new TBrowserPlugin(pname.Data(), command.Data(), pos, subpos);
560 }
561 else if (fname && strlen(fname)) {
562 pname = name ? name : gSystem->BaseName(fname);
563 Ssiz_t t = pname.Last('.');
564 if (t > 0) pname.Remove(t);
565 command.Form("gROOT->Macro(\"%s\");", gSystem->UnixPathName(fname));
566 p = new TBrowserPlugin(pname.Data(), command.Data(), pos, subpos);
567 }
568 else return 0;
569 if (IsWebGUI() && command.Contains("new TCanvas"))
570 return gROOT->ProcessLine(command.Data());
571 StartEmbedding(pos, subpos);
572 fPlugins.Add(p);
573 retval = gROOT->ProcessLine(command.Data());
574 if (command.Contains("new TCanvas")) {
575 pname = gPad->GetName();
576 p->SetName(pname.Data());
577 }
578 SetTabTitle(pname.Data(), pos, subpos);
580 return retval;
581}
582
583////////////////////////////////////////////////////////////////////////////////
584/// Returns drawing option.
585
587{
588 if (fActBrowser)
589 return fActBrowser->GetDrawOption();
590 return 0;
591}
592
593////////////////////////////////////////////////////////////////////////////////
594/// Returns the TGTab at position pos.
595
597{
598 switch (pos) {
599 case kLeft: return fTabLeft;
600 case kRight: return fTabRight;
601 case kBottom: return fTabBottom;
602 default: return 0;
603 }
604}
605
606////////////////////////////////////////////////////////////////////////////////
607/// Handle keyboard events.
608
610{
611 char input[10];
612 UInt_t keysym;
613
614 if (event->fType == kGKeyPress) {
615 gVirtualX->LookupString(event, input, sizeof(input), keysym);
616
617 if (!event->fState && (EKeySym)keysym == kKey_F5) {
618 Refresh(kTRUE);
619 return kTRUE;
620 }
621 switch ((EKeySym)keysym) { // ignore these keys
622 case kKey_Shift:
623 case kKey_Control:
624 case kKey_Meta:
625 case kKey_Alt:
626 case kKey_CapsLock:
627 case kKey_NumLock:
628 case kKey_ScrollLock:
629 return kTRUE;
630 default:
631 break;
632 }
633 if (event->fState & kKeyControlMask) { // Cntrl key modifier pressed
634 switch ((EKeySym)keysym & ~0x20) { // treat upper and lower the same
635 case kKey_B:
637 return kTRUE;
638 case kKey_O:
640 return kTRUE;
641 case kKey_E:
643 return kTRUE;
644 case kKey_C:
646 return kTRUE;
647 case kKey_H:
649 return kTRUE;
650 case kKey_N:
652 return kTRUE;
653 case kKey_T:
655 return kTRUE;
656 case kKey_W:
658 return kTRUE;
659 case kKey_Q:
661 return kTRUE;
662 default:
663 break;
664 }
665 }
666 }
667 return TGMainFrame::HandleKey(event);
668}
669
670////////////////////////////////////////////////////////////////////////////////
671/// Handle menu entries events.
672
674{
675 TRootHelpDialog *hd;
676 TString cmd;
677 static Int_t eNr = 1;
678 TGPopupMenu *sender = (TGPopupMenu *)gTQSender;
679 if (sender != fMenuFile)
680 return;
681 switch (id) {
682 case kBrowse:
683 new TBrowser();
684 break;
685 case kOpenFile:
686 {
687 Bool_t newfile = kFALSE;
688 static TString dir(".");
689 TGFileInfo fi;
691 fi.fIniDir = StrDup(dir);
692 new TGFileDialog(gClient->GetDefaultRoot(), this,
693 kFDOpen,&fi);
694 dir = fi.fIniDir;
695 if (fi.fMultipleSelection && fi.fFileNamesList) {
696 TObjString *el;
697 TIter next(fi.fFileNamesList);
698 while ((el = (TObjString *) next())) {
699 gROOT->ProcessLine(Form("new TFile(\"%s\");",
701 }
702 newfile = kTRUE;
703 }
704 else if (fi.fFilename) {
705 gROOT->ProcessLine(Form("new TFile(\"%s\");",
707 newfile = kTRUE;
708 }
709 if (fActBrowser && newfile) {
710 TGFileBrowser *fb = dynamic_cast<TGFileBrowser *>(fActBrowser);
711 if (fb) fb->Selected(0);
712 }
713 }
714 break;
715 // Handle Help menu items...
716 case kHelpAbout:
717 {
718#ifdef R__UNIX
719 TString rootx = TROOT::GetBinDir() + "/root -a &";
720 gSystem->Exec(rootx);
721#else
722#ifdef WIN32
724#else
725 char str[32];
726 sprintf(str, "About ROOT %s...", gROOT->GetVersion());
727 hd = new TRootHelpDialog(this, str, 600, 400);
728 hd->SetText(gHelpAbout);
729 hd->Popup();
730#endif
731#endif
732 }
733 break;
734 case kHelpOnCanvas:
735 hd = new TRootHelpDialog(this, "Help on Canvas...", 600, 400);
736 hd->SetText(gHelpCanvas);
737 hd->Popup();
738 break;
739 case kHelpOnMenus:
740 hd = new TRootHelpDialog(this, "Help on Menus...", 600, 400);
742 hd->Popup();
743 break;
745 hd = new TRootHelpDialog(this, "Help on Graphics Editor...", 600, 400);
747 hd->Popup();
748 break;
749 case kHelpOnBrowser:
750 hd = new TRootHelpDialog(this, "Help on Browser...", 600, 400);
752 hd->Popup();
753 break;
754 case kHelpOnObjects:
755 hd = new TRootHelpDialog(this, "Help on Objects...", 600, 400);
757 hd->Popup();
758 break;
759 case kHelpOnPS:
760 hd = new TRootHelpDialog(this, "Help on PostScript...", 600, 400);
762 hd->Popup();
763 break;
764 case kHelpOnRemote:
765 hd = new TRootHelpDialog(this, "Help on Browser...", 600, 400);
766 hd->SetText(gHelpRemote);
767 hd->Popup();
768 break;
769 case kClone:
770 CloneBrowser();
771 break;
772 case kNewEditor:
773 cmd.Form("new TGTextEditor((const char *)0, gClient->GetRoot())");
774 ++eNr;
775 ExecPlugin(Form("Editor %d", eNr), "", cmd.Data(), 1);
776 break;
777 case kNewCanvas:
778 if (IsWebGUI())
779 gROOT->ProcessLine("new TCanvas()");
780 else
781 ExecPlugin("", "", "new TCanvas()", 1);
782 break;
783 case kNewHtml:
784 cmd.Form("new TGHtmlBrowser(\"%s\", gClient->GetRoot())",
785 gEnv->GetValue("Browser.StartUrl", "http://root.cern.ch"));
786 ExecPlugin("HTML", "", cmd.Data(), 1);
787 break;
788 case kExecPluginMacro:
789 {
790 static TString dir(".");
791 TGFileInfo fi;
793 fi.fIniDir = StrDup(dir);
794 new TGFileDialog(gClient->GetDefaultRoot(), this,
795 kFDOpen,&fi);
796 dir = fi.fIniDir;
797 if (fi.fFilename) {
798 ExecPlugin(0, fi.fFilename, 0, kRight);
799 }
800 }
801 break;
802 case kExecPluginCmd:
803 {
804 char command[1024];
805 strlcpy(command, "new TGLSAViewer(gClient->GetRoot(), 0);",
806 sizeof(command));
807 new TGInputDialog(gClient->GetRoot(), this,
808 "Enter plugin command line:",
809 command, command);
810 if (strcmp(command, "")) {
811 ExecPlugin("User", 0, command, kRight);
812 }
813 }
814 break;
815 case kCloseTab:
817 break;
818 case kCloseWindow:
819 CloseWindow();
820 break;
821 case kQuitRoot:
822 CloseWindow();
824 break;
825 default:
826 break;
827 }
828}
829
830////////////////////////////////////////////////////////////////////////////////
831/// Initialize default plugins. Could be also of the form:
832/// StartEmbedding(0);
833/// TPluginHandler *ph;
834/// ph = gROOT->GetPluginManager()->FindHandler("TGClassBrowser");
835/// if (ph && ph->LoadPlugin() != -1) {
836/// ph->ExecPlugin(3, gClient->GetRoot(), 200, 500);
837/// }
838/// StopEmbedding();
839
841{
842 TString cmd;
843
844 if ((opt == 0) || (!opt[0]))
845 return;
846 // --- Left vertical area
847
848 // File Browser plugin
849 if (strchr(opt, 'F')) {
850 cmd.Form("new TGFileBrowser(gClient->GetRoot(), (TBrowser *)0x%lx, 200, 500);", (ULong_t)fBrowser);
851 ExecPlugin("Files", 0, cmd.Data(), 0);
853 }
854
855 // --- Right main area
856
857 Int_t i, len = strlen(opt);
858 for (i=0; i<len; ++i) {
859 // Editor plugin...
860 if (opt[i] == 'E') {
861 cmd.Form("new TGTextEditor((const char *)0, gClient->GetRoot());");
862 ExecPlugin("Editor 1", 0, cmd.Data(), 1);
864 }
865
866 // HTML plugin...
867 if (opt[i] == 'H') {
868 if (gSystem->Load("libGuiHtml") >= 0) {
869 cmd.Form("new TGHtmlBrowser(\"%s\", gClient->GetRoot());",
870 gEnv->GetValue("Browser.StartUrl",
871 "http://root.cern.ch/root/html/ClassIndex.html"));
872 ExecPlugin("HTML", 0, cmd.Data(), 1);
874 }
875 }
876
877 // Canvas plugin...
878 if ((opt[i] == 'C') && !IsWebGUI()) {
879 cmd.Form("new TCanvas();");
880 ExecPlugin("c1", 0, cmd.Data(), 1);
882 }
883
884 // GLViewer plugin...
885 if (opt[i] == 'G') {
886 cmd.Form("new TGLSAViewer(gClient->GetRoot(), 0);");
887 ExecPlugin("OpenGL", 0, cmd.Data(), 1);
889 }
890
891 // PROOF plugin...
892 if (opt[i] == 'P') {
893 cmd.Form("new TSessionViewer();");
894 ExecPlugin("PROOF", 0, cmd.Data(), 1);
896 }
897 }
898 // --- Right bottom area
899
900 // Command plugin...
901 if (strchr(opt, 'I')) {
902 cmd.Form("new TGCommandPlugin(gClient->GetRoot(), 700, 300);");
903 ExecPlugin("Command", 0, cmd.Data(), 2);
905 }
906
907 // --- Select first tab everywhere
908 SetTab(0, 0);
909 SetTab(1, 0);
910 SetTab(2, 0);
911}
912
913////////////////////////////////////////////////////////////////////////////////
914/// Check if the GUI factory is set to use the Web GUI.
915
917{
918 TString factory = gEnv->GetValue("Gui.Factory", "native");
919 return (factory.Contains("web", TString::kIgnoreCase));
920}
921
922////////////////////////////////////////////////////////////////////////////////
923/// Really delete the browser and the this GUI.
924
926{
928 delete this;
929}
930
931////////////////////////////////////////////////////////////////////////////////
932/// Recursively remove object from browser.
933
935{
936 if (fActBrowser)
938}
939
940////////////////////////////////////////////////////////////////////////////////
941/// Recursively reparent TGPopupMenu to gClient->GetDefaultRoot().
942
944{
945 TGMenuEntry *entry = 0;
946 TIter next(popup->GetListOfEntries());
947 while ((entry = (TGMenuEntry *)next())) {
948 if (entry->GetPopup()) {
949 RecursiveReparent(entry->GetPopup());
950 }
951 }
952 popup->ReparentWindow(gClient->GetDefaultRoot());
953}
954
955////////////////////////////////////////////////////////////////////////////////
956/// Refresh the actual browser contents.
957
959{
960 if (fActBrowser)
961 fActBrowser->Refresh(force);
962}
963
964////////////////////////////////////////////////////////////////////////////////
965/// Remove tab element "subpos" from tab "pos".
966
968{
969 TGTab *edit = 0;
970 switch (pos) {
971 case kLeft: // left
972 edit = fTabLeft;
973 break;
974 case kRight: // right
975 edit = fTabRight;
978 fActMenuBar = 0;
979 break;
980 case kBottom: // bottom
981 edit = fTabBottom;
982 break;
983 }
984 if (!edit || !edit->GetTabTab(subpos))
985 return;
986 const char *tabName = edit->GetTabTab(subpos)->GetString();
987 TObject *obj = 0;
988 if ((obj = fPlugins.FindObject(tabName))) {
989 fPlugins.Remove(obj);
990 }
991 TGFrameElement *el = 0;
992 if (edit->GetTabContainer(subpos))
993 el = (TGFrameElement *)edit->GetTabContainer(subpos)->GetList()->First();
994 if (el && el->fFrame) {
995 el->fFrame->Disconnect("ProcessedConfigure(Event_t*)");
996 el->fFrame->SetFrameElement(0);
997 if (el->fFrame->InheritsFrom("TGMainFrame")) {
998 Bool_t sleep = (el->fFrame->InheritsFrom("TRootCanvas")) ? kTRUE : kFALSE;
999 ((TGMainFrame *)el->fFrame)->CloseWindow();
1000 if (sleep)
1001 gSystem->Sleep(150);
1003 }
1004 else
1005 delete el->fFrame;
1006 el->fFrame = 0;
1007 if (el->fLayout && (el->fLayout != fgDefaultHints) &&
1008 (el->fLayout->References() > 0)) {
1009 el->fLayout->RemoveReference();
1010 if (!el->fLayout->References()) {
1011 delete el->fLayout;
1012 }
1013 }
1014 edit->GetTabContainer(subpos)->GetList()->Remove(el);
1015 delete el;
1016 }
1017 fNbTab[pos]--;
1018 edit->RemoveTab(subpos);
1019 SwitchMenus(edit->GetTabContainer(edit->GetCurrent()));
1020}
1021
1022////////////////////////////////////////////////////////////////////////////////
1023/// Switch to Tab "subpos" in TGTab "pos".
1024
1026{
1027 TGTab *tab = GetTab(pos);
1028 if (subpos == -1)
1029 subpos = fCrTab[pos];
1030
1031 if (tab && tab->SetTab(subpos, kFALSE)) { // Block signal emit
1032 if (pos == kRight)
1033 SwitchMenus(tab->GetTabContainer(subpos));
1034 tab->Layout();
1035 }
1036}
1037
1038////////////////////////////////////////////////////////////////////////////////
1039/// Set text "title" of Tab "subpos" in TGTab "pos".
1040
1041void TRootBrowser::SetTabTitle(const char *title, Int_t pos, Int_t subpos)
1042{
1043 TBrowserPlugin *p = 0;
1044 TGTab *edit = GetTab(pos);
1045 if (!edit) return;
1046 if (subpos == -1)
1047 subpos = fCrTab[pos];
1048
1049 TGTabElement *el = edit->GetTabTab(subpos);
1050 if (el) {
1051 el->SetText(new TGString(title));
1052 edit->Layout();
1053 if ((p = (TBrowserPlugin *)fPlugins.FindObject(title)))
1054 p->SetName(title);
1055 }
1056}
1057
1058////////////////////////////////////////////////////////////////////////////////
1059/// Set text in culumn col in status bar.
1060
1061void TRootBrowser::SetStatusText(const char* txt, Int_t col)
1062{
1063 fStatusBar->SetText(txt, col);
1064}
1065
1066////////////////////////////////////////////////////////////////////////////////
1067/// Show the selected frame's menu and hide previous one.
1068
1070{
1071 TGFrameElement *el = 0;
1072 // temporary solution until I find a proper way to handle
1073 // these bloody menus...
1074 fBindList->Delete();
1075 TIter nextm(fMenuBar->GetList());
1076 while ((el = (TGFrameElement *) nextm())) {
1077 TGMenuTitle *t = (TGMenuTitle *) el->fFrame;
1078 Int_t code = t->GetHotKeyCode();
1087 }
1089 fMenuFrame->ShowFrame(menu);
1090 menu->Layout();
1091 fMenuFrame->Layout();
1092 fActMenuBar = menu;
1093}
1094
1095////////////////////////////////////////////////////////////////////////////////
1096/// Start embedding external frame in the tab "pos" and tab element "subpos".
1097
1099{
1100 fEditTab = GetTab(pos);
1101 if (!fEditTab) return;
1102 fEditPos = pos;
1103 fEditSubPos = subpos;
1104
1105 if (fEditFrame == 0) {
1106 if (subpos == -1) {
1107 fCrTab[pos] = fNbTab[pos]++;
1108 fEditFrame = fEditTab->AddTab(Form("Tab %d",fNbTab[pos]));
1112 if(tabel) {
1113 tabel->MapWindow();
1114 if (fShowCloseTab && (pos == 1))
1115 tabel->ShowClose();
1116 }
1118 fEditTab->Layout();
1119 }
1120 else {
1121 fCrTab[pos] = subpos;
1123 fEditTab->SetTab(subpos);
1124 }
1126 }
1127}
1128
1129////////////////////////////////////////////////////////////////////////////////
1130/// Stop embedding external frame in the current editable frame.
1131
1133{
1134 if (fEditFrame != 0) {
1137 if (el && el->fFrame) {
1138 // let be notified when the inside frame gets resized, and tell its
1139 // container to recompute its layout
1140 el->fFrame->Connect("ProcessedConfigure(Event_t*)", "TGCompositeFrame",
1141 fEditFrame, "Layout()");
1142 }
1143 if (layout) {
1144 el = (TGFrameElement*) fEditFrame->GetList()->Last();
1145 // !!!! MT what to do with the old layout? Leak it for now ...
1146 if (el) el->fLayout = layout;
1147 }
1148 fEditFrame->Layout();
1149 if (fEditTab == fTabRight)
1151 }
1152 if (name && strlen(name)) {
1154 }
1156 fEditFrame = fEditTab = 0;
1157 fEditPos = fEditSubPos = -1;
1158}
1159
1160////////////////////////////////////////////////////////////////////////////////
1161/// Move the menu from original frame to our TGMenuFrame, or display the
1162/// menu associated to the current tab.
1163
1165{
1166 if (from == 0)
1167 return;
1168 TGFrameElement *fe = (TGFrameElement *)from->GetList()->First();
1169 if (!fe) {
1170 if (fActMenuBar != fMenuBar)
1172 return;
1173 }
1175 TGFrameElement *el = 0;
1176 if (embed && embed->GetList()) {
1177 TIter next(embed->GetList());
1178 while ((el = (TGFrameElement *)next())) {
1179 if (el->fFrame->InheritsFrom("TGMenuBar")) {
1180 TGMenuBar *menu = (TGMenuBar *)el->fFrame;
1181 if (fActMenuBar == menu)
1182 return;
1183 TGFrameElement *nw;
1184 TIter nel(fMenuFrame->GetList());
1185 while ((nw = (TGFrameElement *) nel())) {
1186 if (nw->fFrame == menu) {
1187 ShowMenu(menu);
1188 return;
1189 }
1190 }
1191 ((TGCompositeFrame *)menu->GetParent())->HideFrame(menu);
1194 fMenuFrame->AddFrame(menu, fLH2);
1195 TGFrameElement *mel;
1196 TIter mnext(menu->GetList());
1197 while ((mel = (TGFrameElement *) mnext())) {
1198 TGMenuTitle *t = (TGMenuTitle *) mel->fFrame;
1199 TGPopupMenu *popup = menu->GetPopup(t->GetName());
1200 if (popup) {
1201 RecursiveReparent(popup);
1202 if (popup->GetEntry("Close Canvas")) {
1203 TGMenuEntry *exit = popup->GetEntry("Close Canvas");
1204 popup->HideEntry(exit->GetEntryId());
1205 }
1206 if (popup->GetEntry("Close Viewer")) {
1207 TGMenuEntry *exit = popup->GetEntry("Close Viewer");
1208 popup->HideEntry(exit->GetEntryId());
1209 }
1210 if (popup->GetEntry("Quit ROOT")) {
1211 TGMenuEntry *exit = popup->GetEntry("Quit ROOT");
1212 popup->HideEntry(exit->GetEntryId());
1213 }
1214 if (popup->GetEntry("Exit")) {
1215 TGMenuEntry *exit = popup->GetEntry("Exit");
1216 popup->HideEntry(exit->GetEntryId());
1217 }
1218 }
1219 }
1220 ShowMenu(menu);
1221 return;
1222 }
1223 }
1224 }
1225 if (fActMenuBar != fMenuBar)
1227}
1228
1229////////////////////////////////////////////////////////////////////////////////
1230/// Emits signal when double clicking on icon.
1231
1233{
1234 Emit("DoubleClicked(TObject*)", (Long_t)obj);
1235}
1236
1237////////////////////////////////////////////////////////////////////////////////
1238/// Emits signal when double clicking on icon.
1239
1241{
1242 Long_t args[2];
1243
1244 args[0] = (Long_t)obj;
1245 args[1] = checked;
1246
1247 Emit("Checked(TObject*,Bool_t)", args);
1248}
1249
1250////////////////////////////////////////////////////////////////////////////////
1251/// Emits signal "ExecuteDefaultAction(TObject*)".
1252
1254{
1255 Emit("ExecuteDefaultAction(TObject*)", (Long_t)obj);
1256}
1257
1258
1259////////////////////////////////////////////////////////////////////////////////
1260/// static contructor returning TBrowserImp,
1261/// as needed by the plugin mechanism.
1262
1264 UInt_t width, UInt_t height,
1265 Option_t *opt)
1266{
1267 TRootBrowser *browser = new TRootBrowser(b, title, width, height, opt);
1268 return (TBrowserImp *)browser;
1269}
1270
1271////////////////////////////////////////////////////////////////////////////////
1272/// static contructor returning TBrowserImp,
1273/// as needed by the plugin mechanism.
1274
1276 Int_t y, UInt_t width, UInt_t height,
1277 Option_t *opt)
1278{
1279 TRootBrowser *browser = new TRootBrowser(b, title, x, y, width, height, opt);
1280 return (TBrowserImp *)browser;
1281}
@ 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: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
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:414
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:2895
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: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:2965
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: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