ROOT  6.06/09
Reference Guide
TEveWindow.cxx
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Matevz Tadel 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #include "TEveWindow.h"
13 #include "TEveWindowManager.h"
14 #include "TEveManager.h"
15 #include "TEveSelection.h"
16 
17 #include "THashList.h"
18 
19 #include "TGButton.h"
20 #include "TGMenu.h"
21 #include "TGPack.h"
22 #include "TGTab.h"
23 #include "TRootContextMenu.h"
24 
25 #include <cassert>
26 
27 /** \class TEveCompositeFrame
28 \ingroup TEve
29 Abstract base-class for frame-slots that encompass EVE-windows
30 (sub-classes of TEveWindow).
31 
32 The EVE-frame classes are managed by their embedded EVE-windows and
33 mostly serve as an interface to particular ROOT widgets
34 (sub-classes of TGCompositeFrame) they are embedded into.
35 
36 This base-class, a sub-class of a vertical composite-frame, creates
37 also the title-bar which can be used to interact with the embedded
38 window. 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
40 title-bar is restored.
41 
42 Sub-classes provide for specific behaviour and expectations of
43 individual ROOT GUI container frames.
44 
45 POSSIBLE EXTENSIONS
46 
47 No frame is drawn around this composite-frame - frame style could be
48 available as a (static) member.
49 
50 Menus of embedded windows could also be managed - hidden or transposed
51 to a top-level menubar.
52 */
53 
55 
56 TEveContextMenu* TEveCompositeFrame::fgCtxMenu = 0;
57 
58 const TString TEveCompositeFrame::fgkEmptyFrameName("<relinquished>");
59 TList* TEveCompositeFrame::fgFrameList = new THashList;
60 
62 
66 
67 ////////////////////////////////////////////////////////////////////////////////
68 /// Set properties of the EVE frame.
69 /// Should be called before the windows are created.
70 
71 void 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 
119  if (fgIconBarCreator)
120  {
122  }
123  else
124  {
125  TGButton* b = new TGTextButton(fTopFrame, "Actions");
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 
151  MapSubwindows();
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 {
194  fTitleBar->SetText(name);
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);
225  fEveWindow->PostDock();
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)
249  gui_frame->ReparentWindow(fClient->GetDefaultRoot());
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
353 An 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 {
398  fMainFrame->SetWindowName(name);
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)
447  fOriginalContainer = 0;
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
499 An 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
541 An 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();
571  fTab->GetTabTab(t)->SetText(new TGString(name));
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  {
588  if (fTab->GetTabContainer(t) == fParentInTab)
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
640 Abstract base-class for representing eve-windows.
641 Sub-classes define a particular GUI frame that gets showin the window.
642 */
643 
645 
650 
651 ////////////////////////////////////////////////////////////////////////////////
652 
653 TEveWindow::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.
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
775  TEveCompositeFrameInPack* packFrame = dynamic_cast<TEveCompositeFrameInPack*>(fEveFrame);
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 
851  ew_slot->PopulateEmptyFrame(fEveFrame);
853 
854  fDestroyOnZeroRefCnt = dozrc;
855 
856  fEveFrame->Layout();
857  fEveFrame->MapWindow();
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  {
876  fEveFrame->Destroy();
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 
903  fShowTitleBar = x;
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 
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 {
1100  return fgCurrentBackgroundColor;
1101 }
1102 
1103 ////////////////////////////////////////////////////////////////////////////////
1104 /// Get background-color for mini-bar (collapsed title-bar). Static.
1105 
1107 {
1108  return fgMiniBarBackgroundColor;
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
1129 Description of TEveWindowSlot
1130 */
1131 
1133 
1134 ////////////////////////////////////////////////////////////////////////////////
1135 /// Constructor.
1136 
1137 TEveWindowSlot::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 {
1171  TEveWindow::SetCurrent(curr);
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 
1257  Int_t size = fEmbedBuffer->GetList()->GetSize();
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
1294 Encapsulates TGFrame into an eve-window.
1295 The 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 
1305 TEveWindowFrame::TEveWindowFrame(TGFrame* frame, const char* n, const char* t) :
1306  TEveWindow (n, t),
1307  fGUIFrame (frame)
1308 {
1309  if (fGUIFrame == 0)
1310  {
1311  fGUIFrame = new TGCompositeFrame();
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
1342 Encapsulates TGPack into an eve-window.
1343 The 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 
1352 TEveWindowPack::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 {
1363  fPack->DeleteWindow();
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 {
1413  fPack->SetVertical(x);
1414 }
1415 
1416 ////////////////////////////////////////////////////////////////////////////////
1417 /// Refit existing frames so that their lengths are equal.
1418 
1420 {
1421  fPack->EqualizeFrames();
1422  fPack->Layout();
1423 }
1424 
1425 /** \class TEveWindowTab
1426 \ingroup TEve
1427 Encapsulates TGTab into an eve-window.
1428 The 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 
1437 TEveWindowTab::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
1469 Specialization of TContext menu.
1470 Provide a window manager hint that ensures proper placement of popup on Cocoa.
1471 */
1472 
1474 
1475 ////////////////////////////////////////////////////////////////////////////////
1476 /// Constructor.
1477 
1478 TEveContextMenu::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 }
virtual TEveWindowSlot * NewSlot()
Create new frame-slot - a new tab.
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGFrame.cxx:1172
virtual TEveWindowSlot * NewSlot()
Create a new frame-slot at the last position of the pack.
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Definition: TGPack.cxx:393
virtual void HideAllDecorations()
Hide title-bar and mini-bar.
Definition: TEveWindow.cxx:301
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
void DecDenyDestroy()
Decreases the deny-destroy count of the element.
virtual TEveWindowSlot * NewSlot()
Definition: TEveWindow.h:242
virtual void PostDock()
Virtual function called after a window is docked.
Definition: TEveWindow.cxx:703
Encapsulates TGPack into an eve-window.
Definition: TEveWindow.h:360
virtual TGFrame * GetGUIFrame()
Return top-frame of this eve-window - the pack.
Specialization of TContext menu.
Definition: TEveWindow.h:430
TEveWindow * GetDefaultContainer() const
Int_t fDenyDestroy
Counter for top-level list-tree items that prevent automatic destruction.
Definition: TEveElement.h:87
void MainFrameClosed()
Slot for main-frame's "CloseWindow()" signal.
Definition: TEveWindow.cxx:456
TEveCompositeFrame * fEveFrame
Definition: TEveWindow.h:218
TEveWindowFrame * StopEmbedding(const char *name=0)
An embedded window is created in place of this window-slot.
static TEveContextMenu * fgCtxMenu
Definition: TEveWindow.h:70
const TGWindow * GetParent() const
Definition: TGWindow.h:87
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.
Definition: TGTab.h:66
float Float_t
Definition: RtypesCore.h:53
TClass * fChildClass
Definition: TEveElement.h:468
TGFrame * fGUIFrame
Definition: TEveWindow.h:342
virtual const char * GetElementName() const
Virtual function for retrieving name of the element.
Definition: TEveElement.h:481
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
Definition: TGFrame.cxx:1746
void EqualizeFrames()
Refit existing frames so that their lengths are equal.
List_t fChildren
Definition: TEveElement.h:79
static TList * fgFrameList
Definition: TEveWindow.h:73
#define assert(cond)
Definition: unittest.h:542
void WindowDocked(TEveWindow *window)
Emit the "WindowDocked(TEveWindow*)" signal.
TH1 * h
Definition: legend2.C:5
static UInt_t fgMainFrameDefHeight
Definition: TEveWindow.h:224
virtual void SetCurrent(Bool_t curr)
Set current state of this window-slot.
Abstract base-class for representing eve-windows.
Definition: TEveWindow.h:209
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:892
static TEveWindowSlot * CreateDefaultWindowSlot()
Create a default window slot.
Definition: TEveWindow.cxx:967
An EVE window-slot contained within a TGMainFrame.
Definition: TEveWindow.h:111
virtual ~TEveWindowFrame()
Destructor.
Bool_t IsCurrent() const
Returns true if this window is the current one.
Definition: TEveWindow.cxx:911
TGCompositeFrame * fTopFrame
Definition: TEveWindow.h:57
virtual void SetTextJustify(Int_t tmode)
Set text justification.
Definition: TGButton.cxx:645
void IncDenyDestroy()
Increases the deny-destroy count of the element.
TEveCompositeFrame * GetEveFrame()
Definition: TEveWindow.h:257
Basic string class.
Definition: TString.h:137
virtual TList * GetList() const
Definition: TGFrame.h:385
#define gClient
Definition: TGClient.h:174
Description of TEveWindowSlot.
Definition: TEveWindow.h:301
static Pixel_t GetMiniBarBackgroundColor()
Get background-color for mini-bar (collapsed title-bar). Static.
virtual void Destroy()
Destroy this element.
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGFrame.cxx:1186
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TEveCompositeFrameInMainFrame(const TEveCompositeFrameInMainFrame &)
virtual void SetMapSubwindows(Bool_t on)
Definition: TGFrame.h:438
const Bool_t kFALSE
Definition: Rtypes.h:92
TEveWindowTab * MakeTab()
A tab is created in place of this window-slot.
virtual ~TEveWindowTab()
Destructor.
virtual ~TEveWindowPack()
Destructor.
void MakeCurrent()
Make this window current.
Definition: TEveWindow.cxx:919
TGCompositeFrame * GetTabContainer(Int_t tabIndex) const
Return container of tab with index tabIndex.
Definition: TGTab.cxx:563
static Pixel_t fgCurrentBackgroundColor
Definition: TEveWindow.h:226
TEveElement * fEveParent
Definition: TEveWindow.h:65
void DontCallClose()
Typically call this method in the slot connected to the CloseWindow() signal to prevent the calling o...
Definition: TGFrame.cxx:1738
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1239
virtual ~TEveWindow()
Destructor.
Definition: TEveWindow.cxx:668
Bool_t HasDefaultContainer() const
Bool_t IsCurrentWindow(const TEveWindow *w) const
A list of TEveElements.
Definition: TEveElement.h:459
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1131
TEveWindowFrame * MakeFrame(TGFrame *frame=0)
An eve-window-frame is created and frame is passed into it.
Int_t FindTabIndex()
Return index of this frame in the tab.
Definition: TEveWindow.cxx:581
void SwapWindowWithCurrent()
Swap frames with the current window.
Definition: TEveWindow.cxx:750
virtual void WindowNameChanged(const TString &name)
Update widgets using window's name or title.
Definition: TEveWindow.cxx:396
virtual void PreUndock()
Virtual function called before a window is undocked.
Definition: TEveWindow.cxx:690
TGFrame * fMiniBar
Definition: TEveWindow.h:63
virtual ~TEveWindowSlot()
Destructor.
Int_t GetNumberOfTabs() const
Return number of tabs.
Definition: TGTab.cxx:658
virtual void Destroy()
Virtual function called from eve side when the frame should be destroyed.
Definition: TEveWindow.cxx:411
void ActionPressed()
The action-button of the title-bar was pressed.
Definition: TEveWindow.cxx:321
static void SetMainFrameDefHeight(UInt_t x)
Set default height for new main-frame windows. Static.
virtual void RemoveElement(TEveElement *el)
Remove el from the list of children.
static TEveWindowSlot * CreateWindowMainFrame(TEveWindow *eve_parent=0)
Create a new main-frame and populate it with a default window-slot.
Definition: TEveWindow.cxx:977
static UInt_t GetMainFrameDefWidth()
Get default width for new main-frame windows. Static.
static const TString fgkEmptyFrameName
Definition: TEveWindow.h:71
void SetText(TGString *text)
Set new tab text.
Definition: TGTab.cxx:180
TEveWindowPack(const TEveWindowPack &)
virtual void SetCurrent(Bool_t curr)
Set current state of this frame.
Definition: TEveWindow.cxx:271
Double_t x[n]
Definition: legend1.C:17
TEveWindow * GetCurrentWindow() const
Bool_t fDestroyOnZeroRefCnt
Deny-destroy count.
Definition: TEveElement.h:88
ULong_t Pixel_t
Definition: GuiTypes.h:41
void Class()
Definition: Class.C:29
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition: THashList.h:36
void EqualizeFrames()
Refit existing frames so that their lengths are equal.
Definition: TGPack.cxx:497
void ReplaceWindow(TEveWindow *w)
Replace this window with the passed one.
Definition: TEveWindow.cxx:819
Definition: TGPack.h:39
void UndockWindow()
Undock the window - put it into a dedicated main-frame.
Definition: TEveWindow.cxx:768
virtual TGFrame * GetGUIFrame()
Return top-frame of this eve-window - the tab.
static double p2(double t, double a, double b, double c)
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:265
TContextMenuImp * fContextMenuImp
Definition: TContextMenu.h:53
virtual void Destroy()
Virtual function called from eve side when the frame should be destroyed.
Definition: TEveWindow.cxx:528
static void SetMainFrameDefWidth(UInt_t x)
Set default width for new main-frame windows. Static.
TGCompositeFrame * GetGUICompositeFrame()
Returns the registered top-frame of this eve-window dynamic-casted to composite-frame.
virtual void Popup(Int_t x, Int_t y, TObject *obj, TVirtualPad *c=0, TVirtualPad *p=0)
Popup context menu at given location in canvas c and pad p for selected object.
const char * GetWindowName() const
Definition: TGFrame.h:560
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:294
Abstract base-class for frame-slots that encompass EVE-windows (sub-classes of TEveWindow).
Definition: TEveWindow.h:39
void SetVertical(Bool_t x)
Sets the vertical flag and reformats the back to new stacking direction.
Definition: TGPack.cxx:597
void UndockWindowDestroySlot()
Undock the window - put it into a dedicated main-frame.
Definition: TEveWindow.cxx:795
static void SetupFrameMarkup(IconBarCreator_foo creator, UInt_t top_frame_height=14, UInt_t mini_bar_height=4, Bool_t allow_top_collapse=kTRUE)
Set properties of the EVE frame.
Definition: TEveWindow.cxx:71
virtual ~TEveCompositeFrame()
If fEveWindow != 0 we are being deleted from the ROOT GUI side.
Definition: TEveWindow.cxx:171
A doubly linked list.
Definition: TList.h:47
static UInt_t fgMainFrameDefWidth
Definition: TEveWindow.h:223
static UInt_t GetMainFrameDefHeight()
Get default height for new main-frame windows. Static.
void SwapWindow(TEveWindow *w)
Swap frames with the given window.
Definition: TEveWindow.cxx:737
void FlipOrientation()
Flip orientation of the pack (vertical / horizontal).
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:1135
virtual void DestroyWindowAndSlot()
Destroy eve-window and its frame-slot.
Definition: TEveWindow.cxx:867
virtual void PreDeleteElement()
Externally assigned and controlled user data.
virtual void SetShowTitleBar(Bool_t show)
Set state of title-bar.
Definition: TEveWindow.cxx:285
List_t::const_iterator List_ci
Definition: TEveElement.h:71
TGTabElement * GetTabTab(Int_t tabIndex) const
Return the tab element of tab with index tabIndex.
Definition: TGTab.cxx:612
TGFrame *(* IconBarCreator_foo)(TEveCompositeFrame *, TGCompositeFrame *, Int_t)
Definition: TEveWindow.h:45
TEveWindowSlot(const TEveWindowSlot &)
void FlipShowTitleBar()
Definition: TEveWindow.h:260
ClassImp(TEveCompositeFrame)
TGTextButton * fToggleBar
Definition: TEveWindow.h:58
An EVE window-slot contained within one tab of a TGTab.
Definition: TEveWindow.h:171
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
Bool_t GetShowTitleBar() const
Definition: TEveWindow.h:261
static UInt_t fgTopFrameHeight
Definition: TEveWindow.h:52
void SetVertical(Bool_t x=kTRUE)
Set orientation of the pack (vertical / horizontal).
TGCompositeFrame * fEmbedBuffer
Definition: TEveWindow.h:309
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:187
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:674
virtual ~TEveCompositeFrameInMainFrame()
Destructor.
Definition: TEveWindow.cxx:376
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
Definition: TGTab.cxx:341
This class provides an interface to context sensitive popup menus.
Definition: TContextMenu.h:44
virtual void Destroy()
Virtual function called from eve side when the frame should be destroyed.
Definition: TEveWindow.cxx:603
virtual void CloseWindow()
Close and delete main frame.
Definition: TGFrame.cxx:1728
unsigned int UInt_t
Definition: RtypesCore.h:42
TGTextButton * fEmptyButt
Definition: TEveWindow.h:308
virtual void ShowNormalDecorations()
Show title-bar or mini-bar, as dictated by the window.
Definition: TEveWindow.cxx:312
TGTab * fTab
Definition: TEveWindow.h:402
void DeleteWindow(TEveWindow *w)
Called by a window before it gets deleted.
void PopulateEmptyFrame(TEveCompositeFrame *ef)
Populate given frame-slot - intended for initial population of a new slot or low-level window-swappin...
Definition: TEveWindow.cxx:727
TEveCompositeFrame(const TEveCompositeFrame &)
static void SwapWindows(TEveWindow *w1, TEveWindow *w2)
Swap windows w1 and w2.
Encapsulates TGTab into an eve-window.
Definition: TEveWindow.h:395
virtual void RemoveFrame(TGFrame *f)
Remove frame f and refit existing frames to pack size.
Definition: TGPack.cxx:336
void ClearEveFrame()
Clears eve-frame associated with this window.
Definition: TEveWindow.cxx:889
static double p1(double t, double a, double b)
virtual void AddElement(TEveElement *el)
Add el to the list of children.
TEveWindow * fEveWindow
Definition: TEveWindow.h:66
virtual void RemoveTab(Int_t tabIndex=-1, Bool_t storeRemoved=kTRUE)
Remove container and tab of tab with index tabIndex.
Definition: TGTab.cxx:392
TGTextButton * fTitleBar
Definition: TEveWindow.h:59
#define gVirtualX
Definition: TVirtualX.h:362
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Definition: TGPack.cxx:363
virtual void Layout()
Reposition the frames so that they fit correctly.
Definition: TGPack.cxx:476
virtual void NameTitleChanged()
Name or title of the window changed - propagate to frames.
Definition: TEveWindow.cxx:717
virtual void SetText(TGHotString *new_label)
Set new button text.
Definition: TGButton.cxx:594
static Pixel_t GetCurrentBackgroundColor()
Get background-color for marking the title-bar of current window. Static.
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:232
void SetOriginalSlotAndContainer(TEveWindow *slot, TEveWindow *container)
Set the container where to return the contained window on destruction.
Definition: TEveWindow.cxx:425
void SelectWindow(TEveWindow *w)
Entry-point for communicating the fact that a window was acted upon in such a way that it should beco...
virtual Int_t GetSize() const
Definition: TCollection.h:95
double f(double x)
TEveWindowPack * MakePack()
A pack is created in place of this window-slot.
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
Definition: TGFrame.cxx:1054
Bool_t fShowTitleBar
Definition: TEveWindow.h:219
TEveCompositeFrameInTab(const TEveCompositeFrameInTab &)
static IconBarCreator_foo fgIconBarCreator
Definition: TEveWindow.h:51
virtual ~TEveCompositeFrameInTab()
Destructor.
Definition: TEveWindow.cxx:561
virtual void AcquireEveWindow(TEveWindow *ew)
Accept window and increase its deny-destroy count.
Definition: TEveWindow.cxx:205
Double_t y[n]
Definition: legend1.C:17
TGPack * fPack
Definition: TEveWindow.h:367
virtual ~TEveCompositeFrameInPack()
Destructor.
Definition: TEveWindow.cxx:518
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1293
TEveCompositeFrameInPack(const TEveCompositeFrameInPack &)
virtual void SetCleanup(Int_t=kLocalCleanup)
Definition: TGFrame.h:280
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
TEveWindow(const TEveWindow &)
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1146
virtual void SetCurrent(Bool_t curr)
Set current state of this eve-window.
Definition: TEveWindow.cxx:929
TEveWindowFrame(const TEveWindowFrame &)
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual void SetCurrent(Bool_t curr)
Set current state of this frame.
Definition: TEveWindow.cxx:624
Mother of all ROOT objects.
Definition: TObject.h:58
TGFrame * fIconBar
Definition: TEveWindow.h:60
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:556
void FlipTitleBarState()
Change display-state of the title-bar / mini-bar.
Definition: TEveWindow.cxx:334
Handle_t Window_t
Definition: GuiTypes.h:30
virtual void UnmapWindow()
Definition: TGFrame.h:269
TEveWindowTab(const TEveWindowTab &)
TEveWindow * GetEveParentAsWindow() const
Returns eve-parent dynamic-casted to TEveWindow.
Definition: TEveWindow.cxx:262
virtual void Add(TObject *obj)
Definition: TList.h:81
double f2(const double *x)
virtual void DestroyWindow()
Destroy eve-window - replace it with an empty frame-slot.
Definition: TEveWindow.cxx:835
virtual void MapWindow()
Definition: TGFrame.h:267
static void SetCurrentBackgroundColor(Pixel_t p)
Set background-color for marking the title-bar of current window. Static.
TGClient * fClient
Definition: TGObject.h:41
TF1 * f1
Definition: legend1.C:11
virtual TEveWindowSlot * NewSlotWithWeight(Float_t w)
Create a new weighted frame-slot at the last position of the pack.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:370
Exception class thrown by TEve classes and macros.
Definition: TEveUtil.h:102
TGLayoutHints * fEveWindowLH
Definition: TEveWindow.h:61
R__EXTERN Int_t gDebug
Definition: Rtypes.h:128
void SetupAndPopup(TGWindow *button, TObject *obj)
Position the popup below given button and show context menu for object obj.
TEveWindowManager * GetWindowManager() const
Definition: TEveManager.h:142
virtual void AddFrameWithWeight(TGFrame *f, TGLayoutHints *l, Float_t w)
Add frame f at the end with given weight.
Definition: TGPack.cxx:275
void SomeWindowClosed(TEveWindow *w)
Slot called when a window is closed ...
Definition: TEveWindow.cxx:441
TEveContextMenu(const char *name, const char *title="Eve context menu")
Constructor.
virtual void WindowNameChanged(const TString &name)
Update widgets using window's name or title.
Definition: TEveWindow.cxx:192
void SetShowTitleBar(Bool_t x)
Set display state of the title-bar.
Definition: TEveWindow.cxx:898
static void SetMiniBarBackgroundColor(Pixel_t p)
Set background-color for mini-bar (collapsed title-bar). Static.
void TitleBarClicked()
Slot for clicking on the title-bar.
Definition: TEveWindow.cxx:958
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
Definition: TGFrame.cxx:930
void TitleBarClicked()
Slot for mouse-click on the central part of the title-bar.
Definition: TEveWindow.cxx:346
virtual Bool_t CanMakeNewSlots() const
Definition: TEveWindow.h:241
virtual void DeleteWindow()
Delete window.
Definition: TGFrame.cxx:258
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
TGCompositeFrame * fParentInTab
Definition: TEveWindow.h:179
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition: TEveElement.h:33
Handle_t GetId() const
Definition: TGObject.h:52
static UInt_t fgMiniBarHeight
Definition: TEveWindow.h:53
An EVE window-slot contained within one frame of a TGPack.
Definition: TEveWindow.h:147
void WindowUndocked(TEveWindow *window)
Emit the "WindowUndocked(TEveWindow*)" signal.
TGCompositeFrame * StartEmbedding()
Start embedding a window that will replace the current slot.
static Pixel_t fgMiniBarBackgroundColor
Definition: TEveWindow.h:227
virtual TEveWindow * RelinquishEveWindow(Bool_t reparent=kTRUE)
Remove window and decrease its deny-destroy count.
Definition: TEveWindow.cxx:238
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
Definition: TGFrame.cxx:303
const Int_t n
Definition: legend1.C:16
virtual TGFrame * GetGUIFrame()
Return top-frame of this eve-window - the big button to make slot current.
Encapsulates TGFrame into an eve-window.
Definition: TEveWindow.h:335
virtual void DestroyWindow()
Definition: TGWindow.h:94
Bool_t GetVertical() const
Definition: TGPack.h:103
virtual TGFrame * GetGUIFrame()=0
Bool_t IsAncestorOf(TEveWindow *win)
Returns true if this is an ancestor of win.
Definition: TEveWindow.cxx:937
virtual void PreDeleteElement()
Called before the element is deleted, thus offering the last chance to detach from acquired resources...
Definition: TEveWindow.cxx:681
virtual void Destroy()=0
static Bool_t fgAllowTopFrameCollapse
Definition: TEveWindow.h:54
virtual void WindowNameChanged(const TString &name)
Update widgets using window's name or title.
Definition: TEveWindow.cxx:568
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:904