12 #ifndef ROOT_TEveWindow
13 #define ROOT_TEveWindow
22 class TEveWindowFrame;
23 class TEveWindowMainFrame;
26 class TEveContextMenu;
39 class TEveCompositeFrame :
public TGCompositeFrame
41 friend class TEveWindow;
42 friend class TEveWindowManager;
45 typedef TGFrame* (*IconBarCreator_foo)(TEveCompositeFrame*, TGCompositeFrame*, Int_t);
48 TEveCompositeFrame(
const TEveCompositeFrame&);
49 TEveCompositeFrame& operator=(
const TEveCompositeFrame&);
51 static IconBarCreator_foo fgIconBarCreator;
52 static UInt_t fgTopFrameHeight;
53 static UInt_t fgMiniBarHeight;
54 static Bool_t fgAllowTopFrameCollapse;
57 TGCompositeFrame *fTopFrame;
58 TGTextButton *fToggleBar;
59 TGTextButton *fTitleBar;
61 TGLayoutHints *fEveWindowLH;
65 TEveElement *fEveParent;
66 TEveWindow *fEveWindow;
70 static TEveContextMenu *fgCtxMenu;
71 static const TString fgkEmptyFrameName;
73 static TList *fgFrameList;
76 TEveCompositeFrame(TGCompositeFrame* gui_parent, TEveWindow* eve_parent);
77 virtual ~TEveCompositeFrame();
79 virtual void WindowNameChanged(
const TString& name);
81 virtual void Destroy() = 0;
83 virtual void AcquireEveWindow(TEveWindow* ew);
84 virtual TEveWindow* RelinquishEveWindow(Bool_t reparent=kTRUE);
86 TEveWindow* GetEveWindow()
const {
return fEveWindow; }
87 TEveWindow* GetEveParentAsWindow()
const;
89 virtual void SetCurrent(Bool_t curr);
90 virtual void SetShowTitleBar(Bool_t show);
91 virtual void HideAllDecorations();
92 virtual void ShowNormalDecorations();
95 void FlipTitleBarState();
96 void TitleBarClicked();
98 static void SetupFrameMarkup(IconBarCreator_foo creator,
99 UInt_t top_frame_height = 14,
100 UInt_t mini_bar_height = 4,
101 Bool_t allow_top_collapse = kTRUE);
103 ClassDef(TEveCompositeFrame, 0);
111 class TEveCompositeFrameInMainFrame :
public TEveCompositeFrame
114 TEveCompositeFrameInMainFrame(
const TEveCompositeFrameInMainFrame&);
115 TEveCompositeFrameInMainFrame& operator=(
const TEveCompositeFrameInMainFrame&);
118 TGMainFrame *fMainFrame;
119 TEveWindow *fOriginalSlot;
120 TEveWindow *fOriginalContainer;
123 TEveCompositeFrameInMainFrame(TGCompositeFrame* parent, TEveWindow* eve_parent,
125 virtual ~TEveCompositeFrameInMainFrame();
127 virtual void WindowNameChanged(
const TString& name);
129 virtual void Destroy();
131 void SetOriginalSlotAndContainer(TEveWindow* slot, TEveWindow* container);
133 void SomeWindowClosed(TEveWindow* w);
134 void MainFrameClosed();
136 TEveWindow* GetOriginalSlot()
const {
return fOriginalSlot; }
137 TEveWindow* GetOriginalContainer()
const {
return fOriginalContainer; }
139 ClassDef(TEveCompositeFrameInMainFrame, 0);
147 class TEveCompositeFrameInPack :
public TEveCompositeFrame
150 TEveCompositeFrameInPack(
const TEveCompositeFrameInPack&);
151 TEveCompositeFrameInPack& operator=(
const TEveCompositeFrameInPack&);
157 TEveCompositeFrameInPack(TGCompositeFrame* parent, TEveWindow* eve_parent,
159 virtual ~TEveCompositeFrameInPack();
161 virtual void Destroy();
163 ClassDef(TEveCompositeFrameInPack, 0);
171 class TEveCompositeFrameInTab :
public TEveCompositeFrame
174 TEveCompositeFrameInTab(
const TEveCompositeFrameInTab&);
175 TEveCompositeFrameInTab& operator=(
const TEveCompositeFrameInTab&);
179 TGCompositeFrame *fParentInTab;
181 Int_t FindTabIndex();
184 TEveCompositeFrameInTab(TGCompositeFrame* parent, TEveWindow* eve_parent,
186 virtual ~TEveCompositeFrameInTab();
188 virtual void WindowNameChanged(
const TString& name);
190 virtual void Destroy();
192 virtual void SetCurrent(Bool_t curr);
194 ClassDef(TEveCompositeFrameInTab, 0);
209 class TEveWindow :
public TEveElementList
211 friend class TEveWindowManager;
214 TEveWindow(
const TEveWindow&);
215 TEveWindow& operator=(
const TEveWindow&);
218 TEveCompositeFrame *fEveFrame;
219 Bool_t fShowTitleBar;
221 virtual void SetCurrent(Bool_t curr);
223 static UInt_t fgMainFrameDefWidth;
224 static UInt_t fgMainFrameDefHeight;
226 static Pixel_t fgCurrentBackgroundColor;
227 static Pixel_t fgMiniBarBackgroundColor;
229 virtual void PreDeleteElement();
232 TEveWindow(
const char* n=
"TEveWindow",
const char* t=
"");
233 virtual ~TEveWindow();
235 virtual void NameTitleChanged();
237 virtual TGFrame* GetGUIFrame() = 0;
238 virtual void PreUndock();
239 virtual void PostDock();
241 virtual Bool_t CanMakeNewSlots()
const {
return kFALSE; }
242 virtual TEveWindowSlot* NewSlot() {
return 0; }
244 void PopulateEmptyFrame(TEveCompositeFrame* ef);
246 void SwapWindow(TEveWindow* w);
247 void SwapWindowWithCurrent();
250 void UndockWindowDestroySlot();
252 void ReplaceWindow(TEveWindow* w);
254 virtual void DestroyWindow();
255 virtual void DestroyWindowAndSlot();
257 TEveCompositeFrame* GetEveFrame() {
return fEveFrame; }
258 void ClearEveFrame();
260 void FlipShowTitleBar() { SetShowTitleBar(!fShowTitleBar); }
261 Bool_t GetShowTitleBar()
const {
return fShowTitleBar; }
262 void SetShowTitleBar(Bool_t x);
264 Bool_t IsCurrent()
const;
268 Bool_t IsAncestorOf(TEveWindow* win);
270 void TitleBarClicked();
275 static TEveWindowSlot* CreateDefaultWindowSlot();
276 static TEveWindowSlot* CreateWindowMainFrame(TEveWindow* eve_parent=0);
277 static TEveWindowSlot* CreateWindowInTab(TGTab* tab, TEveWindow* eve_parent=0);
279 static void SwapWindows(TEveWindow* w1, TEveWindow* w2);
283 static UInt_t GetMainFrameDefWidth();
284 static UInt_t GetMainFrameDefHeight();
285 static void SetMainFrameDefWidth (UInt_t x);
286 static void SetMainFrameDefHeight(UInt_t x);
288 static Pixel_t GetCurrentBackgroundColor();
289 static Pixel_t GetMiniBarBackgroundColor();
290 static void SetCurrentBackgroundColor(Pixel_t p);
291 static void SetMiniBarBackgroundColor(Pixel_t p);
293 ClassDef(TEveWindow, 0);
301 class TEveWindowSlot :
public TEveWindow
304 TEveWindowSlot(
const TEveWindowSlot&);
305 TEveWindowSlot& operator=(
const TEveWindowSlot&);
308 TGTextButton *fEmptyButt;
309 TGCompositeFrame *fEmbedBuffer;
311 virtual void SetCurrent(Bool_t curr);
314 TEveWindowSlot(
const char* n=
"TEveWindowSlot",
const char* t=
"");
315 virtual ~TEveWindowSlot();
317 virtual TGFrame* GetGUIFrame();
319 TEveWindowPack* MakePack();
320 TEveWindowTab* MakeTab();
322 TEveWindowFrame* MakeFrame(TGFrame* frame=0);
324 TGCompositeFrame* StartEmbedding();
325 TEveWindowFrame* StopEmbedding(
const char* name=0);
327 ClassDef(TEveWindowSlot, 0);
335 class TEveWindowFrame :
public TEveWindow
338 TEveWindowFrame(
const TEveWindowFrame&);
339 TEveWindowFrame& operator=(
const TEveWindowFrame&);
345 TEveWindowFrame(TGFrame* frame,
const char* n=
"TEveWindowFrame",
const char* t=
"");
346 virtual ~TEveWindowFrame();
348 virtual TGFrame* GetGUIFrame() {
return fGUIFrame; }
350 TGCompositeFrame* GetGUICompositeFrame();
352 ClassDef(TEveWindowFrame, 0);
360 class TEveWindowPack :
public TEveWindow
363 TEveWindowPack(
const TEveWindowPack&);
364 TEveWindowPack& operator=(
const TEveWindowPack&);
370 TEveWindowPack(TGPack* p,
const char* n=
"TEveWindowPack",
const char* t=
"");
371 virtual ~TEveWindowPack();
373 virtual TGFrame* GetGUIFrame();
375 virtual Bool_t CanMakeNewSlots()
const {
return kTRUE; }
376 virtual TEveWindowSlot* NewSlotWithWeight(Float_t w);
377 virtual TEveWindowSlot* NewSlot();
379 void FlipOrientation();
380 void SetVertical(Bool_t x=kTRUE);
381 void SetHorizontal() { SetVertical(kFALSE); }
383 void EqualizeFrames();
385 TGPack* GetPack()
const {
return fPack; }
387 ClassDef(TEveWindowPack, 0);
395 class TEveWindowTab :
public TEveWindow
398 TEveWindowTab(
const TEveWindowTab&);
399 TEveWindowTab& operator=(
const TEveWindowTab&);
405 TEveWindowTab(TGTab* tab,
const char* n=
"TEveWindowTab",
const char* t=
"");
406 virtual ~TEveWindowTab();
408 virtual TGFrame* GetGUIFrame();
410 virtual Bool_t CanMakeNewSlots()
const {
return kTRUE; }
411 virtual TEveWindowSlot* NewSlot();
413 TGTab* GetTab()
const {
return fTab; }
415 ClassDef(TEveWindowTab, 0);
430 class TEveContextMenu :
public TContextMenu
433 TEveContextMenu(
const char *name,
const char *title =
"Eve context menu");
435 void SetupAndPopup(TGWindow* button, TObject* obj);
437 ClassDef(TEveContextMenu, 0)