00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGDockableFrame
00013 #define ROOT_TGDockableFrame
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef ROOT_TGFrame
00028 #include "TGFrame.h"
00029 #endif
00030
00031 #ifndef ROOT_TGWidget
00032 #include "TGWidget.h"
00033 #endif
00034
00035 #ifndef ROOT_TGButton
00036 #include "TGButton.h"
00037 #endif
00038
00039 #ifndef ROOT_TGWindow
00040 #include "TGWindow.h"
00041 #endif
00042
00043
00044 class TGDockableFrame;
00045
00046
00047 class TGDockButton : public TGButton {
00048 protected:
00049 Bool_t fMouseOn;
00050 ULong_t fNormBg;
00051 ULong_t fHiBg;
00052
00053 virtual void DrawBorder();
00054 virtual void DoRedraw();
00055
00056 public:
00057 TGDockButton(const TGCompositeFrame *p = 0, Int_t id = 1);
00058 virtual ~TGDockButton();
00059
00060 virtual Bool_t HandleCrossing(Event_t *event);
00061
00062 ClassDef(TGDockButton,0)
00063 };
00064
00065
00066 class TGDockHideButton : public TGDockButton {
00067 protected:
00068 Int_t fAspectRatio;
00069
00070 virtual void DoRedraw();
00071
00072 public:
00073 TGDockHideButton(const TGCompositeFrame *p = 0);
00074
00075 void SetAspectRatio(Int_t a) { fAspectRatio = a; DoRedraw(); }
00076
00077 ClassDef(TGDockHideButton,0)
00078 };
00079
00080
00081 class TGUndockedFrame : public TGTransientFrame {
00082
00083 private:
00084 TGUndockedFrame(const TGUndockedFrame&);
00085 TGUndockedFrame& operator=(const TGUndockedFrame&);
00086
00087 protected:
00088 TGDockableFrame *fDockable;
00089
00090 public:
00091 TGUndockedFrame(const TGWindow *p = 0, TGDockableFrame *dockable = 0);
00092 virtual ~TGUndockedFrame();
00093
00094 void FixSize();
00095 void CloseWindow();
00096
00097 ClassDef(TGUndockedFrame,0)
00098 };
00099
00100
00101 class TGDockableFrame : public TGCompositeFrame, public TGWidget {
00102 friend class TGUndockedFrame;
00103
00104 private:
00105 TGDockableFrame(const TGDockableFrame&);
00106 TGDockableFrame& operator=(const TGDockableFrame&);
00107
00108 protected:
00109 Bool_t fHidden;
00110 Bool_t fEnableHide;
00111 Bool_t fEnableUndock;
00112 Bool_t fDeleted;
00113 Bool_t fFixedSize;
00114 TString fDockName;
00115 TGCompositeFrame *fContainer;
00116 TGCompositeFrame *fButtons;
00117 TGDockButton *fDockButton;
00118 TGDockHideButton *fHideButton;
00119 TGUndockedFrame *fFrame;
00120 TGLayoutHints *fCl, *fHints;
00121 TGLayoutHints *fLb, *fLc;
00122
00123 public:
00124 TGDockableFrame(const TGWindow *p = 0, Int_t id = -1,
00125 UInt_t options = kHorizontalFrame);
00126 virtual ~TGDockableFrame();
00127
00128 virtual void AddFrame(TGFrame *f, TGLayoutHints *hints);
00129
00130 virtual Bool_t ProcessMessage(Long_t, Long_t, Long_t);
00131 virtual void Docked() { Emit("Docked()"); }
00132 virtual void Undocked() { Emit("Undocked()"); }
00133
00134 void UndockContainer();
00135 void DockContainer(Int_t del = kTRUE);
00136
00137 void HideContainer();
00138 void ShowContainer();
00139
00140 void EnableUndock(Bool_t onoff);
00141 Bool_t EnableUndock() const { return fEnableUndock; }
00142 void EnableHide(Bool_t onoff);
00143 Bool_t EnableHide() const { return fEnableHide; }
00144
00145 void SetWindowName(const char *name);
00146
00147 Bool_t IsUndocked() const { return (fFrame != 0); }
00148 Bool_t IsHidden() const { return fHidden; }
00149
00150 Bool_t IsFixedSize() const { return fFixedSize; }
00151 void SetFixedSize(Bool_t fixed) { fFixedSize = fixed; }
00152
00153 TGCompositeFrame *GetContainer() const { return fContainer; }
00154 TGUndockedFrame *GetUndocked() const { return fFrame; }
00155
00156 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00157
00158 ClassDef(TGDockableFrame,0)
00159 };
00160
00161 #endif