Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEveBrowser.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 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#include "TEveBrowser.h"
13
14#include "TEveUtil.h"
15#include "TEveElement.h"
16#include "TEveManager.h"
17#include "TEveSelection.h"
18#include "TEveGedEditor.h"
19#include "TEveWindow.h"
20#include "TEveWindowManager.h"
21
22#include "TGFileBrowser.h"
23#include "TBrowser.h"
24
25#include "TClass.h"
26#include "TROOT.h"
27#include "TSystem.h"
28#include "TVirtualX.h"
29
30#include "TClassMenuItem.h"
31
32#include "TColor.h"
33
34#include "TGCanvas.h"
35#include "TGMenu.h"
36#include "TGSplitter.h"
37#include "TGTab.h"
38#include <KeySymbols.h>
39#include "TGLSAViewer.h"
40
41#include "TGeoVolume.h"
42#include "TGeoNode.h"
43
44/** \class TEveListTreeItem
45\ingroup TEve
46Special list-tree-item for Eve.
47
48Most state is picked directly from TEveElement, no need to store it
49locally nor to manage its consistency.
50
51Handles also selected/highlighted colors and, in the future, drag-n-drop.
52*/
53
54
55////////////////////////////////////////////////////////////////////////////////
56/// Warn about access to function members that should never be called.
57/// TGListTree calls them in cases that are not used by Eve.
58
59void TEveListTreeItem::NotSupported(const char* func) const
60{
61 Warning(Form("TEveListTreeItem::%s()", func), "not supported.");
62}
63
64////////////////////////////////////////////////////////////////////////////////
65/// Return highlight color corresponding to current state of TEveElement.
66
68{
69 switch (fElement->GetSelectedLevel())
70 {
71 case 1: return TColor::Number2Pixel(kBlue - 2);
72 case 2: return TColor::Number2Pixel(kBlue - 6);
73 case 3: return TColor::Number2Pixel(kCyan - 2);
74 case 4: return TColor::Number2Pixel(kCyan - 6);
75 }
77}
78
79////////////////////////////////////////////////////////////////////////////////
80/// Item's check-box state has been toggled ... forward to element's
81/// render-state.
82
88
89/** \class TEveGListTreeEditorFrame
90\ingroup TEve
91Composite GUI frame for parallel display of a TGListTree and TEveGedEditor.
92*/
93
94
96
97////////////////////////////////////////////////////////////////////////////////
98/// Constructor.
99
101 TGMainFrame (p ? p : gClient->GetRoot(), width, height),
102 fFrame (nullptr),
103 fLTFrame (nullptr),
104 fListTree (nullptr),
105 fSplitter (nullptr),
106 fEditor (nullptr),
107 fCtxMenu (nullptr),
108 fSignalsConnected (kFALSE)
109{
111
113
114 // List-tree
128
129 // Splitter
132
133 // Editor
136 fEditor = (TEveGedEditor*) gROOT->GetClass(fgEditorClass)->New();
141 {
142 TGFrameElement *el = nullptr;
143 TIter next(fFrame->GetList());
144 while ((el = (TGFrameElement *) next())) {
145 if (el->fFrame == fEditor)
146 if (el->fLayout) {
147 el->fLayout->SetLayoutHints(kLHintsTop | kLHintsExpandX);
148 el->fLayout->SetPadLeft(0); el->fLayout->SetPadRight(1);
149 el->fLayout->SetPadTop(2); el->fLayout->SetPadBottom(1);
150 break;
151 }
152 }
153 }
155
157
158 fCtxMenu = new TContextMenu("", "");
159
160 Layout();
162 MapWindow();
163}
164
165////////////////////////////////////////////////////////////////////////////////
166/// Destructor.
167
169{
171
172 delete fCtxMenu;
173
174 // Should un-register editor, all items and list-tree from gEve ... eventually.
175
176 delete fEditor;
177 delete fSplitter;
178 delete fListTree;
179 delete fLTCanvas;
180 delete fLTFrame;
181 delete fFrame;
182}
183
184////////////////////////////////////////////////////////////////////////////////
185/// Set GED editor class.
186
191
192////////////////////////////////////////////////////////////////////////////////
193/// Connect list-tree signals.
194
196{
197 fListTree->Connect("MouseOver(TGListTreeItem*, UInt_t)", "TEveGListTreeEditorFrame",
198 this, "ItemBelowMouse(TGListTreeItem*, UInt_t)");
199 fListTree->Connect("Clicked(TGListTreeItem*, Int_t, UInt_t, Int_t, Int_t)", "TEveGListTreeEditorFrame",
200 this, "ItemClicked(TGListTreeItem*, Int_t, UInt_t, Int_t, Int_t)");
201 fListTree->Connect("DoubleClicked(TGListTreeItem*, Int_t)", "TEveGListTreeEditorFrame",
202 this, "ItemDblClicked(TGListTreeItem*, Int_t)");
203 fListTree->Connect("KeyPressed(TGListTreeItem*, ULong_t, ULong_t)", "TEveGListTreeEditorFrame",
204 this, "ItemKeyPress(TGListTreeItem*, UInt_t, UInt_t)");
205
207}
208
209////////////////////////////////////////////////////////////////////////////////
210/// Disconnect list-tree signals.
211
213{
214 if (!fSignalsConnected) return;
215
216 fListTree->Disconnect("MouseOver(TGListTreeItem*, UInt_t)",
217 this, "ItemBelowMouse(TGListTreeItem*, UInt_t)");
218 fListTree->Disconnect("Clicked(TGListTreeItem*, Int_t, UInt_t, Int_t, Int_t)",
219 this, "ItemClicked(TGListTreeItem*, Int_t, UInt_t, Int_t, Int_t)");
220 fListTree->Disconnect("DoubleClicked(TGListTreeItem*, Int_t)",
221 this, "ItemDblClicked(TGListTreeItem*, Int_t)");
222 fListTree->Disconnect("KeyPressed(TGListTreeItem*, ULong_t, ULong_t)",
223 this, "ItemKeyPress(TGListTreeItem*, UInt_t, UInt_t)");
224
226}
227
228////////////////////////////////////////////////////////////////////////////////
229/// Reconfigure to horizontal layout, list-tree and editor side by side.
230
232{
233 UnmapWindow();
234
238
239 TGFrameElement *el = nullptr;
240 TIter next(fFrame->GetList());
241 while ((el = (TGFrameElement *) next()))
242 {
243 if (el->fFrame == fSplitter)
244 {
245 // This is needed so that splitter window gets destroyed on server.
247 delete fSplitter;
248 el->fFrame = fSplitter = new TGVSplitter(fFrame);
249 el->fLayout->SetLayoutHints(kLHintsLeft | kLHintsExpandY);
250 el->fLayout->SetPadLeft(2); el->fLayout->SetPadRight (2);
251 el->fLayout->SetPadTop (1); el->fLayout->SetPadBottom(1);
252 }
253 else if (el->fFrame == fEditor)
254 {
257 el->fLayout->SetLayoutHints(kLHintsLeft | kLHintsExpandY);
258 }
259 }
260
263
264 Layout();
266 MapWindow();
267}
268
269////////////////////////////////////////////////////////////////////////////////
270/// Reconfigure to vertical layout, list-tree above the editor.
271
273{
274 UnmapWindow();
275
279
280 TGFrameElement *el = nullptr;
281 TIter next(fFrame->GetList());
282 while ((el = (TGFrameElement *) next()))
283 {
284 if (el->fFrame == fSplitter)
285 {
286 // This is needed so that splitter window gets destroyed on server.
288 delete fSplitter;
289 el->fFrame = fSplitter = new TGHSplitter(fFrame);
290 el->fLayout->SetLayoutHints(kLHintsTop | kLHintsExpandX);
291 el->fLayout->SetPadLeft(2); el->fLayout->SetPadRight (2);
292 el->fLayout->SetPadTop (1); el->fLayout->SetPadBottom(1);
293 }
294 else if (el->fFrame == fEditor)
295 {
298 el->fLayout->SetLayoutHints(kLHintsTop | kLHintsExpandX);
299 }
300 }
301
304
305 Layout();
307 MapWindow();
308}
309
310////////////////////////////////////////////////////////////////////////////////
311/// Different item is below mouse.
312
318
319////////////////////////////////////////////////////////////////////////////////
320/// Item has been clicked, based on mouse button do:
321/// - M1 - select, show in editor;
322/// - M2 - paste (call gEve->ElementPaste();
323/// - M3 - popup context menu.
324
326{
327 //printf("ItemClicked item %s List %d btn=%d, x=%d, y=%d\n",
328 // item->GetText(),fDisplayFrame->GetList()->GetEntries(), btn, x, y);
329
330 static const TEveException eh("TEveGListTreeEditorFrame::ItemClicked ");
331
332 TEveElement* el = (TEveElement*) item->GetUserData();
333 if (el == nullptr) return;
334 TObject* obj = el->GetObject(eh);
335
336 switch (btn)
337 {
338 case 1:
340 break;
341
342 case 2:
343 if (gEve->ElementPaste(el))
344 gEve->Redraw3D();
345 break;
346
347 case 3:
348 // If control pressed, show menu for render-element itself.
349 // event->fState & kKeyControlMask
350 // ??? how do i get current event?
351 // !!!!! Have this now ... fix.
352 if (obj) fCtxMenu->Popup(x, y, obj);
353 break;
354
355 default:
356 break;
357 }
358}
359
360////////////////////////////////////////////////////////////////////////////////
361/// Item has been double-clicked, potentially expand the children.
362
364{
365 static const TEveException eh("TEveGListTreeEditorFrame::ItemDblClicked ");
366
367 if (btn != 1) return;
368
369 TEveElement* el = (TEveElement*) item->GetUserData();
370 if (el == nullptr) return;
371
372 el->ExpandIntoListTree(fListTree, item);
373
374 TObject* obj = el->GetObject(eh);
375 if (obj)
376 {
377 // Browse geonodes.
378 if (obj->IsA()->InheritsFrom(TGeoNode::Class()))
379 {
380 TGeoNode* n = dynamic_cast<TGeoNode*>(obj);
381 if (item->GetFirstChild() == nullptr && n->GetNdaughters())
382 {
384 for (Int_t i=0; i< n->GetNdaughters(); i++)
385 {
386 TString title;
387 title.Form("%d : %s[%d]", i,
388 n->GetDaughter(i)->GetVolume()->GetName(),
389 n->GetDaughter(i)->GetNdaughters());
390
392 child->SetUserData(n->GetDaughter(i));
393 }
394 }
395 }
396 }
397}
398
399////////////////////////////////////////////////////////////////////////////////
400/// A key has been pressed for an item.
401///
402/// Only `<Delete>`, `<Enter>` and `<Return>` keys are handled here,
403/// otherwise the control is passed back to TGListTree.
404
406{
407 static const TEveException eh("TEveGListTreeEditorFrame::ItemKeyPress ");
408
410 if (entry == nullptr) return;
411
412 TEveElement* el = (TEveElement*) entry->GetUserData();
413
414 fListTree->SetEventHandled(); // Reset back to false in default case.
415
416 switch (keysym)
417 {
418 case kKey_Delete:
419 {
420 if (entry->GetParent())
421 {
422 if (el->GetDenyDestroy() > 0 && el->GetNItems() == 1)
423 throw(eh + "DestroyDenied set for this item.");
424
425 TEveElement* parent = (TEveElement*) entry->GetParent()->GetUserData();
426
427 if (parent)
428 {
429 gEve->RemoveElement(el, parent);
430 gEve->Redraw3D();
431 }
432 }
433 else
434 {
435 if (el->GetDenyDestroy() > 0)
436 throw(eh + "DestroyDenied set for this top-level item.");
438 gEve->Redraw3D();
439 }
440 break;
441 }
442
443 case kKey_Enter:
444 case kKey_Return:
445 {
447 break;
448 }
449
450 default:
451 {
453 break;
454 }
455 }
456}
457
458
459/** \class TEveBrowser
460\ingroup TEve
461Specialization of TRootBrowser for Eve.
462*/
463
464
465////////////////////////////////////////////////////////////////////////////////
466/// Add "Export to CINT" into context-menu for class cl.
467
469{
470 TList* l = cl->GetMenuList();
472 "Export to CINT", "ExportToCINT", this, "const char*,TObject*", 1);
473
474 l->AddFirst(n);
475}
476
477////////////////////////////////////////////////////////////////////////////////
478/// Calculate position of a widget for reparenting into parent.
479
481{
482 UInt_t w, h;
484 gVirtualX->GetWindowSize(parent->GetId(), x, y, w, h);
485 gVirtualX->TranslateCoordinates(parent->GetId(),
486 gClient->GetDefaultRoot()->GetId(),
487 0, 0, x, y, childdum);
488}
489
490namespace
491{
492enum EEveMenu_e {
502};
503
504}
505
506////////////////////////////////////////////////////////////////////////////////
507/// Constructor.
508
510 TRootBrowser(nullptr, "Eve Main Window", w, h, "", kFALSE),
511 fFileBrowser(nullptr),
512 fEvePopup (nullptr),
513 fSelPopup (nullptr),
514 fHilPopup (nullptr)
515{
516 // Construct Eve menu.
517
518 fEvePopup = new TGPopupMenu(gClient->GetRoot());
519 fEvePopup->AddEntry("New &MainFrame Slot", kNewMainFrameSlot);
520 fEvePopup->AddEntry("New &Tab Slot", kNewTabSlot);
522 fEvePopup->AddEntry("New &Viewer", kNewViewer);
523 fEvePopup->AddEntry("New &Scene", kNewScene);
525 fEvePopup->AddEntry("New &Browser", kNewBrowser);
526 fEvePopup->AddEntry("New &Canvas", kNewCanvas);
527 fEvePopup->AddEntry("New Canvas Ext", kNewCanvasExt);
528 fEvePopup->AddEntry("New Text &Editor", kNewTextEditor);
529 // fEvePopup->AddEntry("New HTML Browser", kNewHtmlBrowser);
531
532 {
533 fSelPopup = new TGPopupMenu(gClient->GetRoot());
536 fSelPopup->AddEntry("Projectable", kSel_PS_Projectable);
537 fSelPopup->AddEntry("Compound", kSel_PS_Compound);
538 fSelPopup->AddEntry("Projectable and Compound",
543 fEvePopup->AddPopup("Selection", fSelPopup);
544 }
545 {
546 fHilPopup = new TGPopupMenu(gClient->GetRoot());
549 fHilPopup->AddEntry("Projectable", kHil_PS_Projectable);
550 fHilPopup->AddEntry("Compound", kHil_PS_Compound);
551 fHilPopup->AddEntry("Projectable and Compound",
556 fEvePopup->AddPopup("Highlight", fHilPopup);
557 }
558
560 fEvePopup->AddEntry("Vertical browser", kVerticalBrowser);
562 {
563 TGPopupMenu *wd = new TGPopupMenu(gClient->GetRoot());
564 wd->AddEntry("Normal", kWinDecorNormal);
565 wd->AddEntry("Hide", kWinDecorHide);
566 wd->AddEntry("Title bars", kWinDecorTitleBar);
567 wd->AddEntry("Mini bars", kWinDecorMiniBar);
568 fEvePopup->AddPopup("Window decorations", wd);
569 }
570
571 fEvePopup->Connect("Activated(Int_t)", "TEveBrowser",
572 this, "EveMenu(Int_t)");
573
574 fMenuBar->AddPopup("&Eve", fEvePopup, new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0));
575
579
580 // Rename "Close Window" to "Close Eve"
581 fMenuFile->GetEntry(kCloseWindow)->GetLabel()->SetString("Close Eve");
582}
583
584////////////////////////////////////////////////////////////////////////////////
585/// Handle events from Eve menu.
586
588{
589 switch (id)
590 {
591 case kNewMainFrameSlot: {
594 break;
595 }
596 case kNewTabSlot: {
599 break;
600 }
601 case kNewViewer: {
602 gEve->SpawnNewViewer("Viewer Pepe");
603 break;
604 }
605 case kNewScene: {
606 gEve->SpawnNewScene("Scena Mica");
607 break;
608 }
609 case kNewBrowser: {
610 gROOT->ProcessLineFast("new TBrowser");
611 break;
612 }
613 case kNewCanvas: {
615 gROOT->ProcessLineFast("new TCanvas");
617 SetTabTitle("Canvas", 1);
618 break;
619 }
620 case kNewCanvasExt: {
621 gROOT->ProcessLineFast("new TCanvas");
622 break;
623 }
624 case kNewTextEditor: {
626 gROOT->ProcessLineFast(Form("new TGTextEditor((const char *)0, (const TGWindow *)0x%zx)", (size_t)gClient->GetRoot()));
628 SetTabTitle("Editor", 1);
629 break;
630 }
631 case kNewHtmlBrowser: {
632 gSystem->Load("libGuiHtml");
633 if (gSystem->Load("libRHtml") >= 0)
634 {
636 gROOT->ProcessLine(Form("new TGHtmlBrowser(\"https://root.cern/doc/master/classes.html\", \
637 (const TGWindow *)0x%zx)", (size_t)gClient->GetRoot()));
639 SetTabTitle("HTML", 1);
640 }
641 break;
642 }
643 case kSel_PS_Ignore:
644 case kSel_PS_Element:
646 case kSel_PS_Compound:
648 case kSel_PS_Master: {
652 break;
653 }
654 case kHil_PS_Ignore:
655 case kHil_PS_Element:
657 case kHil_PS_Compound:
659 case kHil_PS_Master: {
663 break;
664 }
665 case kVerticalBrowser: {
669 } else {
672 }
673 break;
674 }
675 case kWinDecorNormal: {
677 break;
678 }
679 case kWinDecorHide: {
681 break;
682 }
683 case kWinDecorTitleBar: {
685 break;
686 }
687 case kWinDecorMiniBar: {
689 break;
690 }
691
692 default: {
693 break;
694 }
695 }
696}
697
698////////////////////////////////////////////////////////////////////////////////
699/// Initialize standard plugins.
700
702{
703 TString o(opt);
704
705 // File Browser plugin ... we have to process it here.
706 if (o.Contains('F'))
707 {
710 fb->BrowseObj(gROOT);
711 fb->Show();
712 fFileBrowser = fb;
713 StopEmbedding("Files");
714 o.ReplaceAll("F", ".");
715 }
716
718}
719
720////////////////////////////////////////////////////////////////////////////////
721/// Create a file-browser. Caller should provide Start/StopEmbedding() calls
722/// and populate the new browser.
723///
724/// If flag make_default is kTRUE, the default file-browser is set to the
725/// newly created browser.
726
728{
730 TBrowser *tb = new TBrowser("Pipi", "Strel", &imp);
731 TGFileBrowser *fb = new TGFileBrowser(gClient->GetRoot(), tb, 200, 500);
732 tb->SetBrowserImp((TBrowserImp *)this);
733 fb->SetBrowser(tb);
734 fb->SetNewBrowser(this);
735 gROOT->GetListOfBrowsers()->Remove(tb);
736 // This guy is never used and stays in list-of-cleanups after destruction.
737 // So let's just delete it now.
738 delete tb->GetContextMenu();
739
740 if (make_default)
741 fFileBrowser = fb;
742
743 return fb;
744}
745
746////////////////////////////////////////////////////////////////////////////////
747/// Returns the default file-browser.
748
753
754////////////////////////////////////////////////////////////////////////////////
755/// Set the default file browser.
756
761
762////////////////////////////////////////////////////////////////////////////////
763/// Override from TRootBrowser. We need to be more brutal as fBrowser is
764/// not set in Eve case.
765
767{
768 delete this;
769}
770
771////////////////////////////////////////////////////////////////////////////////
772/// Virtual from TRootBrowser. Need to intercept closing of Eve tabs.
773
775{
776 // Check if this is an Eve window and destroy accordingly.
778 if (pcf)
779 {
780 TGFrameElement *fe = (TGFrameElement *) pcf->GetList()->First();
781 if (fe)
782 {
783 TEveCompositeFrame *ecf = dynamic_cast<TEveCompositeFrame*>(fe->fFrame);
784 if (ecf)
785 {
786 ecf->GetEveWindow()->DestroyWindowAndSlot();
787 return;
788 }
789 }
790 }
791
792 // Fallback to standard tab destruction
794}
795
796////////////////////////////////////////////////////////////////////////////////
797/// Virtual from TGMainFrame. Calls TEveManager::Terminate().
798
803
804////////////////////////////////////////////////////////////////////////////////
805/// Hide the bottom tab (usually holding command-line widget).
806
812
813////////////////////////////////////////////////////////////////////////////////
814/// TRootBrowser keeps (somewhat unnecessarily) counters for number ob tabs
815/// on each position. Eve bastardizes the right tab so we have to fix the counters
816/// when a new window is added ... it doesn't seem to be needed when it is removed.
817
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
@ kRaisedFrame
Definition GuiTypes.h:384
@ kSunkenFrame
Definition GuiTypes.h:383
@ kVerticalFrame
Definition GuiTypes.h:381
@ kDoubleBorder
Definition GuiTypes.h:385
@ kFixedWidth
Definition GuiTypes.h:387
@ kHorizontalFrame
Definition GuiTypes.h:382
@ kFixedHeight
Definition GuiTypes.h:389
const Mask_t kKeyControlMask
Definition GuiTypes.h:197
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
@ kKey_Return
Definition KeySymbols.h:30
@ kKey_Delete
Definition KeySymbols.h:33
@ kKey_Enter
Definition KeySymbols.h:31
#define b(i)
Definition RSha256.hxx:100
#define h(i)
Definition RSha256.hxx:106
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
@ kCyan
Definition Rtypes.h:67
@ kBlue
Definition Rtypes.h:67
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition TError.cxx:252
R__EXTERN TEveManager * gEve
#define gClient
Definition TGClient.h:157
@ kNoCleanup
Definition TGFrame.h:40
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsNormal
Definition TGLayout.h:32
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t child
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
#define gROOT
Definition TROOT.h:411
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2495
R__EXTERN TSystem * gSystem
Definition TSystem.h:572
#define gVirtualX
Definition TVirtualX.h:337
ABC describing GUI independent browser implementation protocol.
Definition TBrowserImp.h:29
virtual void SetBrowser(TBrowser *b)
Definition TBrowserImp.h:68
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Describes one element of the context menu associated to a class The menu item may describe.
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
TList * GetMenuList() const
Return the list of menu items associated with the class.
Definition TClass.cxx:4368
static ULong_t Number2Pixel(Int_t ci)
Static method that given a color index number, returns the corresponding pixel value.
Definition TColor.cxx:2445
This class provides an interface to context sensitive popup menus.
virtual void Popup(Int_t x, Int_t y, TObject *obj, TVirtualPad *c=nullptr, TVirtualPad *p=nullptr)
Popup context menu at given location in canvas c and pad p for selected object.
TEveBrowser(const TEveBrowser &)
void CalculateReparentXY(TGObject *parent, Int_t &x, Int_t &y)
Calculate position of a widget for reparenting into parent.
TGFileBrowser * GetFileBrowser() const
Returns the default file-browser.
void SanitizeTabCounts()
TRootBrowser keeps (somewhat unnecessarily) counters for number ob tabs on each position.
void EveMenu(Int_t id)
Handle events from Eve menu.
void SetupCintExport(TClass *cl)
Add "Export to CINT" into context-menu for class cl.
void CloseTab(Int_t id) override
Virtual from TRootBrowser. Need to intercept closing of Eve tabs.
void CloseWindow() override
Virtual from TGMainFrame. Calls TEveManager::Terminate().
void ReallyDelete() override
Override from TRootBrowser.
TGPopupMenu * fSelPopup
TGPopupMenu * fHilPopup
TGFileBrowser * MakeFileBrowser(Bool_t make_default=kFALSE)
Create a file-browser.
void SetFileBrowser(TGFileBrowser *b)
Set the default file browser.
void InitPlugins(Option_t *opt="FI")
Initialize standard plugins.
TGPopupMenu * fEvePopup
void HideBottomTab()
Hide the bottom tab (usually holding command-line widget).
TGFileBrowser * fFileBrowser
Abstract base-class for frame-slots that encompass EVE-windows (sub-classes of TEveWindow).
Definition TEveWindow.h:40
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition TEveElement.h:36
virtual UChar_t GetSelectedLevel() const
Get selection level, needed for rendering selection and highlight feedback.
virtual Bool_t SetRnrState(Bool_t rnr)
Set render state of this element and of its children to the same value.
virtual void ElementChanged(Bool_t update_scenes=kTRUE, Bool_t redraw=kFALSE)
Call this after an element has been changed so that the state can be propagated around the framework.
Exception class thrown by TEve classes and macros.
Definition TEveUtil.h:102
static TString fgEditorClass
static void SetEditorClass(const char *edclass)
Set GED editor class.
void ItemClicked(TGListTreeItem *entry, Int_t btn, UInt_t mask, Int_t x, Int_t y)
Item has been clicked, based on mouse button do:
void DisconnectSignals()
Disconnect list-tree signals.
TEveGListTreeEditorFrame(const TEveGListTreeEditorFrame &)
void ReconfToVertical()
Reconfigure to vertical layout, list-tree above the editor.
void ItemBelowMouse(TGListTreeItem *entry, UInt_t mask)
Different item is below mouse.
~TEveGListTreeEditorFrame() override
Destructor.
TEveGedEditor * fEditor
Definition TEveBrowser.h:96
TGCompositeFrame * fLTFrame
Definition TEveBrowser.h:91
void ItemDblClicked(TGListTreeItem *item, Int_t btn)
Item has been double-clicked, potentially expand the children.
TContextMenu * fCtxMenu
Definition TEveBrowser.h:98
TGCompositeFrame * fFrame
Definition TEveBrowser.h:90
void ItemKeyPress(TGListTreeItem *entry, UInt_t keysym, UInt_t mask)
A key has been pressed for an item.
void ReconfToHorizontal()
Reconfigure to horizontal layout, list-tree and editor side by side.
void ConnectSignals()
Connect list-tree signals.
Specialization of TGedEditor for proper update propagation to TEveManager.
Pixel_t GetActiveColor() const override
Return highlight color corresponding to current state of TEveElement.
TEveElement * fElement
Definition TEveBrowser.h:36
void Toggle() override
Item's check-box state has been toggled ... forward to element's render-state.
void NotSupported(const char *func) const
Warn about access to function members that should never be called.
Bool_t IsChecked() const override
Definition TEveBrowser.h:68
TEveGListTreeEditorFrame * GetLTEFrame() const
static void Terminate()
Properly terminate global TEveManager.
TEveSelection * GetSelection() const
Bool_t ElementPaste(TEveElement *element)
Paste has been called.
void RemoveElement(TEveElement *element, TEveElement *parent)
Remove element from parent.
TEveWindowManager * GetWindowManager() const
TEveViewer * SpawnNewViewer(const char *name, const char *title="", Bool_t embed=kTRUE)
Create a new GL viewer.
void Redraw3D(Bool_t resetCameras=kFALSE, Bool_t dropLogicals=kFALSE)
void RemoveFromListTree(TEveElement *element, TGListTree *lt, TGListTreeItem *lti)
Remove top-level element from list-tree with specified tree-item.
TEveScene * SpawnNewScene(const char *name, const char *title="")
Create a new scene.
TEveSelection * GetHighlight() const
void SetPickToSelect(Int_t ps)
virtual void UserPickedElement(TEveElement *el, Bool_t multi=kFALSE)
Called when user picks/clicks on an element.
Int_t GetPickToSelect() const
void ShowNormalEveDecorations()
Show eve decorations (title-bar or mini-bar) as specified for the contained window on all frames.
void SetShowTitleBars(Bool_t state)
Set show title-bar state on all frames.
void HideAllEveDecorations()
Hide all eve decorations (title-bar and mini-bar) on all frames.
void SelectWindow(TEveWindow *w)
Entry-point for communicating the fact that a window was acted upon in such a way that it should beco...
Description of TEveWindowSlot.
Definition TEveWindow.h:302
static TEveWindowSlot * CreateWindowMainFrame(TEveWindow *eve_parent=nullptr)
Create a new main-frame and populate it with a default window-slot.
static TEveWindowSlot * CreateWindowInTab(TGTab *tab, TEveWindow *eve_parent=nullptr)
Create a new tab in a given tab-widget and populate it with a default window-slot.
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition TGCanvas.h:192
virtual void SetContainer(TGFrame *f)
Definition TGCanvas.h:222
TGViewPort * GetViewPort() const
Definition TGCanvas.h:217
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition TGClient.cxx:233
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:289
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
virtual TList * GetList() const
Definition TGFrame.h:312
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1156
TGCompositeFrame(const TGCompositeFrame &)=delete
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1249
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1064
void SetEditable(Bool_t on=kTRUE) override
Switch ON/OFF edit mode.
Definition TGFrame.cxx:940
void SetEditDisabled(UInt_t on=1) override
Set edit disable flag for this frame and subframes.
Definition TGFrame.cxx:1014
void ChangeOptions(UInt_t options) override
Change composite frame options. Options is an OR of the EFrameTypes.
Definition TGFrame.cxx:1035
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1182
virtual void Associate(const TGWindow *w)
Definition TGCanvas.h:89
System file browser, used as TRootBrowser plug-in.
void BrowseObj(TObject *obj) override
Browse object.
void SetNewBrowser(TRootBrowser *b)
void Show() override
static Pixel_t GetDefaultSelectedBackground()
Get default selected frame background.
Definition TGFrame.cxx:688
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:597
void ReparentWindow(const TGWindow *p, Int_t x=0, Int_t y=0) override
Reparent window, make p the new parent and position the window at position (x,y) in new parent.
Definition TGFrame.h:204
void MapWindow() override
map window
Definition TGFrame.h:206
virtual UInt_t GetOptions() const
Definition TGFrame.h:199
void UnmapWindow() override
unmap window
Definition TGFrame.h:208
UInt_t GetHeight() const
Definition TGFrame.h:227
UInt_t GetWidth() const
Definition TGFrame.h:226
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
A list tree is a widget that can contain a number of items arranged in a tree structure.
Definition TGListTree.h:197
void SetColorMode(EColorMarkupMode colorMode)
Definition TGListTree.h:436
void AddItem(TGListTreeItem *parent, TGListTreeItem *item)
Add given item to list tree.
Int_t DeleteChildren(TGListTreeItem *item)
Delete children of item from list.
void SetAutoCheckBoxPic(Bool_t on)
Definition TGListTree.h:354
void SetEventHandled(Bool_t eh=kTRUE)
Definition TGListTree.h:424
virtual void SetCanvas(TGCanvas *canvas)
Definition TGListTree.h:321
TGListTreeItem * GetCurrent() const
Definition TGListTree.h:385
void SetUserControl(Bool_t ctrl=kTRUE)
Definition TGListTree.h:422
Defines top level windows that interact with the system Window Manager.
Definition TGFrame.h:399
virtual void AddPopup(TGHotString *s, TGPopupMenu *menu, TGLayoutHints *l, TGPopupMenu *before=nullptr)
Add popup menu to menu bar.
Definition TGMenu.cxx:414
This class is the baseclass for all ROOT GUI widgets.
Definition TGObject.h:21
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Handle_t GetId() const
Definition TGObject.h:41
This class creates a popup menu object.
Definition TGMenu.h:110
virtual TGMenuEntry * GetEntry(Int_t id)
Find entry with specified id.
Definition TGMenu.cxx:1893
virtual Bool_t IsEntryChecked(Int_t id)
Return true if menu item is checked.
Definition TGMenu.cxx:1841
virtual void AddPopup(TGHotString *s, TGPopupMenu *popup, TGMenuEntry *before=nullptr, const TGPicture *p=nullptr)
Add a (cascading) popup menu to a popup menu.
Definition TGMenu.cxx:1148
virtual void CheckEntry(Int_t id)
Check a menu entry (i.e. add a check mark in front of it).
Definition TGMenu.cxx:1778
virtual void UnCheckEntry(Int_t id)
Uncheck menu entry (i.e. remove check mark).
Definition TGMenu.cxx:1803
virtual void AddSeparator(TGMenuEntry *before=nullptr)
Add a menu separator to the menu.
Definition TGMenu.cxx:1056
virtual void RCheckEntry(Int_t id, Int_t IDfirst, Int_t IDlast)
Radio-select entry (note that they cannot be unselected, the selection must be moved to another entry...
Definition TGMenu.cxx:1856
virtual void AddEntry(TGHotString *s, Int_t id, void *ud=nullptr, const TGPicture *p=nullptr, TGMenuEntry *before=nullptr)
Add a menu entry.
Definition TGMenu.cxx:986
virtual void SetFrame(TGFrame *frame, Bool_t prev)=0
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition TGTab.cxx:706
TGCompositeFrame * GetTabContainer(Int_t tabIndex) const
Return container of tab with index tabIndex.
Definition TGTab.cxx:611
ROOT GUI Window base class.
Definition TGWindow.h:23
@ kEditEnable
allow edit of this window
Definition TGWindow.h:56
@ kEditDisable
disable edit of this window
Definition TGWindow.h:57
void SetGlobal(Bool_t global) override
Set editor global.
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition TGeoNode.h:39
static TClass * Class()
A doubly linked list.
Definition TList.h:38
Mother of all ROOT objects.
Definition TObject.h:41
virtual TClass * IsA() const
Definition TObject.h:246
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:865
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
This class creates a ROOT object browser, constituted by three main tabs.
void StartEmbedding(Int_t pos=kRight, Int_t subpos=-1) override
Start embedding external frame in the tab "pos" and tab element "subpos".
void SetTabTitle(const char *title, Int_t pos=kRight, Int_t subpos=-1)
Set text "title" of Tab "subpos" in TGTab "pos".
Int_t fCrTab[3]
Actual (active) tab elements (for each Tab)
TGHorizontalFrame * fH2
Horizontal frame.
Int_t fNbTab[3]
Number of tab elements (for each Tab)
TGHSplitter * fHSplitter
Horizontal splitter.
virtual void CloseTab(Int_t id)
Remove tab element id from right tab.
void StopEmbedding(const char *name=nullptr) override
TGHorizontalFrame * fPreMenuFrame
First (owned) menu frame.
TGTab * fTabRight
Right Tab.
TGPopupMenu * fMenuFile
"File" popup menu
TGTab * GetTabRight() const
TGHorizontalFrame * fTopMenuFrame
Top menu frame.
TGMenuBar * fMenuBar
Main (owned) menu bar.
void InitPlugins(Option_t *opt="")
Initialize default plugins.
TGVerticalFrame * fV2
Vertical frame.
Basic string class.
Definition TString.h:138
const char * Data() const
Definition TString.h:384
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition TString.h:712
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition TString.cxx:2362
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition TString.h:640
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
Definition TSystem.cxx:1868
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
TLine l
Definition textangle.C:4