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