10#include "KVListView.h"
11#include "KVLVContainer.h"
71 fMethCall.Execute(obj,
"", i);
156 std::cout <<
"Error in <KVLVColumnData::GetDataString> : column " <<
fName <<
" : this type is not supported "
195 if (with_reference) {
215 return (d1 < d2 ? -1 : (d1 > d2 ? 1 : 0));
239 return (l1 < l2 ? -1 : (l1 > l2 ? 1 : 0));
251 return (l1 < l2 ? -1 : (l1 > l2 ? 1 : 0));
294 std::cout <<
"Error in <KVLVColumnData::Compare> : this type is not supported "
348 Connect(
"Clicked(TGFrame*,Int_t,Int_t,Int_t)",
349 "KVLVContainer",
this,
"OpenContextMenu(TGFrame*,Int_t,Int_t,Int_t)");
350 Connect(
"DoubleClicked(TGFrame*,Int_t,Int_t,Int_t)",
351 "KVLVContainer",
this,
"DoDoubleClick(TGFrame*,Int_t,Int_t,Int_t)");
397 for (
int i = 0; i <
fNcols; i++) {
471 if (list_of_objects->
GetEntries() > max_entries) {
474 Form(
"The list contains more than %d items. Do you want to display all items ?",
481 TIter next(list_of_objects);
483 while ((o = next()) && (
N++) < max_entries) list2.
Add(o);
548 if (
l && !
l->GetSize())
return;
553 while ((obj = nxt())) {
576 for (
int i = 0; i < ncols; i++) {
607 if (
f->GetUserData() == userData) {
630 if (
f->GetUserData() == userData) {
654 if (val ==
data)
return f;
674 if (val ==
data)
return f;
694 if (val ==
data)
return f;
739 printf(
"%ld\n",
data);
760 while (!
data.End()) {
1041 Connect(
"DoubleClickAction(TObject*)", receiver_class, receiver, slot);
1051 Emit(
"DoubleClickAction(TObject*)", (
Long_t)obj);
1072 else if (list->
GetSize() == 1) {
1122 Emit(
"SelectAll()");
const Mask_t kKeyControlMask
winID h TVirtualViewer3D TVirtualGLPainter p
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
char * Form(const char *fmt,...)
Base class for KaliVeda framework.
virtual TObject * GetObject() const
const Char_t * GetLabel() const
Extension of TDatime to handle various useful date formats.
const Char_t * String(EKVDateFormat fmt=kCTIME)
Utility class describing the data used to fill each column of the list view container.
TString fName
name used on button at top of column
Int_t Compare_double(TObject *o1, TObject *o2)
TMethodCall fMethCall
method call object
const Char_t * GetDataString(TObject *)
Format string with column data for object.
Int_t fRetType
return type of data retrieval method
KVDatime::EKVDateFormat fFmt
format for presenting date & time
Int_t Compare_date(TObject *o1, TObject *o2)
Int_t Compare(TObject *ob1, TObject *ob2)
Int_t Compare_long(TObject *o1, TObject *o2)
TString fDataFormat
format for displaying numerical data
TString result
string used to store object data
Int_t Compare_string(TObject *o1, TObject *o2)
virtual void SetIsDateTime(KVDatime::EKVDateFormat fmt=KVDatime::kCTIME, Bool_t with_reference=kTRUE)
void GetData(TObject *, Long_t &)
Bool_t fIsKVDatime
kTRUE if date & time is in KVDatime object, TDatime if not
Extension of TGLVContainer for KVListView widget.
void ActivateItemWithData(void *userData, Bool_t activate=kTRUE)
KVLVColumnData * fSortData
name of column (i.e. type of data) currently used to sort objects
virtual void FillList(const TCollection *=0)
void AddDataColumn(const char *columnName)
virtual void Display(const TCollection *=0)
void DoubleClickAction(TObject *)
TObject * GetFirstInList()
Returns first object in currently displayed list.
void ActivateItemsWithColumnData(const Char_t *colname, KVNumberList data, Bool_t activate=kTRUE)
TContextMenu * fContextMenu
used to display popup context menu for items
virtual ~KVLVContainer()
Destructor.
void OpenContextMenu(TGFrame *, Int_t, Int_t, Int_t)
Bool_t fUserDoubleClickAction
user-defined double-click action instead of Browse() method
void ActivateItemWithColumnData(const Char_t *colname, const Char_t *data, Bool_t activate=kTRUE)
Bool_t fAllowContextMenu
can objects' context menu be opened with right-click ?
Int_t fNcols
number of data columns
void DoDoubleClick(TGFrame *, Int_t, Int_t, Int_t)
Bool_t fUseObjLabelAsRealClass
if kTRUE, object's classname read from KVBase::GetLabel() (objects must be KVBase-derived!...
Bool_t fControlClick
set to kTRUE when user ctrl-clicks an item
TGLVEntry * FindItemWithColumnData(const Char_t *colname, const Char_t *data)
Bool_t fAllowDoubleClick
do something when object double-clicked ?
friend class KVLVFrameElement
TList * GetSelectedItems()
Bool_t fKeepUserItems
internal use only, do not clear list of user items in RemoveAll()
KVLVColumnData ** fColData
description of column data
virtual void SelectAll()
void SetNewColumnName(const char* columnName);
KVList * fUserItems
list of currently displayed items, used by Refresh()
void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add an item to the list.
KVLVContainer(const TGWindow *p=0, UInt_t w=1, UInt_t h=1, UInt_t options=kSunkenFrame, Pixel_t back=GetDefaultFrameBackground())
TObject * GetLastInList()
Returns last object in currently displayed list.
TList * GetSelectedObjects()
virtual void SetDataColumns(Int_t ncols)
void AddContextMenuClassException(TClass *)
Int_t fSortType
current sorting mode of contents (ascending or descending)
virtual void SetDataColumn(Int_t index, TClass *cl, const Char_t *name, const Char_t *method="")
void Sort(int column)
Sort objects in container according to contents of given column.
virtual void ActivateItemFromSelectAll(TGFrameElement *el)
Activate item.
TList * fContextMenuClassExceptions
list of classes for which we override value of fAllowContextMenu
void SetDoubleClickAction(const char *receiver_class, void *receiver, const char *slot)
Bool_t HandleButton(Event_t *event)
Override TGContainer method in order to set fControlClick flag.
TGLVEntry * FindItemWithData(void *userData)
Find item with fUserData == userData in container.
Int_t * fSortDir
direction of sorting for each column
KVList * fPickOrderedObjects
list of currently selected objects, in order of selection
Bool_t fIsResized
used to resize columns exactly once
One item/line in a KVListView window.
Extension of TGFrameElement used by KVLVContainer.
Bool_t IsSortable() const
KVLVContainer * fContainer
Int_t Compare(const TObject *obj) const
Method responsible for sorting the objects in the GUI list.
Enhanced version of ROOT TGListView widget.
Extended TList class which owns its objects by default.
Strings used to represent a set of ranges of values.
virtual TObject * FindObject(const char *name) const
virtual void AddLast(TObject *obj)
virtual void SetOwner(Bool_t enable=kTRUE)
virtual void Clear(Option_t *option="")
virtual void SetCleanup(Bool_t enable=kTRUE)
virtual void Add(TObject *obj)
virtual TObject * Remove(TObject *obj)
Remove object from list.
virtual Int_t GetEntries() const
virtual Int_t GetSize() const
virtual const char * GetValue(const char *name, const char *dflt) const
const char * GetReturnTypeName() const
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
void MapSubwindows() override
static TGLayoutHints * fgDefaultHints
virtual void Associate(const TGWindow *w)
const TGWindow * fMsgWindow
virtual void CurrentChanged(Int_t x, Int_t y)
virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
virtual TGPosition GetPagePosition() const
TGFrameElement * fLastActiveEl
virtual Bool_t IsActive() const
virtual void Activate(Bool_t)
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Bool_t HandleButton(Event_t *event) override
void SetMultipleSelection(Bool_t multi=kTRUE)
virtual void AddItem(TGLVEntry *item)
void DeActivateItem(TGFrameElement *el) override
void ActivateItem(TGFrameElement *el) override
TGListView * GetListView() const
Bool_t GetMultipleSelection() const
void * GetUserData() const
virtual void ResizeColumns()
virtual const TGWindow * GetMainFrame() const
const TGWindow * GetParent() const
void Clear(Option_t *option="") override
TObject * FindObject(const char *name) const override
void Add(TObject *obj) override
TObject * Last() const override
TObject * First() const override
virtual void Sort(Bool_t order=kSortAscending)
static const EReturnType kLong
static const EReturnType kString
static const EReturnType kDouble
virtual void Browse(TBrowser *b)
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
void Emit(const char *signal)
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
const char * Data() const
void Form(const char *fmt,...)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Column in an SQLite database.