KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches

Detailed Description

Enhanced version of ROOT TGListView widget.

Created by KVClassFactory on Wed Apr 9 11:51:38 2008 Author: franklan

Example of use

KVListView takes a list of objects (TObject or derived class) and presents them as a list of items with different data for each object presented in separate columns.
The user specifies the common base-class of the objects to display, the number of columns, and the data to be presented in each column.
The example in the figure shown above (displaying a list of KVDBRun objects) was generated with the following code:

   lvRuns = new KVListView(KVDBRunClass(), cfRuns, 500, 250); // 'cfRuns' is pointer to parent frame

   lvRuns->SetDataColumns(4);   //set number of columns to 4

   lvRuns->SetDataColumn(0, "Run", "GetNumber");       //by default, the data presented in a column with title "Toto" will be retrieved
   lvRuns->SetDataColumn(1, "Events", "", kTextRight);      //from each object by calling the "GetToto" method of the class given to the KVListView ctor.
   lvRuns->SetDataColumn(2, "Date", "GetDatime");      //in case the "getter" method has a non-standard name, it can be given explicitly.

   lvRuns->GetDataColumn(2)->SetIsDateTime();      //some special treatment is afforded to date/time data. see method doc.
   lvRuns->SetDataColumn(3, "Comments", "", kTextLeft);// specify text alignment for data

   lvRuns->ActivateSortButtons();//when clicking a column header, the list is sorted according to that column's data.
   ...                           //clicking a second time the same column sorts objects in the opposite sense.


To display objects, put them in a TList and call

   lvRuns->Display( pointer_to_TList );


Object selection

Items in the list can be selected using either:

  • single left click (single object selection),
  • CTRL+left-click (selection of multiple non-neighbouring objects),
  • or SHIFT+left-click (selection of multiple & neighbouring objects)
  • CTRL+a (select all objects in list)

(By default, multiple selection of objects is allowed. Call AllowMultipleSelection(kFALSE) to disable).

When the selection changes, the KVListView emits the

   SelectionChanged()

signal.
The list of the currently selected objects can be retrieved with the method

   GetSelectedObjects()

which returns a TList of the currently selected objects (delete list after use), or

   GetPickOrderedSelectedObjects()

which returns a TList of the currently selected objects IN THE ORDER THEY WERE CLICKED

  • this list must NOT be deleted by the user.

    Double-click action

By default, double-left-clicking an object will execute the

   Browse()

method of the object. This method is defined for all TObjects, it can be overridden in derived classes in order to do something interesting and/or useful.
Alternatively, using method

   SetDoubleClickAction(const char* receiver_class, void* receiver, const char* slot)

you can define a different behaviour when objects are double-clicked using signals & slots.
If you want to deactivate the double-click actions, call

   AllowDoubleClick(kFALSE)


Context menus

By default, context menus are active, which means that right-clicking an object opens its context menu. Call method

   AllowContextMenu(kFALSE)

to deactivate all context menus, or

   AddContextMenuClassException(TClass*)

to activate/deactivate context menus for specific classes, depending on whether context menus are globally activated or not.
See also 'Wrapper classes' below.

Icons

An icon is shown next to each item in the list. This icon is defined (for most ROOT objects e.g. histograms of different types) in the $ROOTSYS/etc/root.mimes file. Other icons can be added in .kvrootrc as in the following example:

   +KaliVeda.GUI.MimeTypes:   TCutG
   KaliVeda.GUI.MimeTypes.TCutG.Icon:   cut_t.xpm

which adds an icon (pair of scissors) for the TCutG class (not defined in root.mimes).
See also 'Wrapper classes' below.

Wrapper classes

For convenience, the objects placed in the list may be of a class which provides a 'wrapper' around the actual object of interest.
In this case, it is possible (if the 'wrapper' inherits from KVBase) to have the icon and the context menu of each object reflect the object of interest, rather than the wrapper.
To do so, call method

   SetUseObjLabelAsRealClass(kTRUE)

and have the wrapper class' GetLabel() and GetObject() methods return the class name and address of the wrapped object.

Definition at line 146 of file KVListView.h.

#include <KVListView.h>

Inheritance diagram for KVListView:

Public Member Functions

 KVListView (TClass *obj_class, const TGWindow *p, UInt_t w, UInt_t h, UInt_t options=kSunkenFrame|kDoubleBorder, Pixel_t back=GetDefaultFrameBackground())
 
virtual ~KVListView ()
 
void ActivateItemsWithColumnData (const Char_t *colname, KVNumberList data, Bool_t activate=kTRUE)
 
void ActivateItemWithColumnData (const Char_t *colname, const Char_t *data, Bool_t activate=kTRUE)
 
void ActivateItemWithColumnData (const Char_t *colname, Double_t data, Bool_t activate=kTRUE)
 
