Logo ROOT  
Reference Guide
TTVLVContainer.cxx
Go to the documentation of this file.
1// @(#)root/treeviewer:$Id$
2//Author : Andrei Gheata 16/08/00
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "TTVLVContainer.h"
13#include "TTreeViewer.h"
14#include "TGPicture.h"
15#include "TGLabel.h"
16#include "TGButton.h"
17#include "TGTextEntry.h"
18#include "TGToolTip.h"
19#include "TList.h"
20
21
23
24/** \class TGItemContext
25empty object used as context menu support for TGLVTreeEntries.
26*/
27
28////////////////////////////////////////////////////////////////////////////////
29/// Constructor
30
32{
33 fItem = 0;
34}
35
36////////////////////////////////////////////////////////////////////////////////
37/// Draw item
38
40{
42}
43
44////////////////////////////////////////////////////////////////////////////////
45/// Edit expression
46
48{
50}
51
52////////////////////////////////////////////////////////////////////////////////
53/// Empty item
54
56{
57 fItem->Empty();
58}
59
60////////////////////////////////////////////////////////////////////////////////
61/// Remove item
62
64{
66}
67
68////////////////////////////////////////////////////////////////////////////////
69/// Scan item
70
72{
75}
76
77////////////////////////////////////////////////////////////////////////////////
78/// Set item expression
79
80void TGItemContext::SetExpression(const char *name, const char *alias, Bool_t cut)
81{
82 fItem->SetExpression(name, alias, cut);
83}
84
86
87/** \class TTVLVEntry
88This class represent entries that goes into the TreeViewer
89listview container. It subclasses TGLVEntry and adds 2
90data members: the item true name and the alias.
91*/
92
93////////////////////////////////////////////////////////////////////////////////
94/// TTVLVEntry constructor.
95
97 const TGPicture *bigpic, const TGPicture *smallpic,
98 TGString *name, TGString **subnames,
99 EListViewMode ViewMode)
100 :TGLVEntry(p, bigpic, smallpic, name, subnames, ViewMode)
101{
102 // both alias and true name are initialized to name
104
105 fTip = 0;
106 fIsCut = kFALSE;
107 fTrueName = name->GetString();
108 fContext = new TGItemContext();
109 fContext->Associate(this);
110
112}
113
114////////////////////////////////////////////////////////////////////////////////
115/// TTVLVEntry destructor
116
118{
119 if (fTip) delete fTip;
120 delete fContext;
121}
122
123////////////////////////////////////////////////////////////////////////////////
124/// Convert all aliases into true names
125
127{
130 TString start(fConvName);
131 TIter next(list);
132 TTVLVEntry* item;
133 while (!FullConverted()) {
134 next.Reset();
135 start = fConvName;
136 while ((item=(TTVLVEntry*)next())) {
137 if (item != this)
138 fConvName.ReplaceAll(item->GetAlias(), item->GetTrueName());
139 }
140 if (fConvName == start) {
141 //the following line is deadcode reported by coverity because item=0
142 //if (item) Warning(item->GetAlias(), "Cannot convert aliases for this expression.");
143 return(fConvName.Data());
144 }
145 }
146 return(fConvName.Data());
147}
148
149////////////////////////////////////////////////////////////////////////////////
150/// Return true if converted name is alias free
151
153{
155 TIter next(list);
156 TTVLVEntry* item;
157 while ((item=(TTVLVEntry*)next())) {
158 if (item != this) {
159 if (fConvName.Contains(item->GetAlias())) return kFALSE;
160 }
161 }
162 return kTRUE;
163}
164
165////////////////////////////////////////////////////////////////////////////////
166/// Copy this item's name and alias to an other.
167
169{
170 if (!dest) return;
171 dest->SetExpression(fTrueName.Data(), fAlias.Data(), fIsCut);
172 TString alias = dest->GetAlias();
173 if (!alias.BeginsWith("~") && !alias.Contains("empty")) dest->PrependTilde();
174}
175
176////////////////////////////////////////////////////////////////////////////////
177/// Handle mouse crossing event.
178
180{
181 if (fTip) {
182 if (event->fType == kEnterNotify)
183 fTip->Reset();
184 else
185 fTip->Hide();
186 }
187 return kTRUE;
188}
189
190////////////////////////////////////////////////////////////////////////////////
191/// Check if alias name is not empty.
192
194{
195 if (fAlias.Length()) return kTRUE;
196 return kFALSE;
197}
198
199////////////////////////////////////////////////////////////////////////////////
200/// Prepend a ~ to item alias
201
203{
204 fAlias = "~" + fAlias;
206}
207
208////////////////////////////////////////////////////////////////////////////////
209/// Redraw this entry with new name
210
212{
213 if (fItemName) delete fItemName;
214 fItemName = new TGString(name);
215 Int_t max_ascent, max_descent;
217 gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
218 fTHeight = max_ascent + max_descent;
219 gVirtualX->ClearWindow(fId);
221 fClient->NeedRedraw(this);
222}
223
224////////////////////////////////////////////////////////////////////////////////
225/// Set cut type
226
228{
229 if (fIsCut && type) return;
230 if (!fIsCut && !type) return;
231 if (type) {
232 SetSmallPic(fClient->GetPicture("selection_t.xpm"));
233 SetToolTipText("Selection expression. Drag to scissors to activate");
234 } else
235 SetSmallPic(fClient->GetPicture("expression_t.xpm"));
236 fIsCut = type;
237}
238
239////////////////////////////////////////////////////////////////////////////////
240/// Set the true name, alias and type of the expression, then refresh it
241
242void TTVLVEntry::SetExpression(const char* name, const char* alias, Bool_t cutType)
243{
244 SetItemName(alias);
245 SetAlias(alias);
247 ULong_t *itemType = (ULong_t *) GetUserData();
248 if (*itemType & TTreeViewer::kLTPackType) {
249 if (strlen(name))
250 SetSmallPic(fClient->GetPicture("pack_t.xpm"));
251 else
252 SetSmallPic(fClient->GetPicture("pack-empty_t.xpm"));
253 }
254 if ((*itemType & TTreeViewer::kLTDragType) && strlen(name) && !fIsCut)
255 SetToolTipText("Double-click to draw. Drag and drop. Use Edit/Expression or context menu to edit.");
256 if (*itemType & TTreeViewer::kLTDragType) SetCutType(cutType);
257}
258
259////////////////////////////////////////////////////////////////////////////////
260/// Clear all names and alias
261
263{
264 SetExpression("","-empty-");
265 ULong_t *itemType = (ULong_t *) GetUserData();
266 if (itemType && (*itemType & TTreeViewer::kLTDragType))
267 SetToolTipText("User-defined expression/cut. Double-click to edit");
268}
269
270////////////////////////////////////////////////////////////////////////////////
271/// Set tool tip text associated with this item. The delay is in
272/// milliseconds (minimum 250). To remove tool tip call method with text = 0
273
274void TTVLVEntry::SetToolTipText(const char *text, Long_t delayms)
275{
276 if (fTip) {
277 delete fTip;
278 fTip = 0;
279 }
280
281 if (text && strlen(text))
282 fTip = new TGToolTip(fClient->GetRoot(), this, text, delayms);
283}
284////////////////////////////////////////////////////////////////////////////////
285/// Set small picture
286
288{
289 const TGPicture *cspic = fSmallPic;
290 fSmallPic = spic;
292 if (fSelPic) delete fSelPic;
293 fSelPic = 0;
294 if (fActive) {
296 }
297 DoRedraw();
298 fClient->FreePicture(cspic);
299}
300
302
303/** \class TTVLVContainer
304This class represent the list view container for the.
305TreeView class. It is a TGLVContainer with item dragging
306capabilities for the TTVLVEntry objects inside.
307*/
308
309////////////////////////////////////////////////////////////////////////////////
310/// TGLVContainer constructor
311
313 :TGLVContainer(p, w, h,options | kSunkenFrame)
314{
315 fListView = 0;
316 fViewer = 0;
318 fCursor = gVirtualX->CreateCursor(kMove);
319 fDefaultCursor = gVirtualX->CreateCursor(kPointer);
321}
322
323////////////////////////////////////////////////////////////////////////////////
324/// TGLVContainer destructor
325
327{
328 delete fExpressionList;
329}
330
331////////////////////////////////////////////////////////////////////////////////
332/// Return the cut entry
333
335{
337 if (el) {
338 TTVLVEntry *f = (TTVLVEntry *) el->fFrame;
339 if (f) return f->ConvertAliases();
340 return 0;
341 }
342 return 0;
343}
344
345////////////////////////////////////////////////////////////////////////////////
346/// Return the expression item at specific position
347
349{
350 TGFrameElement *el = (TGFrameElement *) fList->At(index);
351 if (el) {
352 TTVLVEntry *item = (TTVLVEntry *) el->fFrame;
353 return item;
354 }
355 return 0;
356}
357
358////////////////////////////////////////////////////////////////////////////////
359/// Return the list of user-defined expressions
360
362{
364 TIter next(fList);
365 TGFrameElement *el;
366 while ((el = (TGFrameElement*)next())) {
367 TTVLVEntry *item = (TTVLVEntry *)el->fFrame;
368 if (item) {
369 ULong_t *itemType = (ULong_t *) item->GetUserData();
370 if ((*itemType & TTreeViewer::kLTExpressionType) &&
371 (*itemType & TTreeViewer::kLTDragType)) fExpressionList->Add(item);
372 }
373 }
374 return fExpressionList;
375}
376
377////////////////////////////////////////////////////////////////////////////////
378/// Return the expression on X
379
381{
383 if (el) {
384 TTVLVEntry *f = (TTVLVEntry *) el->fFrame;
385 if (f) return f->ConvertAliases();
386 return 0;
387 }
388 return 0;
389}
390
391////////////////////////////////////////////////////////////////////////////////
392/// Return the expression on Y
393
395{
397 if (el) {
398 TTVLVEntry *f = (TTVLVEntry *) el->fFrame;
399 if (f) return f->ConvertAliases();
400 return 0;
401 }
402 return 0;
403}
404
405////////////////////////////////////////////////////////////////////////////////
406/// Return the expression on Z
407
409{
411 if (el) {
412 TTVLVEntry *f = (TTVLVEntry *) el->fFrame;
413 if (f) return f->ConvertAliases();
414 return 0;
415 }
416 return 0;
417}
418
419////////////////////////////////////////////////////////////////////////////////
420/// Return the cut entry
421
423{
425 if (el) {
426 TTVLVEntry *f = (TTVLVEntry *) el->fFrame;
427 if (f) return f->GetTrueName();
428 return 0;
429 }
430 return 0;
431}
432
433////////////////////////////////////////////////////////////////////////////////
434/// Handle mouse button event in container.
435
437{
438 int total, selected;
439
440 if (event->fType == kButtonPress) {
441 fXp = event->fX;
442 fYp = event->fY;
443 if (fLastActive) {
445 fLastActive = 0;
446 }
447 total = selected = 0;
448
449 TGFrameElement *el;
450 TIter next(fList);
451 while ((el = (TGFrameElement *) next())) {
452 TTVLVEntry *f = (TTVLVEntry *) el->fFrame;
453 ++total;
454 if (f->GetId() == (Window_t)event->fUser[0]) { // fUser[0] = subwindow
455 f->Activate(kTRUE);
456 if (f->GetTip()) (f->GetTip())->Hide();
457 fX0 = f->GetX();
458 fY0 = f->GetY();
459 ++selected;
460 fLastActive = f;
461 } else {
462 f->Activate(kFALSE);
463 }
464 }
465
466 if (fTotal != total || fSelected != selected) {
467 fTotal = total;
468 fSelected = selected;
471 }
472
473 if (selected == 1 && event->fCode == 1) {
474 ULong_t *itemType = (ULong_t *) fLastActive->GetUserData();
475 if (*itemType & TTreeViewer::kLTDragType) {
477 gVirtualX->SetCursor(fId,fCursor);
478 fXp = event->fX;
479 fYp = event->fY;
480 }
481 }
482 }
483
484 if (event->fType == kButtonRelease) {
485 if (fDragging) {
487 gVirtualX->SetCursor(fId,fDefaultCursor);
489 TGFrameElement *el;
490 TIter next(fList);
491 while ((el = (TGFrameElement *) next())) {
492 TTVLVEntry *f = (TTVLVEntry *) el->fFrame;
493 if ((f == fLastActive) || !f->IsActive()) continue;
494 ULong_t *itemType = (ULong_t *) f->GetUserData();
496 if (!(*itemType & TTreeViewer::kLTPackType)) {
497 // dragging items to expressions
498 ((TTVLVEntry *) fLastActive)->CopyItem(f);
499 if (*itemType & TTreeViewer::kLTDragType)
500 f->SetToolTipText("Double-click to draw. Drag and drop. Use Edit/Expression or context menu to edit.");
501 } else {
502 if (strlen(((TTVLVEntry *) fLastActive)->GetTrueName())) {
503 // dragging to scan box
504 if (!strlen(f->GetTrueName())) {
505 f->SetTrueName(((TTVLVEntry *)fLastActive)->GetTrueName());
506 f->SetSmallPic(fClient->GetPicture("pack_t.xpm"));
507 } else {
508 TString name(2000);
509 TString dragged = ((TTVLVEntry *)fLastActive)->ConvertAliases();
510 name = f->GetTrueName();
511 if ((name.Length()+dragged.Length()) < 228) {
512 name += ":";
513 name += dragged;
514 f->SetTrueName(name.Data());
515 } else {
516 Warning("HandleButton",
517 "Name too long. Can not add any more items to scan box.");
518 }
519 }
520 }
521 }
522 fLastActive = f;
523 if (fViewer) {
524 char msg[2000];
525 msg[0] = 0;
526 snprintf(msg,2000, "Content : %s", f->GetTrueName());
527 fViewer->Message(msg);
528 }
529 }
530 if ((TMath::Abs(event->fX - fXp) < 2) && (TMath::Abs(event->fY - fYp) < 2)) {
532 event->fCode, (event->fYRoot << 16) | event->fXRoot);
533 }
534 } else {
536 event->fCode, (event->fYRoot << 16) | event->fXRoot);
537 }
538 }
539 return kTRUE;
540}
541
542////////////////////////////////////////////////////////////////////////////////
543/// Handle mouse motion events.
544
546{
547 Int_t xf0, xff, yf0, yff;
548 Int_t xpos = event->fX - (fXp-fX0);
549 Int_t ypos = event->fY - (fYp-fY0);
550
551 if (fDragging) {
552 TGFrameElement *el;
553 ULong_t *itemType;
554 TIter next(fList);
555 while ((el = (TGFrameElement *) next())) {
556 TTVLVEntry *f = (TTVLVEntry *) el->fFrame;
557 if (f == fLastActive) {
558 if (f->GetTip()) (f->GetTip())->Hide();
559 continue;
560 }
561 xf0 = f->GetX();
562 yf0 = f->GetY();
563 xff = f->GetX() + f->GetWidth();
564 yff = f->GetY() + f->GetHeight();
565 itemType = (ULong_t *) f->GetUserData();
566 if (*itemType & TTreeViewer::kLTExpressionType) {
567 if (xpos>xf0 && xpos<xff && ypos>yf0 && ypos<yff) {
568 f->Activate(kTRUE);
569 } else {
570 f->Activate(kFALSE);
571 }
572 }
573 }
574 if ((fXp - event->fX) > 10) {
577 }
578 fLastActive->Move(xpos, ypos);
579 gVirtualX->RaiseWindow(fLastActive->GetId());
581 }
582 return kTRUE;
583}
584
585////////////////////////////////////////////////////////////////////////////////
586/// Clear all names and aliases for expression type items
587
589{
590 TGFrameElement *el;
591 TIter next(fList);
592 while ((el = (TGFrameElement *) next())) {
593 TTVLVEntry *f = (TTVLVEntry *) el->fFrame;
594 UInt_t *userData = (UInt_t *) f->GetUserData();
595 if (*userData & TTreeViewer::kLTExpressionType) {
596 if (*userData & TTreeViewer::kLTPackType) {
597 f->SetSmallPic(fClient->GetPicture("pack-empty_t.xpm"));
598 f->SetTrueName("");
599 } else {
600 f->Empty();
601 }
602 }
603 }
604}
605
606////////////////////////////////////////////////////////////////////////////////
607/// Remove all non-static items from the list view, except expressions
608
610{
611 TGFrameElement *el;
612 TIter next(fList);
613 while ((el = (TGFrameElement *) next())) {
614 TTVLVEntry *f = (TTVLVEntry *) el->fFrame;
615 UInt_t *userData = (UInt_t *) f->GetUserData();
616 if (!((*userData) & TTreeViewer::kLTExpressionType)) {
617 RemoveItem(f);
618 }
619 }
620 fLastActive = 0;
621}
622
623////////////////////////////////////////////////////////////////////////////////
624/// Select an item
625
627{
628 if (fLastActive) {
630 fLastActive = 0;
631 }
632 TGFrameElement *el;
633 fSelected = 0;
634 TIter next(fList);
635 while ((el = (TGFrameElement *) next())) {
636 TTVLVEntry *f = (TTVLVEntry *) el->fFrame;
637 if (!strcmp(f->GetItemName()->GetString(),name)) {
638 f->Activate(kTRUE);
639 fLastActive = (TGLVEntry *) f;
640 fSelected++;
641 } else {
642 f->Activate(kFALSE);
643 }
644 }
645}
646
648
649/** \class TGSelectBox
650This class represent a specialized expression editor for
651TTVLVEntry 'true name' and 'alias' data members.
652It is a singleton in order to be able to use it for several
653expressions.
654*/
655
660
662
663////////////////////////////////////////////////////////////////////////////////
664/// TGSelectBox constructor
665
667 UInt_t w, UInt_t h)
668 :TGTransientFrame(p, main, w, h)
669{
670 if (!fgInstance) {
671 fgInstance = this;
673 if (!fViewer) Error("TGSelectBox", "Must be started from viewer");
674 fEntry = 0;
676 fBLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 2, 2, 2);
678
679 fLabel = new TGLabel(this, "");
681
682 fTe = new TGTextEntry(this, new TGTextBuffer(2000));
683 fTe->SetToolTipText("Type an expression using C++ syntax. Click other expression/leaves to paste them here.");
685
686 fLabelAlias = new TGLabel(this, "Alias");
688
689 fTeAlias = new TGTextEntry(this, new TGTextBuffer(100));
690 fTeAlias->SetToolTipText("Define an alias for this expression. Do NOT use leading strings of other aliases.");
692
693 fBf = new TGHorizontalFrame(this, 10, 10);
694
695 fCANCEL = new TGTextButton(fBf, "&Cancel", kTFCancel);
696 fCANCEL->Associate(this);
698
699 fDONE = new TGTextButton(fBf, "&Done", kTFDone);
700 fDONE->Associate(this);
702
704
707
708// SetBackgroundColor(color);
709 Window_t wdum;
710 Int_t ax, ay;
711 gVirtualX->TranslateCoordinates(main->GetId(), GetParent()->GetId(), 25,
712 (Int_t)(((TGFrame *) main)->GetHeight() - fHeight) >> 1,
713 ax, ay, wdum);
714 MoveResize(ax, ay, w, GetDefaultHeight());
715 MapWindow();
716 }
717}
718
719////////////////////////////////////////////////////////////////////////////////
720/// TGSelectBox destructor
721
723{
724 fgInstance = 0;
725 delete fLabel;
726 delete fTe;
727 delete fLabelAlias;
728 delete fTeAlias;
729 delete fDONE;
730 delete fCANCEL;
731 delete fBf;
732 delete fLayout;
733 delete fBLayout;
734 delete fBLayout1;
735}
736
737////////////////////////////////////////////////////////////////////////////////
738/// Close the select box
739
741{
742 gVirtualX->UnmapWindow(GetId());
743 delete this;
744}
745
746////////////////////////////////////////////////////////////////////////////////
747/// Return the pointer to the instantiated singleton
748
750{
751 return fgInstance;
752}
753
754////////////////////////////////////////////////////////////////////////////////
755/// Just focus the cursor inside
756
758{
759 Event_t event;
760 event.fType = kButtonPress;
761 event.fCode = kButton1;
762 event.fX = event.fY = 1;
763 Int_t position = fTe->GetCursorPosition();
764 fTe->HandleButton(&event);
765 fTe->SetCursorPosition(position);
766}
767
768////////////////////////////////////////////////////////////////////////////////
769/// Set label of selection box
770
771void TGSelectBox::SetLabel(const char* title)
772{
773 fLabel->SetText(new TGString(title));
774}
775
776////////////////////////////////////////////////////////////////////////////////
777/// Save the edited entry true name and alias
778
780{
781 if (fEntry) {
782
783 Bool_t cutType;
785 if (name.Length())
786 fEntry->SetToolTipText("Double-click to draw. Drag and drop. Use Edit/Expression or context menu to edit.");
787 else
788 fEntry->SetToolTipText("User-defined expression/cut. Double-click to edit");
789 // Set type of item to "cut" if containing boolean operators
790 cutType = name.Contains("<") || name.Contains(">") || name.Contains("=") ||
791 name.Contains("!") || name.Contains("&") || name.Contains("|");
792 TString alias(fTeAlias->GetText());
793 if (!alias.BeginsWith("~") && !alias.Contains("empty")) fTeAlias->InsertText("~", 0);
795
796 if (fOldAlias.Contains("empty")) {
798 return;
799 }
800 TList *list = fViewer->ExpressionList();
801 TIter next(list);
802 TTVLVEntry* item;
803 while ((item=(TTVLVEntry*)next())) {
804 if (item != fEntry) {
805 name = item->GetTrueName();
806 name.ReplaceAll(fOldAlias.Data(), fTeAlias->GetText());
807 item->SetTrueName(name.Data());
808 }
809 }
810 }
811}
812
813////////////////////////////////////////////////////////////////////////////////
814/// Connect one entry
815
817{
818 fEntry = entry;
819 fTe->SetText(entry->GetTrueName());
820 fTeAlias->SetText(entry->GetAlias());
821 fOldAlias = entry->GetAlias();
822}
823
824////////////////////////////////////////////////////////////////////////////////
825/// Insert text in text entry
826
828{
829 Int_t start = fTe->GetCursorPosition();
831 fTe->SetCursorPosition(start+strlen(text));
832}
833
834////////////////////////////////////////////////////////////////////////////////
835/// Message interpreter
836
838{
839 switch (GET_MSG(msg)) {
840 case kC_TEXTENTRY:
841 switch (GET_SUBMSG(msg)) {
842 case kTE_ENTER:
843 if (ValidateAlias()) SaveText();
844 break;
845 default:
846 break;
847 }
848 break;
849 case kC_COMMAND:
850 switch (GET_SUBMSG(msg)) {
851 case kCM_BUTTON:
852 switch (parm1) {
853 case kTFDone:
854 if (!ValidateAlias()) break;
855 SaveText();
856 CloseWindow();
857 break;
858 case kTFCancel:
859 CloseWindow();
860 break;
861 default:
862 break;
863 }
864 break;
865 default:
866 break;
867 }
868 break;
869 default:
870 if (parm2) break; // just to avoid warning on CC compiler
871 break;
872 }
873 return kTRUE;
874}
875
876////////////////////////////////////////////////////////////////////////////////
877/// Return true if edited alias is not a leading string of other expression aliases
878
880{
881 if (!strcmp(fTeAlias->GetText(), "-empty-") || !strlen(fTeAlias->GetText())) {
882 fViewer->Warning("ValidateAlias", "You should define the alias first.");
883 return kFALSE;
884 }
885 TList *list = fViewer->ExpressionList();
886 TIter next(list);
887 TTVLVEntry* item;
888 while ((item=(TTVLVEntry*)next())) {
889 if (item != fEntry) {
890 TString itemalias(item->GetAlias());
891 if (itemalias.Contains(fTeAlias->GetText())) {
892 fViewer->Warning("ValidAlias", "Alias can not be the leading string of other alias.");
893 return kFALSE;
894 }
895 }
896 }
897 return kTRUE;
898}
@ kButtonRelease
Definition: GuiTypes.h:59
@ kButtonPress
Definition: GuiTypes.h:59
@ kEnterNotify
Definition: GuiTypes.h:60
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:167
const Mask_t kEnterWindowMask
Definition: GuiTypes.h:166
@ kButton1
Definition: GuiTypes.h:213
Handle_t Window_t
Definition: GuiTypes.h:28
#define f(i)
Definition: RSha256.hxx:104
#define h(i)
Definition: RSha256.hxx:106
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
unsigned long ULong_t
Definition: RtypesCore.h:51
long Long_t
Definition: RtypesCore.h:50
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassImp(name)
Definition: Rtypes.h:365
@ kSunkenFrame
Definition: TGFrame.h:61
@ kLHintsRight
Definition: TGLayout.h:33
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsCenterY
Definition: TGLayout.h:35
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
EListViewMode
Definition: TGListView.h:39
static unsigned int total
char name[80]
Definition: TGX11.cxx:109
int type
Definition: TGX11.cxx:120
ETransientFrameCommands
@ kTFCancel
@ kTFDone
#define gVirtualX
Definition: TVirtualX.h:345
@ kMove
Definition: TVirtualX.h:46
@ kPointer
Definition: TVirtualX.h:47
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Int_t GET_MSG(Long_t val)
EWidgetMessageTypes
@ kCT_SELCHANGED
@ kTE_ENTER
@ kCT_ITEMCLICK
@ kC_COMMAND
@ kCM_BUTTON
@ kC_TEXTENTRY
@ kCT_ITEMDBLCLICK
@ kC_CONTAINER
Int_t GET_SUBMSG(Long_t val)
#define snprintf
Definition: civetweb.c:1540
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
Definition: TGCanvas.cxx:2403
virtual void SetHsbPosition(Int_t newPos)
Set position of horizontal scrollbar.
Definition: TGCanvas.cxx:2389
const TGWindow * GetRoot() const
Returns current root (i.e.
Definition: TGClient.cxx:224
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:289
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:372
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition: TGClient.cxx:308
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
Definition: TGFrame.h:375
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1146
Bool_t fMapSubwindows
Definition: TGFrame.h:354
TList * fList
Definition: TGFrame.h:351
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:373
virtual void RemoveItem(TGFrame *item)
Remove item from container.
Definition: TGCanvas.cxx:655
const TGWindow * fMsgWindow
Definition: TGCanvas.h:52
Int_t fYp
Definition: TGCanvas.h:54
Int_t fY0
Definition: TGCanvas.h:55
Int_t fSelected
Definition: TGCanvas.h:59
Int_t fX0
Definition: TGCanvas.h:55
Int_t fXp
Definition: TGCanvas.h:54
Bool_t fDragging
Definition: TGCanvas.h:57
Int_t fTotal
Definition: TGCanvas.h:58
TGFrame * fFrame
Definition: TGLayout.h:119
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:321
UInt_t fHeight
Definition: TGFrame.h:135
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:627
virtual void Move(Int_t x, Int_t y)
Move frame.
Definition: TGFrame.cxx:575
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
UInt_t GetHeight() const
Definition: TGFrame.h:272
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
Definition: TGFrame.cxx:611
virtual void MapWindow()
Definition: TGFrame.h:251
empty object used as context menu support for TGLVTreeEntries.
void EditExpression()
Edit expression.
void Empty()
Empty item.
TGItemContext()
Constructor.
void Draw(Option_t *option="")
Draw item.
void RemoveItem()
Remove item.
TTVLVEntry * fItem
void Scan()
Scan item.
void SetExpression(const char *name="", const char *alias="-empty-", Bool_t cut=kFALSE)
Set item expression.
void Associate(TTVLVEntry *item)
TGLVEntry * fLastActive
Definition: TGListView.h:209
const TGPicture * fCurrent
Definition: TGListView.h:73
UInt_t fTHeight
Definition: TGListView.h:67
UInt_t fTWidth
Definition: TGListView.h:66
virtual void DoRedraw()
Redraw list view item.
Definition: TGListView.cxx:314
Bool_t fActive
Definition: TGListView.h:68
FontStruct_t fFontStruct
Definition: TGListView.h:77
TGString * fItemName
Definition: TGListView.h:61
void * GetUserData() const
Definition: TGListView.h:113
virtual TGDimension GetDefaultSize() const
Get default size of list item.
Definition: TGListView.cxx:463
virtual void Activate(Bool_t a)
Make list view item active.
Definition: TGListView.cxx:254
TGSelectedPicture * fSelPic
Definition: TGListView.h:75
const TGPicture * fSmallPic
Definition: TGListView.h:72
virtual void SetText(TGString *newText)
Set new text in label.
Definition: TGLabel.cxx:177
TGClient * fClient
Definition: TGObject.h:37
Handle_t GetId() const
Definition: TGObject.h:47
Handle_t fId
Definition: TGObject.h:36
This class represent a specialized expression editor for TTVLVEntry 'true name' and 'alias' data memb...
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Message interpreter.
TGHorizontalFrame * fBf
TGSelectBox(const TGWindow *p, const TGWindow *main, UInt_t w=10, UInt_t h=10)
TGSelectBox constructor.
TGLayoutHints * fBLayout1
TGTextEntry * fTeAlias
virtual void CloseWindow()
Close the select box.
virtual ~TGSelectBox()
TGSelectBox destructor.
void InsertText(const char *text)
Insert text in text entry.
TGLayoutHints * fBLayout
TGLabel * fLabelAlias
TGLayoutHints * fLayout
TGTextButton * fCANCEL
void GrabPointer()
Just focus the cursor inside.
void SetLabel(const char *title)
Set label of selection box.
void SetEntry(TTVLVEntry *entry)
Connect one entry.
static TGSelectBox * fgInstance
TTVLVEntry * fEntry
static TGSelectBox * GetInstance()
Return the pointer to the instantiated singleton.
Bool_t ValidateAlias()
Return true if edited alias is not a leading string of other expression aliases.
TGLabel * fLabel
TString fOldAlias
TGTextEntry * fTe
TTreeViewer * fViewer
TGTextButton * fDONE
void SaveText()
Save the edited entry true name and alias.
Int_t GetLength() const
Definition: TGString.h:39
const char * GetString() const
Definition: TGString.h:40
Int_t GetCursorPosition() const
Definition: TGTextEntry.h:128
const char * GetText() const
Definition: TGTextEntry.h:134
virtual void SetCursorPosition(Int_t pos)
Set the cursor position to newPos.
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
virtual void SetText(const char *text, Bool_t emit=kTRUE)
Sets text entry to text, clears the selection and moves the cursor to the end of the line.
virtual void InsertText(const char *text, Int_t pos)
Inserts text at position pos, clears the selection and moves the cursor to the end of the line.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in text entry widget.
void Hide()
Hide tool tip window.
Definition: TGToolTip.cxx:246
void Reset()
Reset tool tip popup delay timer.
Definition: TGToolTip.cxx:259
const TGWindow * fMain
Definition: TGFrame.h:578
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:84
const TGWindow * GetParent() const
Definition: TGWindow.h:85
void Reset()
Definition: TCollection.h:252
A doubly linked list.
Definition: TList.h:44
virtual void Add(TObject *obj)
Definition: TList.h:87
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition: TList.cxx:354
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:399
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:866
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
Basic string class.
Definition: TString.h:131
Ssiz_t Length() const
Definition: TString.h:405
const char * Data() const
Definition: TString.h:364
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:687
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition: TString.h:610
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:619
This class represent the list view container for the.
Cursor_t fDefaultCursor
void SelectItem(const char *name)
Select an item.
TList * fExpressionList
TList * ExpressionList()
Return the list of user-defined expressions.
const char * Cut()
Return the cut entry.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion events.
TTreeViewer * GetViewer()
const char * Ez()
Return the expression on Z.
TGListView * fListView
const char * Ey()
Return the expression on Y.
const char * ScanList()
Return the cut entry.
TTreeViewer * fViewer
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in container.
TTVLVEntry * ExpressionItem(Int_t index)
Return the expression item at specific position.
virtual ~TTVLVContainer()
TGLVContainer destructor.
const char * Ex()
Return the expression on X.
TTVLVContainer(const TGWindow *p, UInt_t w, UInt_t h, UInt_t options=kSunkenFrame)
TGLVContainer constructor.
void EmptyAll()
Clear all names and aliases for expression type items.
void RemoveNonStatic()
Remove all non-static items from the list view, except expressions.
This class represent entries that goes into the TreeViewer listview container.
void SetSmallPic(const TGPicture *spic)
Set small picture.
void SetCutType(Bool_t type=kFALSE)
Set cut type.
Bool_t fIsCut
Bool_t HasAlias()
Check if alias name is not empty.
TTVLVContainer * GetContainer()
TTVLVContainer * fContainer
TGToolTip * fTip
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
void SetAlias(const char *alias)
void SetToolTipText(const char *text, Long_t delayms=1000)
Set tool tip text associated with this item.
void SetTrueName(const char *name)
TGItemContext * fContext
const char * ConvertAliases()
Convert all aliases into true names.
void SetExpression(const char *name, const char *alias, Bool_t cutType=kFALSE)
Set the true name, alias and type of the expression, then refresh it.
void CopyItem(TTVLVEntry *dest)
Copy this item's name and alias to an other.
const char * GetAlias()
TString fConvName
TString fTrueName
TString fAlias
void Empty()
Clear all names and alias.
void SetItemName(const char *name)
Redraw this entry with new name.
virtual ~TTVLVEntry()
TTVLVEntry destructor.
const char * GetTrueName()
Bool_t FullConverted()
Return true if converted name is alias free.
TTVLVEntry(const TGWindow *p, const TGPicture *bigpic, const TGPicture *smallpic, TGString *name, TGString **subnames, EListViewMode ViewMode)
TTVLVEntry constructor.
void PrependTilde()
Prepend a ~ to item alias.
A graphic user interface designed to handle ROOT trees and to take advantage of TTree class features.
Definition: TTreeViewer.h:54
void EditExpression()
@ kLTExpressionType
Definition: TTreeViewer.h:69
void RemoveItem()
void SetScanMode(Bool_t mode=kTRUE)
Definition: TTreeViewer.h:219
void Message(const char *msg)
TList * ExpressionList()
Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
TText * text
int main(int argc, char **argv)
Short_t Abs(Short_t d)
Definition: TMathBase.h:120
EGEventType fType
Definition: GuiTypes.h:174
Int_t fY
Definition: GuiTypes.h:177
Int_t fXRoot
Definition: GuiTypes.h:178
Int_t fYRoot
Definition: GuiTypes.h:178
Int_t fX
Definition: GuiTypes.h:177
Long_t fUser[5]
Definition: GuiTypes.h:186
UInt_t fCode
Definition: GuiTypes.h:179
#define dest(otri, vertexptr)
Definition: triangle.c:1040