Warning, file /include/root/TGDockableFrame.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_TGDockableFrame
0013 #define ROOT_TGDockableFrame
0014
0015
0016 #include "TGFrame.h"
0017
0018 #include "TGWidget.h"
0019
0020 #include "TGButton.h"
0021
0022 #include "TGWindow.h"
0023
0024
0025 class TGDockableFrame;
0026
0027
0028 class TGDockButton : public TGButton {
0029 protected:
0030 Bool_t fMouseOn;
0031 ULong_t fNormBg;
0032 ULong_t fHiBg;
0033
0034 void DrawBorder() override;
0035 void DoRedraw() override;
0036
0037 public:
0038 TGDockButton(const TGCompositeFrame *p = nullptr, Int_t id = 1);
0039 ~TGDockButton() override;
0040
0041 Bool_t HandleCrossing(Event_t *event) override;
0042
0043 ClassDefOverride(TGDockButton,0)
0044 };
0045
0046
0047 class TGDockHideButton : public TGDockButton {
0048 protected:
0049 Int_t fAspectRatio;
0050
0051 void DoRedraw() override;
0052
0053 public:
0054 TGDockHideButton(const TGCompositeFrame *p = nullptr);
0055
0056 void SetAspectRatio(Int_t a) { fAspectRatio = a; DoRedraw(); }
0057
0058 ClassDefOverride(TGDockHideButton,0)
0059 };
0060
0061
0062 class TGUndockedFrame : public TGTransientFrame {
0063
0064 private:
0065 TGUndockedFrame(const TGUndockedFrame&) = delete;
0066 TGUndockedFrame& operator=(const TGUndockedFrame&) = delete;
0067
0068 protected:
0069 TGDockableFrame *fDockable;
0070
0071 public:
0072 TGUndockedFrame(const TGWindow *p = nullptr, TGDockableFrame *dockable = nullptr);
0073 ~TGUndockedFrame() override;
0074
0075 void FixSize();
0076 void CloseWindow() override;
0077
0078 ClassDefOverride(TGUndockedFrame,0)
0079 };
0080
0081
0082 class TGDockableFrame : public TGCompositeFrame, public TGWidget {
0083 friend class TGUndockedFrame;
0084
0085 private:
0086 TGDockableFrame(const TGDockableFrame&) = delete;
0087 TGDockableFrame& operator=(const TGDockableFrame&) = delete;
0088
0089 protected:
0090 Bool_t fHidden;
0091 Bool_t fEnableHide;
0092 Bool_t fEnableUndock;
0093 Bool_t fDeleted;
0094 Bool_t fFixedSize;
0095 TString fDockName;
0096 TGCompositeFrame *fContainer;
0097 TGCompositeFrame *fButtons;
0098 TGDockButton *fDockButton;
0099 TGDockHideButton *fHideButton;
0100 TGUndockedFrame *fFrame;
0101 TGLayoutHints *fHints;
0102 TGLayoutHints *fLb, *fLc;
0103
0104 public:
0105 TGDockableFrame(const TGWindow *p = nullptr, Int_t id = -1,
0106 UInt_t options = kHorizontalFrame);
0107 ~TGDockableFrame() override;
0108
0109 void AddFrame(TGFrame *f, TGLayoutHints *hints) override;
0110
0111 Bool_t ProcessMessage(Longptr_t, Longptr_t, Longptr_t) override;
0112 virtual void Docked() { Emit("Docked()"); }
0113 virtual void Undocked() { Emit("Undocked()"); }
0114
0115 void UndockContainer();
0116 void DockContainer(Int_t del = kTRUE);
0117
0118 void HideContainer();
0119 void ShowContainer();
0120
0121 void EnableUndock(Bool_t onoff);
0122 Bool_t EnableUndock() const { return fEnableUndock; }
0123 void EnableHide(Bool_t onoff);
0124 Bool_t EnableHide() const { return fEnableHide; }
0125
0126 void SetWindowName(const char *name) override;
0127
0128 Bool_t IsUndocked() const { return fFrame != nullptr; }
0129 Bool_t IsHidden() const { return fHidden; }
0130
0131 Bool_t IsFixedSize() const { return fFixedSize; }
0132 void SetFixedSize(Bool_t fixed) { fFixedSize = fixed; }
0133
0134 TGCompositeFrame *GetContainer() const { return fContainer; }
0135 TGUndockedFrame *GetUndocked() const { return fFrame; }
0136
0137 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
0138
0139 ClassDefOverride(TGDockableFrame,0)
0140 };
0141
0142 #endif