void ActivateItemWithColumnData (const Char_t *colname, Long_t data, Bool_t activate=kTRUE)
 
void ActivateItemWithData (void *userData, Bool_t activate=kTRUE)
 
virtual void ActivateSortButtons ()
 
void AddContextMenuClassException (TClass *)
 
void AllowBrowse (Bool_t on=kTRUE)
 
void AllowContextMenu (Bool_t on=kTRUE)
 
void AllowDoubleClick (Bool_t on=kTRUE)
 
void AllowMultipleSelection (Bool_t yes=kTRUE)
 
virtual void Display (const TCollection *l)
 
TGLVEntryFindItemWithColumnData (const Char_t *colname, const Char_t *data)
 
TGLVEntryFindItemWithColumnData (const Char_t *colname, Double_t data)
 
TGLVEntryFindItemWithColumnData (const Char_t *colname, Long_t data)
 
TGLVEntryFindItemWithData (void *userData)
 
virtual Int_t GetColumnNumber (const Char_t *colname)
 
virtual KVLVColumnDataGetDataColumn (Int_t index) const
 
TObjectGetFirstInList () const
 
TObjectGetLastInList () const
 
TGLVEntryGetLastSelectedItem () const
 
TObjectGetLastSelectedObject () const
 
Bool_t GetMultipleSelection () const
 
TClassGetObjClass () const
 
KVListGetPickOrderedSelectedObjects () const
 
TListGetSelectedItems () const
 
TListGetSelectedObjects () const
 
TCollectionGetUserItems ()
 
virtual Bool_t ProcessMessage (Long_t msg, Long_t parm1, Long_t parm2)
 Handle messages generated by the list view container.
 
virtual void RemoveAll ()
 
virtual void SelectAll ()
 
virtual void SetDataColumn (Int_t index, const Char_t *name, const Char_t *method="", Int_t mode=kTextCenterX)
 
virtual void SetDataColumns (Int_t ncolumns)
 
virtual void SetDefaultColumnWidth (TGVFileSplitter *splitter)
 
void SetDoubleClickAction (const char *receiver_class, void *receiver, const char *slot)
 
virtual void SetMaxColumnSize (UInt_t width)
 
void SetObjClass (TClass *cl)
 
void SetUseObjLabelAsRealClass (Bool_t yes=kTRUE)
 
virtual void Sort (Int_t column)
 
virtual void UnSelectAll ()
 
- Public Member Functions inherited from TGListView
 TGListView (const TGWindow *p, UInt_t w, UInt_t h, UInt_t options=kSunkenFrame|kDoubleBorder, Pixel_t back=GetDefaultFrameBackground())
 
 ~TGListView () override
 
virtual void AdjustHeaders ()
 
virtual void Clicked (TGLVEntry *entry, Int_t btn)
 
virtual void Clicked (TGLVEntry *entry, Int_t btn, Int_t x, Int_t y)
 
virtual void DoubleClicked (TGLVEntry *entry, Int_t btn)
 
virtual void DoubleClicked (TGLVEntry *entry, Int_t btn, Int_t x, Int_t y)
 
virtual const char * GetHeader (Int_t idx) const
 
TGTextButton ** GetHeaderButtons ()
 
TGDimension GetMaxItemSize () const
 
UInt_t GetNumColumns ()
 
EListViewMode GetViewMode () const
 
TClassIsA () const override
 
void Layout () override
 
virtual void LayoutHeader (TGFrame *head)
 
