File indexing completed on 2025-01-18 10:12:31
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TTVLVContainer
0013 #define ROOT_TTVLVContainer
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 #include "TGListView.h"
0027
0028
0029 class TGLabel;
0030 class TGTextEntry;
0031 class TTreeViewer;
0032 class TGToolTip;
0033 class TTVLVEntry;
0034 class TTVLVContainer;
0035
0036 class TGItemContext : public TObject {
0037
0038 protected:
0039 TTVLVEntry *fItem;
0040 public:
0041 TGItemContext();
0042 ~TGItemContext() override { }
0043 void Associate(TTVLVEntry *item) { fItem = item; }
0044 void Delete(Option_t *) override { }
0045 void Draw(Option_t *option="") override;
0046 void EditExpression();
0047 void Empty();
0048 void RemoveItem();
0049 void Scan();
0050 void SetExpression(const char *name="", const char *alias="-empty-", bool cut=false);
0051
0052 ClassDefOverride(TGItemContext, 0)
0053 };
0054
0055
0056 class TTVLVEntry : public TGLVEntry {
0057
0058 protected:
0059 TTVLVContainer *fContainer;
0060 TString fTrueName;
0061 TString fAlias;
0062 TString fConvName;
0063 TGToolTip *fTip;
0064 bool fIsCut;
0065 TGItemContext *fContext;
0066
0067 protected:
0068 bool FullConverted();
0069
0070 public:
0071 TTVLVEntry(const TGWindow *p,
0072 const TGPicture *bigpic, const TGPicture *smallpic,
0073 TGString *name, TGString **subnames, EListViewMode ViewMode);
0074 ~TTVLVEntry() override;
0075 const char *ConvertAliases();
0076 void CopyItem(TTVLVEntry *dest);
0077 const char *GetAlias() {return fAlias.Data();}
0078 TTVLVContainer *GetContainer() {return fContainer;}
0079 TGItemContext *GetContext() {return fContext;}
0080 const char *GetConvName() {return fConvName;}
0081 const char *GetTrueName() {return fTrueName.Data();}
0082 TGToolTip *GetTip() {return fTip;}
0083 bool HandleCrossing(Event_t *event) override;
0084 bool HasAlias();
0085 bool IsCut() {return fIsCut;}
0086 void PrependTilde();
0087 void SetCutType(bool type=false);
0088 void SetItemName(const char* name);
0089 void SetAlias(const char* alias) {fAlias = alias;}
0090 void SetExpression(const char* name, const char* alias, bool cutType=false);
0091 void SetTrueName(const char* name) {fTrueName = name;}
0092 void SetToolTipText(const char *text, Long_t delayms = 1000);
0093 void SetSmallPic(const TGPicture *spic);
0094 void Empty();
0095
0096 ClassDefOverride(TTVLVEntry,0)
0097 };
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110 class TTVLVContainer : public TGLVContainer {
0111
0112 friend class TGClient;
0113
0114 private:
0115 Cursor_t fCursor;
0116 Cursor_t fDefaultCursor;
0117 TGListView *fListView;
0118 TTreeViewer *fViewer;
0119 TList *fExpressionList;
0120
0121 public:
0122 TTVLVContainer(const TGWindow *p, UInt_t w, UInt_t h, UInt_t options=kSunkenFrame);
0123 ~TTVLVContainer() override;
0124 virtual void AddThisItem(TTVLVEntry *item)
0125 { AddFrame(item, fItemLayout); item->SetColumns(fCpos, fJmode); }
0126 const char *Cut();
0127 void EmptyAll();
0128 TTVLVEntry *ExpressionItem(Int_t index);
0129 TList *ExpressionList();
0130 const char *Ex();
0131 const char *Ey();
0132 const char *Ez();
0133 TTreeViewer *GetViewer() {return fViewer;}
0134 void SetListView(TGListView *lv) override {fListView = lv;}
0135 void SetViewer(TTreeViewer *viewer) {fViewer = viewer;}
0136 void RemoveNonStatic();
0137 const char *ScanList();
0138 void SelectItem(const char* name);
0139 bool HandleButton(Event_t *event) override;
0140 bool HandleMotion(Event_t *event) override;
0141
0142 ClassDefOverride(TTVLVContainer,0)
0143 };
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157 class TGSelectBox : public TGTransientFrame {
0158
0159 private:
0160 TTreeViewer *fViewer;
0161 TGLabel *fLabel;
0162 TTVLVEntry *fEntry;
0163 TGTextEntry *fTe;
0164 TGLabel *fLabelAlias;
0165 TGTextEntry *fTeAlias;
0166 TString fOldAlias;
0167 TGLayoutHints *fLayout;
0168 TGLayoutHints *fBLayout;
0169 TGLayoutHints *fBLayout1;
0170 TGHorizontalFrame *fBf;
0171 TGTextButton *fDONE;
0172 TGTextButton *fCANCEL;
0173
0174 protected:
0175 static TGSelectBox *fgInstance;
0176
0177 public:
0178 TGSelectBox(const TGWindow *p, const TGWindow *main, UInt_t w = 10, UInt_t h = 10);
0179 ~TGSelectBox() override;
0180 void CloseWindow() override;
0181 TTVLVEntry *EditedEntry() {return fEntry;}
0182 void GrabPointer();
0183 void SetLabel(const char* title);
0184 void SetEntry(TTVLVEntry *entry);
0185 void SaveText();
0186 void InsertText(const char* text);
0187 bool ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override;
0188 bool ValidateAlias();
0189
0190 static TGSelectBox *GetInstance();
0191
0192 ClassDefOverride(TGSelectBox,0)
0193 };
0194
0195 #endif