00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TTVLVContainer
00013 #define ROOT_TTVLVContainer
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef ROOT_TGListView
00027 #include "TGListView.h"
00028 #endif
00029
00030
00031 class TGLabel;
00032 class TGTextEntry;
00033 class TTreeViewer;
00034 class TGToolTip;
00035 class TTVLVEntry;
00036 class TTVLVContainer;
00037
00038 class TGItemContext : public TObject {
00039
00040 protected:
00041 TTVLVEntry *fItem;
00042 public:
00043 TGItemContext();
00044 virtual ~TGItemContext() { }
00045 void Associate(TTVLVEntry *item) { fItem = item; }
00046 virtual void Delete(Option_t *) { }
00047 void Draw(Option_t *option="");
00048 void EditExpression();
00049 void Empty();
00050 void RemoveItem();
00051 void Scan();
00052 void SetExpression(const char *name="", const char *alias="-empty-", Bool_t cut=kFALSE);
00053
00054 ClassDef(TGItemContext, 0)
00055 };
00056
00057
00058 class TTVLVEntry : public TGLVEntry {
00059
00060 protected:
00061 TTVLVContainer *fContainer;
00062 TString fTrueName;
00063 TString fAlias;
00064 TString fConvName;
00065 TGToolTip *fTip;
00066 Bool_t fIsCut;
00067 TGItemContext *fContext;
00068
00069 protected:
00070 Bool_t FullConverted();
00071
00072 public:
00073 TTVLVEntry(const TGWindow *p,
00074 const TGPicture *bigpic, const TGPicture *smallpic,
00075 TGString *name, TGString **subnames, EListViewMode ViewMode);
00076 virtual ~TTVLVEntry();
00077 const char *ConvertAliases();
00078 void CopyItem(TTVLVEntry *dest);
00079 const char *GetAlias() {return fAlias.Data();}
00080 TTVLVContainer *GetContainer() {return fContainer;}
00081 TGItemContext *GetContext() {return fContext;}
00082 const char *GetConvName() {return fConvName;}
00083 const char *GetTrueName() {return fTrueName.Data();}
00084 TGToolTip *GetTip() {return fTip;}
00085 virtual Bool_t HandleCrossing(Event_t *event);
00086 Bool_t HasAlias();
00087 Bool_t IsCut() {return fIsCut;}
00088 void PrependTilde();
00089 void SetCutType(Bool_t type=kFALSE);
00090 void SetItemName(const char* name);
00091 void SetAlias(const char* alias) {fAlias = alias;}
00092 void SetExpression(const char* name, const char* alias, Bool_t cutType=kFALSE);
00093 void SetTrueName(const char* name) {fTrueName = name;}
00094 void SetToolTipText(const char *text, Long_t delayms = 1000);
00095 void SetSmallPic(const TGPicture *spic);
00096 void Empty();
00097
00098 ClassDef(TTVLVEntry,0)
00099 };
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112 class TTVLVContainer : public TGLVContainer {
00113
00114 friend class TGClient;
00115
00116 private:
00117 Cursor_t fCursor;
00118 Cursor_t fDefaultCursor;
00119 TGListView *fListView;
00120 TTreeViewer *fViewer;
00121 TList *fExpressionList;
00122 public:
00123 TTVLVContainer(const TGWindow *p, UInt_t w, UInt_t h, UInt_t options=kSunkenFrame);
00124 virtual ~TTVLVContainer();
00125 virtual void AddThisItem(TTVLVEntry *item)
00126 { AddFrame(item, fItemLayout); item->SetColumns(fCpos, fJmode); }
00127 const char *Cut();
00128 void EmptyAll();
00129 TTVLVEntry *ExpressionItem(Int_t index);
00130 TList *ExpressionList();
00131 const char *Ex();
00132 const char *Ey();
00133 const char *Ez();
00134 TTreeViewer *GetViewer() {return fViewer;}
00135 void SetListView(TGListView *lv) {fListView = lv;}
00136 void SetViewer(TTreeViewer *viewer) {fViewer = viewer;}
00137 void RemoveNonStatic();
00138 const char *ScanList();
00139 void SelectItem(const char* name);
00140 virtual Bool_t HandleButton(Event_t *event);
00141 virtual Bool_t HandleMotion(Event_t *event);
00142
00143 ClassDef(TTVLVContainer,0)
00144 };
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158 class TGSelectBox : public TGTransientFrame {
00159
00160 private:
00161 TTreeViewer *fViewer;
00162 TGLabel *fLabel;
00163 TTVLVEntry *fEntry;
00164 TGTextEntry *fTe;
00165 TGLabel *fLabelAlias;
00166 TGTextEntry *fTeAlias;
00167 TString fOldAlias;
00168 TGLayoutHints *fLayout;
00169 TGLayoutHints *fBLayout;
00170 TGLayoutHints *fBLayout1;
00171 TGHorizontalFrame *fBf;
00172 TGTextButton *fDONE;
00173 TGTextButton *fCANCEL;
00174
00175 protected:
00176 static TGSelectBox *fgInstance;
00177
00178 public:
00179 TGSelectBox(const TGWindow *p, const TGWindow *main, UInt_t w = 10, UInt_t h = 10);
00180 virtual ~TGSelectBox();
00181 virtual void CloseWindow();
00182 TTVLVEntry *EditedEntry() {return fEntry;}
00183 void GrabPointer();
00184 void SetLabel(const char* title);
00185 void SetEntry(TTVLVEntry *entry);
00186 void SaveText();
00187 void InsertText(const char* text);
00188 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00189 Bool_t ValidateAlias();
00190
00191 static TGSelectBox *GetInstance();
00192
00193 ClassDef(TGSelectBox,0)
00194 };
00195
00196 #endif