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
54
56
59
61
65
66////////////////////////////////////////////////////////////////////////////////
67/// Set properties of the EVE frame.
68/// Should be called before the windows are created.
69
80
81////////////////////////////////////////////////////////////////////////////////
82/// Constructor.
83
86 TGCompositeFrame (parent, 0, 0, kVerticalFrame),
87
88 fTopFrame (nullptr),
89 fToggleBar (nullptr),
90 fTitleBar (nullptr),
91 fIconBar (nullptr),
92 fEveWindowLH (nullptr),
93
94 fMiniBar (nullptr),
95
96 fEveParent (eve_parent),
97 fEveWindow (nullptr),
98
99 fShowInSync (kTRUE)
100{
102
104 {
105 fToggleBar = new TGTextButton(fTopFrame, "Hide");
108 fToggleBar->Connect("Clicked()", "TEveCompositeFrame", this, "FlipTitleBarState()");
110 }
111
112 fTitleBar = new TGTextButton(fTopFrame, "Title Bar");
115 fTitleBar->Connect("Clicked()", "TEveCompositeFrame", this, "TitleBarClicked()");
117
119 {
121 }
122 else
123 {
124 TGButton* b = new TGTextButton(fTopFrame, "Actions");
125 b->ChangeOptions(kRaisedFrame);
126 b->Resize(40, fgTopFrameHeight);
127 b->Connect("Pressed()", "TEveCompositeFrame", this, "ActionPressed()");
128 fIconBar = b;
129 }
131
133
134 // --- MiniBar
136 {
137 fMiniBar = new TGButton(this);
141 fMiniBar->Connect("Clicked()", "TEveCompositeFrame", this, "FlipTitleBarState()");
143 }
144
145 // --- Common settings.
146
149
153
154 // Layout for embedded windows.
156
157 // !!! The following should actually be done somewhere else, in
158 // some not-yet-existing static method of TEveWindow. Right now the
159 // eve-frame-creation code is still a little bit everywhere.
160 if (fEveParent == nullptr)
162
163 fgFrameList->Add(this);
164}
165
166////////////////////////////////////////////////////////////////////////////////
167/// If fEveWindow != 0 we are being deleted from the ROOT GUI side.
168/// Relinquish EveWindow and ref-counting should do the rest.
169
171{
172 fgFrameList->Remove(this);
173
174 if (fEveWindow != nullptr)
175 {
176 if (gDebug > 0)
177 Info("TEveCompositeFrame::~TEveCompositeFrame",
178 "EveWindow not null '%s', relinquishing it now.",
180
183 }
184
185 delete fEveWindowLH;
186}
187
188////////////////////////////////////////////////////////////////////////////////
189/// Update widgets using window's name or title.
190
195
196////////////////////////////////////////////////////////////////////////////////
197/// Accept window and increase its deny-destroy count.
198/// Window's gui-frame is embedded and mapped.
199/// Layout is not called.
200///
201/// Throws an exception if a window is already embedded or if 0 is
202/// passed as an argument.
203
205{
206 // Replace current eve-window with the given one.
207 // Current GUI window is unmapped, removed and reparented to default-root.
208 // New GUI window is reparented to this, added and mapped.
209
210 static const TEveException eh("TEveCompositeFrame::AcquireEveWindow ");
211
212 if (fEveWindow)
213 throw eh + "Window already set.";
214
215 if (ew == nullptr)
216 throw eh + "Called with 0 argument.";
217
218 fEveWindow = ew;
219
222 gui_frame->ReparentWindow(this);
225 gui_frame->MapWindow();
226
230}
231
232////////////////////////////////////////////////////////////////////////////////
233/// Remove window and decrease its deny-destroy count.
234/// Window's gui-frame is unmapped, removed and, if reparent flag is
235/// true (default), reparented to default-root.
236
257
258////////////////////////////////////////////////////////////////////////////////
259/// Returns eve-parent dynamic-casted to TEveWindow.
260
262{
263 return dynamic_cast<TEveWindow*>(fEveParent);
264}
265
266////////////////////////////////////////////////////////////////////////////////
267/// Set current state of this frame.
268/// This is called by the management functions in TEveWindow.
269
279
280////////////////////////////////////////////////////////////////////////////////
281/// Set state of title-bar. This toggles between the display of the full
282/// title-bar and 4-pixel-high mini-bar.
283
296
297////////////////////////////////////////////////////////////////////////////////
298/// Hide title-bar and mini-bar.
299
307
308////////////////////////////////////////////////////////////////////////////////
309/// Show title-bar or mini-bar, as dictated by the window.
310
315
316////////////////////////////////////////////////////////////////////////////////
317/// The action-button of the title-bar was pressed.
318/// This opens context menu of the eve-window.
319
321{
322 if (fgCtxMenu == nullptr) {
323 fgCtxMenu = new TEveContextMenu("", "");
324 }
325
326 fgCtxMenu->SetupAndPopup(fIconBar, fEveWindow);
327}
328
329////////////////////////////////////////////////////////////////////////////////
330/// Change display-state of the title-bar / mini-bar.
331/// This function is used as a slot and passes the call to eve-window.
332
340
341////////////////////////////////////////////////////////////////////////////////
342/// Slot for mouse-click on the central part of the title-bar.
343/// The call is passed to eve-window.
344
349
350/** \class TEveCompositeFrameInMainFrame
351\ingroup TEve
352An EVE window-slot contained within a TGMainFrame.
353*/
354
355
356////////////////////////////////////////////////////////////////////////////////
357/// Constructor.
358
361 TGMainFrame* mf) :
363 fMainFrame (mf),
364 fOriginalSlot (nullptr),
365 fOriginalContainer (nullptr)
366{
367 fMainFrame->Connect("CloseWindow()", "TEveCompositeFrameInMainFrame", this, "MainFrameClosed()");
368 gEve->GetWindowManager()->Connect("WindowDeleted(TEveWindow*)", "TEveCompositeFrameInMainFrame", this, "SomeWindowClosed(TEveWindow*)");
369}
370
371////////////////////////////////////////////////////////////////////////////////
372/// Destructor.
373
375{
376 if (gDebug > 0)
377 Info("~TEveCompositeFrameInMainFrame", "Destructor.");
378
379 // MainFrames get deleted with a time-out. So, during EVE manager
380 // shutdown, it might happen that this gets called when gEve is null.
381 if (gEve && gEve->GetWindowManager())
382 {
383 gEve->GetWindowManager()->Disconnect("WindowDeleted(TEveWindow*)", this, "SomeWindowClosed(TEveWindow*)");
384 }
385 else
386 {
387 Info("~TEveCompositeFrameInMainFrame", "gEve null - OK if it was terminated.");
388 }
389}
390
391////////////////////////////////////////////////////////////////////////////////
392/// Update widgets using window's name or title.
393
400
401////////////////////////////////////////////////////////////////////////////////
402/// Virtual function called from eve side when the frame should be
403/// destroyed. This means we expect that fEveWindow is null.
404///
405/// We simply call CloseWindow() on the main-frame which will in
406/// turn generate the "CloseWindow()" signal.
407/// This is then handled in MainFrameClosed().
408
410{
411 if (gDebug > 0)
412 Info("TEveCompositeFrameInMainFrame::Destroy()",
413 "Propagating call to main-frame.");
414
415 assert (fEveWindow == nullptr);
416
418}
419
420////////////////////////////////////////////////////////////////////////////////
421/// Set the container where to return the contained window on destruction.
422
425{
426 static const TEveException kEH("TEveCompositeFrameInMainFrame::SetOriginalSlotAndContainer ");
427
428 if (container && ! container->CanMakeNewSlots())
429 throw kEH + "Given window can not make new slots.";
430
433}
434
435////////////////////////////////////////////////////////////////////////////////
436/// Slot called when a window is closed ... we check that this was
437/// not our original container.
438
440{
441 if (w == fOriginalSlot)
442 fOriginalSlot = nullptr;
443
444 if (w == fOriginalContainer)
445 fOriginalContainer = nullptr;
446}
447
448////////////////////////////////////////////////////////////////////////////////
449/// Slot for main-frame's "CloseWindow()" signal.
450/// If an eve window is still present, it will be put into:
451/// - original-container, if it is set;
452//// - into window-managers default-container.
453
455{
456 if (fEveWindow != nullptr)
457 {
458 TEveWindow* swapCandidate = nullptr;
459 if (fOriginalSlot)
460 {
461 // if use pack, show hidden slot
463 if (packFrame) {
464 TGPack* pack = (TGPack*)(packFrame->GetParent());
465 pack->ShowFrame(packFrame);
466 }
468 }
469 else if (fOriginalContainer)
470 {
472 }
474 {
476 }
477
478 if (swapCandidate)
479 {
482 }
483 }
484
486
487 if (fEveWindow != nullptr)
489
490 if (gDebug > 0)
491 Info("TEveCompositeFrameInMainFrame::MainFrameClosed()",
492 "Expecting destructor call soon.");
493}
494
495/** \class TEveCompositeFrameInPack
496\ingroup TEve
497An EVE window-slot contained within one frame of a TGPack.
498*/
499
500
501////////////////////////////////////////////////////////////////////////////////
502/// Constructor.
503
511
512////////////////////////////////////////////////////////////////////////////////
513/// Destructor.
514
518
519////////////////////////////////////////////////////////////////////////////////
520/// Virtual function called from eve side when the frame should be
521/// destroyed. This means we expect that fEveWindow is null.
522///
523/// Remove the frame from pack and delete it.
524
526{
527 if (gDebug > 0)
528 Info("TEveCompositeFrameInPack::Destroy()", "Removing from pack and deleting.");
529
530 assert(fEveWindow == nullptr);
531
532 fPack->RemoveFrame(this);
533 delete this;
534}
535
536/** \class TEveCompositeFrameInTab
537\ingroup TEve
538An EVE window-slot contained within one tab of a TGTab.
539*/
540
541
542////////////////////////////////////////////////////////////////////////////////
543/// Constructor.
544
547 TGTab* tab) :
549 fTab (tab),
550 fParentInTab (parent)
551{
552}
553
554////////////////////////////////////////////////////////////////////////////////
555/// Destructor.
556
560
561////////////////////////////////////////////////////////////////////////////////
562/// Update widgets using window's name or title.
563
572
573////////////////////////////////////////////////////////////////////////////////
574/// Return index of this frame in the tab.
575/// Throws an exception if it is not found.
576
578{
579 static const TEveException eh("TEveCompositeFrameInTab::FindTabIndex ");
580
582 for (Int_t t = 0; t < nt; ++t)
583 {
585 {
586 return t;
587 }
588 }
589
590 throw eh + "parent frame not found in tab.";
591}
592
593////////////////////////////////////////////////////////////////////////////////
594/// Virtual function called from eve side when the frame should be
595/// destroyed. This means we expect that fEveWindow is null.
596///
597/// Remove the frame from tab and delete it.
598
600{
601 if (gDebug > 0)
602 Info("TEveCompositeFrameInTab::Destroy()", "Removing from tab and deleting.");
603
604 assert (fEveWindow == nullptr);
605
606 Int_t t = FindTabIndex();
607
608 // disconnect form Removed() if / when connected
609 fTab->RemoveTab(t, kFALSE);
612 delete fParentInTab;
613 delete this;
614}
615
616////////////////////////////////////////////////////////////////////////////////
617/// Set current state of this frame.
618/// Virtual from TEveCompositeFrame.
619
621{
623
624 Int_t t = FindTabIndex();
626 if (curr) {
627 te->SetBackgroundColor(TEveWindow::GetCurrentBackgroundColor());
628 } else {
629 te->SetBackgroundColor(GetDefaultFrameBackground());
630 }
632}
633
634/** \class TEveWindow
635\ingroup TEve
636Abstract base-class for representing eve-windows.
637Sub-classes define a particular GUI frame that gets showin the window.
638*/
639
640
645
646////////////////////////////////////////////////////////////////////////////////
647
648TEveWindow::TEveWindow(const char* n, const char* t) :
649 TEveElementList(n, t),
650
651 fEveFrame (nullptr),
652 fShowTitleBar (kTRUE)
653{
654 // Constructor.
655
656 // Override from TEveElementList.
658}
659
660////////////////////////////////////////////////////////////////////////////////
661/// Destructor.
662
664{
665 if (gDebug > 0)
666 Info("~TEveWindow", "name='%s', deny-destroy=%d.",
668}
669
670////////////////////////////////////////////////////////////////////////////////
671/// Called before the element is deleted, thus offering the last chance
672/// to detach from acquired resources and from the framework itself.
673/// Here the request is just passed to TEveManager.
674/// If you override it, make sure to call base-class version.
675
681
682////////////////////////////////////////////////////////////////////////////////
683/// Virtual function called before a window is undocked.
684
686{
687 for (List_ci i=fChildren.begin(); i!=fChildren.end(); ++i)
688 {
689 TEveWindow* w = dynamic_cast<TEveWindow*>(*i);
690 if (w)
691 w->PreUndock();
692 }
693}
694
695////////////////////////////////////////////////////////////////////////////////
696/// Virtual function called after a window is docked.
697
699{
700 for (List_ci i=fChildren.begin(); i!=fChildren.end(); ++i)
701 {
702 TEveWindow* w = dynamic_cast<TEveWindow*>(*i);
703 if (w)
704 w->PostDock();
705 }
706}
707
708////////////////////////////////////////////////////////////////////////////////
709/// Name or title of the window changed - propagate to frames.
710/// Virtual from TEveElement.
711
716
717////////////////////////////////////////////////////////////////////////////////
718/// Populate given frame-slot - intended for initial population
719/// of a new slot or low-level window-swapping.
720/// No layout or window-mapping is done.
721
723{
724 ef->fEveParent->AddElement(this);
725 ef->AcquireEveWindow(this);
726 fEveFrame = ef;
727}
728
729////////////////////////////////////////////////////////////////////////////////
730/// Swap frames with the given window.
731
733{
734 static const TEveException eh("TEveWindow::SwapWindow ");
735
736 if (w == nullptr)
737 throw eh + "Called with null argument.";
738
739 SwapWindows(this, w);
740}
741
742////////////////////////////////////////////////////////////////////////////////
743/// Swap frames with the current window.
744
746{
747 static const TEveException eh("TEveWindow::SwapWindowWithCurrent ");
748
750
751 if (current == nullptr)
752 throw eh + "Current eve-window is not set.";
753
754 if (current == this)
755 throw eh + "This is the current window ... nothing changed.";
756
757 SwapWindows(this, current);
758}
759
760////////////////////////////////////////////////////////////////////////////////
761/// Undock the window - put it into a dedicated main-frame.
762
764{
766 if (return_cont && ! return_cont->CanMakeNewSlots())
767 return_cont = nullptr;
768
769 // hide slot if in pack
771 if (packFrame) {
772 TGPack* pack = (TGPack*)(packFrame->GetParent());
773 pack->HideFrame(fEveFrame);
774 }
775
777
779
781 SetOriginalSlotAndContainer(ew_slot, return_cont);
782
784}
785
786////////////////////////////////////////////////////////////////////////////////
787/// Undock the window - put it into a dedicated main-frame.
788/// The old window slot is destroyed.
789
791{
793 if (return_cont && ! return_cont->CanMakeNewSlots())
794 return_cont = nullptr;
795
797
799
801 SetOriginalSlotAndContainer(nullptr, return_cont);
802
803 ew_slot->DestroyWindowAndSlot();
804
806}
807
808////////////////////////////////////////////////////////////////////////////////
809/// Replace this window with the passed one.
810/// Eve parent-ship is properly handled.
811/// This will most likely lead to the destruction of this window.
812/// Layout is called on the frame.
813
815{
817
820 w->fEveFrame = fEveFrame;
821
823
824 w->fEveFrame->Layout();
825}
826
827////////////////////////////////////////////////////////////////////////////////
828/// Destroy eve-window - replace it with an empty frame-slot.
829
831{
832 if (gDebug > 0)
833 Info("TEveWindow::DestroyWindow()", "name='%s', class='%s', deny-destroy=%d.",
835
836 if (fEveFrame != nullptr && fDenyDestroy == 1)
837 {
839
841
844
846 ew_slot->PopulateEmptyFrame(fEveFrame);
848
850
851 fEveFrame->Layout();
853 fEveFrame = nullptr;
854 }
855
857}
858
859////////////////////////////////////////////////////////////////////////////////
860/// Destroy eve-window and its frame-slot.
861
863{
864 if (gDebug > 0)
865 Info("TEveWindow::DestroyWindowAndSlot()", "'name=%s', class= '%s', deny-destroy=%d.",
867
868 if (fEveFrame != nullptr && fDenyDestroy == 1)
869 {
872 fEveFrame = nullptr;
873 }
874
876}
877
878////////////////////////////////////////////////////////////////////////////////
879/// Clears eve-frame associated with this window.
880/// This is used in special case when the window is embedded in a foreign
881/// GUI container and gets deleted from this side.
882/// In particular, this happens when TRootBrowser closes a tab.
883
885{
886 fEveFrame = nullptr;
887}
888
889////////////////////////////////////////////////////////////////////////////////
890/// Set display state of the title-bar.
891/// This is forwarded to eve-frame.
892
902
903////////////////////////////////////////////////////////////////////////////////
904/// Returns true if this window is the current one.
905
907{
908 return gEve->GetWindowManager()->IsCurrentWindow(this);
909}
910
911////////////////////////////////////////////////////////////////////////////////
912/// Make this window current.
913
919
920////////////////////////////////////////////////////////////////////////////////
921/// Set current state of this eve-window.
922/// Protected method - called by window-manager.
923
928
929////////////////////////////////////////////////////////////////////////////////
930/// Returns true if this is an ancestor of win.
931
933{
934 TEveWindow* parent = dynamic_cast<TEveWindow*>(win->fEveFrame->fEveParent);
935 if (parent)
936 {
937 if (parent == this)
938 return kTRUE;
939 else
940 return IsAncestorOf(parent);
941 }
942 else
943 {
944 return kFALSE;
945 }
946}
947
948////////////////////////////////////////////////////////////////////////////////
949/// Slot for clicking on the title-bar.
950/// The wish that this window becomes the current one is sent to
951/// the window-manager.
952
957
958////////////////////////////////////////////////////////////////////////////////
959/// Create a default window slot.
960/// Static helper.
961
963{
964 return new TEveWindowSlot("Free Window Slot", "A free window slot, can become a container or swallow a window.");
965}
966
967////////////////////////////////////////////////////////////////////////////////
968/// Create a new main-frame and populate it with a default window-slot.
969/// The main-frame is mapped.
970/// Static helper.
971
973{
975 mf->SetCleanup(kLocalCleanup);
976
978 (mf, eve_parent, mf);
979
981 ew_slot->PopulateEmptyFrame(slot);
982
984 slot->MapWindow();
985
986 mf->Layout();
987 mf->MapWindow();
988
989 return ew_slot;
990}
991
992////////////////////////////////////////////////////////////////////////////////
993/// Create a new tab in a given tab-widget and populate it with a
994/// default window-slot.
995/// Static helper.
996
998{
999 TGCompositeFrame *parent = tab->AddTab("<unused>");
1000 parent->SetCleanup(kLocalCleanup);
1001
1003
1005
1006 ew_slot->PopulateEmptyFrame(slot);
1007
1009
1010 tab->Layout();
1011
1012 slot->MapWindow();
1013
1014 return ew_slot;
1015}
1016
1017////////////////////////////////////////////////////////////////////////////////
1018/// Swap windows w1 and w2. They are properly reparented in the eve
1019/// hierarch as well.
1020/// Layout is called on both frames.
1021
1023{
1024 static const TEveException eh("TEveWindow::SwapWindows ");
1025
1026 if (w1 == nullptr || w2 == nullptr)
1027 throw eh + "Called with null window.";
1028
1029 if (w1 == w2)
1030 throw eh + "Windows are equal ... nothing to change.";
1031
1032 if (w1->IsAncestorOf(w2) || w2->IsAncestorOf(w1))
1033 throw eh + "Windows are in direct ancestry.";
1034
1035 TEveCompositeFrame *f1 = w1->fEveFrame, *f2 = w2->fEveFrame;
1036 TEveElement *p1 = f1->fEveParent, *p2 = f2->fEveParent;
1037
1038 if (p1 != p2)
1039 {
1040 p1->AddElement(w2);
1041 p2->AddElement(w1);
1042 }
1043
1044 f1->RelinquishEveWindow(kFALSE);
1045 f2->RelinquishEveWindow(kFALSE);
1046 f1->AcquireEveWindow(w2); w2->fEveFrame = f1;
1047 f2->AcquireEveWindow(w1); w1->fEveFrame = f2;
1048
1049 if (p1 != p2)
1050 {
1051 p1->RemoveElement(w1);
1052 p2->RemoveElement(w2);
1053 }
1054
1055 f1->Layout(); f2->Layout();
1056}
1057
1058////////////////////////////////////////////////////////////////////////////////
1059/// Get default width for new main-frame windows. Static.
1060
1065
1066////////////////////////////////////////////////////////////////////////////////
1067/// Get default height for new main-frame windows. Static.
1068
1073
1074////////////////////////////////////////////////////////////////////////////////
1075/// Set default width for new main-frame windows. Static.
1076
1081
1082////////////////////////////////////////////////////////////////////////////////
1083/// Set default height for new main-frame windows. Static.
1084
1089
1090////////////////////////////////////////////////////////////////////////////////
1091/// Get background-color for marking the title-bar of current window. Static.
1092
1097
1098////////////////////////////////////////////////////////////////////////////////
1099/// Get background-color for mini-bar (collapsed title-bar). Static.
1100
1105
1106////////////////////////////////////////////////////////////////////////////////
1107/// Set background-color for marking the title-bar of current window. Static.
1108
1113
1114////////////////////////////////////////////////////////////////////////////////
1115/// Set background-color for mini-bar (collapsed title-bar). Static.
1116
1121
1122/** \class TEveWindowSlot
1123\ingroup TEve
1124Description of TEveWindowSlot
1125*/
1126
1127
1128////////////////////////////////////////////////////////////////////////////////
1129/// Constructor.
1130
1131TEveWindowSlot::TEveWindowSlot(const char* n, const char* t) :
1132 TEveWindow (n, t),
1133 fEmptyButt (nullptr),
1134 fEmbedBuffer (nullptr)
1135{
1136 fEmptyButt = new TGTextButton(nullptr, " <empty>\nclick to select");
1139
1140 fEmptyButt->Connect("Clicked()", "TEveWindow", this, "TitleBarClicked()");
1141}
1142
1143////////////////////////////////////////////////////////////////////////////////
1144/// Destructor.
1145
1150
1151////////////////////////////////////////////////////////////////////////////////
1152/// Return top-frame of this eve-window - the big button to make slot current.
1153
1158
1159////////////////////////////////////////////////////////////////////////////////
1160/// Set current state of this window-slot.
1161/// Virtual from TEveWindow.
1162
1173
1174////////////////////////////////////////////////////////////////////////////////
1175/// A pack is created in place of this window-slot.
1176/// This window-slot will auto-destruct.
1177
1179{
1181 (nullptr, "Pack", "Window container for horizontal and vertical stacking.");
1182
1184
1185 return eve_pack;
1186}
1187
1188////////////////////////////////////////////////////////////////////////////////
1189/// A tab is created in place of this window-slot.
1190/// This window-slot will auto-destruct.
1191
1193{
1195 (nullptr, "Tab", "Window container for horizontal and vertical stacking.");
1196
1198
1199 return eve_tab;
1200}
1201
1202////////////////////////////////////////////////////////////////////////////////
1203/// An eve-window-frame is created and frame is passed into it.
1204/// If frame is 0 (the default), a default composite-frame will be created
1205/// in TEveWindowFrame() constructor.
1206/// This window-slot will auto-destruct.
1207
1209{
1211 (frame, "External frame", "");
1212
1214
1215 return eve_frame;
1216}
1217
1218////////////////////////////////////////////////////////////////////////////////
1219/// Start embedding a window that will replace the current slot.
1220/// It is expected that a main-frame will be created and then
1221/// StopEmbedding() will be called.
1222
1224{
1225 static const TEveException eh("TEveWindowSlot::StartEmbedding ");
1226
1227 if (fEmbedBuffer != nullptr)
1228 throw eh + "Already embedding.";
1229
1230 fEmbedBuffer = new TGCompositeFrame(gClient->GetDefaultRoot());
1232
1233 return fEmbedBuffer;
1234}
1235
1236////////////////////////////////////////////////////////////////////////////////
1237/// An embedded window is created in place of this window-slot.
1238/// This window-slot will auto-destruct.
1239
1241{
1242 static const TEveException eh("TEveWindowSlot::StopEmbedding ");
1243
1244 if (fEmbedBuffer == nullptr) {
1245 Warning(eh, "Embedding not in progress.");
1246 return nullptr;
1247 }
1248
1250
1251 Int_t size = fEmbedBuffer->GetList()->GetSize();
1252
1253 if (size == 0) {
1254 Warning(eh, "Frame has not been registered.");
1255 delete fEmbedBuffer;
1256 fEmbedBuffer = nullptr;
1257 return nullptr;
1258 }
1259
1260 if (size > 1) {
1261 Warning(eh, "Several frames have been registered (%d). Only the first one will be taken.", size);
1262 }
1263
1264 TGFrame *f = ((TGFrameElement*)fEmbedBuffer->GetList()->First())->fFrame;
1266 f->UnmapWindow();
1267 f->ReparentWindow(gClient->GetDefaultRoot());
1268 delete fEmbedBuffer;
1269 fEmbedBuffer = nullptr;
1270
1271 TGMainFrame *mf = dynamic_cast<TGMainFrame*>(f);
1272 assert(mf != nullptr);
1273
1274 if (name) {
1275 mf->SetWindowName(name);
1276 }
1277
1279 (f, mf->GetWindowName(), mf->ClassName());
1280
1282
1283 return eve_frame;
1284}
1285
1286/** \class TEveWindowFrame
1287\ingroup TEve
1288Encapsulates TGFrame into an eve-window.
1289The frame is owned by the eve-window.
1290*/
1291
1292
1293////////////////////////////////////////////////////////////////////////////////
1294/// Constructor.
1295/// If the passed frame is 0, a default TGCompositeFrame frame is instantiated
1296/// and set to local-cleanup.
1297
1298TEveWindowFrame::TEveWindowFrame(TGFrame* frame, const char* n, const char* t) :
1299 TEveWindow (n, t),
1300 fGUIFrame (frame)
1301{
1302 if (fGUIFrame == nullptr)
1303 {
1306 }
1307}
1308
1309////////////////////////////////////////////////////////////////////////////////
1310/// Destructor.
1311
1316
1317////////////////////////////////////////////////////////////////////////////////
1318/// Returns the registered top-frame of this eve-window dynamic-casted
1319/// to composite-frame.
1320/// Throws an exception if the cast fails.
1321
1323{
1324 static const TEveException kEH("TEveWindowFrame::GetGUICompositeFrame ");
1325
1326 TGCompositeFrame *cf = dynamic_cast<TGCompositeFrame*>(fGUIFrame);
1327 if (cf == nullptr)
1328 throw kEH + "The registered frame is not a composite-frame.";
1329
1330 return cf;
1331}
1332
1333/** \class TEveWindowPack
1334\ingroup TEve
1335Encapsulates TGPack into an eve-window.
1336The pack is owned by the eve-window.
1337*/
1338
1339
1340////////////////////////////////////////////////////////////////////////////////
1341/// Constructor.
1342/// If passed pack is 0, a default one is instantiated.
1343
1344TEveWindowPack::TEveWindowPack(TGPack* p, const char* n, const char* t) :
1345 TEveWindow (n, t),
1346 fPack (p ? p : new TGPack())
1347{
1348}
1349
1350////////////////////////////////////////////////////////////////////////////////
1351/// Destructor.
1352
1357
1358////////////////////////////////////////////////////////////////////////////////
1359/// Return top-frame of this eve-window - the pack.
1360
1362{
1363 return fPack;
1364}
1365
1366////////////////////////////////////////////////////////////////////////////////
1367/// Create a new frame-slot at the last position of the pack.
1368
1373
1374////////////////////////////////////////////////////////////////////////////////
1375/// Create a new weighted frame-slot at the last position of the pack.
1376
1378{
1380
1382 ew_slot->PopulateEmptyFrame(slot);
1383
1384 fPack->AddFrameWithWeight(slot, nullptr, w);
1385 slot->MapWindow();
1386
1387 fPack->Layout();
1388
1389 return ew_slot;
1390}
1391
1392////////////////////////////////////////////////////////////////////////////////
1393/// Flip orientation of the pack (vertical / horizontal).
1394
1399
1400////////////////////////////////////////////////////////////////////////////////
1401/// Set orientation of the pack (vertical / horizontal).
1402
1407
1408////////////////////////////////////////////////////////////////////////////////
1409/// Refit existing frames so that their lengths are equal.
1410
1416
1417/** \class TEveWindowTab
1418\ingroup TEve
1419Encapsulates TGTab into an eve-window.
1420The tab is owned by the eve-window.
1421*/
1422
1423
1424////////////////////////////////////////////////////////////////////////////////
1425/// Constructor.
1426/// If passed tab is 0, a default one is instantiated.
1427
1428TEveWindowTab::TEveWindowTab(TGTab* tab, const char* n, const char* t) :
1429 TEveWindow(n, t),
1430 fTab (tab ? tab : new TGTab())
1431{
1432}
1433
1434////////////////////////////////////////////////////////////////////////////////
1435/// Destructor.
1436
1441
1442////////////////////////////////////////////////////////////////////////////////
1443/// Return top-frame of this eve-window - the tab.
1444
1446{
1447 return fTab;
1448}
1449
1450////////////////////////////////////////////////////////////////////////////////
1451/// Create new frame-slot - a new tab.
1452
1457
1458/** \class TEveContextMenu
1459\ingroup TEve
1460Specialization of TContext menu.
1461Provide a window manager hint that ensures proper placement of popup on Cocoa.
1462*/
1463
1464
1465////////////////////////////////////////////////////////////////////////////////
1466/// Constructor.
1467
1468TEveContextMenu::TEveContextMenu(const char *name, const char *title) :
1469 TContextMenu(name, title)
1470{
1471}
1472
1473////////////////////////////////////////////////////////////////////////////////
1474/// Position the popup below given button and show context menu for object obj.
1475
1477{
1478 Int_t x, y;
1479 UInt_t w, h;
1481 gVirtualX->GetWindowSize(button->GetId(), x, y, w, h);
1482 gVirtualX->TranslateCoordinates(button->GetId(),
1483 gClient->GetDefaultRoot()->GetId(),
1484 0, 0, x, y, childdum);
1485
1487 if (rcm != nullptr)
1488 {
1489 gVirtualX->SetWMTransientHint (rcm->GetId(), button->GetId());
1490 }
1491
1492 Popup(x - 2, y + h - 2, obj);
1493}
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
@ 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
#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
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:60
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:71
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
Definition TError.cxx:241
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
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t win
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t button
char name[80]
Definition TGX11.cxx:110
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
Definition TROOT.cxx:627
#define gVirtualX
Definition TVirtualX.h:338
This class provides an interface to context sensitive popup menus.
TContextMenuImp * fContextMenuImp
!Context menu system specific implementation
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 &)
void SetOriginalSlotAndContainer(TEveWindow *slot, TEveWindow *container)
Set the container where to return the contained window on destruction.
void Destroy() override
Virtual function called from eve side when the frame should be destroyed.
void SomeWindowClosed(TEveWindow *w)
Slot called when a window is closed ... we check that this was not our original container.
void WindowNameChanged(const TString &name) override
Update widgets using window's name or title.
void MainFrameClosed()
Slot for main-frame's "CloseWindow()" signal.
~TEveCompositeFrameInMainFrame() override
Destructor.
An EVE window-slot contained within one frame of a TGPack.
Definition TEveWindow.h:148
~TEveCompositeFrameInPack() override
Destructor.
void Destroy() override
Virtual function called from eve side when the frame should be destroyed.
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
void Destroy() override
Virtual function called from eve side when the frame should be destroyed.
void SetCurrent(Bool_t curr) override
Set current state of this frame.
void WindowNameChanged(const TString &name) override
Update widgets using window's name or title.
TEveCompositeFrameInTab(const TEveCompositeFrameInTab &)
~TEveCompositeFrameInTab() override
Destructor.
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
~TEveCompositeFrame() override
If fEveWindow != 0 we are being deleted from the ROOT GUI side.
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 &)
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.
const char * GetElementName() const override
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
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()
Called before the element is deleted, thus offering the last chance to detach from acquired resources...
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
! Deny-destroy count.
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.
~TEveWindowFrame() override
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
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.
TEveWindowSlot * NewSlot() override
Create a new frame-slot at the last position of the pack.
TGPack * fPack
Definition TEveWindow.h:367
TGFrame * GetGUIFrame() override
Return top-frame of this eve-window - the pack.
~TEveWindowPack() override
Destructor.
Description of TEveWindowSlot.
Definition TEveWindow.h:302
TEveWindowFrame * MakeFrame(TGFrame *frame=nullptr)
An eve-window-frame is created and frame is passed into it.
TGCompositeFrame * fEmbedBuffer
Definition TEveWindow.h:309
TEveWindowFrame * StopEmbedding(const char *name=nullptr)
An embedded window is created in place of this window-slot.
TEveWindowSlot(const TEveWindowSlot &)
TGCompositeFrame * StartEmbedding()
Start embedding a window that will replace the current slot.
~TEveWindowSlot() override
Destructor.
TEveWindowTab * MakeTab()
A tab is created in place of this window-slot.
void SetCurrent(Bool_t curr) override
Set current state of this window-slot.
TGFrame * GetGUIFrame() override
Return top-frame of this eve-window - the big button to make slot current.
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
TEveWindowTab(const TEveWindowTab &)
~TEveWindowTab() override
Destructor.
TEveWindowSlot * NewSlot() override
Create new frame-slot - a new tab.
TGFrame * GetGUIFrame() override
Return top-frame of this eve-window - the tab.
Abstract base-class for representing eve-windows.
Definition TEveWindow.h:210
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.
~TEveWindow() override
Destructor.
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.
static TEveWindowSlot * CreateWindowMainFrame(TEveWindow *eve_parent=nullptr)
Create a new main-frame and populate it with a default window-slot.
TEveWindow(const TEveWindow &)
static void SetMainFrameDefHeight(UInt_t x)
Set default height for new main-frame windows. Static.
void PreDeleteElement() override
Called before the element is deleted, thus offering the last chance to detach from acquired resources...
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.
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...
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
static TEveWindowSlot * CreateWindowInTab(TGTab *tab, TEveWindow *eve_parent=nullptr)
Create a new tab in a given tab-widget and populate it with a default window-slot.
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.
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
void TitleBarClicked()
Slot for clicking on the title-bar.
void NameTitleChanged() override
Name or title of the window changed - propagate to frames.
static TClass * Class()
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.
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:233
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:380
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:289
void SetMapSubwindows(Bool_t on) override
Definition TGFrame.h:364
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
virtual TList * GetList() const
Definition TGFrame.h:312
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
Definition TGFrame.cxx:1156
void Layout() override
Layout the elements of the composite frame.
Definition TGFrame.cxx:1249
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition TGFrame.cxx:1196
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
Definition TGFrame.cxx:1064
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition TGFrame.cxx:1141
void SetEditable(Bool_t on=kTRUE) override
Switch ON/OFF edit mode.
Definition TGFrame.cxx:940
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition TGFrame.cxx:1182
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:313
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:597
void SetBackgroundColor(Pixel_t back) override
Set background color (override from TGWindow base class).
Definition TGFrame.cxx:304
void MapWindow() override
map window
Definition TGFrame.h:206
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:675
virtual void DeleteWindow()
Delete window.
Definition TGFrame.cxx:268
void UnmapWindow() override
unmap window
Definition TGFrame.h:208
virtual void SetCleanup(Int_t=kLocalCleanup)
Definition TGFrame.h:219
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:387
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:399
void DontCallClose()
Typically call this method in the slot connected to the CloseWindow() signal to prevent the calling o...
Definition TGFrame.cxx:1772
virtual void CloseWindow()
Close and delete main frame.
Definition TGFrame.cxx:1762
void SetWindowName(const char *name=nullptr) override
Set window name. This is typically done via the window manager.
Definition TGFrame.cxx:1780
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Stack of frames in horizontal (default) or vertical stack.
Definition TGPack.h:40
virtual void AddFrameWithWeight(TGFrame *f, TGLayoutHints *l, Float_t w)
Add frame f at the end with given weight.
Definition TGPack.cxx:264
void EqualizeFrames()
Refit existing frames so that their lengths are equal.
Definition TGPack.cxx:476
void RemoveFrame(TGFrame *f) override
Remove frame f and refit existing frames to pack size.
Definition TGPack.cxx:323
void SetVertical(Bool_t x)
Sets the vertical flag and reformats the back to new stacking direction.
Definition TGPack.cxx:568
void Layout() override
Reposition the frames so that they fit correctly.
Definition TGPack.cxx:457
Bool_t GetVertical() const
Definition TGPack.h:102
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:210
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:660
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition TGTab.cxx:706
virtual void RemoveTab(Int_t tabIndex=-1, Bool_t storeRemoved=kTRUE)
Remove container and tab of tab with index tabIndex.
Definition TGTab.cxx:424
TGCompositeFrame * GetTabContainer(Int_t tabIndex) const
Return container of tab with index tabIndex.
Definition TGTab.cxx:611
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:689
virtual void SetText(TGHotString *new_label)
Set new button text.
Definition TGButton.cxx:638
ROOT GUI Window base class.
Definition TGWindow.h:23
virtual void DestroyWindow()
destroy window
Definition TGWindow.cxx:190
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
Mother of all ROOT objects.
Definition TObject.h:42
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:226
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:1075
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition TObject.cxx:1063
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition TQObject.cxx:865
Bool_t Disconnect(const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
This class provides an interface to context sensitive popup menus.
Basic string class.
Definition TString.h:138
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