Bool_t ProcessMessage (Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
 
virtual void ResizeColumns ()
 
void SavePrimitive (std::ostream &out, Option_t *option="") override
 
virtual void ScrollHeader (Int_t pos)
 
virtual void SelectionChanged ()
 
void SetContainer (TGFrame *f) override
 
virtual void SetDefaultHeaders ()
 
virtual void SetHeader (const char *s, Int_t hmode, Int_t cmode, Int_t idx)
 
virtual void SetHeaders (Int_t ncolumns)
 
virtual void SetIncrements (Int_t hInc, Int_t vInc)
 
virtual void SetViewMode (EListViewMode viewMode)
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TGCanvas
 TGCanvas (const TGWindow *p=nullptr, UInt_t w=1, UInt_t h=1, UInt_t options=kSunkenFrame|kDoubleBorder, Pixel_t back=GetDefaultFrameBackground())
 
 ~TGCanvas () override
 
virtual void AddFrame (TGFrame *f, TGLayoutHints *l=nullptr)
 
virtual void ClearViewPort ()
 
void DrawBorder () override
 
TGFrameGetContainer () const
 
TGDimension GetDefaultSize () const override
 
virtual Int_t GetHsbPosition () const
 
TGHScrollBarGetHScrollbar () const
 
Int_t GetScrolling () const
 
TGViewPortGetViewPort () const
 
virtual Int_t GetVsbPosition () const
 
TGVScrollBarGetVScrollbar () const
 
void MapSubwindows () override
 
virtual void SetHsbPosition (Int_t newPos)
 
void SetScrolling (Int_t scrolling)
 
virtual void SetVsbPosition (Int_t newPos)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TGFrame
 TGFrame (const TGWindow *p=nullptr, UInt_t w=1, UInt_t h=1, UInt_t options=0, Pixel_t back=GetDefaultFrameBackground())
 
 TGFrame (TGClient *c, Window_t id, const TGWindow *parent=nullptr)
 
 ~TGFrame () override
 
virtual void Activate (Bool_t)
 
void AddInput (UInt_t emask)
 
virtual void ChangeBackground (Pixel_t back)
 
virtual void ChangeOptions (UInt_t options)
 
Bool_t Contains (Int_t x, Int_t y) const
 
void Delete (Option_t *="") override
 
virtual void DeleteWindow ()
 
void DrawClass () const override
 
TObjectDrawClone (Option_t *="") const override
 
virtual void DrawCopy (Handle_t, Int_t, Int_t)
 
void Dump () const override
 
virtual Pixel_t GetBackground () const
 
Int_t GetBorderWidth () const
 
virtual UInt_t GetDefaultHeight () const
 
virtual UInt_t GetDefaultWidth () const
 
virtual TDNDDataGetDNDData (Atom_t)
 
virtual Int_t GetDragType () const
 
virtual Int_t GetDropType () const
 
UInt_t GetEventMask () const
 
virtual Pixel_t GetForeground () const
 
TGFrameElementGetFrameElement () const
 
virtual TGFrameGetFrameFromPoint (Int_t x, Int_t y)
 
UInt_t GetHeight () const
 
UInt_t GetMaxHeight () const
 
UInt_t GetMaxWidth () const
 
UInt_t GetMinHeight () const
 
UInt_t GetMinWidth () const
 
virtual UInt_t GetOptions () const
 
TGDimension GetSize () const
 
UInt_t GetWidth () const
 
Int_t GetX () const
 
Int_t GetY () const
 
virtual Bool_t HandleButton (Event_t *)
 
virtual Bool_t HandleClientMessage (Event_t *event)
 
virtual Bool_t HandleColormapChange (Event_t *)
 
virtual Bool_t HandleConfigureNotify (Event_t *event)
 
virtual Bool_t HandleCrossing (Event_t *)
 
virtual Bool_t HandleDNDDrop (TDNDData *)
 
virtual Atom_t HandleDNDEnter (Atom_t *)
 
virtual Bool_t HandleDNDFinished ()
 
virtual Bool_t HandleDNDLeave ()
 
virtual Atom_t HandleDNDPosition (Int_t, Int_t, Atom_t, Int_t, Int_t)
 
virtual Bool_t HandleDoubleClick (Event_t *)
 
virtual Bool_t HandleDragDrop (TGFrame *, Int_t, Int_t, TGLayoutHints *)
 
virtual Bool_t HandleDragEnter (TGFrame *)
 
virtual Bool_t HandleDragLeave (TGFrame *)
 
virtual Bool_t HandleDragMotion (TGFrame *)
 
Bool_t HandleEvent (Event_t *event) override
 
virtual Bool_t HandleFocusChange (Event_t *)
 
virtual Bool_t HandleKey (Event_t *)
 
virtual Bool_t HandleMotion (Event_t *)
 
virtual Bool_t HandleSelection (Event_t *)
 
virtual Bool_t HandleSelectionClear (Event_t *)
 
virtual Bool_t HandleSelectionRequest (Event_t *)
 
void Inspect () const override
 
virtual Bool_t IsActive () const
 
virtual Bool_t IsComposite () const
 
Bool_t IsDNDSource () const
 
Bool_t IsDNDTarget () const
 
Bool_t IsEditable () const override
 
virtual Bool_t IsLayoutBroken () const
 
void MapRaised () override
 
void MapSubwindows () override
 
void MapWindow () override
 
void Move (Int_t x, Int_t y) override
 
void MoveResize (Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
 
void Print (Option_t *option="") const override
 
virtual void ProcessedConfigure (Event_t *event)
 
virtual void ProcessedEvent (Event_t *event)
 
virtual void ReallyDelete ()
 
void RemoveInput (UInt_t emask)
 
void ReparentWindow (const TGWindow *p, Int_t x=0, Int_t y=0) override
 
virtual void Resize (TGDimension size)
 
void Resize (UInt_t w=0, UInt_t h=0) override
 
void SaveUserColor (std::ostream &out, Option_t *)
 
virtual void SendMessage (const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
 
void SetBackgroundColor (Pixel_t back) override
 
virtual void SetCleanup (Int_t=kLocalCleanup)
 
void SetDNDSource (Bool_t onoff)
 
void SetDNDTarget (Bool_t onoff)
 
virtual void SetDragType (Int_t type)
 
void SetDrawOption (Option_t *="") override
 
virtual void SetDropType (Int_t type)
 
void SetEditable (Bool_t) override
 
virtual void SetForegroundColor (Pixel_t)
 
void SetFrameElement (TGFrameElement *fe)
 
virtual void SetHeight (UInt_t h)
 
virtual void SetLayoutBroken (Bool_t=kTRUE)
 
virtual void SetMaxHeight (UInt_t h)
 
virtual void SetMaxWidth (UInt_t w)
 
virtual void SetMinHeight (UInt_t h)
 
virtual void SetMinWidth (UInt_t w)
 
virtual void SetSize (const TGDimension &s)
 
virtual void SetWidth (UInt_t w)
 
virtual void SetX (Int_t x)
 
virtual void SetY (Int_t y)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
void UnmapWindow () override
 
- Public Member Functions inherited from TGWindow
 TGWindow (const TGWindow *p=nullptr, Int_t x=0, Int_t y=0, UInt_t w=0, UInt_t h=0, UInt_t border=0, Int_t depth=0, UInt_t clss=0, void *visual=nullptr, SetWindowAttributes_t *attr=nullptr, UInt_t wtype=0)
 
 TGWindow (TGClient *c, Window_t id, const TGWindow *parent=nullptr)
 
 ~TGWindow () override
 
virtual void DestroySubwindows ()
 
virtual void DestroyWindow ()
 
virtual UInt_t GetEditDisabled () const
 
virtual const TGWindowGetMainFrame () const
 
const char * GetName () const override
 
const TGWindowGetParent () const
 
virtual Bool_t HandleExpose (Event_t *event)
 
virtual Bool_t HandleIdleEvent (TGIdleHandler *)
 
Bool_t HandleTimer (TTimer *) override
 
virtual void IconifyWindow ()
 
TClassIsA () const override
 
virtual Bool_t IsMapped ()
 
virtual Bool_t IsMapSubwindows () const
 
virtual void LowerWindow ()
 
virtual Int_t MustCleanup () const
 
void Print (Option_t *option="") const override
 
virtual void RaiseWindow ()
 
virtual void RequestFocus ()
 
virtual void SetBackgroundPixmap (Pixmap_t pixmap)
 
virtual void SetEditDisabled (UInt_t on=kEditDisable)
 
virtual void SetMapSubwindows (Bool_t)
 
virtual void SetName (const char *name)
 
virtual void SetWindowName (const char *name=nullptr)
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TGObject
 TGObject ()
 
 TGObject (const TGObject &tgo)
 
 ~TGObject () override
 
TGClientGetClient () const
 
Handle_t GetId () const
 
ULong_t Hash () const override
 
Bool_t IsEqual (const TObject *obj) const override
 
void SaveAs (const char *filename="", Option_t *option="") const override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TObject
 TObject ()
 
 TObject (const TObject &object)
 
virtual ~TObject ()
 
void AbstractMethod (const char *method) const
 
virtual void AppendPad (Option_t *option="")
 
virtual void Browse (TBrowser *b)
 
ULong_t CheckedHash ()
 
virtual const char * ClassName () const
 
virtual void Clear (Option_t *="")
 
virtual TObjectClone (const char *newname="") const
 
virtual Int_t Compare (const TObject *obj) const
 
virtual void Copy (TObject &object) const
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 
virtual void Draw (Option_t *option="")
 
virtual void Error (const char *method, const char *msgfmt,...) const
 
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 
virtual TObjectFindObject (const char *name) const
 
virtual TObjectFindObject (const TObject *obj) const
 
virtual Option_tGetDrawOption () const
 
virtual const char * GetIconName () const
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 
virtual Option_tGetOption () const
 
virtual const char * GetTitle () const
 
virtual UInt_t GetUniqueID () const
 
Bool_t HasInconsistentHash () const
 
virtual void Info (const char *method, const char *msgfmt,...) const
 
virtual Bool_t InheritsFrom (const char *classname) const
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 
void InvertBit (UInt_t f)
 
Bool_t IsDestructed () const
 
virtual Bool_t IsFolder () const
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
virtual Bool_t IsSortable () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
virtual void ls (Option_t *option="") const
 
void MayNotUse (const char *method) const
 
virtual Bool_t Notify ()
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *vp)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, void *vp)
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 
virtual void Paint (Option_t *option="")
 
virtual void Pop ()
 
virtual Int_t Read (const char *name)
 
virtual void RecursiveRemove (TObject *obj)
 
void ResetBit (UInt_t f)
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 
virtual void SetUniqueID (UInt_t uid)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const
 
- Public Member Functions inherited from TQObject
 TQObject ()
 
virtual ~TQObject ()
 
Bool_t AreSignalsBlocked () const
 
Bool_t BlockSignals (Bool_t b)
 
virtual void ChangedBy (const char *method)
 
void CollectClassSignalLists (TList &list, TClass *cls)
 
Bool_t Connect (const char *signal, const char *receiver_class, void *receiver, const char *slot)
 
virtual void Connected (const char *)
 
virtual void Destroyed ()
 
Bool_t Disconnect (const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
 
virtual void Disconnected (const char *)
 
void Emit (const char *signal)
 
void Emit (const char *signal, const T &arg)
 
void EmitVA (const char *signal_name, Int_t, const T &... params)
 
TListGetListOfClassSignals () const
 
TListGetListOfConnections () const
 
TListGetListOfSignals () const
 
virtual Bool_t HasConnection (const char *signal_name) const
 
virtual void HighPriority (const char *signal_name, const char *slot_name=nullptr)
 
virtual void LowPriority (const char *signal_name, const char *slot_name=nullptr)
 
virtual void Message (const char *msg)
 
virtual Int_t NumberOfConnections () const
 
virtual Int_t NumberOfSignals () const
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 

Private Attributes

TContextMenufContextMenu
 
UInt_t fMaxColumnSize
 maximum width of columns
 
TClassfObjClass
 class of objects in list
 
int nselected
 number of selected items
 

Additional Inherited Members

- Public Types inherited from TGWindow
enum  EEditMode
 
enum  EStatusBits
 
- Public Types inherited from TObject
enum  EDeprecatedStatusBits
 
enum  EStatusBits
 
- Static Public Member Functions inherited from TGListView
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TGCanvas
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TGFrame
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static const TGGCGetBckgndGC ()
 
static const TGGCGetBlackGC ()
 
static Pixel_t GetBlackPixel ()
 
static Pixel_t GetDefaultFrameBackground ()
 
static Pixel_t GetDefaultSelectedBackground ()
 
static const TGGCGetHilightGC ()
 
static const TGGCGetShadowGC ()
 
static const TGGCGetWhiteGC ()
 
static Pixel_t GetWhitePixel ()
 
- Static Public Member Functions inherited from TGWindow
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Int_t GetCounter ()
 
- Static Public Member Functions inherited from TGObject
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TObject
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Longptr_t GetDtorOnly ()
 
static Bool_t GetObjectStat ()
 
static void SetDtorOnly (void *obj)
 
static void SetObjectStat (Bool_t stat)
 
- Static Public Member Functions inherited from TQObject
static Bool_t AreAllSignalsBlocked ()
 
static Bool_t BlockAllSignals (Bool_t b)
 
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static Bool_t Connect (const char *sender_class, const char *signal, const char *receiver_class, void *receiver, const char *slot)
 
static Bool_t Connect (TQObject *sender, const char *signal, const char *receiver_class, void *receiver, const char *slot)
 
static const char * DeclFileName ()
 
static Bool_t Disconnect (const char *class_name, const char *signal, void *receiver=nullptr, const char *slot=nullptr)
 
static Bool_t Disconnect (TQObject *sender, const char *signal=nullptr, void *receiver=nullptr, const char *slot=nullptr)
 
- Public Attributes inherited from TGCanvas
 kCanvasNoScroll
 
 kCanvasScrollBoth
 
 kCanvasScrollHorizontal
 
 kCanvasScrollVertical
 
- Public Attributes inherited from TGWindow
 kEditDisable
 
 kEditDisableBtnEnable
 
 kEditDisableEvents
 
 kEditDisableGrab
 
 kEditDisableHeight
 
 kEditDisableKeyEnable
 
 kEditDisableLayout
 
 kEditDisableResize
 
 kEditDisableWidth
 
 kEditEnable
 
 kIsHtmlView
 
- Public Attributes inherited from TObject
 kBitMask
 
 kCanDelete
 
 kCannotPick
 
 kHasUUID
 
 kInconsistent
 
 kInvalidObject
 
 kIsOnHeap
 
 kIsReferenced
 
 kMustCleanup
 
 kNoContextMenu
 
 kNotDeleted
 
 kObjInCanvas
 
 kOverwrite
 
 kSingleKey
 
 kWriteDelete
 
 kZombie
 
- Protected Member Functions inherited from TGFrame
void DoRedraw () override
 
virtual void Draw3dRectangle (UInt_t type, Int_t x, Int_t y, UInt_t w, UInt_t h)
 
TString GetOptionString () const
 
const TGResourcePoolGetResourcePool () const
 
voidGetSender () override
 
virtual void StartGuiBuilding (Bool_t on=kTRUE)
 
- Protected Member Functions inherited from TGWindow
 TGWindow (const TGWindow &tgw)
 
 TGWindow (Window_t id)
 
TGWindowoperator= (const TGWindow &tgw)
 
- Protected Member Functions inherited from TGObject
TGObjectoperator= (const TGObject &tgo)
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 
void MakeZombie ()
 
- Protected Member Functions inherited from TQObject
virtual const char * GetSenderClassName () const
 
- Static Protected Member Functions inherited from TGListView
static FontStruct_t GetDefaultFontStruct ()
 
static const TGGCGetDefaultGC ()
 
- Static Protected Member Functions inherited from TGFrame
static Time_t GetLastClick ()
 
- Static Protected Member Functions inherited from TQObject
static Int_t CheckConnectArgs (TQObject *sender, TClass *sender_class, const char *signal, TClass *receiver_class, const char *slot)
 
static TString CompressName (const char *method_name)
 
static Bool_t ConnectToClass (const char *sender_class, const char *signal, TClass *receiver_class, void *receiver, const char *slot)
 
static Bool_t ConnectToClass (TQObject *sender, const char *signal, TClass *receiver_class, void *receiver, const char *slot)
 
- Protected Attributes inherited from TGListView
TGTextButton ** fColHeader
 
TStringfColNames
 
Int_tfColumns
 
FontStruct_t fFontStruct
 
TGHeaderFramefHeader
 
Int_tfJmode
 
Bool_t fJustChanged
 
TGDimension fMaxSize
 
UInt_t fMinColumnSize
 
Int_t fNColumns
 
GContext_t fNormGC
 
TGVFileSplitter ** fSplitHeader
 
EListViewMode fViewMode
 
- Protected Attributes inherited from TGCanvas
TGHScrollBarfHScrollbar
 
Int_t fScrolling
 
TGViewPortfVport
 
TGVScrollBarfVScrollbar
 
- Protected Attributes inherited from TGFrame
Pixel_t fBackground
 
Int_t fBorderWidth
 
Int_t fDNDState
 
UInt_t fEventMask
 
TGFrameElementfFE
 
UInt_t fHeight
 
UInt_t fMaxHeight
 
UInt_t fMaxWidth
 
UInt_t fMinHeight
 
UInt_t fMinWidth
 
UInt_t fOptions
 
UInt_t fWidth
 
Int_t fX
 
Int_t fY
 
 kDeleteWindowCalled
 
- Protected Attributes inherited from TGWindow
UInt_t fEditDisabled
 
TString fName
 
Bool_t fNeedRedraw
 
const TGWindowfParent
 
- Protected Attributes inherited from TGObject
TGClientfClient
 
Handle_t fId
 
- Protected Attributes inherited from TObject
 kOnlyPrepStep
 
- Protected Attributes inherited from TQObject
TListfListOfConnections
 
TListfListOfSignals
 
Bool_t fSignalsBlocked
 
- Static Protected Attributes inherited from TGListView
static const TGFontfgDefaultFont
 
static TGGCfgDefaultGC
 
- Static Protected Attributes inherited from TGFrame
static const TGGCfgBckgndGC
 
static const TGGCfgBlackGC
 
static Pixel_t fgBlackPixel
 
static Window_t fgDbw
 
static Int_t fgDbx
 
static Int_t fgDby
 
static Pixel_t fgDefaultFrameBackground
 
static Pixel_t fgDefaultSelectedBackground
 
static const TGGCfgHilightGC
 
static Bool_t fgInit
 
static UInt_t fgLastButton
 
static Time_t fgLastClick
 
static const TGGCfgShadowGC
 
static UInt_t fgUserColor
 
static const TGGCfgWhiteGC
 
static Pixel_t fgWhitePixel
 
- Static Protected Attributes inherited from TGWindow
static Int_t fgCounter
 
- Static Protected Attributes inherited from TQObject
static Bool_t fgAllSignalsBlocked
 

Constructor & Destructor Documentation

◆ KVListView()

KVListView::KVListView ( TClass obj_class,
const TGWindow p,
UInt_t  w,
UInt_t  h,
UInt_t  options = kSunkenFrame | kDoubleBorder,
Pixel_t  back = GetDefaultFrameBackground() 
)

Create list view widget for objects of class obj_class. A KVLVContainer object is also created and set as the container in use. The view mode is set to kLVDetails (only one possible, no icons) Scrolling increments are set to 1 (vertical) & 19 (horizontal)

Definition at line 24 of file KVListView.cpp.

◆ ~KVListView()

virtual KVListView::~KVListView ( )
inlinevirtual

Definition at line 157 of file KVListView.h.

Member Function Documentation

◆ ActivateItemsWithColumnData()

void KVListView::ActivateItemsWithColumnData ( const Char_t colname,
KVNumberList  data,
Bool_t  activate = kTRUE 
)
inline

Definition at line 227 of file KVListView.h.

◆ ActivateItemWithColumnData() [1/3]

void KVListView::ActivateItemWithColumnData ( const Char_t colname,
const Char_t data,
Bool_t  activate = kTRUE 
)
inline

Definition at line 215 of file KVListView.h.

◆ ActivateItemWithColumnData() [2/3]

void KVListView::ActivateItemWithColumnData ( const Char_t colname,
Double_t  data,
Bool_t  activate = kTRUE 
)
inline

Definition at line 223 of file KVListView.h.

◆ ActivateItemWithColumnData() [3/3]

void KVListView::ActivateItemWithColumnData ( const Char_t colname,
Long_t  data,
Bool_t  activate = kTRUE 
)
inline

Definition at line 219 of file KVListView.h.

◆ ActivateItemWithData()

void KVListView::ActivateItemWithData ( void userData,
Bool_t  activate = kTRUE 
)
inline

Definition at line 199 of file KVListView.h.

◆ ActivateSortButtons()

void KVListView::ActivateSortButtons ( )
virtual

Connects the column header buttons (if defined) to the container's Sort(const Char_t*) method. Each button, when pressed, sends a "Clicked" signal which activates "Sort" with the name of the button/column as argument.

Definition at line 72 of file KVListView.cpp.

◆ AddContextMenuClassException()

void KVListView::AddContextMenuClassException ( TClass cl)

The global context menu status (allowed or not allowed) is set by AllowContextMenu(). If required, this can be overridden for specific classes by calling this method for each required class. In this case, any objects in the list of precisely this class (not derived classes) will have the opposite behaviour to that defined by AllowContextMenu(), i.e. if context menus are globally disabled, this method defines the classes for which a context menu is authorised, and vice-versa.

Definition at line 235 of file KVListView.cpp.

◆ AllowBrowse()

void KVListView::AllowBrowse ( Bool_t  on = kTRUE)
inline

Deprecated: use AllowDoubleClick()

Definition at line 278 of file KVListView.h.

◆ AllowContextMenu()

void KVListView::AllowContextMenu ( Bool_t  on = kTRUE)
inline

Call with on=kFALSE to disable objects' context menus opening with mouse right-click

Definition at line 283 of file KVListView.h.

◆ AllowDoubleClick()

void KVListView::AllowDoubleClick ( Bool_t  on = kTRUE)
inline

Call with on=kFALSE to disable objects' Browse() method being called with mouse double-click

Definition at line 272 of file KVListView.h.

◆ AllowMultipleSelection()

void KVListView::AllowMultipleSelection ( Bool_t  yes = kTRUE)
inline

Definition at line 291 of file KVListView.h.

◆ Display()

virtual void KVListView::Display ( const TCollection l)
inlinevirtual

Definition at line 173 of file KVListView.h.

◆ FindItemWithColumnData() [1/3]

TGLVEntry * KVListView::FindItemWithColumnData ( const Char_t colname,
const Char_t data 
)
inline

Definition at line 203 of file KVListView.h.

◆ FindItemWithColumnData() [2/3]

TGLVEntry * KVListView::FindItemWithColumnData ( const Char_t colname,
Double_t  data 
)
inline

Definition at line 211 of file KVListView.h.

◆ FindItemWithColumnData() [3/3]

TGLVEntry * KVListView::FindItemWithColumnData ( const Char_t colname,
Long_t  data 
)
inline

Definition at line 207 of file KVListView.h.

◆ FindItemWithData()

TGLVEntry * KVListView::FindItemWithData ( void userData)
inline

Definition at line 195 of file KVListView.h.

◆ GetColumnNumber()

Int_t KVListView::GetColumnNumber ( const Char_t colname)
virtual

Returns index of data column from its name. Return -1 if not found.

Definition at line 124 of file KVListView.cpp.

◆ GetDataColumn()

virtual KVLVColumnData * KVListView::GetDataColumn ( Int_t  index) const
inlinevirtual

Definition at line 168 of file KVListView.h.

◆ GetFirstInList()

TObject * KVListView::GetFirstInList ( ) const
inline

return first object in currently displayed list

Definition at line 262 of file KVListView.h.

◆ GetLastInList()

TObject * KVListView::GetLastInList ( ) const
inline

return last object in currently displayed list

Definition at line 267 of file KVListView.h.

◆ GetLastSelectedItem()

TGLVEntry * KVListView::GetLastSelectedItem ( ) const
inline

Definition at line 235 of file KVListView.h.

◆ GetLastSelectedObject()

TObject * KVListView::GetLastSelectedObject ( ) const
inline

Definition at line 231 of file KVListView.h.

◆ GetMultipleSelection()

Bool_t KVListView::GetMultipleSelection ( ) const
inline

Definition at line 295 of file KVListView.h.

◆ GetObjClass()

TClass * KVListView::GetObjClass ( ) const
inline

Definition at line 302 of file KVListView.h.

◆ GetPickOrderedSelectedObjects()

KVList * KVListView::GetPickOrderedSelectedObjects ( ) const
inline

list of selected objects (derived from TObject) in the order they were picked DO NOT DELETE!!!

Definition at line 251 of file KVListView.h.

◆ GetSelectedItems()

TList * KVListView::GetSelectedItems ( ) const
inline

list of selected KVLVEntry objects DELETE AFTER USE !!!

Definition at line 239 of file KVListView.h.

◆ GetSelectedObjects()

TList * KVListView::GetSelectedObjects ( ) const
inline

list of selected objects (derived from TObject) DELETE AFTER USE !!!

Definition at line 245 of file KVListView.h.

◆ GetUserItems()

TCollection * KVListView::GetUserItems ( )
inline

return list of all objects (selected or unselected) in list view

Definition at line 257 of file KVListView.h.

◆ ProcessMessage()

Bool_t KVListView::ProcessMessage ( Long_t  msg,
Long_t  parm1,
Long_t  parm2 
)
virtual

Handle messages generated by the list view container.

Reimplemented from TGFrame.

Definition at line 47 of file KVListView.cpp.

◆ RemoveAll()

virtual void KVListView::RemoveAll ( )
inlinevirtual

Definition at line 190 of file KVListView.h.

◆ SelectAll()

virtual void KVListView::SelectAll ( )
inlinevirtual

Definition at line 182 of file KVListView.h.

◆ SetDataColumn()

void KVListView::SetDataColumn ( Int_t  index,
const Char_t name,
const Char_t method = "",
Int_t  mode = kTextCenterX 
)
virtual

Define column with index = 0, 1, ... name = name of column (shown in column header button) method = method to call to fill column with data (by default, "Getname") mode = text alignment for data in column (kTextCenterX [default], kTextLeft, kTextRight) column header name is always center aligned

Definition at line 106 of file KVListView.cpp.

◆ SetDataColumns()

void KVListView::SetDataColumns ( Int_t  ncolumns)
virtual

Definition at line 91 of file KVListView.cpp.

◆ SetDefaultColumnWidth()

void KVListView::SetDefaultColumnWidth ( TGVFileSplitter splitter)
virtual

Set default column width of the columns headers. Limit minimum size of a column to total width / number of columns If only one column it will span the whole viewport

Reimplemented from TGListView.

Definition at line 145 of file KVListView.cpp.

◆ SetDoubleClickAction()

void KVListView::SetDoubleClickAction ( const char *  receiver_class,
void receiver,
const char *  slot 
)

Overrides the default 'double-click' action. By default, double-clicking on an object in the list will call the Browse(TBrowser*) method of the selected object. Use this method to override this behaviour. When an object is double-clicked the method 'slot' of the object 'receiver' of class 'receiver_class' will be called. The method in question must have the signature receiver_class::slot(TObject*) The address of the selected (T)object is passed as argument.

Definition at line 210 of file KVListView.cpp.

◆ SetMaxColumnSize()

virtual void KVListView::SetMaxColumnSize ( UInt_t  width)
inlinevirtual

Definition at line 161 of file KVListView.h.

◆ SetObjClass()

void KVListView::SetObjClass ( TClass cl)
inline

Definition at line 306 of file KVListView.h.

◆ SetUseObjLabelAsRealClass()

void KVListView::SetUseObjLabelAsRealClass ( Bool_t  yes = kTRUE)

If list contains KVBase-derived objects, calling this method with yes=kTRUE will cause the string returned by the objects' KVBase::GetLabel() method to be used as the class name of the object

Definition at line 189 of file KVListView.cpp.

◆ Sort()

virtual void KVListView::Sort ( Int_t  column)
inlinevirtual

Sort list according to data in given column (=0, 1, ...)

Definition at line 177 of file KVListView.h.

◆ UnSelectAll()

virtual void KVListView::UnSelectAll ( )
inlinevirtual

Definition at line 186 of file KVListView.h.

Member Data Documentation

◆ fContextMenu

TContextMenu* KVListView::fContextMenu
private

Definition at line 151 of file KVListView.h.

◆ fMaxColumnSize

UInt_t KVListView::fMaxColumnSize
private

maximum width of columns

Definition at line 150 of file KVListView.h.

◆ fObjClass

TClass* KVListView::fObjClass
private

class of objects in list

Definition at line 149 of file KVListView.h.

◆ nselected

int KVListView::nselected
private

number of selected items

Definition at line 148 of file KVListView.h.