Logo ROOT  
Reference Guide
TEveWindow.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Author: Matevz Tadel 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 "TEveWindow.h"
13#include "TEveWindowManager.h"
14#include "TEveManager.h"
15#include "TEveSelection.h"
16
17#include "THashList.h"
18
19#include "TGButton.h"
20#include "TGMenu.h"
21#include "TGPack.h"
22#include "TGTab.h"
23#include "TRootContextMenu.h"
24#include "TVirtualX.h"
25
26#include <cassert>
27
28/** \class TEveCompositeFrame
29\ingroup TEve
30Abstract base-class for frame-slots that encompass EVE-windows
31(sub-classes of TEveWindow).
32
33The EVE-frame classes are managed by their embedded EVE-windows and
34mostly serve as an interface to particular ROOT widgets
35(sub-classes of TGCompositeFrame) they are embedded into.
36
37This base-class, a sub-class of a vertical composite-frame, creates
38also the title-bar which can be used to interact with the embedded
39window. Optionally, the title-bar can be replaced with a mini-bar
40(a 4-pixel thin bar at the top). By clicking on the mini-bar, the
41title-bar is restored.
42
43Sub-classes provide for specific behaviour and expectations of
44individual ROOT GUI container frames.
45
46POSSIBLE EXTENSIONS
47
48No frame is drawn around this composite-frame - frame style could be
49available as a (static) member.
50
51Menus of embedded windows could also be managed - hidden or transposed
52to a top-level menubar.
53*/
54
56
58
61
63
67
68////////////////////////////////////////////////////////////////////////////////
69/// Set properties of the EVE frame.
70/// Should be called before the windows are created.
71
72void TEveCompositeFrame::SetupFrameMarkup(IconBarCreator_foo creator,
73 UInt_t top_frame_height,
74 UInt_t mini_bar_height,
75 Bool_t allow_top_collapse)
76{
77 fgIconBarCreator = creator;
78 fgTopFrameHeight = top_frame_height;
79 fgMiniBarHeight = mini_bar_height;
80 fgAllowTopFrameCollapse = allow_top_collapse;
81}
82
83////////////////////////////////////////////////////////////////////////////////
84/// Constructor.
85
87 TEveWindow* eve_parent) :
88 TGCompositeFrame (parent, 0, 0, kVerticalFrame),
89
90 fTopFrame (0),
91 fToggleBar (0),
92 fTitleBar (0),
93 fIconBar (0),
94 fEveWindowLH (0),
95
96 fMiniBar (0),
97
98 fEveParent (eve_parent),
99 fEveWindow (0),
100
101 fShowInSync (kTRUE)
102{
104
106 {
107 fToggleBar = new TGTextButton(fTopFrame, "Hide");
110 fToggleBar->Connect("Clicked()", "TEveCompositeFrame", this, "FlipTitleBarState()");
112 }
113
114 fTitleBar = new TGTextButton(fTopFrame, "Title Bar");
117 fTitleBar->Connect("Clicked()", "TEveCompositeFrame", this, "TitleBarClicked()");
119
121 {
123 }
124 else
125 {
126 TGButton* b = new TGTextButton(fTopFrame, "Actions");
127 b->ChangeOptions(kRaisedFrame);
128 b->Resize(40, fgTopFrameHeight);
129 b->Connect("Pressed()", "TEveCompositeFrame", this, "ActionPressed()");
130 fIconBar = b;
131 }
133
135
136 // --- MiniBar
138 {
139 fMiniBar = new TGButton(this);
143 fMiniBar->Connect("Clicked()", "TEveCompositeFrame", this, "FlipTitleBarState()");
145 }
146
147 // --- Common settings.
148
151
155
156 // Layout for embedded windows.
158
159 // !!! The following should actually be done somewhere else, in
160 // some not-yet-existing static method of TEveWindow. Right now the
161 // eve-frame-creation code is still a little bit everywhere.
162 if (fEveParent == 0)
164
165 fgFrameList->Add(this);
166}
167
168////////////////////////////////////////////////////////////////////////////////
169/// If fEveWindow != 0 we are being deleted from the ROOT GUI side.
170/// Relinquish EveWindow and ref-counting should do the rest.
171
173{
174 fgFrameList->Remove(this);
175
176 if (fEveWindow != 0)
177 {
178 if (gDebug > 0)
179 Info("TEveCompositeFrame::~TEveCompositeFrame",
180 "EveWindow not null '%s', relinquishing it now.",
182
185 }
186
187 delete fEveWindowLH;
188}
189
190////////////////////////////////////////////////////////////////////////////////
191/// Update widgets using window's name or title.
192
194{
196}
197
198////////////////////////////////////////////////////////////////////////////////
199/// Accept window and increase its deny-destroy count.
200/// Window's gui-frame is embedded and mapped.
201/// Layout is not called.
202///
203/// Throws an exception if a window is already embedded or if 0 is
204/// passed as an argument.
205
207{
208 // Replace current eve-window with the given one.
209 // Current GUI window is unmapped, removed and reparented to default-root.
210 // New GUI window is reparented to this, added and mapped.
211
212 static const TEveException eh("TEveCompositeFrame::AcquireEveWindow ");
213
214 if (fEveWindow)
215 throw eh + "Window already set.";
216
217 if (ew == 0)
218 throw eh + "Called with 0 argument.";
219
220 fEveWindow = ew;
221
223 TGFrame* gui_frame = fEveWindow->GetGUIFrame();
224 gui_frame->ReparentWindow(this);
225 AddFrame(gui_frame, fEveWindowLH);
227 gui_frame->MapWindow();
228
232}
233
234////////////////////////////////////////////////////////////////////////////////
235/// Remove window and decrease its deny-destroy count.
236/// Window's gui-frame is unmapped, removed and, if reparent flag is
237/// true (default), reparented to default-root.
238
240{
241 TEveWindow* ex_ew = fEveWindow;
242
243 if (fEveWindow)
244 {
245 TGFrame* gui_frame = fEveWindow->GetGUIFrame();
246 gui_frame->UnmapWindow();
248 RemoveFrame(gui_frame);
249 if (reparent)
252 fEveWindow = 0;
255 }
256
257 return ex_ew;
258}
259
260////////////////////////////////////////////////////////////////////////////////
261/// Returns eve-parent dynamic-casted to TEveWindow.
262
264{
265 return dynamic_cast<TEveWindow*>(fEveParent);
266}
267
268////////////////////////////////////////////////////////////////////////////////
269/// Set current state of this frame.
270/// This is called by the management functions in TEveWindow.
271
273{
274 if (curr) {
276 } else {
278 }
280}
281
282////////////////////////////////////////////////////////////////////////////////
283/// Set state of title-bar. This toggles between the display of the full
284/// title-bar and 4-pixel-high mini-bar.
285
287{
288 if (show) {
291 } else {
294 }
295
297}
298
299////////////////////////////////////////////////////////////////////////////////
300/// Hide title-bar and mini-bar.
301
303{
306
308}
309
310////////////////////////////////////////////////////////////////////////////////
311/// Show title-bar or mini-bar, as dictated by the window.
312
314{
316}
317
318////////////////////////////////////////////////////////////////////////////////
319/// The action-button of the title-bar was pressed.
320/// This opens context menu of the eve-window.
321
323{
324 if (fgCtxMenu == 0) {
325 fgCtxMenu = new TEveContextMenu("", "");
326 }
327
329}
330
331////////////////////////////////////////////////////////////////////////////////
332/// Change display-state of the title-bar / mini-bar.
333/// This function is used as a slot and passes the call to eve-window.
334
336{
337 if (fShowInSync)
339 else
341}
342
343////////////////////////////////////////////////////////////////////////////////
344/// Slot for mouse-click on the central part of the title-bar.
345/// The call is passed to eve-window.
346
348{
350}
351
352/** \class TEveCompositeFrameInMainFrame
353\ingroup TEve
354An EVE window-slot contained within a TGMainFrame.
355*/
356
358
359////////////////////////////////////////////////////////////////////////////////
360/// Constructor.
361
363 TEveWindow* eve_parent,
364 TGMainFrame* mf) :
365 TEveCompositeFrame(parent, eve_parent),
366 fMainFrame (mf),
367 fOriginalSlot (0),
368 fOriginalContainer (0)
369{
370 fMainFrame->Connect("CloseWindow()", "TEveCompositeFrameInMainFrame", this, "MainFrameClosed()");
371 gEve->GetWindowManager()->Connect("WindowDeleted(TEveWindow*)", "TEveCompositeFrameInMainFrame", this, "SomeWindowClosed(TEveWindow*)");
372}
373
374////////////////////////////////////////////////////////////////////////////////
375/// Destructor.
376
378{
379 if (gDebug > 0)
380 Info("~TEveCompositeFrameInMainFrame", "Destructor.");
381
382 // MainFrames get deleted with a time-out. So, during EVE manager
383 // shutdown, it might happen that this gets called when gEve is null.
384 if (gEve && gEve->GetWindowManager())
385 {
386 gEve->GetWindowManager()->Disconnect("WindowDeleted(TEveWindow*)", this, "SomeWindowClosed(TEveWindow*)");
387 }
388 else
389 {
390 Info("~TEveCompositeFrameInMainFrame", "gEve null - OK if it was terminated.");
391 }
392}
393
394////////////////////////////////////////////////////////////////////////////////
395/// Update widgets using window's name or title.
396
398{
400
402}
403
404////////////////////////////////////////////////////////////////////////////////
405/// Virtual function called from eve side when the frame should be
406/// destroyed. This means we expect that fEveWindow is null.
407///
408/// We simply call CloseWindow() on the main-frame which will in
409/// turn generate the "CloseWindow()" signal.
410/// This is then handled in MainFrameClosed().
411
413{
414 if (gDebug > 0)
415 Info("TEveCompositeFrameInMainFrame::Destroy()",
416 "Propagating call to main-frame.");
417
418 assert (fEveWindow == 0);
419
421}
422
423////////////////////////////////////////////////////////////////////////////////
424/// Set the container where to return the contained window on destruction.
425
427 TEveWindow* container)
428{
429 static const TEveException kEH("TEveCompositeFrameInMainFrame::SetOriginalSlotAndContainer ");
430
431 if (container && ! container->CanMakeNewSlots())
432 throw kEH + "Given window can not make new slots.";
433
434 fOriginalSlot = slot;
435 fOriginalContainer = container;
436}
437
438////////////////////////////////////////////////////////////////////////////////
439/// Slot called when a window is closed ... we check that this was
440/// not our original container.
441
443{
444 if (w == fOriginalSlot)
445 fOriginalSlot = 0;
446
447 if (w == fOriginalContainer)
449}
450
451////////////////////////////////////////////////////////////////////////////////
452/// Slot for main-frame's "CloseWindow()" signal.
453/// If an eve window is still present, it will be put into:
454/// - original-container, if it is set;
455//// - into window-managers default-container.
456
458{
459 if (fEveWindow != 0)
460 {
461 TEveWindow* swapCandidate = 0;
462 if (fOriginalSlot)
463 {
464 // if use pack, show hidden slot
466 if (packFrame) {
467 TGPack* pack = (TGPack*)(packFrame->GetParent());
468 pack->ShowFrame(packFrame);
469 }
470 swapCandidate = fOriginalSlot;
471 }
472 else if (fOriginalContainer)
473 {
474 swapCandidate = fOriginalContainer->NewSlot();
475 }
477 {
478 swapCandidate = gEve->GetWindowManager()->GetDefaultContainer()->NewSlot();
479 }
480
481 if (swapCandidate)
482 {
483 TEveWindow::SwapWindows(fEveWindow, swapCandidate);
485 }
486 }
487
489
490 if (fEveWindow != 0)
492
493 if (gDebug > 0)
494 Info("TEveCompositeFrameInMainFrame::MainFrameClosed()",
495 "Expecting destructor call soon.");
496}
497
498/** \class TEveCompositeFrameInPack
499\ingroup TEve
500An EVE window-slot contained within one frame of a TGPack.
501*/
502
504
505////////////////////////////////////////////////////////////////////////////////
506/// Constructor.
507
509 TEveWindow* eve_parent,
510 TGPack* pack) :
511 TEveCompositeFrame(parent, eve_parent),
512 fPack (pack)
513{
514}
515
516////////////////////////////////////////////////////////////////////////////////
517/// Destructor.
518
520{
521}
522
523////////////////////////////////////////////////////////////////////////////////
524/// Virtual function called from eve side when the frame should be
525/// destroyed. This means we expect that fEveWindow is null.
526///
527/// Remove the frame from pack and delete it.
528
530{
531 if (gDebug > 0)
532 Info("TEveCompositeFrameInPack::Destroy()", "Removing from pack and deleting.");
533
534 assert(fEveWindow == 0);
535
536 fPack->RemoveFrame(this);
537 delete this;
538}
539
540/** \class TEveCompositeFrameInTab
541\ingroup TEve
542An EVE window-slot contained within one tab of a TGTab.
543*/
544
546
547////////////////////////////////////////////////////////////////////////////////
548/// Constructor.
549
551 TEveWindow* eve_parent,
552 TGTab* tab) :
553 TEveCompositeFrame(parent, eve_parent),
554 fTab (tab),
555 fParentInTab (parent)
556{
557}
558
559////////////////////////////////////////////////////////////////////////////////
560/// Destructor.
561
563{
564}
565
566////////////////////////////////////////////////////////////////////////////////
567/// Update widgets using window's name or title.
568
570{
571 Int_t t = FindTabIndex();
573 fTab->Layout();
574
576}
577
578////////////////////////////////////////////////////////////////////////////////
579/// Return index of this frame in the tab.
580/// Throws an exception if it is not found.
581
583{
584 static const TEveException eh("TEveCompositeFrameInTab::FindTabIndex ");
585
586 Int_t nt = fTab->GetNumberOfTabs();
587 for (Int_t t = 0; t < nt; ++t)
588 {
590 {
591 return t;
592 }
593 }
594
595 throw eh + "parent frame not found in tab.";
596}
597
598////////////////////////////////////////////////////////////////////////////////
599/// Virtual function called from eve side when the frame should be
600/// destroyed. This means we expect that fEveWindow is null.
601///
602/// Remove the frame from tab and delete it.
603
605{
606 if (gDebug > 0)
607 Info("TEveCompositeFrameInTab::Destroy()", "Removing from tab and deleting.");
608
609 assert (fEveWindow == 0);
610
611 Int_t t = FindTabIndex();
612
613 // disconnect form Removed() if / when connected
614 fTab->RemoveTab(t, kFALSE);
617 delete fParentInTab;
618 delete this;
619}
620
621////////////////////////////////////////////////////////////////////////////////
622/// Set current state of this frame.
623/// Virtual from TEveCompositeFrame.
624
626{
628
629 Int_t t = FindTabIndex();
630 TGTabElement* te = fTab->GetTabTab(t);
631 if (curr) {
633 } else {
635 }
636 fClient->NeedRedraw(te);
637}
638
639/** \class TEveWindow
640\ingroup TEve
641Abstract base-class for representing eve-windows.
642Sub-classes define a particular GUI frame that gets showin the window.
643*/
644
646
651
652////////////////////////////////////////////////////////////////////////////////
653
654TEveWindow::TEveWindow(const char* n, const char* t) :
655 TEveElementList(n, t),
656
657 fEveFrame (0),
658 fShowTitleBar (kTRUE)
659{
660 // Constructor.
661
662 // Override from TEveElementList.
664}
665
666////////////////////////////////////////////////////////////////////////////////
667/// Destructor.
668
670{
671 if (gDebug > 0)
672 Info("~TEveWindow", "name='%s', deny-destroy=%d.",
674}
675
676////////////////////////////////////////////////////////////////////////////////
677/// Called before the element is deleted, thus offering the last chance
678/// to detach from acquired resources and from the framework itself.
679/// Here the request is just passed to TEveManager.
680/// If you override it, make sure to call base-class version.
681
683{
686}
687
688////////////////////////////////////////////////////////////////////////////////
689/// Virtual function called before a window is undocked.
690
692{
693 for (List_ci i=fChildren.begin(); i!=fChildren.end(); ++i)
694 {
695 TEveWindow* w = dynamic_cast<TEveWindow*>(*i);
696 if (w)
697 w->PreUndock();
698 }
699}
700
701////////////////////////////////////////////////////////////////////////////////
702/// Virtual function called after a window is docked.
703
705{
706 for (List_ci i=fChildren.begin(); i!=fChildren.end(); ++i)
707 {
708 TEveWindow* w = dynamic_cast<TEveWindow*>(*i);
709 if (w)
710 w->PostDock();
711 }
712}
713
714////////////////////////////////////////////////////////////////////////////////
715/// Name or title of the window changed - propagate to frames.
716/// Virtual from TEveElement.
717
719{
721}
722
723////////////////////////////////////////////////////////////////////////////////
724/// Populate given frame-slot - intended for initial population
725/// of a new slot or low-level window-swapping.
726/// No layout or window-mapping is done.
727
729{
730 ef->fEveParent->AddElement(this);
731 ef->AcquireEveWindow(this);
732 fEveFrame = ef;
733}
734
735////////////////////////////////////////////////////////////////////////////////
736/// Swap frames with the given window.
737
739{
740 static const TEveException eh("TEveWindow::SwapWindow ");
741
742 if (w == 0)
743 throw eh + "Called with null argument.";
744
745 SwapWindows(this, w);
746}
747
748////////////////////////////////////////////////////////////////////////////////
749/// Swap frames with the current window.
750
752{
753 static const TEveException eh("TEveWindow::SwapWindowWithCurrent ");
754
756
757 if (current == 0)
758 throw eh + "Current eve-window is not set.";
759
760 if (current == this)
761 throw eh + "This is the current window ... nothing changed.";
762
763 SwapWindows(this, current);
764}
765
766////////////////////////////////////////////////////////////////////////////////
767/// Undock the window - put it into a dedicated main-frame.
768
770{
771 TEveWindow* return_cont = fEveFrame->GetEveParentAsWindow();
772 if (return_cont && ! return_cont->CanMakeNewSlots())
773 return_cont = 0;
774
775 // hide slot if in pack
777 if (packFrame) {
778 TGPack* pack = (TGPack*)(packFrame->GetParent());
779 pack->HideFrame(fEveFrame);
780 }
781
783
784 TEveWindow::SwapWindows(ew_slot, this);
785
787 SetOriginalSlotAndContainer(ew_slot, return_cont);
788
790}
791
792////////////////////////////////////////////////////////////////////////////////
793/// Undock the window - put it into a dedicated main-frame.
794/// The old window slot is destroyed.
795
797{
798 TEveWindow* return_cont = fEveFrame->GetEveParentAsWindow();
799 if (return_cont && ! return_cont->CanMakeNewSlots())
800 return_cont = 0;
801
803
804 TEveWindow::SwapWindows(ew_slot, this);
805
807 SetOriginalSlotAndContainer(0, return_cont);
808
809 ew_slot->DestroyWindowAndSlot();
810
812}
813
814////////////////////////////////////////////////////////////////////////////////
815/// Replace this window with the passed one.
816/// Eve parent-ship is properly handled.
817/// This will most likely lead to the destruction of this window.
818/// Layout is called on the frame.
819
821{
823
826 w->fEveFrame = fEveFrame;
827
829
830 w->fEveFrame->Layout();
831}
832
833////////////////////////////////////////////////////////////////////////////////
834/// Destroy eve-window - replace it with an empty frame-slot.
835
837{
838 if (gDebug > 0)
839 Info("TEveWindow::DestroyWindow()", "name='%s', class='%s', deny-destroy=%d.",
841
842 if (fEveFrame != 0 && fDenyDestroy == 1)
843 {
845
847
850
854
855 fDestroyOnZeroRefCnt = dozrc;
856
857 fEveFrame->Layout();
859 fEveFrame = 0;
860 }
861
863}
864
865////////////////////////////////////////////////////////////////////////////////
866/// Destroy eve-window and its frame-slot.
867
869{
870 if (gDebug > 0)
871 Info("TEveWindow::DestroyWindowAndSlot()", "'name=%s', class= '%s', deny-destroy=%d.",
873
874 if (fEveFrame != 0 && fDenyDestroy == 1)
875 {
878 fEveFrame = 0;
879 }
880
882}
883
884////////////////////////////////////////////////////////////////////////////////
885/// Clears eve-frame associated with this window.
886/// This is used in special case when the window is embedded in a foreign
887/// GUI container and gets deleted from this side.
888/// In particular, this happens when TRootBrowser closes a tab.
889
891{
892 fEveFrame = 0;
893}
894
895////////////////////////////////////////////////////////////////////////////////
896/// Set display state of the title-bar.
897/// This is forwarded to eve-frame.
898
900{
901 if (fShowTitleBar == x)
902 return;
903
906 fEveFrame->Layout();
907}
908
909////////////////////////////////////////////////////////////////////////////////
910/// Returns true if this window is the current one.
911
913{
914 return gEve->GetWindowManager()->IsCurrentWindow(this);
915}
916
917////////////////////////////////////////////////////////////////////////////////
918/// Make this window current.
919
921{
922 if ( ! gEve->GetWindowManager()->IsCurrentWindow(this))
924}
925
926////////////////////////////////////////////////////////////////////////////////
927/// Set current state of this eve-window.
928/// Protected method - called by window-manager.
929
931{
932 fEveFrame->SetCurrent(curr);
933}
934
935////////////////////////////////////////////////////////////////////////////////
936/// Returns true if this is an ancestor of win.
937
939{
940 TEveWindow* parent = dynamic_cast<TEveWindow*>(win->fEveFrame->fEveParent);
941 if (parent)
942 {
943 if (parent == this)
944 return kTRUE;
945 else
946 return IsAncestorOf(parent);
947 }
948 else
949 {
950 return kFALSE;
951 }
952}
953
954////////////////////////////////////////////////////////////////////////////////
955/// Slot for clicking on the title-bar.
956/// The wish that this window becomes the current one is sent to
957/// the window-manager.
958
960{
962}
963
964////////////////////////////////////////////////////////////////////////////////
965/// Create a default window slot.
966/// Static helper.
967
969{
970 return new TEveWindowSlot("Free Window Slot", "A free window slot, can become a container or swallow a window.");
971}
972
973////////////////////////////////////////////////////////////////////////////////
974/// Create a new main-frame and populate it with a default window-slot.
975/// The main-frame is mapped.
976/// Static helper.
977
979{
982
984 (mf, eve_parent, mf);
985
987 ew_slot->PopulateEmptyFrame(slot);
988
990 slot->MapWindow();
991
992 mf->Layout();
993 mf->MapWindow();
994
995 return ew_slot;
996}
997
998////////////////////////////////////////////////////////////////////////////////
999/// Create a new tab in a given tab-widget and populate it with a
1000/// default window-slot.
1001/// Static helper.
1002
1004{
1005 TGCompositeFrame *parent = tab->AddTab("<unused>");
1006 parent->SetCleanup(kLocalCleanup);
1007
1008 TEveCompositeFrameInTab *slot = new TEveCompositeFrameInTab(parent, eve_parent, tab);
1009
1011
1012 ew_slot->PopulateEmptyFrame(slot);
1013
1015
1016 tab->Layout();
1017
1018 slot->MapWindow();
1019
1020 return ew_slot;
1021}
1022
1023////////////////////////////////////////////////////////////////////////////////
1024/// Swap windows w1 and w2. They are properly reparented in the eve
1025/// hierarch as well.
1026/// Layout is called on both frames.
1027
1029{
1030 static const TEveException eh("TEveWindow::SwapWindows ");
1031
1032 if (w1 == 0 || w2 == 0)
1033 throw eh + "Called with null window.";
1034
1035 if (w1 == w2)
1036 throw eh + "Windows are equal ... nothing to change.";
1037
1038 if (w1->IsAncestorOf(w2) || w2->IsAncestorOf(w1))
1039 throw eh + "Windows are in direct ancestry.";
1040
1041 TEveCompositeFrame *f1 = w1->fEveFrame, *f2 = w2->fEveFrame;
1042 TEveElement *p1 = f1->fEveParent, *p2 = f2->fEveParent;
1043
1044 if (p1 != p2)
1045 {
1046 p1->AddElement(w2);
1047 p2->AddElement(w1);
1048 }
1049
1050 f1->RelinquishEveWindow(kFALSE);
1051 f2->RelinquishEveWindow(kFALSE);
1052 f1->AcquireEveWindow(w2); w2->fEveFrame = f1;
1053 f2->AcquireEveWindow(w1); w1->fEveFrame = f2;
1054
1055 if (p1 != p2)
1056 {
1057 p1->RemoveElement(w1);
1058 p2->RemoveElement(w2);
1059 }
1060
1061 f1->Layout(); f2->Layout();
1062}
1063
1064////////////////////////////////////////////////////////////////////////////////
1065/// Get default width for new main-frame windows. Static.
1066
1068{
1069 return fgMainFrameDefWidth;
1070}
1071
1072////////////////////////////////////////////////////////////////////////////////
1073/// Get default height for new main-frame windows. Static.
1074
1076{
1077 return fgMainFrameDefHeight;
1078}
1079
1080////////////////////////////////////////////////////////////////////////////////
1081/// Set default width for new main-frame windows. Static.
1082
1084{
1086}
1087
1088////////////////////////////////////////////////////////////////////////////////
1089/// Set default height for new main-frame windows. Static.
1090
1092{
1094}
1095
1096////////////////////////////////////////////////////////////////////////////////
1097/// Get background-color for marking the title-bar of current window. Static.
1098
1100{
1102}
1103
1104////////////////////////////////////////////////////////////////////////////////
1105/// Get background-color for mini-bar (collapsed title-bar). Static.
1106
1108{
1110}
1111
1112////////////////////////////////////////////////////////////////////////////////
1113/// Set background-color for marking the title-bar of current window. Static.
1114
1116{
1118}
1119
1120////////////////////////////////////////////////////////////////////////////////
1121/// Set background-color for mini-bar (collapsed title-bar). Static.
1122
1124{
1126}
1127
1128/** \class TEveWindowSlot
1129\ingroup TEve
1130Description of TEveWindowSlot
1131*/
1132
1134
1135////////////////////////////////////////////////////////////////////////////////
1136/// Constructor.
1137
1138TEveWindowSlot::TEveWindowSlot(const char* n, const char* t) :
1139 TEveWindow (n, t),
1140 fEmptyButt (0),
1141 fEmbedBuffer (0)
1142{
1143 fEmptyButt = new TGTextButton(0, " <empty>\nclick to select");
1146
1147 fEmptyButt->Connect("Clicked()", "TEveWindow", this, "TitleBarClicked()");
1148}
1149
1150////////////////////////////////////////////////////////////////////////////////
1151/// Destructor.
1152
1154{
1156}
1157
1158////////////////////////////////////////////////////////////////////////////////
1159/// Return top-frame of this eve-window - the big button to make slot current.
1160
1162{
1163 return fEmptyButt;
1164}
1165
1166////////////////////////////////////////////////////////////////////////////////
1167/// Set current state of this window-slot.
1168/// Virtual from TEveWindow.
1169
1171{
1173
1174 if (curr)
1176 else
1178 gClient->NeedRedraw(fEmptyButt);
1179}
1180
1181////////////////////////////////////////////////////////////////////////////////
1182/// A pack is created in place of this window-slot.
1183/// This window-slot will auto-destruct.
1184
1186{
1187 TEveWindowPack* eve_pack = new TEveWindowPack
1188 (0, "Pack", "Window container for horizontal and vertical stacking.");
1189
1190 ReplaceWindow(eve_pack);
1191
1192 return eve_pack;
1193}
1194
1195////////////////////////////////////////////////////////////////////////////////
1196/// A tab is created in place of this window-slot.
1197/// This window-slot will auto-destruct.
1198
1200{
1201 TEveWindowTab* eve_tab = new TEveWindowTab
1202 (0, "Tab", "Window container for horizontal and vertical stacking.");
1203
1204 ReplaceWindow(eve_tab);
1205
1206 return eve_tab;
1207}
1208
1209////////////////////////////////////////////////////////////////////////////////
1210/// An eve-window-frame is created and frame is passed into it.
1211/// If frame is 0 (the default), a default composite-frame will be created
1212/// in TEveWindowFrame() constructor.
1213/// This window-slot will auto-destruct.
1214
1216{
1217 TEveWindowFrame* eve_frame = new TEveWindowFrame
1218 (frame, "External frame", "");
1219
1220 ReplaceWindow(eve_frame);
1221
1222 return eve_frame;
1223}
1224
1225////////////////////////////////////////////////////////////////////////////////
1226/// Start embedding a window that will replace the current slot.
1227/// It is expected that a main-frame will be created and then
1228/// StopEmbedding() will be called.
1229
1231{
1232 static const TEveException eh("TEveWindowSlot::StartEmbedding ");
1233
1234 if (fEmbedBuffer != 0)
1235 throw eh + "Already embedding.";
1236
1237 fEmbedBuffer = new TGCompositeFrame(gClient->GetDefaultRoot());
1239
1240 return fEmbedBuffer;
1241}
1242
1243////////////////////////////////////////////////////////////////////////////////
1244/// An embedded window is created in place of this window-slot.
1245/// This window-slot will auto-destruct.
1246
1248{
1249 static const TEveException eh("TEveWindowSlot::StopEmbedding ");
1250
1251 if (fEmbedBuffer == 0) {
1252 Warning(eh, "Embedding not in progress.");
1253 return 0;
1254 }
1255
1257
1258 Int_t size = fEmbedBuffer->GetList()->GetSize();
1259
1260 if (size == 0) {
1261 Warning(eh, "Frame has not been registered.");
1262 delete fEmbedBuffer;
1263 fEmbedBuffer = 0;
1264 return 0;
1265 }
1266
1267 if (size > 1) {
1268 Warning(eh, "Several frames have been registered (%d). Only the first one will be taken.", size);
1269 }
1270
1271 TGFrame *f = ((TGFrameElement*)fEmbedBuffer->GetList()->First())->fFrame;
1273 f->UnmapWindow();
1274 f->ReparentWindow(gClient->GetDefaultRoot());
1275 delete fEmbedBuffer;
1276 fEmbedBuffer = 0;
1277
1278 TGMainFrame *mf = dynamic_cast<TGMainFrame*>(f);
1279 assert(mf != 0);
1280
1281 if (name) {
1282 mf->SetWindowName(name);
1283 }
1284
1285 TEveWindowFrame* eve_frame = new TEveWindowFrame
1286 (f, mf->GetWindowName(), mf->ClassName());
1287
1288 ReplaceWindow(eve_frame);
1289
1290 return eve_frame;
1291}
1292
1293/** \class TEveWindowFrame
1294\ingroup TEve
1295Encapsulates TGFrame into an eve-window.
1296The frame is owned by the eve-window.
1297*/
1298
1300
1301////////////////////////////////////////////////////////////////////////////////
1302/// Constructor.
1303/// If the passed frame is 0, a default TGCompositeFrame frame is instantiated
1304/// and set to local-cleanup.
1305
1306TEveWindowFrame::TEveWindowFrame(TGFrame* frame, const char* n, const char* t) :
1307 TEveWindow (n, t),
1308 fGUIFrame (frame)
1309{
1310 if (fGUIFrame == 0)
1311 {
1314 }
1315}
1316
1317////////////////////////////////////////////////////////////////////////////////
1318/// Destructor.
1319
1321{
1323}
1324
1325////////////////////////////////////////////////////////////////////////////////
1326/// Returns the registered top-frame of this eve-window dynamic-casted
1327/// to composite-frame.
1328/// Throws an exception if the cast fails.
1329
1331{
1332 static const TEveException kEH("TEveWindowFrame::GetGUICompositeFrame ");
1333
1334 TGCompositeFrame *cf = dynamic_cast<TGCompositeFrame*>(fGUIFrame);
1335 if (cf == 0)
1336 throw kEH + "The registered frame is not a composite-frame.";
1337
1338 return cf;
1339}
1340
1341/** \class TEveWindowPack
1342\ingroup TEve
1343Encapsulates TGPack into an eve-window.
1344The pack is owned by the eve-window.
1345*/
1346
1348
1349////////////////////////////////////////////////////////////////////////////////
1350/// Constructor.
1351/// If passed pack is 0, a default one is instantiated.
1352
1353TEveWindowPack::TEveWindowPack(TGPack* p, const char* n, const char* t) :
1354 TEveWindow (n, t),
1355 fPack (p ? p : new TGPack())
1356{
1357}
1358
1359////////////////////////////////////////////////////////////////////////////////
1360/// Destructor.
1361
1363{
1365}
1366
1367////////////////////////////////////////////////////////////////////////////////
1368/// Return top-frame of this eve-window - the pack.
1369
1371{
1372 return fPack;
1373}
1374
1375////////////////////////////////////////////////////////////////////////////////
1376/// Create a new frame-slot at the last position of the pack.
1377
1379{
1380 return NewSlotWithWeight(1.f);
1381}
1382
1383////////////////////////////////////////////////////////////////////////////////
1384/// Create a new weighted frame-slot at the last position of the pack.
1385
1387{
1389
1391 ew_slot->PopulateEmptyFrame(slot);
1392
1393 fPack->AddFrameWithWeight(slot, 0, w);
1394 slot->MapWindow();
1395
1396 fPack->Layout();
1397
1398 return ew_slot;
1399}
1400
1401////////////////////////////////////////////////////////////////////////////////
1402/// Flip orientation of the pack (vertical / horizontal).
1403
1405{
1407}
1408
1409////////////////////////////////////////////////////////////////////////////////
1410/// Set orientation of the pack (vertical / horizontal).
1411
1413{
1415}
1416
1417////////////////////////////////////////////////////////////////////////////////
1418/// Refit existing frames so that their lengths are equal.
1419
1421{
1423 fPack->Layout();
1424}
1425
1426/** \class TEveWindowTab
1427\ingroup TEve
1428Encapsulates TGTab into an eve-window.
1429The tab is owned by the eve-window.
1430*/
1431
1433
1434////////////////////////////////////////////////////////////////////////////////
1435/// Constructor.
1436/// If passed tab is 0, a default one is instantiated.
1437
1438TEveWindowTab::TEveWindowTab(TGTab* tab, const char* n, const char* t) :
1439 TEveWindow(n, t),
1440 fTab (tab ? tab : new TGTab())
1441{
1442}
1443
1444////////////////////////////////////////////////////////////////////////////////
1445/// Destructor.
1446
1448{
1449 fTab->DeleteWindow();
1450}
1451
1452////////////////////////////////////////////////////////////////////////////////
1453/// Return top-frame of this eve-window - the tab.
1454
1456{
1457 return fTab;
1458}
1459
1460////////////////////////////////////////////////////////////////////////////////
1461/// Create new frame-slot - a new tab.
1462
1464{
1465 return TEveWindow::CreateWindowInTab(fTab, this);
1466}
1467
1468/** \class TEveContextMenu
1469\ingroup TEve
1470Specialization of TContext menu.
1471Provide a window manager hint that ensures proper placement of popup on Cocoa.
1472*/
1473
1475
1476////////////////////////////////////////////////////////////////////////////////
1477/// Constructor.
1478
1479TEveContextMenu::TEveContextMenu(const char *name, const char *title) :
1480 TContextMenu(name, title)
1481{
1482}
1483
1484////////////////////////////////////////////////////////////////////////////////
1485/// Position the popup below given button and show context menu for object obj.
1486
1488{
1489 Int_t x, y;
1490 UInt_t w, h;
1491 Window_t childdum;
1492 gVirtualX->GetWindowSize(button->GetId(), x, y, w, h);
1493 gVirtualX->TranslateCoordinates(button->GetId(),
1494 gClient->GetDefaultRoot()->GetId(),
1495 0, 0, x, y, childdum);
1496
1497 TRootContextMenu *rcm = dynamic_cast<TRootContextMenu*>(fContextMenuImp);
1498 if (rcm != 0)
1499 {
1500 gVirtualX->SetWMTransientHint (rcm->GetId(), button->GetId());
1501 }
1502
1503 Popup(x - 2, y + h - 2, obj);
1504}
void Class()
Definition: Class.C:29
@ kRaisedFrame
Definition: GuiTypes.h:384
@ kVerticalFrame
Definition: GuiTypes.h:381
@ kFixedHeight
Definition: GuiTypes.h:389
ULong_t Pixel_t
Definition: GuiTypes.h:39
Handle_t Window_t
Definition: GuiTypes.h:28
#define b(i)
Definition: RSha256.hxx:100
#define f(i)
Definition: RSha256.hxx:104
#define h(i)
Definition: RSha256.hxx:106
unsigned int UInt_t
Definition: RtypesCore.h:44
const Bool_t kFALSE
Definition: RtypesCore.h:90
bool Bool_t
Definition: RtypesCore.h:61
R__EXTERN Int_t gDebug
Definition: RtypesCore.h:117
float Float_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassImp(name)
Definition: Rtypes.h:361
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
#define gClient
Definition: TGClient.h:166
@ kNoCleanup
Definition: TGFrame.h:49
@ kLocalCleanup
Definition: TGFrame.h:50
@ kLHintsExpandY
Definition: TGLayout.h:38
@ kLHintsNormal
Definition: TGLayout.h:39
@ kLHintsExpandX
Definition: TGLayout.h:37
@ kTextCenterX
Definition: TGWidget.h:36
@ kTextCenterY
Definition: TGWidget.h:39
char name[80]
Definition: TGX11.cxx:109
#define gVirtualX
Definition: TVirtualX.h:338
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:40
TContextMenuImp * fContextMenuImp
Definition: TContextMenu.h:49
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.
An EVE window-slot contained within a TGMainFrame.
Definition: TEveWindow.h:112
TEveCompositeFrameInMainFrame(const TEveCompositeFrameInMainFrame &)
virtual void Destroy()
Virtual function called from eve side when the frame should be destroyed.
Definition: TEveWindow.cxx:412
void SetOriginalSlotAndContainer(TEveWindow *slot, TEveWindow *container)
Set the container where to return the contained window on destruction.
Definition: TEveWindow.cxx:426
virtual void WindowNameChanged(const TString &name)
Update widgets using window's name or title.
Definition: TEveWindow.cxx:397
void SomeWindowClosed(TEveWindow *w)
Slot called when a window is closed ... we check that this was not our original container.
Definition: TEveWindow.cxx:442
void MainFrameClosed()
Slot for main-frame's "CloseWindow()" signal.
Definition: TEveWindow.cxx:457
virtual ~TEveCompositeFrameInMainFrame()
Destructor.
Definition: TEveWindow.cxx:377
An EVE window-slot contained within one frame of a TGPack.
Definition: TEveWindow.h:148
virtual void Destroy()
Virtual function called from eve side when the frame should be destroyed.
Definition: TEveWindow.cxx:529
virtual ~TEveCompositeFrameInPack()
Destructor.
Definition: TEveWindow.cxx:519
TEveCompositeFrameInPack(const TEveCompositeFrameInPack &)
An EVE window-slot contained within one tab of a TGTab.
Definition: TEveWindow.h:172
Int_t FindTabIndex()
Return index of this frame in the tab.
Definition: TEveWindow.cxx:582
TGCompositeFrame * fParentInTab
Definition: TEveWindow.h:179
virtual ~TEveCompositeFrameInTab()
Destructor.
Definition: TEveWindow.cxx:562
virtual void SetCurrent(Bool_t curr)
Set current state of this frame.
Definition: TEveWindow.cxx:625
virtual void Destroy()
Virtual function called from eve side when the frame should be destroyed.
Definition: TEveWindow.cxx:604
virtual void WindowNameChanged(const TString &name)
Update widgets using window's name or title.
Definition: TEveWindow.cxx:569
TEveCompositeFrameInTab(const TEveCompositeFrameInTab &)
Abstract base-class for frame-slots that encompass EVE-windows (sub-classes of TEveWindow).
Definition: TEveWindow.h:40
TGLayoutHints * fEveWindowLH
Definition: TEveWindow.h:61
static Bool_t fgAllowTopFrameCollapse
Definition: TEveWindow.h:54
TEveElement * fEveParent
Definition: TEveWindow.h:65
static void SetupFrameMarkup(IconBarCreator_foo creator, UInt_t top_frame_height=14, UInt_t mini_bar_height=4, Bool_t allow_top_collapse=kTRUE)
Set properties of the EVE frame.
Definition: TEveWindow.cxx:72
void FlipTitleBarState()
Change display-state of the title-bar / mini-bar.
Definition: TEveWindow.cxx:335
virtual TEveWindow * RelinquishEveWindow(Bool_t reparent=kTRUE)
Remove window and decrease its deny-destroy count.
Definition: TEveWindow.cxx:239
virtual void Destroy()=0
virtual void ShowNormalDecorations()
Show title-bar or mini-bar, as dictated by the window.
Definition: TEveWindow.cxx:313
TGFrame * fMiniBar
Definition: TEveWindow.h:63
virtual void WindowNameChanged(const TString &name)
Update widgets using window's name or title.
Definition: TEveWindow.cxx:193
void ActionPressed()
The action-button of the title-bar was pressed.
Definition: TEveWindow.cxx:322
TGCompositeFrame * fTopFrame
Definition: TEveWindow.h:57
TEveWindow * GetEveParentAsWindow() const
Returns eve-parent dynamic-casted to TEveWindow.
Definition: TEveWindow.cxx:263
static UInt_t fgMiniBarHeight
Definition: TEveWindow.h:53
TEveWindow * fEveWindow
Definition: TEveWindow.h:66
TGTextButton * fToggleBar
Definition: TEveWindow.h:58
TGFrame *(* IconBarCreator_foo)(TEveCompositeFrame *, TGCompositeFrame *, Int_t)
Definition: TEveWindow.h:45
TGFrame * fIconBar
Definition: TEveWindow.h:60
virtual void AcquireEveWindow(TEveWindow *ew)
Accept window and increase its deny-destroy count.
Definition: TEveWindow.cxx:206
static UInt_t fgTopFrameHeight
Definition: TEveWindow.h:52
static TList * fgFrameList
Definition: TEveWindow.h:73
TGTextButton * fTitleBar
Definition: TEveWindow.h:59
static TEveContextMenu * fgCtxMenu
Definition: TEveWindow.h:70
virtual void HideAllDecorations()
Hide title-bar and mini-bar.
Definition: TEveWindow.cxx:302
virtual void SetShowTitleBar(Bool_t show)
Set state of title-bar.
Definition: TEveWindow.cxx:286
TEveCompositeFrame(const TEveCompositeFrame &)
virtual ~TEveCompositeFrame()
If fEveWindow != 0 we are being deleted from the ROOT GUI side.
Definition: TEveWindow.cxx:172
static const TString fgkEmptyFrameName
Definition: TEveWindow.h:71
virtual void SetCurrent(Bool_t curr)
Set current state of this frame.
Definition: TEveWindow.cxx:272
void TitleBarClicked()
Slot for mouse-click on the central part of the title-bar.
Definition: TEveWindow.cxx:347
static IconBarCreator_foo fgIconBarCreator
Definition: TEveWindow.h:51
Specialization of TContext menu.
Definition: TEveWindow.h:431
TEveContextMenu(const char *name, const char *title="Eve context menu")
Constructor.
void SetupAndPopup(TGWindow *button, TObject *obj)
Position the popup below given button and show context menu for object obj.
A list of TEveElements.
Definition: TEveElement.h:431
virtual const char * GetElementName() const
Virtual function for retrieving name of the element.
Definition: TEveElement.h:450
TClass * fChildClass
Definition: TEveElement.h:437
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:34
virtual void AddElement(TEveElement *el)
Add el to the list of children.
List_t fChildren
Definition: TEveElement.h:79
Bool_t fDestroyOnZeroRefCnt
Deny-destroy count.
Definition: TEveElement.h:88
void DecDenyDestroy()
Decreases the deny-destroy count of the element.
void IncDenyDestroy()
Increases the deny-destroy count of the element.
virtual void Destroy()
Destroy this element.
virtual void PreDeleteElement()
Externally assigned and controlled user data.
List_t::const_iterator List_ci
Definition: TEveElement.h:71
virtual void RemoveElement(TEveElement *el)
Remove el from the list of children.
Int_t fDenyDestroy
Counter for top-level list-tree items that prevent automatic destruction.
Definition: TEveElement.h:87
Exception class thrown by TEve classes and macros.
Definition: TEveUtil.h:102
TEveWindowManager * GetWindowManager() const
Definition: TEveManager.h:142
Encapsulates TGFrame into an eve-window.
Definition: TEveWindow.h:336
TGFrame * fGUIFrame
Definition: TEveWindow.h:342
TGCompositeFrame * GetGUICompositeFrame()
Returns the registered top-frame of this eve-window dynamic-casted to composite-frame.
virtual ~TEveWindowFrame()
Destructor.
TEveWindowFrame(const TEveWindowFrame &)
void WindowUndocked(TEveWindow *window)
Emit the "WindowUndocked(TEveWindow*)" signal.
Bool_t HasDefaultContainer() const
void WindowDocked(TEveWindow *window)
Emit the "WindowDocked(TEveWindow*)" signal.
TEveWindow * GetDefaultContainer() const
TEveWindow * GetCurrentWindow() const
Bool_t IsCurrentWindow(const TEveWindow *w) const
void DeleteWindow(TEveWindow *w)
Called by a window before it gets deleted.
void SelectWindow(TEveWindow *w)
Entry-point for communicating the fact that a window was acted upon in such a way that it should beco...
Encapsulates TGPack into an eve-window.
Definition: TEveWindow.h:361
virtual TGFrame * GetGUIFrame()
Return top-frame of this eve-window - the pack.
void FlipOrientation()
Flip orientation of the pack (vertical / horizontal).
TEveWindowPack(const TEveWindowPack &)
void SetVertical(Bool_t x=kTRUE)
Set orientation of the pack (vertical / horizontal).
virtual TEveWindowSlot * NewSlotWithWeight(Float_t w)
Create a new weighted frame-slot at the last position of the pack.
void EqualizeFrames()
Refit existing frames so that their lengths are equal.
TGPack * fPack
Definition: TEveWindow.h:367
virtual ~TEveWindowPack()
Destructor.
virtual TEveWindowSlot * NewSlot()
Create a new frame-slot at the last position of the pack.
Description of TEveWindowSlot.
Definition: TEveWindow.h:302
TGCompositeFrame * fEmbedBuffer
Definition: TEveWindow.h:309
TEveWindowSlot(const TEveWindowSlot &)
TEveWindowFrame * StopEmbedding(const char *name=0)
An embedded window is created in place of this window-slot.
TGCompositeFrame * StartEmbedding()
Start embedding a window that will replace the current slot.
TEveWindowFrame * MakeFrame(TGFrame *frame=0)
An eve-window-frame is created and frame is passed into it.
TEveWindowTab * MakeTab()
A tab is created in place of this window-slot.
virtual TGFrame * GetGUIFrame()
Return top-frame of this eve-window - the big button to make slot current.
virtual void SetCurrent(Bool_t curr)
Set current state of this window-slot.
virtual ~TEveWindowSlot()
Destructor.
TGTextButton * fEmptyButt
Definition: TEveWindow.h:308
TEveWindowPack * MakePack()
A pack is created in place of this window-slot.
Encapsulates TGTab into an eve-window.
Definition: TEveWindow.h:396
virtual ~TEveWindowTab()
Destructor.
TEveWindowTab(const TEveWindowTab &)
TGTab * fTab
Definition: TEveWindow.h:402
virtual TGFrame * GetGUIFrame()
Return top-frame of this eve-window - the tab.
virtual TEveWindowSlot * NewSlot()
Create new frame-slot - a new tab.
Abstract base-class for representing eve-windows.
Definition: TEveWindow.h:210
virtual void PreDeleteElement()
Called before the element is deleted, thus offering the last chance to detach from acquired resources...
Definition: TEveWindow.cxx:682
void FlipShowTitleBar()
Definition: TEveWindow.h:260
virtual void PreUndock()
Virtual function called before a window is undocked.
Definition: TEveWindow.cxx:691
static void SetMiniBarBackgroundColor(Pixel_t p)
Set background-color for mini-bar (collapsed title-bar). Static.
virtual void DestroyWindowAndSlot()
Destroy eve-window and its frame-slot.
Definition: TEveWindow.cxx:868
static UInt_t GetMainFrameDefHeight()
Get default height for new main-frame windows. Static.
static void SetMainFrameDefWidth(UInt_t x)
Set default width for new main-frame windows. Static.
TEveCompositeFrame * fEveFrame
Definition: TEveWindow.h:218
static void SwapWindows(TEveWindow *w1, TEveWindow *w2)
Swap windows w1 and w2.
TEveWindow(const TEveWindow &)
static void SetMainFrameDefHeight(UInt_t x)
Set default height for new main-frame windows. Static.
static TEveWindowSlot * CreateDefaultWindowSlot()
Create a default window slot.
Definition: TEveWindow.cxx:968
static void SetCurrentBackgroundColor(Pixel_t p)
Set background-color for marking the title-bar of current window. Static.
Bool_t IsCurrent() const
Returns true if this window is the current one.
Definition: TEveWindow.cxx:912
Bool_t IsAncestorOf(TEveWindow *win)
Returns true if this is an ancestor of win.
Definition: TEveWindow.cxx:938
virtual void SetCurrent(Bool_t curr)
Set current state of this eve-window.
Definition: TEveWindow.cxx:930
void ReplaceWindow(TEveWindow *w)
Replace this window with the passed one.
Definition: TEveWindow.cxx:820
virtual Bool_t CanMakeNewSlots() const
Definition: TEveWindow.h:241
void MakeCurrent()
Make this window current.
Definition: TEveWindow.cxx:920
virtual TEveWindowSlot * NewSlot()
Definition: TEveWindow.h:242
static Pixel_t GetMiniBarBackgroundColor()
Get background-color for mini-bar (collapsed title-bar). Static.
void PopulateEmptyFrame(TEveCompositeFrame *ef)
Populate given frame-slot - intended for initial population of a new slot or low-level window-swappin...
Definition: TEveWindow.cxx:728
static TEveWindowSlot * CreateWindowMainFrame(TEveWindow *eve_parent=0)
Create a new main-frame and populate it with a default window-slot.
Definition: TEveWindow.cxx:978
virtual TGFrame * GetGUIFrame()=0
void ClearEveFrame()
Clears eve-frame associated with this window.
Definition: TEveWindow.cxx:890
TEveCompositeFrame * GetEveFrame()
Definition: TEveWindow.h:257
static Pixel_t GetCurrentBackgroundColor()
Get background-color for marking the title-bar of current window. Static.
Bool_t GetShowTitleBar() const
Definition: TEveWindow.h:261
virtual void DestroyWindow()
Destroy eve-window - replace it with an empty frame-slot.
Definition: TEveWindow.cxx:836
void UndockWindow()
Undock the window - put it into a dedicated main-frame.
Definition: TEveWindow.cxx:769
static TEveWindowSlot * CreateWindowInTab(TGTab *tab, TEveWindow *eve_parent=0)
Create a new tab in a given tab-widget and populate it with a default window-slot.
Bool_t fShowTitleBar
Definition: TEveWindow.h:219
void SetShowTitleBar(Bool_t x)
Set display state of the title-bar.
Definition: TEveWindow.cxx:899
void SwapWindowWithCurrent()
Swap frames with the current window.
Definition: TEveWindow.cxx:751
static UInt_t fgMainFrameDefHeight
Definition: TEveWindow.h:224
virtual void NameTitleChanged()
Name or title of the window changed - propagate to frames.
Definition: TEveWindow.cxx:718
void TitleBarClicked()
Slot for clicking on the title-bar.
Definition: TEveWindow.cxx:959
static UInt_t fgMainFrameDefWidth
Definition: TEveWindow.h:223
static Pixel_t fgMiniBarBackgroundColor
Definition: TEveWindow.h:227
static UInt_t GetMainFrameDefWidth()
Get default width for new main-frame windows. Static.
virtual ~TEveWindow()
Destructor.
Definition: TEveWindow.cxx:669
void UndockWindowDestroySlot()
Undock the window - put it into a dedicated main-frame.
Definition: TEveWindow.cxx:796
virtual void PostDock()
Virtual function called after a window is docked.
Definition: TEveWindow.cxx:704
void SwapWindow(TEveWindow *w)
Swap frames with the given window.
Definition: TEveWindow.cxx:738
static Pixel_t fgCurrentBackgroundColor
Definition: TEveWindow.h:226
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:234
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:372
virtual void SetMapSubwindows(Bool_t on)
Definition: TGFrame.h:400
virtual TList * GetList() const
Definition: TGFrame.h:347
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1101
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
Definition: TGFrame.cxx:932
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1241
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1056
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1148
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1188
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1133
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1174
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:305
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:227
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:296
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:667
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:260
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:589
virtual void SetCleanup(Int_t=kLocalCleanup)
Definition: TGFrame.h:242
virtual void MapWindow()
map window
Definition: TGFrame.h:229
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:231
void DontCallClose()
Typically call this method in the slot connected to the CloseWindow() signal to prevent the calling o...
Definition: TGFrame.cxx:1740
virtual void CloseWindow()
Close and delete main frame.
Definition: TGFrame.cxx:1730
const char * GetWindowName() const
Definition: TGFrame.h:522
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1748
TGClient * fClient
Definition: TGObject.h:37
Handle_t GetId() const
Definition: TGObject.h:47
Definition: TGPack.h:40
virtual void RemoveFrame(TGFrame *f)
Remove frame f and refit existing frames to pack size.
Definition: TGPack.cxx:336
virtual void AddFrameWithWeight(TGFrame *f, TGLayoutHints *l, Float_t w)
Add frame f at the end with given weight.
Definition: TGPack.cxx:275
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGPack.cxx:363
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGPack.cxx:393
virtual void Layout()
Reposition the frames so that they fit correctly.
Definition: TGPack.cxx:476
void EqualizeFrames()
Refit existing frames so that their lengths are equal.
Definition: TGPack.cxx:497
void SetVertical(Bool_t x)
Sets the vertical flag and reformats the back to new stacking direction.
Definition: TGPack.cxx:597
Bool_t GetVertical() const
Definition: TGPack.h:103
void SetText(TGString *text)
Set new tab text.
Definition: TGTab.cxx:181
Definition: TGTab.h:62
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Definition: TGTab.cxx:613
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition: TGTab.cxx:659
virtual void RemoveTab(Int_t tabIndex=-1, Bool_t storeRemoved=kTRUE)
Remove container and tab of tab with index tabIndex.
Definition: TGTab.cxx:393
TGCompositeFrame * GetTabContainer(Int_t tabIndex) const
Return container of tab with index tabIndex.
Definition: TGTab.cxx:564
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition: TGTab.cxx:342
virtual void SetTextJustify(Int_t tmode)
Set text justification.
Definition: TGButton.cxx:647
virtual void SetText(TGHotString *new_label)
Set new button text.
Definition: TGButton.cxx:596
virtual void DestroyWindow()
destroy window
Definition: TGWindow.cxx:182
const TGWindow * GetParent() const
Definition: TGWindow.h:84
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition: THashList.h:34
A doubly linked list.
Definition: TList.h:44
virtual void Add(TObject *obj)
Definition: TList.h:87
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:821
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:658
Mother of all ROOT objects.
Definition: TObject.h:37
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:128
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:877
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:865
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition: TQObject.cxx:866
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1024
Basic string class.
Definition: TString.h:131
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
TF1 * f1
Definition: legend1.C:11