#ifndef ROOT_TTVLVContainer
#define ROOT_TTVLVContainer
#ifndef ROOT_TGListView
#include "TGListView.h"
#endif
class TGLabel;
class TGTextEntry;
class TTreeViewer;
class TGToolTip;
class TTVLVEntry;
class TTVLVContainer;
class TGItemContext : public TObject {
protected:
TTVLVEntry *fItem;
public:
TGItemContext();
virtual ~TGItemContext() { }
void Associate(TTVLVEntry *item) { fItem = item; }
virtual void Delete(Option_t *) { }
void Draw(Option_t *option="");
void EditExpression();
void Empty();
void RemoveItem();
void Scan();
void SetExpression(const char *name="", const char *alias="-empty-", Bool_t cut=kFALSE);
ClassDef(TGItemContext, 0)
};
class TTVLVEntry : public TGLVEntry {
protected:
TTVLVContainer *fContainer;
TString fTrueName;
TString fAlias;
TString fConvName;
TGToolTip *fTip;
Bool_t fIsCut;
TGItemContext *fContext;
protected:
Bool_t FullConverted();
public:
TTVLVEntry(const TGWindow *p,
const TGPicture *bigpic, const TGPicture *smallpic,
TGString *name, TGString **subnames, EListViewMode ViewMode);
virtual ~TTVLVEntry();
const char *ConvertAliases();
void CopyItem(TTVLVEntry *dest);
const char *GetAlias() {return fAlias.Data();}
TTVLVContainer *GetContainer() {return fContainer;}
TGItemContext *GetContext() {return fContext;}
const char *GetConvName() {return fConvName;}
const char *GetTrueName() {return fTrueName.Data();}
TGToolTip *GetTip() {return fTip;}
virtual Bool_t HandleCrossing(Event_t *event);
Bool_t HasAlias();
Bool_t IsCut() {return fIsCut;}
void PrependTilde();
void SetCutType(Bool_t type=kFALSE);
void SetItemName(const char* name);
void SetAlias(const char* alias) {fAlias = alias;}
void SetExpression(const char* name, const char* alias, Bool_t cutType=kFALSE);
void SetTrueName(const char* name) {fTrueName = name;}
void SetToolTipText(const char *text, Long_t delayms = 1000);
void SetSmallPic(const TGPicture *spic);
void Empty();
ClassDef(TTVLVEntry,0)
};
class TTVLVContainer : public TGLVContainer {
friend class TGClient;
private:
Cursor_t fCursor;
Cursor_t fDefaultCursor;
TGListView *fListView;
TTreeViewer *fViewer;
TList *fExpressionList;
public:
TTVLVContainer(const TGWindow *p, UInt_t w, UInt_t h, UInt_t options=kSunkenFrame);
virtual ~TTVLVContainer();
virtual void AddThisItem(TTVLVEntry *item)
{ AddFrame(item, fItemLayout); item->SetColumns(fCpos, fJmode); }
const char *Cut();
void EmptyAll();
TTVLVEntry *ExpressionItem(Int_t index);
TList *ExpressionList();
const char *Ex();
const char *Ey();
const char *Ez();
TTreeViewer *GetViewer() {return fViewer;}
void SetListView(TGListView *lv) {fListView = lv;}
void SetViewer(TTreeViewer *viewer) {fViewer = viewer;}
void RemoveNonStatic();
const char *ScanList();
void SelectItem(const char* name);
virtual Bool_t HandleButton(Event_t *event);
virtual Bool_t HandleMotion(Event_t *event);
ClassDef(TTVLVContainer,0)
};
class TGSelectBox : public TGTransientFrame {
private:
TTreeViewer *fViewer;
TGLabel *fLabel;
TTVLVEntry *fEntry;
TGTextEntry *fTe;
TGLabel *fLabelAlias;
TGTextEntry *fTeAlias;
TString fOldAlias;
TGLayoutHints *fLayout;
TGLayoutHints *fBLayout;
TGLayoutHints *fBLayout1;
TGHorizontalFrame *fBf;
TGTextButton *fDONE;
TGTextButton *fCANCEL;
protected:
static TGSelectBox *fgInstance;
public:
TGSelectBox(const TGWindow *p, const TGWindow *main, UInt_t w = 10, UInt_t h = 10);
virtual ~TGSelectBox();
virtual void CloseWindow();
TTVLVEntry *EditedEntry() {return fEntry;}
void GrabPointer();
void SetLabel(const char* title);
void SetEntry(TTVLVEntry *entry);
void SaveText();
void InsertText(const char* text);
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
Bool_t ValidateAlias();
static TGSelectBox *GetInstance();
ClassDef(TGSelectBox,0)
};
#endif