KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVLVContainer.cpp
1/*
2$Id: KVLVContainer.cpp,v 1.8 2009/04/28 09:11:29 franklan Exp $
3$Revision: 1.8 $
4$Date: 2009/04/28 09:11:29 $
5*/
6
7//Created by KVClassFactory on Wed Apr 9 13:54:31 2008
8//Author: franklan
9
10#include "KVListView.h"
11#include "KVLVContainer.h"
12#include "KVLVEntry.h"
13#include "TFunction.h"
14#include "TRootContextMenu.h"
15#include "TSystem.h"
16#include <KVBase.h>
17#include <TGMsgBox.h>
18#include "TGClient.h"
19#include "TEnv.h"
20using namespace std;
21
30
32public:
33 KVLVContainer* fContainer; // object container
34
36 {
37 return kTRUE;
38 }
39 Int_t Compare(const TObject* obj) const;
40};
41
42
43
46
48{
49 // Method responsible for sorting the objects in the GUI list
50
52 KVLVEntry* f2 = (KVLVEntry*)((TGFrameElement*) obj)->fFrame;
53 TObject* r1 = (TObject*)f1->GetUserData();
54 TObject* r2 = (TObject*)f2->GetUserData();
56}
57
58
59
62// KVLVContainer and KVLVColumnData are utility classes used by KVListView
63//
64
65
66
67
68
69void KVLVColumnData::GetData(TObject* obj, Long_t& i)
70{
71 fMethCall.Execute(obj, "", i);
72}
73
74
75
77
79{
80 fMethCall.Execute(obj, "", i);
81}
82
83
84
86
88{
89 if (fRetType == kTString) {
90 Long_t lret;
91 fMethCall.Execute(obj, "", lret);
92 i = ((TString*)lret)->Data();
93 return;
94 }
95 Char_t* cret;
96 fMethCall.Execute(obj, "", &cret);
97 i.Form("%s", cret);
98}
99
100
101
103
105{
106 Long_t lret;
107 fMethCall.Execute(obj, "", lret);
108 switch (fRetType) {
109 case kDatimeRef:
110 ((TDatime*)lret)->Copy(i);
111 break;
112
113 case kDatimeInt:
114 i.Set((UInt_t)lret);
115 }
116}
117
118
119
122
124{
125
126 // Format string with column data for object
127
128 result = "";
129 Long_t lret;
130 Double_t dret;
131 KVDatime dtret;
132 switch (fRetType) {
133
135 case (Int_t)kTString :
136 GetData(obj, result);
137 break;
138
140 GetData(obj, lret);
141 result.Form(fDataFormat, lret);
142 break;
143
145 GetData(obj, dret);
146 result.Form(fDataFormat, dret);
147 break;
148
149 case kDatimeRef:
150 case kDatimeInt:
151 GetData(obj, dtret);
152 result.Form("%s", dtret.String(fFmt));
153 break;
154
155 default:
156 std::cout << "Error in <KVLVColumnData::GetDataString> : column " << fName << " : this type is not supported "
157 << (Int_t)fMethCall.ReturnType() << std::endl;
158 break;
159 }
160 return result.Data();
161}
162
163
164
178
180{
181 // If data in column is date & time info, use this method to
182 //
183 // - set the format for presenting the date & time. These are the formats
184 // available for KVDatime objects, i.e.
185 // KVDatime::kCTIME - ctime format (default) e.g. Thu Apr 10 10:48:34 2008
186 // KVDatime::kSQL - SQL format e.g. 1997-01-15 20:16:28
187 // KVDatime::kGANACQ - GANIL acquisition format e.g. 29-SEP-2005 09:42:17.00
188 //
189 // - define how the information is obtained from the object. The method
190 // given to the constructor must return either
191 // a reference/pointer to TDatime/KVDatime : with_reference=kTRUE (default)
192 // a UInt_t/time_t value (such as returned by TDatime::Convert) : with_reference=kFALSE
193
194 fFmt = fmt;
195 if (with_reference) {
197 // determine class of returned pointer/reference
199 fIsKVDatime = ptr_type.Contains("KVDatime");
200 }
201 else {
203 }
204}
205
206
207
209
211{
212 KVDatime d1, d2;
213 GetData(o1, d1);
214 GetData(o2, d2);
215 return (d1 < d2 ? -1 : (d1 > d2 ? 1 : 0));
216}
217
218
219
221
223{
224 TString s1, s2;
225 GetData(o1, s1);
226 GetData(o2, s2);
227 return s2.CompareTo(s1);
228}
229
230
231
233
235{
236 Long_t l1, l2;
237 GetData(o1, l1);
238 GetData(o2, l2);
239 return (l1 < l2 ? -1 : (l1 > l2 ? 1 : 0));
240}
241
242
243
245
247{
248 Double_t l1, l2;
249 GetData(o1, l1);
250 GetData(o2, l2);
251 return (l1 < l2 ? -1 : (l1 > l2 ? 1 : 0));
252}
253
254
255
256
264
266{
267 // Compare (for sorting) the two objects based on the type of data stored
268 // in this column. The sorting depends on the return type of the data.
269 // for integers: return 1 if ob1->data < ob2->data etc.
270 // for floats: return 1 if ob1->data < ob2->data etc.
271 // for strings: alphabetical sorting using TString::CompareTo
272 // for dates: chronological order (earliest first)
273
274 switch (fRetType) {
275
277 return Compare_string(ob1, ob2);
278 break;
279
281 return Compare_long(ob1, ob2);
282 break;
283
285 return Compare_double(ob1, ob2);
286 break;
287
288 case kDatimeRef:
289 case kDatimeInt:
290 return Compare_date(ob1, ob2);
291 break;
292
293 default:
294 std::cout << "Error in <KVLVColumnData::Compare> : this type is not supported "
295 << (Int_t)fMethCall.ReturnType() << std::endl;
296 break;
297 }
298 return 0;
299}
300
301
302
303
305
307 : TGLVContainer(p, w, h, options, back)
308{
309 default_init();
310}
311
312
313
315
317 : TGLVContainer(p, options, back)
318{
319 default_init();
320}
321
322
323
331
333{
334 // Default initialisation of list view container
335 // Multiple selection is enabled
336 // The parent list view widget handles messages generated by container.
337 // By default, we allow objects' context menu to be opened with right-click,
338 // and objects' Browse() method to be executed by double-clicking.
339 // This can be modified using AllowContextMenu(kFALSE) and AllowDoubleClick(kFALSE).
340
343 fSort = kFALSE;
344 fSortDir = 0;
345 fColData = 0;
347 fContextMenu = new TContextMenu("KVListViewContextMenu");
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)");
352 fUserItems = new KVList;
355
360
363
365 fObjClass = 0;
366
368}
369
370
371
374
388
389
390
391
393
395{
396 if (fColData) {
397 for (int i = 0; i < fNcols; i++) {
398 if (fColData[i]) delete fColData[i];
399 }
400 delete [] fColData;
401 fColData = 0;
402 }
403}
404
405
406
407
410
412{
413 // Sort objects in container according to contents of given column.
414
417 fSort = kTRUE;
418
419 fList->Sort();
420 //invert sort direction for this column for next time
422
423 TGCanvas* canvas = (TGCanvas*) this->GetParent()->GetParent();
424 canvas->Layout();
425
426 fSort = kFALSE;
427}
428
429
430
431
434
436{
437 // Add an item to the list
438
440
441 nw = new KVLVFrameElement;
442 nw->fFrame = f;
443 nw->fLayout = l ? l : fgDefaultHints;
444 nw->fState = 1;
445 nw->fContainer = this;
446 fList->Add(nw);
447}
448
449
450
451
457
458void KVLVContainer::Display(const TCollection* list_of_objects)
459{
460 // Display the list of objects in the container.
461 // If the list is very long (> KVListView.MaxListLength)
462 // we pop up a dialog box to ask if all items should be displayed
463 // which can take quite a long time
464
465 /* remove all items from display, but keep list in memory */
467 RemoveAll();
469
470 Int_t max_entries = gEnv->GetValue("KVListView.MaxListLength", 1000);
471 if (list_of_objects->GetEntries() > max_entries) {
472 Int_t ret;
473 new TGMsgBox(gClient->GetRoot(), GetMainFrame(), "Long list",
474 Form("The list contains more than %d items. Do you want to display all items ?",
475 max_entries),
476 kMBIconQuestion, kMBYes | kMBNo, &ret);
477 if (ret & kMBNo) {
478 // display only the first KVListView.MaxListLength entries
479 TList list2;
480 Int_t N = 0;
481 TIter next(list_of_objects);
482 TObject* o;
483 while ((o = next()) && (N++) < max_entries) list2.Add(o);
484 FillList(&list2);
485 }
486 else
487 FillList(list_of_objects);
488 }
489 else
490 FillList(list_of_objects);
491 if (!fIsResized) {
494 }
495 TGCanvas* canvas = (TGCanvas*) this->GetParent()->GetParent();
496 canvas->Layout();
497
499}
500
501
502
503
507
509{
510 // Redisplay the list of objects in the container.
511 // This can be used to refresh the contents of the window.
512
513 Display();
514}
515
516
517
518
522
524{
525 // When the graphical list is emptied we need to empty the list
526 // of user objects also.
527
530}
531
532
533
534
538
540{
541 // Fill list from list
542 // Pointers to objects are stored in internal list fUserItems for Refresh()
543
544 if (l) {
545 fUserItems->Clear();
546 }
547
548 if (l && !l->GetSize()) return;
549
550 TCollection* theList = (TCollection*)(l ? l : fUserItems);
551 TIter nxt(theList);
552 TObject* obj = 0;
553 while ((obj = nxt())) {
554 if (l) fUserItems->Add(obj);
555 KVLVEntry* ent;
557 ent = new KVLVEntry(obj, dynamic_cast<KVBase*>(obj)->GetLabel(), this, fNcols, fColData);
558 else
559 ent = new KVLVEntry(obj, this, fNcols, fColData);
560 AddItem(ent);
561 }
562}
563
564
565
566
568
570{
572 if (fSortDir) delete [] fSortDir;
573 fNcols = ncols;
574 fSortDir = new int [ncols];
575 fColData = new KVLVColumnData* [ncols];
576 for (int i = 0; i < ncols; i++) {
577 fSortDir[i] = 1;
578 fColData[i] = 0;
579 }
580}
581
582
583
584
586
587void KVLVContainer::SetDataColumn(Int_t index, TClass* cl, const Char_t* name, const Char_t* method)
588{
589 fColData[index] = new KVLVColumnData(cl, name, method);
590}
591
592
593
594
597
599{
600 // Find item with fUserData == userData in container.
601
602 TGFrameElement* el;
603 TIter next(fList);
604 TGLVEntry* f = 0;
605 while ((el = (TGFrameElement*) next())) {
606 f = (TGLVEntry*) el->fFrame;
607 if (f->GetUserData() == userData) {
608 return f;
609 }
610 }
611 return 0;
612}
613
614
615
616
620
621void KVLVContainer::ActivateItemWithData(void* userData, Bool_t activate)
622{
623 // Find item with fUserData == userData in container and make it active
624 // (inactive if activate=kFALSE).
625
626 TGFrameElement* el;
627 TIter next(fList);
628 while ((el = (TGFrameElement*) next())) {
629 TGLVEntry* f = (TGLVEntry*) el->fFrame;
630 if (f->GetUserData() == userData) {
631 if (activate) ActivateItem(el);
632 else DeActivateItem(el);
633 break;
634 }
635 }
636 fClient->NeedRedraw(this);
637}
638
639
640
641
643
645{
646 KVLVColumnData* CD = fColData[((KVListView*)GetListView())->GetColumnNumber(colname)];
647 TString val;
648 TGFrameElement* el;
649 TIter next(fList);
650 TGLVEntry* f = 0;
651 while ((el = (TGFrameElement*) next())) {
652 f = (TGLVEntry*) el->fFrame;
653 CD->GetData((TObject*)f->GetUserData(), val);
654 if (val == data) return f;
655 }
656 return 0;
657}
658
659
660
661
663
665{
666 KVLVColumnData* CD = fColData[((KVListView*)GetListView())->GetColumnNumber(colname)];
667 Long_t val;
668 TGFrameElement* el;
669 TIter next(fList);
670 TGLVEntry* f = 0;
671 while ((el = (TGFrameElement*) next())) {
672 f = (TGLVEntry*) el->fFrame;
673 CD->GetData((TObject*)f->GetUserData(), val);
674 if (val == data) return f;
675 }
676 return 0;
677}
678
679
680
681
683
685{
686 KVLVColumnData* CD = fColData[((KVListView*)GetListView())->GetColumnNumber(colname)];
687 Double_t val;
688 TGFrameElement* el;
689 TIter next(fList);
690 TGLVEntry* f = 0;
691 while ((el = (TGFrameElement*) next())) {
692 f = (TGLVEntry*) el->fFrame;
693 CD->GetData((TObject*)f->GetUserData(), val);
694 if (val == data) return f;
695 }
696 return 0;
697}
698
699
700
701
703
704void KVLVContainer::ActivateItemWithColumnData(const Char_t* colname, const Char_t* data, Bool_t activ)
705{
706 KVLVColumnData* CD = fColData[((KVListView*)GetListView())->GetColumnNumber(colname)];
707 TString val;
708 TGFrameElement* el;
709 TIter next(fList);
710 TGLVEntry* f = 0;
711 while ((el = (TGFrameElement*) next())) {
712 f = (TGLVEntry*) el->fFrame;
713 CD->GetData((TObject*)f->GetUserData(), val);
714 if (val == data) {
715 if (activ) ActivateItem(el);
716 else DeActivateItem(el);
717 break;
718 }
719 }
720 fClient->NeedRedraw(this);
721}
722
723
724
725
727
729{
730 KVLVColumnData* CD = fColData[((KVListView*)GetListView())->GetColumnNumber(colname)];
731 Long_t val;
732 TGFrameElement* el;
733 TIter next(fList);
734 TGLVEntry* f = 0;
735 while ((el = (TGFrameElement*) next())) {
736 f = (TGLVEntry*) el->fFrame;
737 CD->GetData((TObject*)f->GetUserData(), val);
738 if (val == data) {
739 printf("%ld\n", data);
740 if (activ) ActivateItemFromSelectAll(el);
741 else DeActivateItem(el);
742 break;
743 }
744 }
745 //fClient->NeedRedraw(this);
746}
747
748
749
751
753{
754 KVLVColumnData* CD = fColData[((KVListView*)GetListView())->GetColumnNumber(colname)];
755 TGFrameElement* el;
756 TIter next(fList);
757 TGLVEntry* f = 0;
758 Long_t val;
759 data.Begin();
760 while (!data.End()) {
761 Int_t nd = data.Next();
762 //printf("nd=%d\n",nd);
763 next.Reset();
764 Bool_t find = kFALSE;
765 while ((el = (TGFrameElement*) next()) && !find) {
766 f = (TGLVEntry*) el->fFrame;
767 CD->GetData((TObject*)f->GetUserData(), val);
768 if (val == nd) {
769 find = kTRUE;
770 if (activ) ActivateItemFromSelectAll(el);
771 else DeActivateItem(el);
772 }
773 }
774 }
775 fClient->NeedRedraw(this);
776}
777
778
779
780
782
784{
785 KVLVColumnData* CD = fColData[((KVListView*)GetListView())->GetColumnNumber(colname)];
786 Double_t val;
787 TGFrameElement* el;
788 TIter next(fList);
789 TGLVEntry* f = 0;
790 while ((el = (TGFrameElement*) next())) {
791 f = (TGLVEntry*) el->fFrame;
792 CD->GetData((TObject*)f->GetUserData(), val);
793 if (val == data) {
794 if (activ) ActivateItem(el);
795 else DeActivateItem(el);
796 break;
797 }
798 }
799 fClient->NeedRedraw(this);
800}
801
802
803
804
815
817{
818 // Open context menu when user right-clicks an object in the list.
819 // Calling AllowContextMenu(kFALSE) will disable this.
820 // We also fill the list fPickOrderedObjects with the selected objects
821 // in the order of clicking
822 //
823 // if fUseObjLabelAsRealClass=kTRUE (and if objects inherit from KVBase)
824 // then the context menu opened will be that of the class given by
825 // KVBase::GetLabel. The object's KVBase::GetObject() method must
826 // return the real object to use.
827
828 if (but == kButton1) {
829 TGLVEntry* el = (TGLVEntry*)f;
830 TObject* ob = (TObject*)el->GetUserData();
832 if (ob) {
834 if (in_list) fPickOrderedObjects->Remove(ob);
836 }
837 return;
838 }
839
840 // context menus globally disabled and no exceptions defined
842
843 if (but == kButton3) {
844 // Error("OpenContextMenu","x=%d y=%d",x,y);
845 // fContextMenu->Popup(x,y,this); return;
846
847 TGLVEntry* el = (TGLVEntry*)f;
848 TObject* ob = (TObject*)el->GetUserData();
849 if (ob) {
850
851 TObject* CMob = ob;
852 TString CMobClass = ob->ClassName();
853
855 KVBase* bob = dynamic_cast<KVBase*>(ob);
856 CMobClass = bob->GetLabel();
857 CMob = bob->GetObject();
858 }
859 // check class context menu status
863 fContextMenu->Popup(x, y, CMob);
864 }
865 else if (fAllowContextMenu) fContextMenu->Popup(x, y, CMob);
866 }
867 }
868}
869
870
871
872
873
881
883{
884 // Perform 'default' action when user double-left-clicks an object in the list.
885 // By default, this calls the Browse(TBrowser*) method of the object (defined for TObject,
886 // overridden in child classes).
887 // If SetDoubleClickAction() was called, the DoubleClickAction(TObject*) signal
888 // will be emitted with the address of the selected object.
889 // Calling AllowDoubleClick(kFALSE) will disable this.
890
891 if (!fAllowDoubleClick) return;
892
893 if (but == kButton1) {
894 TGLVEntry* el = (TGLVEntry*)f;
895 TObject* ob = (TObject*)el->GetUserData();
896 if (ob) {
898 else ob->Browse(0);
899 }
900 }
901}
902
903
904
905
908
910{
911 // Returns first object in currently displayed list
912
914 if (f) {
915 KVLVEntry* l = (KVLVEntry*)f->fFrame;
916 if (l) {
917 return (TObject*)l->GetUserData();
918 }
919 }
920 return 0;
921}
922
923
924
925
928
930{
931 // Returns last object in currently displayed list
932
934 if (f) {
935 KVLVEntry* l = (KVLVEntry*)f->fFrame;
936 if (l) {
937 return (TObject*)l->GetUserData();
938 }
939 }
940 return 0;
941}
942
943
944
945
949
951{
952 // Create and fill list with all currently selected items (KVLVEntry objects)
953 // USER MUST DELETE TLIST AFTER USE!!!
954
955 TGFrameElement* el;
956 TIter next(fList);
957 TList* ret = new TList();
958
959 while ((el = (TGFrameElement*) next())) {
960 if (el->fFrame->IsActive()) {
961 ret->Add(el->fFrame);
962 }
963 }
964 return ret;
965}
966
967
968
969
970
974
976{
977 // Create and fill list with all currently selected objects (derived from TObject)
978 // USER MUST DELETE TLIST AFTER USE!!!
979
980 TGFrameElement* el;
981 TIter next(fList);
982 TList* ret = new TList();
983
984 while ((el = (TGFrameElement*) next())) {
985 if (el->fFrame->IsActive()) {
986 ret->Add((TObject*)((KVLVEntry*)el->fFrame)->GetUserData());
987 }
988 }
989 return ret;
990}
991
992
993
1002
1004{
1005 // The global context menu status (allowed or not allowed) is set by AllowContextMenu().
1006 // If required, this can be overridden for specific classes by calling this
1007 // method for each required class.
1008 // In this case, any objects in the list of precisely this class (not derived classes)
1009 // will have the opposite behaviour to that defined by AllowContextMenu(),
1010 // i.e. if context menus are globally disabled, this method defines the classes for
1011 // which a context menu is authorised, and vice-versa.
1012
1015}
1016
1017
1018
1019
1029
1030void KVLVContainer::SetDoubleClickAction(const char* receiver_class, void* receiver, const char* slot)
1031{
1032 // Overrides the default 'double-click' action.
1033 // By default, double-clicking on an object in the list will call the Browse(TBrowser*)
1034 // method of the selected object.
1035 // Use this method to override this behaviour.
1036 // When an object is double-clicked the method 'slot' of the object 'receiver' of class
1037 // 'receiver_class' will be called. The method in question must have the signature
1038 // receiver_class::slot(TObject*)
1039 // The address of the selected (T)object is passed as argument.
1040
1041 Connect("DoubleClickAction(TObject*)", receiver_class, receiver, slot);
1043}
1044
1045
1046
1048
1050{
1051 Emit("DoubleClickAction(TObject*)", (Long_t)obj);
1052}
1053
1054
1055
1058
1060{
1061 // Override TGContainer method in order to set fControlClick flag
1063 if (event->fCode == kButton1 && (event->fState & kKeyControlMask)) fControlClick = kTRUE;
1064
1065 if (event->fCode == kButton3) {
1066 TList* list = GetSelectedItems();
1067 if (list->GetSize() == 0) {
1068 fContextMenu->Popup(event->fXRoot, event->fYRoot, this);
1069 delete list;
1070 return kTRUE;
1071 }
1072 else if (list->GetSize() == 1) {
1074 }
1075 delete list;
1076 }
1078}
1079
1080
1081
1083
1084void KVLVContainer::AddDataColumn(const char* columnName)
1085{
1086 if (!fObjClass) return;
1087
1088 SetDataColumn(fNcols + 1, fObjClass, columnName, "GetName");
1089}
1090
1091
1092
1096
1098{
1099 // Override method in TGContainer
1100 // If multiple selection is not enabled, do nothing
1101
1102 if (!GetMultipleSelection()) return;
1103
1104 // Select all items in the container.
1105 // SelectAll() signal emitted.
1106
1107 TIter next(fList);
1108 TGFrameElement* el;
1109 TGFrame* fr;
1111
1112 while ((el = (TGFrameElement*) next())) {
1113 fr = el->fFrame;
1114 if (!fr->IsActive()) {
1116 }
1117 }
1118 fSelected = fTotal;
1119
1121 fTotal, fSelected);
1122 Emit("SelectAll()");
1123
1124}
1125
1126
1129
1131{
1132 // Activate item.
1133 TGFrame* fr = el->fFrame;
1134 fr->Activate(kTRUE);
1135
1136 if (fLastActiveEl != el) {
1137 fLastActiveEl = el;
1140 fSelected++;
1141 }
1142
1143 if (!fSelected) fSelected = 1;
1145 DrawRegion(fr->GetX() - pos.fX, fr->GetY() - pos.fY, fr->GetWidth(), fr->GetHeight());
1146}
1147
1148
int Int_t
unsigned int UInt_t
long Long_t
const Mask_t kKeyControlMask
ULong_t Pixel_t
kButton3
kButton1
#define SafeDelete(p)
#define f(i)
#define s1(x)
bool Bool_t
char Char_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
R__EXTERN TEnv * gEnv
#define gClient
#define N
kMBNo
kMBYes
kMBIconQuestion
winID w
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 name[80]
char * Form(const char *fmt,...)
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
kCT_SELCHANGED
kC_CONTAINER
Base class for KaliVeda framework.
Definition KVBase.h:142
@ kIsKaliVedaObject
Definition KVBase.h:163
virtual TObject * GetObject() const
Definition KVBase.cpp:1560
const Char_t * GetLabel() const
Definition KVBase.h:199
Extension of TDatime to handle various useful date formats.
Definition KVDatime.h:33
EKVDateFormat
Definition KVDatime.h:41
const Char_t * String(EKVDateFormat fmt=kCTIME)
Definition KVDatime.cpp:401
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.
virtual void RemoveAll()
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.
virtual void Refresh()
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)
friend class KVLVEntry
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
TClass * fObjClass
Bool_t fIsResized
used to resize columns exactly once
One item/line in a KVListView window.
Definition KVLVEntry.h:65
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.
Definition KVListView.h:146
Extended TList class which owns its objects by default.
Definition KVList.h:28
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 void Popup(Int_t x, Int_t y, TObject *obj, TBrowser *b)
void Set()
virtual const char * GetValue(const char *name, const char *dflt) const
const char * GetReturnTypeName() const
void Layout() override
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
void MapSubwindows() override
static TGLayoutHints * fgDefaultHints
virtual void RemoveAll()
virtual void Associate(const TGWindow *w)
const TGWindow * fMsgWindow
Int_t fSelected
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
TGLayoutHints * fLayout
TGFrame * fFrame
virtual Bool_t IsActive() const
virtual void Activate(Bool_t)
Int_t GetX() const
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
UInt_t GetHeight() const
Int_t GetY() const
UInt_t GetWidth() const
TGListView * fListView
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()
TGClient * fClient
virtual const TGWindow * GetMainFrame() const
const TGWindow * GetParent() const
void Reset()
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)
EReturnType ReturnType()
static const EReturnType kLong
static const EReturnType kString
TFunction * GetMethod()
static const EReturnType kDouble
void Execute()
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.
Double_t y[n]
Double_t x[n]
TF1 * f1
TH1 * h
TLine l
ClassImp(TPyArg)