Warning, file /include/root/TEveWindow.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TEveWindow
0013 #define ROOT_TEveWindow
0014
0015 #include "TEveElement.h"
0016
0017 #include "TGFrame.h"
0018 #include "TContextMenu.h"
0019
0020 class TEveWindow;
0021 class TEveWindowSlot;
0022 class TEveWindowFrame;
0023 class TEveWindowMainFrame;
0024 class TEveWindowPack;
0025 class TEveWindowTab;
0026 class TEveContextMenu;
0027
0028 class TGButton;
0029 class TGSplitButton;
0030 class TGTextButton;
0031
0032 class TGPack;
0033 class TGTab;
0034
0035
0036
0037
0038
0039 class TEveCompositeFrame : public TGCompositeFrame
0040 {
0041 friend class TEveWindow;
0042 friend class TEveWindowManager;
0043
0044 public:
0045 typedef TGFrame* (*IconBarCreator_foo)(TEveCompositeFrame*, TGCompositeFrame*, Int_t);
0046
0047 private:
0048 TEveCompositeFrame(const TEveCompositeFrame&);
0049 TEveCompositeFrame& operator=(const TEveCompositeFrame&);
0050
0051 static IconBarCreator_foo fgIconBarCreator;
0052 static UInt_t fgTopFrameHeight;
0053 static UInt_t fgMiniBarHeight;
0054 static Bool_t fgAllowTopFrameCollapse;
0055
0056 protected:
0057 TGCompositeFrame *fTopFrame;
0058 TGTextButton *fToggleBar;
0059 TGTextButton *fTitleBar;
0060 TGFrame *fIconBar;
0061 TGLayoutHints *fEveWindowLH;
0062
0063 TGFrame *fMiniBar;
0064
0065 TEveElement *fEveParent;
0066 TEveWindow *fEveWindow;
0067
0068 Bool_t fShowInSync;
0069
0070 static TEveContextMenu *fgCtxMenu;
0071 static const TString fgkEmptyFrameName;
0072
0073 static TList *fgFrameList;
0074
0075 public:
0076 TEveCompositeFrame(TGCompositeFrame* gui_parent, TEveWindow* eve_parent);
0077 ~TEveCompositeFrame() override;
0078
0079 virtual void WindowNameChanged(const TString& name);
0080
0081 virtual void Destroy() = 0;
0082
0083 virtual void AcquireEveWindow(TEveWindow* ew);
0084 virtual TEveWindow* RelinquishEveWindow(Bool_t reparent=kTRUE);
0085
0086 TEveWindow* GetEveWindow() const { return fEveWindow; }
0087 TEveWindow* GetEveParentAsWindow() const;
0088
0089 virtual void SetCurrent(Bool_t curr);
0090 virtual void SetShowTitleBar(Bool_t show);
0091 virtual void HideAllDecorations();
0092 virtual void ShowNormalDecorations();
0093
0094 void ActionPressed();
0095 void FlipTitleBarState();
0096 void TitleBarClicked();
0097
0098 static void SetupFrameMarkup(IconBarCreator_foo creator,
0099 UInt_t top_frame_height = 14,
0100 UInt_t mini_bar_height = 4,
0101 Bool_t allow_top_collapse = kTRUE);
0102
0103 ClassDefOverride(TEveCompositeFrame, 0);
0104 };
0105
0106
0107
0108
0109
0110
0111 class TEveCompositeFrameInMainFrame : public TEveCompositeFrame
0112 {
0113 private:
0114 TEveCompositeFrameInMainFrame(const TEveCompositeFrameInMainFrame&);
0115 TEveCompositeFrameInMainFrame& operator=(const TEveCompositeFrameInMainFrame&);
0116
0117 protected:
0118 TGMainFrame *fMainFrame;
0119 TEveWindow *fOriginalSlot;
0120 TEveWindow *fOriginalContainer;
0121
0122 public:
0123 TEveCompositeFrameInMainFrame(TGCompositeFrame* parent, TEveWindow* eve_parent,
0124 TGMainFrame* mf);
0125 ~TEveCompositeFrameInMainFrame() override;
0126
0127 void WindowNameChanged(const TString& name) override;
0128
0129 void Destroy() override;
0130
0131 void SetOriginalSlotAndContainer(TEveWindow* slot, TEveWindow* container);
0132
0133 void SomeWindowClosed(TEveWindow* w);
0134 void MainFrameClosed();
0135
0136 TEveWindow* GetOriginalSlot() const { return fOriginalSlot; }
0137 TEveWindow* GetOriginalContainer() const { return fOriginalContainer; }
0138
0139 ClassDefOverride(TEveCompositeFrameInMainFrame, 0);
0140 };
0141
0142
0143
0144
0145
0146
0147 class TEveCompositeFrameInPack : public TEveCompositeFrame
0148 {
0149 private:
0150 TEveCompositeFrameInPack(const TEveCompositeFrameInPack&);
0151 TEveCompositeFrameInPack& operator=(const TEveCompositeFrameInPack&);
0152
0153 protected:
0154 TGPack *fPack;
0155
0156 public:
0157 TEveCompositeFrameInPack(TGCompositeFrame* parent, TEveWindow* eve_parent,
0158 TGPack* pack);
0159 ~TEveCompositeFrameInPack() override;
0160
0161 void Destroy() override;
0162
0163 ClassDefOverride(TEveCompositeFrameInPack, 0);
0164 };
0165
0166
0167
0168
0169
0170
0171 class TEveCompositeFrameInTab : public TEveCompositeFrame
0172 {
0173 private:
0174 TEveCompositeFrameInTab(const TEveCompositeFrameInTab&);
0175 TEveCompositeFrameInTab& operator=(const TEveCompositeFrameInTab&);
0176
0177 protected:
0178 TGTab *fTab;
0179 TGCompositeFrame *fParentInTab;
0180
0181 Int_t FindTabIndex();
0182
0183 public:
0184 TEveCompositeFrameInTab(TGCompositeFrame* parent, TEveWindow* eve_parent,
0185 TGTab* tab);
0186 ~TEveCompositeFrameInTab() override;
0187
0188 void WindowNameChanged(const TString& name) override;
0189
0190 void Destroy() override;
0191
0192 void SetCurrent(Bool_t curr) override;
0193
0194 ClassDefOverride(TEveCompositeFrameInTab, 0);
0195 };
0196
0197
0198
0199
0200
0201
0202
0203
0204
0205
0206
0207
0208
0209 class TEveWindow : public TEveElementList
0210 {
0211 friend class TEveWindowManager;
0212
0213 private:
0214 TEveWindow(const TEveWindow&);
0215 TEveWindow& operator=(const TEveWindow&);
0216
0217 protected:
0218 TEveCompositeFrame *fEveFrame;
0219 Bool_t fShowTitleBar;
0220
0221 virtual void SetCurrent(Bool_t curr);
0222
0223 static UInt_t fgMainFrameDefWidth;
0224 static UInt_t fgMainFrameDefHeight;
0225
0226 static Pixel_t fgCurrentBackgroundColor;
0227 static Pixel_t fgMiniBarBackgroundColor;
0228
0229 void PreDeleteElement() override;
0230
0231 public:
0232 TEveWindow(const char* n="TEveWindow", const char* t="");
0233 ~TEveWindow() override;
0234
0235 void NameTitleChanged() override;
0236
0237 virtual TGFrame* GetGUIFrame() = 0;
0238 virtual void PreUndock();
0239 virtual void PostDock();
0240
0241 virtual Bool_t CanMakeNewSlots() const { return kFALSE; }
0242 virtual TEveWindowSlot* NewSlot() { return nullptr; }
0243
0244 void PopulateEmptyFrame(TEveCompositeFrame* ef);
0245
0246 void SwapWindow(TEveWindow* w);
0247 void SwapWindowWithCurrent();
0248
0249 void UndockWindow();
0250 void UndockWindowDestroySlot();
0251
0252 void ReplaceWindow(TEveWindow* w);
0253
0254 virtual void DestroyWindow();
0255 virtual void DestroyWindowAndSlot();
0256
0257 TEveCompositeFrame* GetEveFrame() { return fEveFrame; }
0258 void ClearEveFrame();
0259
0260 void FlipShowTitleBar() { SetShowTitleBar(!fShowTitleBar); }
0261 Bool_t GetShowTitleBar() const { return fShowTitleBar; }
0262 void SetShowTitleBar(Bool_t x);
0263
0264 Bool_t IsCurrent() const;
0265 void MakeCurrent();
0266
0267
0268 Bool_t IsAncestorOf(TEveWindow* win);
0269
0270 void TitleBarClicked();
0271
0272
0273
0274
0275 static TEveWindowSlot* CreateDefaultWindowSlot();
0276 static TEveWindowSlot* CreateWindowMainFrame(TEveWindow* eve_parent=nullptr);
0277 static TEveWindowSlot* CreateWindowInTab(TGTab* tab, TEveWindow* eve_parent=nullptr);
0278
0279 static void SwapWindows(TEveWindow* w1, TEveWindow* w2);
0280
0281
0282
0283 static UInt_t GetMainFrameDefWidth();
0284 static UInt_t GetMainFrameDefHeight();
0285 static void SetMainFrameDefWidth (UInt_t x);
0286 static void SetMainFrameDefHeight(UInt_t x);
0287
0288 static Pixel_t GetCurrentBackgroundColor();
0289 static Pixel_t GetMiniBarBackgroundColor();
0290 static void SetCurrentBackgroundColor(Pixel_t p);
0291 static void SetMiniBarBackgroundColor(Pixel_t p);
0292
0293 ClassDefOverride(TEveWindow, 0);
0294 };
0295
0296
0297
0298
0299
0300
0301 class TEveWindowSlot : public TEveWindow
0302 {
0303 private:
0304 TEveWindowSlot(const TEveWindowSlot&);
0305 TEveWindowSlot& operator=(const TEveWindowSlot&);
0306
0307 protected:
0308 TGTextButton *fEmptyButt;
0309 TGCompositeFrame *fEmbedBuffer;
0310
0311 void SetCurrent(Bool_t curr) override;
0312
0313 public:
0314 TEveWindowSlot(const char* n="TEveWindowSlot", const char* t="");
0315 ~TEveWindowSlot() override;
0316
0317 TGFrame* GetGUIFrame() override;
0318
0319 TEveWindowPack* MakePack();
0320 TEveWindowTab* MakeTab();
0321
0322 TEveWindowFrame* MakeFrame(TGFrame* frame=nullptr);
0323
0324 TGCompositeFrame* StartEmbedding();
0325 TEveWindowFrame* StopEmbedding(const char* name=nullptr);
0326
0327 ClassDefOverride(TEveWindowSlot, 0);
0328 };
0329
0330
0331
0332
0333
0334
0335 class TEveWindowFrame : public TEveWindow
0336 {
0337 private:
0338 TEveWindowFrame(const TEveWindowFrame&);
0339 TEveWindowFrame& operator=(const TEveWindowFrame&);
0340
0341 protected:
0342 TGFrame *fGUIFrame;
0343
0344 public:
0345 TEveWindowFrame(TGFrame* frame, const char* n="TEveWindowFrame", const char* t="");
0346 ~TEveWindowFrame() override;
0347
0348 TGFrame* GetGUIFrame() override { return fGUIFrame; }
0349
0350 TGCompositeFrame* GetGUICompositeFrame();
0351
0352 ClassDefOverride(TEveWindowFrame, 0);
0353 };
0354
0355
0356
0357
0358
0359
0360 class TEveWindowPack : public TEveWindow
0361 {
0362 private:
0363 TEveWindowPack(const TEveWindowPack&);
0364 TEveWindowPack& operator=(const TEveWindowPack&);
0365
0366 protected:
0367 TGPack *fPack;
0368
0369 public:
0370 TEveWindowPack(TGPack* p, const char* n="TEveWindowPack", const char* t="");
0371 ~TEveWindowPack() override;
0372
0373 TGFrame* GetGUIFrame() override;
0374
0375 Bool_t CanMakeNewSlots() const override { return kTRUE; }
0376 virtual TEveWindowSlot* NewSlotWithWeight(Float_t w);
0377 TEveWindowSlot* NewSlot() override;
0378
0379 void FlipOrientation();
0380 void SetVertical(Bool_t x=kTRUE);
0381 void SetHorizontal() { SetVertical(kFALSE); }
0382
0383 void EqualizeFrames();
0384
0385 TGPack* GetPack() const { return fPack; }
0386
0387 ClassDefOverride(TEveWindowPack, 0);
0388 };
0389
0390
0391
0392
0393
0394
0395 class TEveWindowTab : public TEveWindow
0396 {
0397 private:
0398 TEveWindowTab(const TEveWindowTab&);
0399 TEveWindowTab& operator=(const TEveWindowTab&);
0400
0401 protected:
0402 TGTab *fTab;
0403
0404 public:
0405 TEveWindowTab(TGTab* tab, const char* n="TEveWindowTab", const char* t="");
0406 ~TEveWindowTab() override;
0407
0408 TGFrame* GetGUIFrame() override;
0409
0410 Bool_t CanMakeNewSlots() const override { return kTRUE; }
0411 TEveWindowSlot* NewSlot() override;
0412
0413 TGTab* GetTab() const { return fTab; }
0414
0415 ClassDefOverride(TEveWindowTab, 0);
0416 };
0417
0418
0419
0420
0421
0422
0423
0424
0425
0426
0427
0428
0429
0430 class TEveContextMenu : public TContextMenu
0431 {
0432 public:
0433 TEveContextMenu(const char *name, const char *title = "Eve context menu");
0434
0435 void SetupAndPopup(TGWindow* button, TObject* obj);
0436
0437 ClassDefOverride(TEveContextMenu, 0)
0438 };
0439
0440 #endif