KaliVeda
Toolkit for HIC analysis
KVListView.h
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 
146 class KVListView : public TGListView {
147 protected:
152 
153 public:
154  KVListView(TClass* obj_class, const TGWindow* p, UInt_t w, UInt_t h,
155  UInt_t options = kSunkenFrame | kDoubleBorder,
157  virtual ~KVListView() {}
158 
159  virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
160  virtual void ActivateSortButtons(); // *MENU*
161  virtual void SetMaxColumnSize(UInt_t width)
162  {
164  }
165  virtual void SetDataColumns(Int_t ncolumns);
166  virtual void SetDataColumn(Int_t index, const Char_t* name, const Char_t* method = "",
167  Int_t mode = kTextCenterX);
168  virtual KVLVColumnData* GetDataColumn(Int_t index) const
169  {
170  return ((KVLVContainer*)GetContainer())->GetDataColumn(index);
171  }
172 
173  virtual void Display(const TCollection* l)
174  {
175  ((KVLVContainer*)GetContainer())->Display(l); // *MENU*
176  }
177  virtual void Sort(Int_t column)
178  {
181  }
182  virtual void SelectAll()
183  {
185  }
186  virtual void UnSelectAll()
187  {
189  }
190  virtual void RemoveAll()
191  {
193  }
194  virtual Int_t GetColumnNumber(const Char_t* colname);
195  TGLVEntry* FindItemWithData(void* userData)
196  {
197  return ((KVLVContainer*)GetContainer())->FindItemWithData(userData);
198  }
199  void ActivateItemWithData(void* userData, Bool_t activate = kTRUE)
200  {
201  ((KVLVContainer*)GetContainer())->ActivateItemWithData(userData, activate);
202  }
203  TGLVEntry* FindItemWithColumnData(const Char_t* colname, const Char_t* data)
204  {
205  return ((KVLVContainer*)GetContainer())->FindItemWithColumnData(colname, data);
206  }
208  {
209  return ((KVLVContainer*)GetContainer())->FindItemWithColumnData(colname, data);
210  }
212  {
213  return ((KVLVContainer*)GetContainer())->FindItemWithColumnData(colname, data);
214  }
215  void ActivateItemWithColumnData(const Char_t* colname, const Char_t* data, Bool_t activate = kTRUE)
216  {
217  ((KVLVContainer*)GetContainer())->ActivateItemWithColumnData(colname, data, activate);
218  }
219  void ActivateItemWithColumnData(const Char_t* colname, Long_t data, Bool_t activate = kTRUE)
220  {
221  ((KVLVContainer*)GetContainer())->ActivateItemWithColumnData(colname, data, activate);
222  }
223  void ActivateItemWithColumnData(const Char_t* colname, Double_t data, Bool_t activate = kTRUE)
224  {
225  ((KVLVContainer*)GetContainer())->ActivateItemWithColumnData(colname, data, activate);
226  }
227  void ActivateItemsWithColumnData(const Char_t* colname, KVNumberList data, Bool_t activate = kTRUE)
228  {
229  ((KVLVContainer*)GetContainer())->ActivateItemsWithColumnData(colname, data, activate);
230  }
232  {
233  return ((KVLVContainer*)GetContainer())->GetLastSelectedObject();
234  }
236  {
237  return ((KVLVContainer*)GetContainer())->GetLastSelectedItem();
238  }
240  {
243  return ((KVLVContainer*)GetContainer())->GetSelectedItems();
244  }
246  {
249  return ((KVLVContainer*)GetContainer())->GetSelectedObjects();
250  }
252  {
255  return ((KVLVContainer*)GetContainer())->GetPickOrderedSelectedObjects();
256  }
258  {
260  return ((KVLVContainer*)GetContainer())->GetUserItems();
261  }
263  {
265  return ((KVLVContainer*)GetContainer())->GetFirstInList();
266  }
268  {
270  return ((KVLVContainer*)GetContainer())->GetLastInList();
271  }
272  void AllowDoubleClick(Bool_t on = kTRUE)
273  {
276  }
277  void SetDoubleClickAction(const char* receiver_class, void* receiver, const char* slot);
278  void AllowBrowse(Bool_t on = kTRUE)
279  {
282  }
283  void AllowContextMenu(Bool_t on = kTRUE)
284  {
287  }
289  virtual void SetDefaultColumnWidth(TGVFileSplitter* splitter);
290 
291  void AllowMultipleSelection(Bool_t yes = kTRUE)
292  {
293  ((TGLVContainer*)GetContainer())->SetMultipleSelection(yes);
294  }
296  {
297  return ((TGLVContainer*)GetContainer())->GetMultipleSelection();
298  }
299 
300  void SetUseObjLabelAsRealClass(Bool_t yes = kTRUE);
301 
303  {
304  return fObjClass;
305  };
306  void SetObjClass(TClass* cl)
307  {
308  fObjClass = cl;
310  }
311 
312  ClassDef(KVListView, 0) //Slightly modified TGListView
313 };
314 
315 #endif
int Int_t
unsigned int UInt_t
long Long_t
ULong_t Pixel_t
bool Bool_t
char Char_t
double Double_t
#define ClassDef(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t width
Utility class describing the data used to fill each column of the list view container.
Definition: KVLVContainer.h:32
Extension of TGLVContainer for KVListView widget.
Enhanced version of ROOT TGListView widget.
Definition: KVListView.h:146
virtual void ActivateSortButtons()
Definition: KVListView.cpp:72
virtual void SelectAll()
Definition: KVListView.h:182
virtual void SetDataColumns(Int_t ncolumns)
Definition: KVListView.cpp:91
virtual void Sort(Int_t column)
Definition: KVListView.h:177
void SetDoubleClickAction(const char *receiver_class, void *receiver, const char *slot)
Definition: KVListView.cpp:210
TObject * GetLastInList() const
Definition: KVListView.h:267
void ActivateItemWithColumnData(const Char_t *colname, Long_t data, Bool_t activate=kTRUE)
Definition: KVListView.h:219
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:278
virtual void UnSelectAll()
Definition: KVListView.h:186
virtual KVLVColumnData * GetDataColumn(Int_t index) const
Definition: KVListView.h:168
virtual void Display(const TCollection *l)
Definition: KVListView.h:173
virtual ~KVListView()
Definition: KVListView.h:157
void SetObjClass(TClass *cl)
Definition: KVListView.h:306
virtual void SetMaxColumnSize(UInt_t width)
Definition: KVListView.h:161
TObject * GetLastSelectedObject() const
Definition: KVListView.h:231
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:195
TCollection * GetUserItems()
Definition: KVListView.h:257
virtual void SetDefaultColumnWidth(TGVFileSplitter *splitter)
Definition: KVListView.cpp:145
void ActivateItemsWithColumnData(const Char_t *colname, KVNumberList data, Bool_t activate=kTRUE)
Definition: KVListView.h:227
void ActivateItemWithColumnData(const Char_t *colname, Double_t data, Bool_t activate=kTRUE)
Definition: KVListView.h:223
UInt_t fMaxColumnSize
maximum width of columns
Definition: KVListView.h:150
void AddContextMenuClassException(TClass *)
Definition: KVListView.cpp:235
TList * GetSelectedItems() const
Definition: KVListView.h:239
TGLVEntry * FindItemWithColumnData(const Char_t *colname, Long_t data)
Definition: KVListView.h:207
virtual Int_t GetColumnNumber(const Char_t *colname)
Definition: KVListView.cpp:124
TGLVEntry * GetLastSelectedItem() const
Definition: KVListView.h:235
KVList * GetPickOrderedSelectedObjects() const
Definition: KVListView.h:251
int nselected
number of selected items
Definition: KVListView.h:148
void ActivateItemWithColumnData(const Char_t *colname, const Char_t *data, Bool_t activate=kTRUE)
Definition: KVListView.h:215
TClass * GetObjClass() const
Definition: KVListView.h:302
TList * GetSelectedObjects() const
Definition: KVListView.h:245
TClass * fObjClass
class of objects in list
Definition: KVListView.h:149
TObject * GetFirstInList() const
Definition: KVListView.h:262
virtual void RemoveAll()
Definition: KVListView.h:190
TGLVEntry * FindItemWithColumnData(const Char_t *colname, Double_t data)
Definition: KVListView.h:211
TContextMenu * fContextMenu
Definition: KVListView.h:151
void AllowMultipleSelection(Bool_t yes=kTRUE)
Definition: KVListView.h:291
void AllowDoubleClick(Bool_t on=kTRUE)
Definition: KVListView.h:272
void AllowContextMenu(Bool_t on=kTRUE)
Definition: KVListView.h:283
Bool_t GetMultipleSelection() const
Definition: KVListView.h:295
TGLVEntry * FindItemWithColumnData(const Char_t *colname, const Char_t *data)
Definition: KVListView.h:203
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:199
void SetUseObjLabelAsRealClass(Bool_t yes=kTRUE)
Definition: KVListView.cpp:189
Extended TList class which owns its objects by default.
Definition: KVList.h:28
Strings used to represent a set of ranges of values.
Definition: KVNumberList.h:85
TGFrame * GetContainer() const
static Pixel_t GetDefaultFrameBackground()
Column in an SQLite database.
TLine l