00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGSplitter
00013 #define ROOT_TGSplitter
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef ROOT_TGFrame
00027 #include "TGFrame.h"
00028 #endif
00029
00030
00031 class TGSplitter : public TGFrame {
00032
00033 protected:
00034 Cursor_t fSplitCursor;
00035 Bool_t fDragging;
00036 Bool_t fExternalHandler;
00037 const TGPicture *fSplitterPic;
00038
00039 private:
00040 TGSplitter(const TGSplitter&);
00041 TGSplitter& operator=(const TGSplitter&);
00042
00043 public:
00044 TGSplitter(const TGWindow *p = 0, UInt_t w = 2, UInt_t h = 4,
00045 UInt_t options = kChildFrame,
00046 Pixel_t back = GetDefaultFrameBackground());
00047 virtual ~TGSplitter() { }
00048
00049 virtual void SetFrame(TGFrame *frame, Bool_t prev) = 0;
00050
00051 virtual Bool_t HandleButton(Event_t *event) = 0;
00052 virtual Bool_t HandleMotion(Event_t *event) = 0;
00053 virtual Bool_t HandleCrossing(Event_t *event) = 0;
00054
00055 void DragStarted();
00056 void Moved(Int_t delta);
00057
00058 Bool_t GetExternalHandler() const { return fExternalHandler; }
00059 void SetExternalHandler(Bool_t x) { fExternalHandler = x; }
00060
00061 ClassDef(TGSplitter,0)
00062 };
00063
00064
00065 class TGVSplitter : public TGSplitter {
00066
00067 private:
00068 TGVSplitter(const TGVSplitter&);
00069 TGVSplitter& operator=(const TGVSplitter&);
00070
00071 protected:
00072 Int_t fStartX;
00073 UInt_t fFrameWidth;
00074 UInt_t fFrameHeight;
00075 Int_t fMin;
00076 Int_t fMax;
00077 TGFrame *fFrame;
00078 Bool_t fLeft;
00079
00080 public:
00081 TGVSplitter(const TGWindow *p = 0, UInt_t w = 4, UInt_t h = 4,
00082 UInt_t options = kChildFrame,
00083 Pixel_t back = GetDefaultFrameBackground());
00084 TGVSplitter(const TGWindow *p, UInt_t w, UInt_t h, Bool_t external);
00085 virtual ~TGVSplitter();
00086
00087 virtual void DrawBorder();
00088 virtual void SetFrame(TGFrame *frame, Bool_t left);
00089 const TGFrame *GetFrame() const { return fFrame; }
00090 Bool_t GetLeft() const { return fLeft; }
00091 Bool_t IsLeft() const { return fLeft; }
00092 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00093
00094 virtual Bool_t HandleButton(Event_t *event);
00095 virtual Bool_t HandleMotion(Event_t *event);
00096 virtual Bool_t HandleCrossing(Event_t *event);
00097
00098 ClassDef(TGVSplitter,0)
00099 };
00100
00101
00102 class TGHSplitter : public TGSplitter {
00103
00104 private:
00105 TGHSplitter(const TGHSplitter&);
00106 TGHSplitter& operator=(const TGHSplitter&);
00107
00108 protected:
00109 Int_t fStartY;
00110 UInt_t fFrameWidth;
00111 UInt_t fFrameHeight;
00112 Int_t fMin;
00113 Int_t fMax;
00114 TGFrame *fFrame;
00115 Bool_t fAbove;
00116
00117 public:
00118 TGHSplitter(const TGWindow *p = 0, UInt_t w = 4, UInt_t h = 4,
00119 UInt_t options = kChildFrame,
00120 Pixel_t back = GetDefaultFrameBackground());
00121 TGHSplitter(const TGWindow *p, UInt_t w, UInt_t h, Bool_t external);
00122 virtual ~TGHSplitter();
00123
00124 virtual void DrawBorder();
00125 virtual void SetFrame(TGFrame *frame, Bool_t above);
00126 const TGFrame *GetFrame() const { return fFrame; }
00127 Bool_t GetAbove() const { return fAbove; }
00128 Bool_t IsAbove() const { return fAbove; }
00129 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00130
00131 virtual Bool_t HandleButton(Event_t *event);
00132 virtual Bool_t HandleMotion(Event_t *event);
00133 virtual Bool_t HandleCrossing(Event_t *event);
00134
00135 ClassDef(TGHSplitter,0)
00136 };
00137
00138 class TGVFileSplitter : public TGVSplitter {
00139
00140 public:
00141 TGVFileSplitter(const TGWindow *p = 0, UInt_t w = 4, UInt_t h = 4,
00142 UInt_t options = kChildFrame,
00143 Pixel_t back = GetDefaultFrameBackground());
00144 virtual ~TGVFileSplitter();
00145
00146 virtual Bool_t HandleDoubleClick(Event_t *);
00147 virtual Bool_t HandleButton(Event_t *event);
00148 virtual Bool_t HandleMotion(Event_t *event);
00149 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00150
00151 void LayoutHeader(TGFrame *f);
00152 void LayoutListView();
00153 void ButtonPressed();
00154 void ButtonReleased();
00155 void DoubleClicked(TGVFileSplitter* frame);
00156
00157 ClassDef(TGVFileSplitter,0)
00158 };
00159
00160
00161 #endif