#ifndef ROOT_TGSplitter
#define ROOT_TGSplitter
#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif
class TGSplitter : public TGFrame {
protected:
Cursor_t fSplitCursor;
Bool_t fDragging;
Bool_t fExternalHandler;
const TGPicture *fSplitterPic;
private:
TGSplitter(const TGSplitter&);
TGSplitter& operator=(const TGSplitter&);
public:
TGSplitter(const TGWindow *p = 0, UInt_t w = 2, UInt_t h = 4,
UInt_t options = kChildFrame,
Pixel_t back = GetDefaultFrameBackground());
virtual ~TGSplitter() { }
virtual void SetFrame(TGFrame *frame, Bool_t prev) = 0;
virtual Bool_t HandleButton(Event_t *event) = 0;
virtual Bool_t HandleMotion(Event_t *event) = 0;
virtual Bool_t HandleCrossing(Event_t *event) = 0;
void DragStarted();
void Moved(Int_t delta);
Bool_t GetExternalHandler() const { return fExternalHandler; }
void SetExternalHandler(Bool_t x) { fExternalHandler = x; }
ClassDef(TGSplitter,0)
};
class TGVSplitter : public TGSplitter {
private:
TGVSplitter(const TGVSplitter&);
TGVSplitter& operator=(const TGVSplitter&);
protected:
Int_t fStartX;
UInt_t fFrameWidth;
UInt_t fFrameHeight;
Int_t fMin;
Int_t fMax;
TGFrame *fFrame;
Bool_t fLeft;
public:
TGVSplitter(const TGWindow *p = 0, UInt_t w = 4, UInt_t h = 4,
UInt_t options = kChildFrame,
Pixel_t back = GetDefaultFrameBackground());
TGVSplitter(const TGWindow *p, UInt_t w, UInt_t h, Bool_t external);
virtual ~TGVSplitter();
virtual void DrawBorder();
virtual void SetFrame(TGFrame *frame, Bool_t left);
const TGFrame *GetFrame() const { return fFrame; }
Bool_t GetLeft() const { return fLeft; }
Bool_t IsLeft() const { return fLeft; }
virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
virtual Bool_t HandleButton(Event_t *event);
virtual Bool_t HandleMotion(Event_t *event);
virtual Bool_t HandleCrossing(Event_t *event);
ClassDef(TGVSplitter,0)
};
class TGHSplitter : public TGSplitter {
private:
TGHSplitter(const TGHSplitter&);
TGHSplitter& operator=(const TGHSplitter&);
protected:
Int_t fStartY;
UInt_t fFrameWidth;
UInt_t fFrameHeight;
Int_t fMin;
Int_t fMax;
TGFrame *fFrame;
Bool_t fAbove;
public:
TGHSplitter(const TGWindow *p = 0, UInt_t w = 4, UInt_t h = 4,
UInt_t options = kChildFrame,
Pixel_t back = GetDefaultFrameBackground());
TGHSplitter(const TGWindow *p, UInt_t w, UInt_t h, Bool_t external);
virtual ~TGHSplitter();
virtual void DrawBorder();
virtual void SetFrame(TGFrame *frame, Bool_t above);
const TGFrame *GetFrame() const { return fFrame; }
Bool_t GetAbove() const { return fAbove; }
Bool_t IsAbove() const { return fAbove; }
virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
virtual Bool_t HandleButton(Event_t *event);
virtual Bool_t HandleMotion(Event_t *event);
virtual Bool_t HandleCrossing(Event_t *event);
ClassDef(TGHSplitter,0)
};
class TGVFileSplitter : public TGVSplitter {
public:
TGVFileSplitter(const TGWindow *p = 0, UInt_t w = 4, UInt_t h = 4,
UInt_t options = kChildFrame,
Pixel_t back = GetDefaultFrameBackground());
virtual ~TGVFileSplitter();
virtual Bool_t HandleDoubleClick(Event_t *);
virtual Bool_t HandleButton(Event_t *event);
virtual Bool_t HandleMotion(Event_t *event);
virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
void LayoutHeader(TGFrame *f);
void LayoutListView();
void ButtonPressed();
void ButtonReleased();
void DoubleClicked(TGVFileSplitter* frame);
ClassDef(TGVFileSplitter,0)
};
#endif