KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVListView.h
Go to the documentation of this file.
1 /*
2 $Id: KVListView.h,v 1.5 2009/04/28 09:11:29 franklan Exp $
3 $Revision: 1.5 $
4 $Date: 2009/04/28 09:11:29 $
5 */
6 
9 
10 #ifndef __KVLISTVIEW_H
11 #define __KVLISTVIEW_H
12 
13 #include "TGListView.h"
14 #include "KVLVContainer.h"
15 #include "KVLVContainer.h"
16 #include "KVNumberList.h"
17 
145 class KVListView : public TGListView {
146 protected:
151 
152 public:
153  KVListView(TClass* obj_class, const TGWindow* p, UInt_t w, UInt_t h,
154  UInt_t options = kSunkenFrame | kDoubleBorder,
156  virtual ~KVListView() {}
157 
158  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
159  virtual void ActivateSortButtons(); // *MENU*
160  virtual void SetMaxColumnSize(UInt_t width)
161  {
163  }
164  virtual void SetDataColumns(Int_t ncolumns);
165  virtual void SetDataColumn(Int_t index, const Char_t* name, const Char_t* method = "",
166  Int_t mode = kTextCenterX);
167  virtual KVLVColumnData* GetDataColumn(Int_t index) const
168  {
169  return ((KVLVContainer*)GetContainer())->GetDataColumn(index);
170  }
171 
172  virtual void Display(const TCollection* l)
173  {
174  ((KVLVContainer*)GetContainer())->Display(l); // *MENU*
175  }
176  virtual void Sort(Int_t column)
177  {
179  ((KVLVContainer*)GetContainer())->Sort(column);
180  }
181  virtual void SelectAll()
182  {
184  }
185  virtual void UnSelectAll()
186  {
188  }
189  virtual void RemoveAll()
190  {
192  }
193  virtual Int_t GetColumnNumber(const Char_t* colname);
194  TGLVEntry* FindItemWithData(void* userData)
195  {
196  return ((KVLVContainer*)GetContainer())->FindItemWithData(userData);
197  }
198  void ActivateItemWithData(void* userData, Bool_t activate = kTRUE)
199  {
200  ((KVLVContainer*)GetContainer())->ActivateItemWithData(userData, activate);
201  }
202  TGLVEntry* FindItemWithColumnData(const Char_t* colname, const Char_t* data)
203  {
204  return ((KVLVContainer*)GetContainer())->FindItemWithColumnData(colname, data);
205  }
207  {
208  return ((KVLVContainer*)GetContainer())->FindItemWithColumnData(colname, data);
209  }
211  {
212  return ((KVLVContainer*)GetContainer())->FindItemWithColumnData(colname, data);
213  }
214  void ActivateItemWithColumnData(const Char_t* colname, const Char_t* data, Bool_t activate = kTRUE)
215  {
216  ((KVLVContainer*)GetContainer())->ActivateItemWithColumnData(colname, data, activate);
217  }
218  void ActivateItemWithColumnData(const Char_t* colname, Long_t data, Bool_t activate = kTRUE)
219  {
220  ((KVLVContainer*)GetContainer())->ActivateItemWithColumnData(colname, data, activate);
221  }
222  void ActivateItemWithColumnData(const Char_t* colname, Double_t data, Bool_t activate = kTRUE)
223  {
224  ((KVLVContainer*)GetContainer())->ActivateItemWithColumnData(colname, data, activate);
225  }
226  void ActivateItemsWithColumnData(const Char_t* colname, KVNumberList data, Bool_t activate = kTRUE)
227  {
228  ((KVLVContainer*)GetContainer())->ActivateItemsWithColumnData(colname, data, activate);
229  }
231  {
232  return ((KVLVContainer*)GetContainer())->GetLastSelectedObject();
233  }
235  {
236  return ((KVLVContainer*)GetContainer())->GetLastSelectedItem();
237  }
239  {
242  return ((KVLVContainer*)GetContainer())->GetSelectedItems();
243  }
245  {
248  return ((KVLVContainer*)GetContainer())->GetSelectedObjects();
249  }
251  {
254  return ((KVLVContainer*)GetContainer())->GetPickOrderedSelectedObjects();
255  }
257  {
259  return ((KVLVContainer*)GetContainer())->GetUserItems();
260  }
262  {
264  return ((KVLVContainer*)GetContainer())->GetFirstInList();
265  }
267  {
269  return ((KVLVContainer*)GetContainer())->GetLastInList();
270  }
271  void AllowDoubleClick(Bool_t on = kTRUE)
272  {
275  }
276  void SetDoubleClickAction(const char* receiver_class, void* receiver, const char* slot);
277  void AllowBrowse(Bool_t on = kTRUE)
278  {
280  AllowDoubleClick(on);
281  }
282  void AllowContextMenu(Bool_t on = kTRUE)
283  {
286  }
288  virtual void SetDefaultColumnWidth(TGVFileSplitter* splitter);
289 
290  void AllowMultipleSelection(Bool_t yes = kTRUE)
291  {
292  ((TGLVContainer*)GetContainer())->SetMultipleSelection(yes);
293  }
295  {
296  return ((TGLVContainer*)GetContainer())->GetMultipleSelection();
297  }
298 
299  void SetUseObjLabelAsRealClass(Bool_t yes = kTRUE);
300 
302  {
303  return fObjClass;
304  };
306  {
307  fObjClass = cl;
309  }
310 
311  ClassDef(KVListView, 0) //Slightly modified TGListView
312 };
313 
314 #endif
int Int_t
unsigned int UInt_t
long Long_t
ULong_t Pixel_t
char Char_t
bool Bool_t
double Double_t
#define ClassDef(name, id)
include TDocParser_001 C image html pict1_TDocParser_001 png width
Utility class describing the data used to fill each column of the list view container.
Definition: KVLVContainer.h:31
Extension of TGLVContainer for KVListView widget.
Enhanced version of ROOT TGListView widget.
Definition: KVListView.h:145
virtual void ActivateSortButtons()
Definition: KVListView.cpp:72
virtual void SelectAll()
Definition: KVListView.h:181
virtual void SetDataColumns(Int_t ncolumns)
Definition: KVListView.cpp:91
virtual void Sort(Int_t column)
Definition: KVListView.h:176
void SetDoubleClickAction(const char *receiver_class, void *receiver, const char *slot)
Definition: KVListView.cpp:210
TObject * GetLastInList() const
Definition: KVListView.h:266
void ActivateItemWithColumnData(const Char_t *colname, Long_t data, Bool_t activate=kTRUE)
Definition: KVListView.h:218
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Handle messages generated by the list view container.
Definition: KVListView.cpp:47
void AllowBrowse(Bool_t on=kTRUE)
Definition: KVListView.h:277
virtual void UnSelectAll()
Definition: KVListView.h:185
virtual KVLVColumnData * GetDataColumn(Int_t index) const
Definition: KVListView.h:167
virtual void Display(const TCollection *l)
Definition: KVListView.h:172
virtual ~KVListView()
Definition: KVListView.h:156
void SetObjClass(TClass *cl)
Definition: KVListView.h:305
virtual void SetMaxColumnSize(UInt_t width)
Definition: KVListView.h:160
TObject * GetLastSelectedObject() const
Definition: KVListView.h:230
KVListView(TClass *obj_class, const TGWindow *p, UInt_t w, UInt_t h, UInt_t options=kSunkenFrame|kDoubleBorder, Pixel_t back=GetDefaultFrameBackground())
Definition: KVListView.cpp:24
TGLVEntry * FindItemWithData(void *userData)
Definition: KVListView.h:194
TCollection * GetUserItems()
Definition: KVListView.h:256
virtual void SetDefaultColumnWidth(TGVFileSplitter *splitter)
Definition: KVListView.cpp:145
void ActivateItemsWithColumnData(const Char_t *colname, KVNumberList data, Bool_t activate=kTRUE)
Definition: KVListView.h:226
void ActivateItemWithColumnData(const Char_t *colname, Double_t data, Bool_t activate=kTRUE)
Definition: KVListView.h:222
UInt_t fMaxColumnSize
maximum width of columns
Definition: KVListView.h:149
void AddContextMenuClassException(TClass *)
Definition: KVListView.cpp:235
TList * GetSelectedItems() const
Definition: KVListView.h:238
TGLVEntry * FindItemWithColumnData(const Char_t *colname, Long_t data)
Definition: KVListView.h:206
virtual Int_t GetColumnNumber(const Char_t *colname)
Definition: KVListView.cpp:124
TGLVEntry * GetLastSelectedItem() const
Definition: KVListView.h:234
KVList * GetPickOrderedSelectedObjects() const
Definition: KVListView.h:250
int nselected
number of selected items
Definition: KVListView.h:147
void ActivateItemWithColumnData(const Char_t *colname, const Char_t *data, Bool_t activate=kTRUE)
Definition: KVListView.h:214
TClass * GetObjClass() const
Definition: KVListView.h:301
TList * GetSelectedObjects() const
Definition: KVListView.h:244
TClass * fObjClass
class of objects in list
Definition: KVListView.h:148
TObject * GetFirstInList() const
Definition: KVListView.h:261
virtual void RemoveAll()
Definition: KVListView.h:189
TGLVEntry * FindItemWithColumnData(const Char_t *colname, Double_t data)
Definition: KVListView.h:210
TContextMenu * fContextMenu
Definition: KVListView.h:150
void AllowMultipleSelection(Bool_t yes=kTRUE)
Definition: KVListView.h:290
void AllowDoubleClick(Bool_t on=kTRUE)
Definition: KVListView.h:271
void AllowContextMenu(Bool_t on=kTRUE)
Definition: KVListView.h:282
Bool_t GetMultipleSelection() const
Definition: KVListView.h:294
TGLVEntry * FindItemWithColumnData(const Char_t *colname, const Char_t *data)
Definition: KVListView.h:202
virtual void SetDataColumn(Int_t index, const Char_t *name, const Char_t *method="", Int_t mode=kTextCenterX)
Definition: KVListView.cpp:106
void ActivateItemWithData(void *userData, Bool_t activate=kTRUE)
Definition: KVListView.h:198
void SetUseObjLabelAsRealClass(Bool_t yes=kTRUE)
Definition: KVListView.cpp:189
Extended TList class which owns its objects by default.
Definition: KVList.h:27
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:83
TGFrame * GetContainer() const
static Pixel_t GetDefaultFrameBackground()
const long double cl
Definition: KVUnits.h:85
auto * l