Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGListView.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 17/01/98
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
13 This source is based on Xclass95, a Win95-looking GUI toolkit.
14 Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15
16 Xclass95 is free software; you can redistribute it and/or
17 modify it under the terms of the GNU Library General Public
18 License as published by the Free Software Foundation; either
19 version 2 of the License, or (at your option) any later version.
20
21**************************************************************************/
22
23
24/** \class TGListView
25 \ingroup guiwidgets
26
27A list view is a widget that can contain a number of items
28arranged in a grid or list. The items can be represented either
29by a string or by an icon.
30
31The TGListView is user callable. The other classes are service
32classes of the list view.
33
34A list view can generate the following events:
35 - kC_CONTAINER, kCT_SELCHANGED, total items, selected items.
36 - kC_CONTAINER, kCT_ITEMCLICK, which button, location (y<<16|x).
37 - kC_CONTAINER, kCT_ITEMDBLCLICK, which button, location (y<<16|x).
38
39*/
40
41
42#include "TGListView.h"
43#include "TGPicture.h"
44#include "TGButton.h"
45#include "TGScrollBar.h"
46#include "TGResourcePool.h"
47#include "TList.h"
48#include "TSystem.h"
49#include "TGMimeTypes.h"
50#include "TObjString.h"
51#include "TVirtualX.h"
52
53#include <iostream>
54
55const TGFont *TGLVEntry::fgDefaultFont = nullptr;
57
58const TGFont *TGListView::fgDefaultFont = nullptr;
60
61
62
63////////////////////////////////////////////////////////////////////////////////
64/// Create a list view item.
65
69 UInt_t options, Pixel_t back) :
70 TGFrame(p, 10, 10, options, back)
71{
72 fSelPic = 0;
73
74 fCurrent =
77
78 fCheckMark = fClient->GetPicture("checkmark_t.xpm");
80
83 fUserData = 0;
84
85 fCpos = fJmode = 0;
86 fCtw = nullptr;
88
91
93 fTWidth = gVirtualX->TextWidth(fFontStruct,
96 gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
98
99 if (fSubnames) {
100 Int_t i;
101 for (i = 0; fSubnames[i] != 0; ++i)
102 ;
103 fCtw = new int[i+1];
104 fCtw[i] = 0;
105 for (i = 0; fSubnames[i] != 0; ++i) {
106 fCtw[i] = gVirtualX->TextWidth(fFontStruct, fSubnames[i]->GetString(),
107 fSubnames[i]->GetLength());
108 }
109 }
110
113}
114
115////////////////////////////////////////////////////////////////////////////////
116/// Create a list view item.
117///
118/// name - is name of item.
119/// cname - is name of icon. In most cases this is class name of object
120/// associated with this item.
121
123 const TString& cname, TGString **subnames,
124 UInt_t options, Pixel_t back) :
125 TGFrame(p, 10, 10, options, back)
126{
127 fSelPic = 0;
128
129 fCurrent =
131 fCheckMark = fClient->GetPicture("checkmark_t.xpm");
133
134 if (!fBigPic) {
135 fBigPic = fClient->GetPicture("doc_s.xpm");
136 }
138 if (!fSmallPic) {
139 fSmallPic = fClient->GetPicture("doc_t.xpm");
140 }
141
142 fItemName = new TGString(name);
144 fUserData = 0;
145
146 fCpos = fJmode = 0;
147
148 fCtw = nullptr;
149
150 fActive = kFALSE;
151
153 fNormGC = GetDefaultGC()();
154
157 gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
159
160 if (fSubnames) {
161 Int_t i;
162 for (i = 0; fSubnames[i] != 0; ++i)
163 ;
164 fCtw = new int[i+1];
165 fCtw[i] = 0;
166 for (i = 0; fSubnames[i] != 0; ++i) {
167 fCtw[i] = gVirtualX->TextWidth(fFontStruct, fSubnames[i]->GetString(),
168 fSubnames[i]->GetLength());
169 }
170 }
171
173 SetViewMode((EListViewMode)p->GetViewMode());
174}
175
176////////////////////////////////////////////////////////////////////////////////
177/// Delete a list view item.
178
180{
181 if (fItemName) delete fItemName;
182 if (fSelPic) delete fSelPic;
183 if (fSubnames) {
184 for (Int_t i = 0; fSubnames[i] != 0; ++i) delete fSubnames[i];
185 delete [] fSubnames;
186 fSubnames = nullptr;
187 }
188 if (fCtw) {
189 delete [] fCtw;
190 fCtw = nullptr;
191 }
192}
193
194////////////////////////////////////////////////////////////////////////////////
195/// Sets new subnames.
196
197void TGLVEntry::SetSubnames(const char* n1,const char* n2,const char* n3,
198 const char* n4,const char* n5,const char* n6,
199 const char* n7,const char* n8,const char* n9,
200 const char* n10,const char* n11,const char* n12)
201{
202 if (fSubnames) {
203 for (Int_t i = 0; fSubnames[i] != 0; ++i) delete fSubnames[i];
204 delete [] fSubnames;
205 }
206 if (fCtw) {
207 delete [] fCtw;
208 }
209
210 Int_t ncol = 0;
211 fSubnames = nullptr;
212 fCtw = nullptr;
213
214 if (n12 && strlen(n12)) ncol=12;
215 else if (n11 && strlen(n11)) ncol=11;
216 else if (n10 && strlen(n10)) ncol=10;
217 else if (n9 && strlen(n9)) ncol=9;
218 else if (n8 && strlen(n8)) ncol=8;
219 else if (n7 && strlen(n7)) ncol=7;
220 else if (n6 && strlen(n6)) ncol=6;
221 else if (n5 && strlen(n5)) ncol=5;
222 else if (n4 && strlen(n4)) ncol=4;
223 else if (n3 && strlen(n3)) ncol=3;
224 else if (n2 && strlen(n2)) ncol=2;
225 else if (n1 && strlen(n1)) ncol=1;
226
227 if (!ncol) return;
228
229 fSubnames = new TGString* [ncol+1];
230
231 if (ncol>11) fSubnames[11] = new TGString(n12);
232 if (ncol>10) fSubnames[10] = new TGString(n11);
233 if (ncol>9) fSubnames[9] = new TGString(n10);
234 if (ncol>8) fSubnames[8] = new TGString(n9);
235 if (ncol>7) fSubnames[7] = new TGString(n8);
236 if (ncol>6) fSubnames[6] = new TGString(n7);
237 if (ncol>5) fSubnames[5] = new TGString(n6);
238 if (ncol>4) fSubnames[4] = new TGString(n5);
239 if (ncol>3) fSubnames[3] = new TGString(n4);
240 if (ncol>2) fSubnames[2] = new TGString(n3);
241 if (ncol>1) fSubnames[1] = new TGString(n2);
242 if (ncol>0) fSubnames[0] = new TGString(n1);
243 fSubnames[ncol] = 0;
244
245 fCtw = new int[ncol];
246 fCtw[ncol-1] = 0;
247
248 for (int i = 0; i<ncol; i++) {
249 fCtw[i] = gVirtualX->TextWidth(fFontStruct, fSubnames[i]->GetString(),
250 fSubnames[i]->GetLength());
251 }
252}
253
254////////////////////////////////////////////////////////////////////////////////
255/// Make list view item active.
256
258{
259 if (fActive == a) return;
260 fActive = a;
261
262 if (fActive) {
264 } else {
265 if (fSelPic) delete fSelPic;
266 fSelPic = nullptr;
267 }
268 DoRedraw();
269}
270
271////////////////////////////////////////////////////////////////////////////////
272/// Set the view mode for this list item.
273
275{
276 if (viewMode != fViewMode) {
278 if (viewMode == kLVLargeIcons)
280 else
282 if (fActive) {
283 if (fSelPic) delete fSelPic;
285 }
286 gVirtualX->ClearWindow(fId);
288 fClient->NeedRedraw(this);
289 }
290}
291
292////////////////////////////////////////////////////////////////////////////////
293/// change pictures
294
296{
297 if (!bigpic || !smallpic) return;
298
299 gVirtualX->ClearWindow(fId);
300
301 fBigPic = bigpic;
304
305 if (fSelPic) delete fSelPic;
307
308 Resize();
309 gVirtualX->ClearWindow(fId);
310}
311
312////////////////////////////////////////////////////////////////////////////////
313/// Redraw list view item.
314/// List view item is placed and laid out in the container frame,
315/// but is drawn in viewport.
316
318{
319 DrawCopy(fId, 0, 0);
320}
321
322////////////////////////////////////////////////////////////////////////////////
323/// Draw list view item in other window.
324/// List view item is placed and layout in the container frame,
325/// but is drawn in viewport.
326
328{
329 Int_t ix, iy, lx, ly;
331
332 gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
335
336 if (fViewMode == kLVLargeIcons) {
337 ix = (fWidth - fCurrent->GetWidth()) >> 1;
338 iy = 0;
339 lx = (fWidth - fTWidth) >> 1;
340 ly = fHeight - (fTHeight + 1) - 2;
341 } else {
342 ix = 0;
343 iy = (fHeight - fCurrent->GetHeight()) >> 1;
344 lx = fCurrent->GetWidth() + 2;
345 ly = (fHeight - (fTHeight + 1)) >> 1;
346 }
347
348 if ((fChecked) && (fCheckMark)) {
349 if (fViewMode == kLVLargeIcons) {
350 fCheckMark->Draw(id, fNormGC, x + ix + 8, y + iy + 8);
351 gVirtualX->SetForeground(fNormGC, fgWhitePixel);
352 gVirtualX->FillRectangle(id, fNormGC, x + lx, y + ly, fTWidth, fTHeight + 1);
353 gVirtualX->SetForeground(fNormGC, fgBlackPixel);
354 }
355 else {
356 fCheckMark->Draw(id, fNormGC, x + ix, y + iy);
357 gVirtualX->SetForeground(fNormGC, fgWhitePixel);
358 gVirtualX->FillRectangle(id, fNormGC, x + lx, y, fWidth-lx, fHeight);
359 gVirtualX->SetForeground(fNormGC, fgBlackPixel);
360 }
361 }
362 // This if tries to print the elements with ... appended at the end if
363 // the width of the string is longer than that of the column
364 if (fViewMode == kLVDetails && fSubnames && fCpos && fJmode && fCtw) {
367 tmpString.Length());
368 if ( ftmpWidth > (fCpos[0] - lx) ) {
369 for (Int_t j = fItemName->Length() - 1 ; j > 0; j--) {
370 tmpString = (*fItemName)(0,j) + "...";
372 tmpString.Length());
373 if ( ftmpWidth <= (fCpos[0] - lx) ) {
374 break;
375 }
376 }
377 }
378 if (fActive) {
379 if (fSelPic) fSelPic->Draw(id, fNormGC, x + ix, y + iy);
381 gVirtualX->FillRectangle(id, fNormGC, x + lx, y, fWidth-(lx+4), fHeight);
382 gVirtualX->SetForeground(fNormGC, fClient->GetResourcePool()->GetSelectedFgndColor());
383 } else {
384 fCurrent->Draw(id, fNormGC, x + ix, y + iy);
385 gVirtualX->SetForeground(fNormGC, fgWhitePixel);
386 gVirtualX->FillRectangle(id, fNormGC, x + lx, y, fWidth-(lx+4), fHeight);
387 gVirtualX->SetForeground(fNormGC, fgBlackPixel);
388 }
389
391 tmpTGString.Draw(id, fNormGC, x+lx, y+ly + max_ascent);
392 } else if (fViewMode == kLVLargeIcons) {
393 if (fActive) {
394 if (fSelPic) fSelPic->Draw(id, fNormGC, x + ix, y + iy);
396 gVirtualX->FillRectangle(id, fNormGC, x + lx, y + ly, fTWidth, fTHeight + 1);
397 gVirtualX->SetForeground(fNormGC, fClient->GetResourcePool()->GetSelectedFgndColor());
398 } else {
399 fCurrent->Draw(id, fNormGC, x + ix, y + iy);
400 gVirtualX->SetForeground(fNormGC, fgWhitePixel);
401 gVirtualX->FillRectangle(id, fNormGC, x + lx, y + ly, fTWidth, fTHeight + 1);
402 gVirtualX->SetForeground(fNormGC, fgBlackPixel);
403 }
405 } else {
406 if (fActive) {
408 gVirtualX->FillRectangle(id, fNormGC, x + lx, y, fWidth-lx, fHeight);
409 gVirtualX->SetForeground(fNormGC, fClient->GetResourcePool()->GetSelectedFgndColor());
410 if (fSelPic) fSelPic->Draw(id, fNormGC, x + ix, y + iy);
411 } else {
412 gVirtualX->SetForeground(fNormGC, fgWhitePixel);
413 gVirtualX->FillRectangle(id, fNormGC, x + lx, y, fWidth-lx, fHeight);
414 gVirtualX->SetForeground(fNormGC, fgBlackPixel);
415 fCurrent->Draw(id, fNormGC, x + ix, y + iy);
416 }
418 }
419
420 if (fViewMode == kLVDetails) {
421 if (fSubnames && fCpos && fJmode && fCtw) {
422 int i;
423
424 if (fActive) {
425 gVirtualX->SetForeground(fNormGC, fClient->GetResourcePool()->GetSelectedFgndColor());
426 } else {
427 gVirtualX->SetForeground(fNormGC, fgBlackPixel);
428 }
429 // Again fixes the size of the strings
430 for (i = 0; fSubnames[i] != 0; ++i) {
433 tmpString.Length());
434 if ( ftmpWidth > (fCpos[i+1] - fCpos[i]) ) {
435 for (int j = fSubnames[i]->Length() - 1 ; j > 0; j--) {
436 tmpString = (*fSubnames[i])(0,j) + "...";
438 tmpString,
439 tmpString.Length());
440 if ( ftmpWidth <= (fCpos[i+1] - fCpos[i]) ) {
441 break;
442 }
443 }
444 }
445 if (fCpos[i] == 0)
446 break;
447 if (fJmode[i] == kTextRight)
448 lx = fCpos[i+1] - ftmpWidth - 2;
449 else if (fJmode[i] == kTextCenterX)
450 lx = (fCpos[i] + fCpos[i+1] - ftmpWidth) >> 1;
451 else // default to TEXT_LEFT
452 lx = fCpos[i] + 2;
453
454 //if (x + lx < 0) continue; // out of left boundary or mess in name
456 tmpTGString.Draw(id, fNormGC, x + lx, y + ly + max_ascent);
457 }
458 }
459 }
460 gVirtualX->SetForeground(fNormGC, fgBlackPixel);
461}
462
463////////////////////////////////////////////////////////////////////////////////
464/// Get default size of list item.
465
467{
469 TGDimension isize(fCurrent ? fCurrent->GetWidth() : 0,
470 fCurrent ? fCurrent->GetHeight() : 0);
472
473 switch (fViewMode) {
474 default:
475 case kLVLargeIcons:
476 size.fWidth = std::max(isize.fWidth, lsize.fWidth);
477 size.fHeight = isize.fHeight + lsize.fHeight + 6;
478 break;
479
480 case kLVSmallIcons:
481 case kLVList:
482 case kLVDetails:
483 size.fWidth = isize.fWidth + lsize.fWidth + 4;
484 size.fHeight = std::max(isize.fHeight, lsize.fHeight);
485 break;
486 }
487 return size;
488}
489
490////////////////////////////////////////////////////////////////////////////////
491/// Return the default font structure in use.
492
494{
495 if (!fgDefaultFont)
496 fgDefaultFont = gClient->GetResourcePool()->GetIconFont();
497 return fgDefaultFont->GetFontStruct();
498}
499
500////////////////////////////////////////////////////////////////////////////////
501/// Return the default graphics context in use.
502
504{
505 if (!fgDefaultGC) {
506 fgDefaultGC = new TGGC(*gClient->GetResourcePool()->GetFrameGC());
507 fgDefaultGC->SetFont(fgDefaultFont->GetFontHandle());
508 }
509 return *fgDefaultGC;
510}
511
512
513////////////////////////////////////////////////////////////////////////////////
514/// Create a list view container. This is the (large) frame that contains
515/// all the list items. It will be shown through a TGViewPort (which is
516/// created by the TGCanvas derived TGListView).
517
519 UInt_t options, Pixel_t back) :
520 TGContainer(p, w, h, options, back)
521{
522 fListView = 0;
523 fLastActive = 0;
524 fCpos = fJmode = 0;
526
529
530 SetLayoutManager(new TGTileLayout(this, 8));
531}
532
533////////////////////////////////////////////////////////////////////////////////
534/// Create a list view container. This is the (large) frame that contains
535/// all the list items. It will be shown through a TGViewPort (which is
536/// created by the TGCanvas derived TGListView).
537
539 TGContainer(p,options, back)
540{
541 fListView = 0;
542 fLastActive = 0;
543 fCpos = fJmode = 0;
545
548
549 SetLayoutManager(new TGTileLayout(this, 8));
550
551 if (p->InheritsFrom(TGListView::Class())) fListView = (TGListView*)p;
552}
553
554////////////////////////////////////////////////////////////////////////////////
555/// Delete list view container.
556
558{
559 if (!MustCleanup()) {
560 RemoveAll();
561 delete fItemLayout;
562 }
563}
564
565////////////////////////////////////////////////////////////////////////////////
566/// set columns headers
567
568void TGLVContainer::SetColHeaders(const char* n1,const char* n2,const char* n3,
569 const char* n4,const char* n5,const char* n6,
570 const char* n7,const char* n8,const char* n9,
571 const char* n10,const char* n11,const char* n12)
572{
573 if (!fListView) return;
574
575 Int_t ncol = -1;
576 if (n12 && strlen(n12)) ncol=12;
577 else if (n11 && strlen(n11)) ncol=11;
578 else if (n10 && strlen(n10)) ncol=10;
579 else if (n9 && strlen(n9)) ncol=9;
580 else if (n8 && strlen(n8)) ncol=8;
581 else if (n7 && strlen(n7)) ncol=7;
582 else if (n6 && strlen(n6)) ncol=6;
583 else if (n5 && strlen(n5)) ncol=5;
584 else if (n4 && strlen(n4)) ncol=4;
585 else if (n3 && strlen(n3)) ncol=3;
586 else if (n2 && strlen(n2)) ncol=2;
587 else if (n1 && strlen(n1)) ncol=1;
588
589 if (ncol<0) return;
590
604
605 fListView->Layout();
606}
607
608////////////////////////////////////////////////////////////////////////////////
609/// Set list view mode for container.
610
612{
613 if (fViewMode != viewMode) {
615
619
620 if (viewMode == kLVLargeIcons)
622 else
624
626 TIter next(fList);
627 while ((el = (TGFrameElement *) next())) {
628 el->fLayout = fItemLayout;
629 ((TGLVEntry *) el->fFrame)->SetViewMode(viewMode);
630 }
631 delete oldLayout;
632
633 switch (viewMode) {
634 default:
635 case kLVLargeIcons:
636 SetLayoutManager(new TGTileLayout(this, 8));
637 break;
638
639 case kLVSmallIcons:
640 SetLayoutManager(new TGTileLayout(this, 2));
641 break;
642
643 case kLVList:
644 SetLayoutManager(new TGListLayout(this, 2));
645 break;
646
647 case kLVDetails:
649 break;
650 }
651
652 TGCanvas *canvas = (TGCanvas *) this->GetParent()->GetParent();
653
654 // layout and adjust position after layout
658 canvas->Layout();
659 pos.fX = (pos.fX*fWidth)/width;
660 pos.fY = (pos.fY*fHeight)/height;
661
662 if (old == kLVList) { // switch x <-> y
663 SetVsbPosition(pos.fX);
665 } else if (fViewMode == kLVList) {
666 SetHsbPosition(pos.fY);
667 } else {
668 SetVsbPosition(pos.fY);
669 SetHsbPosition(pos.fX);
670 }
671 }
672}
673
674////////////////////////////////////////////////////////////////////////////////
675/// Set column information for list items.
676
678{
679 fCpos = cpos;
680 fJmode = jmode;
681
683 TIter next(fList);
684 while ((el = (TGFrameElement *) next())) {
685 ((TGLVEntry *) el->fFrame)->SetColumns(fCpos, fJmode);
686 }
687 Layout();
688}
689
690////////////////////////////////////////////////////////////////////////////////
691/// Get size of largest item in container.
692
694{
696
698 TIter next(fList);
699 while ((el = (TGFrameElement *) next())) {
700 csize = el->fFrame->GetDefaultSize();
701 maxsize.fWidth = std::max(maxsize.fWidth, csize.fWidth);
702 maxsize.fHeight = std::max(maxsize.fHeight, csize.fHeight);
703 }
704 if (fViewMode == kLVLargeIcons) {
705 maxsize.fWidth += 8;
706 maxsize.fHeight += 8;
707 } else {
708 maxsize.fWidth += 2;
709 maxsize.fHeight += 2;
710 }
711 return maxsize;
712}
713
714////////////////////////////////////////////////////////////////////////////////
715/// Get width of largest subname in container.
716
718{
719 if (idx == 0) {
720 return GetMaxItemSize().fWidth;
721 }
722
723 Int_t width, maxwidth = 0;
724
726 TIter next(fList);
727 while ((el = (TGFrameElement *) next())) {
728 TGLVEntry *entry = (TGLVEntry *) el->fFrame;
729 width = entry->GetSubnameWidth(idx-1);
730 maxwidth = std::max(maxwidth, width);
731 }
732 return maxwidth;
733}
734
735////////////////////////////////////////////////////////////////////////////////
736/// Remove item with fUserData == userData from container.
737
739{
741 TIter next(fList);
742 while ((el = (TGFrameElement *) next())) {
743 TGLVEntry *f = (TGLVEntry *) el->fFrame;
744 if (f->GetUserData() == userData) {
745 RemoveItem(f);
746 break;
747 }
748 }
749}
750
751////////////////////////////////////////////////////////////////////////////////
752/// Select/activate item.
753
759
760////////////////////////////////////////////////////////////////////////////////
761/// Unselect/deactivate item.
762
768
769////////////////////////////////////////////////////////////////////////////////
770/// Handle mouse button event in container.
771
773{
774 if ( !fMultiSelect ) {
775 return TGContainer::HandleButton(event);
776 }
777
778 Int_t total = 0, selected = fSelected, page = 0;
779
783 page = dim.fHeight/4;
784
785 if (event->fCode == kButton4) {
786 //scroll up
787 newpos = pos.fY - page;
788 if (newpos < 0) newpos = 0;
790 return kTRUE;
791 }
792 if (event->fCode == kButton5) {
793 // scroll down
796 return kTRUE;
797 }
798
799 Int_t xx = pos.fX + event->fX; // translate coordinates
800 Int_t yy = pos.fY + event->fY;
801
802 if (event->fType == kButtonPress) {
803 gVirtualX->SetInputFocus(fId);
804
805 fXp = pos.fX + event->fX;
806 fYp = pos.fY + event->fY;
807
809 TIter next(fList);
811
812 if (event->fState & kKeyShiftMask) {
814 TGLVEntry* last = fLastActive;
815
816 while ((el = (TGFrameElement *) next())) {
818
819 if (!fMapSubwindows) {
820 if ((Int_t(el->fFrame->GetY()) + (Int_t)el->fFrame->GetHeight() > yy ) &&
821 (Int_t(el->fFrame->GetX()) + (Int_t)el->fFrame->GetWidth() > xx ) &&
822 (Int_t(el->fFrame->GetY()) < yy) &&
823 (Int_t(el->fFrame->GetX()) < xx)) {
825 }
826 } else {
827 if (el->fFrame->GetId() == (Window_t)event->fUser[0]) {
829 }
830 }
831
832 if (select_frame || last==el->fFrame)
834 if (inSelection || select_frame) {
835 if ( !el->fFrame->IsActive() ) {
836 selected++;
838 }
839 Clicked(el->fFrame, event->fCode);
840 Clicked(el->fFrame, event->fCode, event->fXRoot, event->fYRoot);
841 }
842 total++;
843 }
844 } else if (event->fState & kKeyControlMask) {
845 // DO NOTHING!
846 } else {
847 UnSelectAll();
848 total = selected = 0;
849 }
850
851 while ((el = (TGFrameElement *) next())) {
853
854 if (!fMapSubwindows) {
855 if ((Int_t(el->fFrame->GetY()) + (Int_t)el->fFrame->GetHeight() > yy ) &&
856 (Int_t(el->fFrame->GetX()) + (Int_t)el->fFrame->GetWidth() > xx ) &&
857 (Int_t(el->fFrame->GetY()) < yy) &&
858 (Int_t(el->fFrame->GetX()) < xx)) {
860 }
861 } else {
862 if (el->fFrame->GetId() == (Window_t)event->fUser[0]) {
864 }
865 }
866
867 if (select_frame) {
868 if ( el->fFrame->IsActive() ) {
869 selected--;
871 } else {
872 selected++;
874 }
875 Clicked(el->fFrame, event->fCode);
876 Clicked(el->fFrame, event->fCode, event->fXRoot, event->fYRoot);
877 }
878 total++;
879 }
880
881 if (fTotal != total || fSelected != selected) {
882 fTotal = total;
883 fSelected = selected;
886 }
887
888 if ( selected == 0 ) {
890 fX0 = fXf = fXp;
891 fY0 = fYf = fYp;
892 //if (fMapSubwindows)
893 gVirtualX->DrawRectangle(fId, GetLineGC()(), fX0, fY0, fXf-fX0,
894 fYf-fY0);
895 }
896 }
897
898 if (event->fType == kButtonRelease) {
899 gVirtualX->SetInputFocus(fId);
900
901 if (fDragging) {
904
906 //if (fMapSubwindows)
907 gVirtualX->DrawRectangle(fId, GetLineGC()(), fX0, fY0, fXf-fX0,
908 fYf-fY0);
909 } else {
911 event->fCode, (event->fYRoot << 16) | event->fXRoot);
912 }
913 }
914 fClient->NeedRedraw(this);
915 return kTRUE;
916}
917
918////////////////////////////////////////////////////////////////////////////////
919/// Get list of selected items in container.
920/// Returned TList object should be deleted by the user
921
923{
925 TIter next(fList);
926 TList *ret = new TList();
927
928 while ((el = (TGFrameElement *) next())) {
929 if (el->fFrame->IsActive()) {
930 ret->Add((TGLVEntry *)el->fFrame);
931 }
932 }
933 return ret;
934}
935
936////////////////////////////////////////////////////////////////////////////////
937/// Get list of selected items in container.
938/// Returned TList object and its content should be deleted
939// lst->Delete(); delete lst;
940
942{
944 TIter next(fList);
945 TList *ret = new TList();
946
947 while ((el = (TGFrameElement *) next())) {
948 if (el->fFrame->IsActive()) {
949 ret->Add(new TObjString(((TGLVEntry*)el->fFrame)->GetItemName()->GetString()));
950 }
951 }
952 return ret;
953}
954
955////////////////////////////////////////////////////////////////////////////////
956/// Move current position one column left.
957
959{
960 // in details mode just move one line up
961 if (fViewMode == kLVDetails) return LineUp(select);
962
965
967 if (!fe) return; // empty list
968
970
971 if (fViewMode == kLVSmallIcons && fe == old) return;
972
973 if (old) DeActivateItem(old); //
974 else fLastActiveEl = fe;
975
977 Int_t dx = ms.fWidth;
978 Int_t dy = ms.fHeight;
979
981 Int_t x = fLastActiveEl->fFrame->GetX() - dx + 2;
982
983 Int_t hw = pos.fX + dim.fWidth;
984
986 if (hb && hb->IsMapped()) {
987 Int_t pg = (hb->GetPageSize()*GetWidth())/fViewPort->GetWidth();
988 hw += pg;
989 }
990 if (x <= 0) { // move one line up
991 x = hw;
992 y = y - dy;
993 }
994
995 fe = FindFrame(x, y);
996 if (fe && fe->fFrame->GetY() > fLastActiveEl->fFrame->GetY()) {
997 // cannot go down with the left key
998 x = hw;
999 y = y - dy;
1000 fe = FindFrame(x, y);
1001 }
1002 if (fViewMode == kLVList) {
1003 if (fe && fe->fFrame->GetY() <= fLastActiveEl->fFrame->GetY() - (2 * dy)) {
1004 // avoid jumping more than one line up
1005 x = fe->fFrame->GetX() - dx;
1006 fe = FindFrame(x, y);
1007 }
1008 // cannot go down and/or right with the left key
1009 if (fe && fe->fFrame->GetY() >= fLastActiveEl->fFrame->GetY() &&
1010 fe->fFrame->GetX() >= fLastActiveEl->fFrame->GetX())
1011 fe = fLastActiveEl;
1012 }
1013 if (!fe || fe->fFrame->GetY() > fLastActiveEl->fFrame->GetY())
1015 if (!select) fSelected=1;
1016
1019}
1020
1021////////////////////////////////////////////////////////////////////////////////
1022/// Move current position one column right.
1023
1025{
1026 // in details mode just move one line down
1027 if (fViewMode == kLVDetails) return LineDown(select);
1028
1031
1033 if (!fe) return;
1034
1036
1037 if (fViewMode == kLVSmallIcons && fe == old) return;
1038
1039 if (old) DeActivateItem(old);
1041
1043 Int_t dx = ms.fWidth;
1044 Int_t dy = ms.fHeight;
1045
1047 Int_t x = fLastActiveEl->fFrame->GetX() + dx - 2;
1048
1049 Int_t hw = pos.fX + dim.fWidth - dx;
1050
1052 if (x > hw && (hb && !hb->IsMapped())) { // move one line down
1053 x = 0;
1054 y = y + dy;
1055 }
1056
1057 fe = FindFrame(x, y);
1058 if (fe && fe->fFrame->GetY() < fLastActiveEl->fFrame->GetY()) {
1059 // cannot go up with the right key
1060 x = 0;
1061 y = y + dy;
1062 fe = FindFrame(x, y);
1063 }
1064 if (fViewMode == kLVList) {
1065 // cannot go up and/or left with the right key
1066 if (fe && fe->fFrame->GetY() <= fLastActiveEl->fFrame->GetY() &&
1067 fe->fFrame->GetX() <= fLastActiveEl->fFrame->GetX())
1068 fe = fLastActiveEl;
1069 }
1070 if (!fe || fe->fFrame->GetY() < fLastActiveEl->fFrame->GetY())
1071 fe = (TGFrameElement*)fList->Last();
1072 if (!select) fSelected = 1;
1073
1076}
1077
1078////////////////////////////////////////////////////////////////////////////////
1079/// Make current position first line in window by scrolling up.
1080
1082{
1084 if (!fe) return;
1085
1087
1088 if (old) {
1089 DeActivateItem(old);
1090 } else {
1092 }
1093
1095 Int_t dy = ms.fHeight;
1096
1099
1100 fe = FindFrame(x, y);
1101 if (!fe) fe = (TGFrameElement*)fList->First();
1102 if (fe->fFrame->GetY() > fLastActiveEl->fFrame->GetY()) fe = fLastActiveEl;
1103 if (!select) fSelected = 1;
1104
1107}
1108
1109////////////////////////////////////////////////////////////////////////////////
1110/// Move one line down.
1111
1113{
1115 if (!fe) return;
1116
1118
1119 if (old) DeActivateItem(old);
1121
1123 Int_t dy = ms.fHeight;
1124
1127
1128 fe = FindFrame(x, y);
1129 if (!fe) fe = (TGFrameElement*)fList->Last();
1130 if (fe->fFrame->GetY() < fLastActiveEl->fFrame->GetY()) fe = fLastActiveEl;
1131 if (!select) fSelected = 1;
1132
1135}
1136
1137
1138////////////////////////////////////////////////////////////////////////////////
1139/// Returns page dimension.
1140
1142{
1144 if (!fViewPort) return ret;
1145
1146 ret.fWidth = fViewPort->GetWidth();
1147 ret.fHeight = fViewPort->GetHeight();
1148 return ret;
1149}
1150
1151////////////////////////////////////////////////////////////////////////////////
1152/// Select the TGLVEntry given as argument and de-select the previous one if
1153/// the container is not in multi-selection mode.
1154
1156{
1157 // select (activate) the item passed as argument and deactivate the currently
1158 // active one if not in multi-select mode
1159
1160 if ( !fMultiSelect ) {
1162 if (old)
1163 DeActivateItem(old);
1164 }
1165 ActivateItem(item->GetFrameElement());
1166}
1167
1168////////////////////////////////////////////////////////////////////////////////
1169/// Create a list view widget.
1170
1172 UInt_t options, Pixel_t back) :
1173 TGCanvas(p, w, h, options, back)
1174{
1176 fNColumns = 0;
1177 fColumns = 0;
1178 fJmode = 0;
1179 fColHeader = 0;
1180 fColNames = 0;
1181 fSplitHeader = 0;
1183 fMinColumnSize = 25;
1185 fNormGC = GetDefaultGC()();
1186 if (fHScrollbar)
1187 fHScrollbar->Connect("PositionChanged(Int_t)", "TGListView",
1188 this, "ScrollHeader(Int_t)");
1190
1192}
1193
1194////////////////////////////////////////////////////////////////////////////////
1195/// Delete a list view widget.
1196
1198{
1199 if (fNColumns) {
1200 delete [] fColumns;
1201 delete [] fJmode;
1202 for (int i = 0; i < fNColumns; i++) {
1203 delete fColHeader[i];
1204 delete fSplitHeader[i];
1205 }
1206 delete [] fColHeader;
1207 delete [] fColNames;
1208 delete [] fSplitHeader;
1209 delete fHeader;
1210 }
1211}
1212
1213////////////////////////////////////////////////////////////////////////////////
1214/// Scroll header buttons with horizontal scrollbar
1215
1217{
1218 Int_t i, xl = - pos;
1219 if (fViewMode == kLVDetails) {
1220 for (i = 0; i < fNColumns-1; ++i) {
1221 fColHeader[i]->Move(xl, 0);
1222 xl += fColHeader[i]->GetWidth();
1224 }
1225 fColHeader[i]->Move(xl, 0);
1226 xl += fColHeader[i]->GetWidth();
1228 }
1229}
1230
1231////////////////////////////////////////////////////////////////////////////////
1232/// Set number of headers, i.e. columns that will be shown in detailed view.
1233/// This method must be followed by exactly ncolumns SetHeader() calls,
1234/// making sure that every header (i.e. idx) is set (for and example see
1235/// SetDefaultHeaders()).
1236
1238{
1239 if (ncolumns <= 0) {
1240 Error("SetHeaders", "number of columns must be > 0");
1241 return;
1242 }
1243
1244 if (fNColumns) {
1245 delete [] fColumns;
1246 delete [] fJmode;
1247 for (int i = 0; i < fNColumns; i++) {
1248 if (fColHeader[i]) fColHeader[i]->DestroyWindow();
1249 delete fColHeader[i];
1250 delete fSplitHeader[i];
1251 }
1252 delete [] fColHeader;
1253 delete [] fSplitHeader;
1254 delete [] fColNames;
1255 }
1256
1257 fNColumns = ncolumns+1; // one extra for the blank filler header
1258 fColumns = new int[fNColumns];
1259 fJmode = new int[fNColumns];
1261 fColNames = new TString [fNColumns];
1263
1264 for (int i = 0; i < fNColumns; i++) {
1265 fColHeader[i] = 0;
1266 fJmode[i] = kTextLeft;
1267 fSplitHeader[i] = new TGVFileSplitter(fHeader, 10);
1268 fSplitHeader[i]->Connect("LayoutListView()", "TGListView",
1269 this, "Layout()");
1270 fSplitHeader[i]->Connect("LayoutHeader(TGFrame *)", "TGListView",
1271 this, "LayoutHeader(TGFrame *)");
1272 fSplitHeader[i]->Connect("DoubleClicked(TGVFileSplitter*)", "TGListView",
1273 this, "SetDefaultColumnWidth(TGVFileSplitter*)");
1274 }
1275
1276 // create blank filler header
1277 fColNames[fNColumns-1] = "";
1278 fColHeader[fNColumns-1] = new TGTextButton(fHeader, new TGHotString(""), -1,
1281 fColHeader[fNColumns-1]->Associate(this);
1284 fColHeader[fNColumns-1]->SetStyle(gClient->GetStyle());
1286 fColumns[fNColumns-1] = 0;
1290}
1291
1292////////////////////////////////////////////////////////////////////////////////
1293/// Set header button idx [0-fNColumns>, hmode is the x text alignmode
1294/// (ETextJustification) for the header text and cmode is the x text
1295/// alignmode for the item text.
1296
1298{
1299 if (idx < 0 || idx >= fNColumns-1) {
1300 Error("SetHeader", "header index must be [0 - %d>", fNColumns-1);
1301 return;
1302 }
1303 delete fColHeader[idx];
1304
1305 fColNames[idx] = s;
1306 fColHeader[idx] = new TGTextButton(fHeader, new TGHotString(s), idx,
1309 TString txt = s;
1310 txt.ToLower();
1311 if (txt.Contains("modified")) txt += " date";
1312 if (txt.Contains("attributes")) txt = "type";
1313 fColHeader[idx]->SetToolTipText(Form("Click to sort by %s", txt.Data()));
1314 fColHeader[idx]->Associate(this);
1317
1318 fColHeader[idx]->SetStyle(gClient->GetStyle());
1319
1320 // fJmode and fColumns contain values for columns idx > 0. idx==0 is
1321 // the small icon with the object name
1322 if (idx > 0)
1323 fJmode[idx-1] = cmode;
1324
1325 if (!fColHeader[0]) return;
1326 int xl = fColHeader[0]->GetDefaultWidth() + 10 + fSplitHeader[0]->GetDefaultWidth();
1327 for (int i = 1; i < fNColumns; i++) {
1328 fColumns[i-1] = xl;
1329 if (!fColHeader[i]) break;
1331 }
1332}
1333
1334////////////////////////////////////////////////////////////////////////////////
1335/// Returns name of header idx. If illegal idx or header not set for idx
1336/// 0 is returned.
1337
1338const char *TGListView::GetHeader(Int_t idx) const
1339{
1340 if (idx >= 0 && idx < fNColumns-1 && fColHeader[idx])
1341 return (const char*) fColNames[idx];
1342 return 0;
1343}
1344
1345////////////////////////////////////////////////////////////////////////////////
1346/// Default headers are: Name, Attributes, Size, Owner, Group, Modified.
1347/// The default is good for file system items.
1348
1350{
1351 SetHeaders(6);
1352 SetHeader("Name", kTextLeft, kTextLeft, 0);
1353 SetHeader("Attributes", kTextCenterX, kTextCenterX, 1);
1354 SetHeader("Size", kTextRight, kTextRight, 2);
1355 SetHeader("Owner", kTextCenterX, kTextCenterX, 3);
1356 SetHeader("Group", kTextCenterX, kTextCenterX, 4);
1357 SetHeader("Modified", kTextCenterX, kTextCenterX, 5);
1358}
1359
1360////////////////////////////////////////////////////////////////////////////////
1361/// Set list view mode.
1362
1364{
1366
1367 if (fViewMode != viewMode) {
1371 if (container) container->SetViewMode(viewMode);
1372 Layout();
1373 }
1374}
1375
1376////////////////////////////////////////////////////////////////////////////////
1377/// Set list view container. Container must be at least of type
1378/// TGLVContainer.
1379
1381{
1382 if (f->InheritsFrom(TGLVContainer::Class())) {
1384 ((TGLVContainer *) f)->SetColumns(fColumns, fJmode);
1385 ((TGLVContainer *) f)->SetListView(this);
1386 } else
1387 Error("SetContainer", "frame must inherit from TGLVContainer");
1388}
1389
1390////////////////////////////////////////////////////////////////////////////////
1391/// Set horizontal and vertical scrollbar increments.
1392
1398
1399////////////////////////////////////////////////////////////////////////////////
1400/// Set default column width of the columns headers.
1401
1403{
1405
1406 if (!container) {
1407 Error("SetDefaultColumnWidth", "no listview container set yet");
1408 return;
1409 }
1410 container->ClearViewPort();
1411
1412 for (int i = 0; i < fNColumns; ++i) {
1413 if ( fSplitHeader[i] == splitter ) {
1415 UInt_t bsize = gVirtualX->TextWidth(fColHeader[i]->GetFontStruct(),
1416 dt.Data(), dt.Length());
1417 UInt_t w = std::max(fColHeader[i]->GetDefaultWidth(), bsize + 20);
1418 if (i == 0) w = std::max(fMaxSize.fWidth + 10, w);
1419 if (i > 0) w = std::max(container->GetMaxSubnameWidth(i) + 40, (Int_t)w);
1421 Layout();
1422 }
1423 }
1424}
1425
1426////////////////////////////////////////////////////////////////////////////////
1427/// Resize column headers to show whole item names.
1428
1430{
1431 for (int i = 0; i < fNColumns; ++i) {
1433 if (!container) {
1434 Error("ResizeColumns", "no listview container set yet");
1435 return;
1436 }
1437 fMaxSize = container->GetMaxItemSize();
1439 }
1440}
1441
1442////////////////////////////////////////////////////////////////////////////////
1443/// Layout list view components (container and contents of container).
1444
1446{
1447 Int_t i, xl = 0;
1448 UInt_t w, h = 0;
1449
1451
1452 if (!container) {
1453 Error("Layout", "no listview container set yet");
1454 return;
1455 }
1456
1457 fMaxSize = container->GetMaxItemSize();
1458
1459 if (fViewMode == kLVDetails) {
1460 h = fColHeader[0]->GetDefaultHeight()-4;
1461 fHeader->MoveResize(0, 0, fWidth, h);
1462 fHeader->MapWindow();
1463 for (i = 0; i < fNColumns-1; ++i) {
1465
1466 if ( fJustChanged ) {
1467 w = std::min(fMaxSize.fWidth + 10, fColHeader[i]->GetDefaultWidth());
1469 if (i == 0) w = std::max(fMaxSize.fWidth + 10, w);
1470 if (i > 0) w = std::max(container->GetMaxSubnameWidth(i) + 40, (Int_t)w);
1471 } else {
1472 w = fColHeader[i]->GetWidth();
1473 }
1474 w = std::max(fMinColumnSize, w);
1475 if ( fColHeader[i]->GetDefaultWidth() > w ) {
1476 for (int j = fColNames[i].Length() - 1 ; j > 0; j--) {
1477 fColHeader[i]->SetText( fColNames[i](0,j) + "..." );
1478 if ( fColHeader[i]->GetDefaultWidth() < w )
1479 break;
1480 }
1481 }
1482
1483 fColHeader[i]->MoveResize(xl, 0, w, h);
1484 fColHeader[i]->MapWindow();
1485 xl += w;
1486 fSplitHeader[i]->Move(xl, 0);
1487 fSplitHeader[i]->MapWindow();
1488 fColumns[i] = xl-2; // -2 is fSep in the layout routine
1489 }
1490 fColHeader[i]->MoveResize(xl, 0, fVport->GetWidth()-xl, h);
1491 fColHeader[i]->MapWindow();
1493 fSplitHeader[i]->MapWindow();
1495
1496 container->SetColumns(fColumns, fJmode);
1497
1498 } else {
1499 for (i = 0; i < fNColumns; ++i) {
1500 fColHeader[i]->UnmapWindow();
1502 }
1504 }
1505 // coverity[returned_null]
1506 // coverity[dereference]
1507 TGLayoutManager *lm = container->GetLayoutManager();
1508 lm->SetDefaultWidth(xl);
1510
1511 if (fViewMode == kLVDetails) {
1512 container->Resize(container->GetWidth(), container->GetHeight()+h);
1513 fVScrollbar->SetRange((Int_t)container->GetHeight(),
1514 (Int_t)fVport->GetHeight());
1515 if (fJustChanged) {
1517 fVport->GetHeight());
1518 container->Move(0, h);
1519 } else {
1520 container->DrawRegion(0, 0, fVport->GetWidth(), fVport->GetHeight());
1521 }
1522 fColHeader[i]->MoveResize(xl, 0, fVport->GetWidth()-xl, h);
1523 fColHeader[i]->MapWindow();
1524 } else {
1526 fVport->GetHeight());
1527 container->Move(0, 0);
1528 }
1529
1531}
1532
1533////////////////////////////////////////////////////////////////////////////////
1534/// Layout list view components (container and contents of container).
1535
1537{
1538 Int_t i, xl = 0;
1539 UInt_t w, h = 0;
1540 static Int_t oldPos = 0;
1541 if (head == 0) oldPos = 0;
1542
1544
1545 if (!container) {
1546 Error("Layout", "no listview container set yet");
1547 return;
1548 }
1549 fMaxSize = container->GetMaxItemSize();
1550 Int_t posx = container->GetPagePosition().fX;
1551
1552 if (fViewMode == kLVDetails) {
1553 h = fColHeader[0]->GetDefaultHeight()-4;
1554 fHeader->MoveResize(0, 0, fWidth, h);
1555 fHeader->MapWindow();
1556 for (i = 0; i < fNColumns-1; ++i) {
1558
1559 if ( fJustChanged ) {
1560 w = std::min(fMaxSize.fWidth + 10, fColHeader[i]->GetDefaultWidth());
1562 if (i == 0) w = std::max(fMaxSize.fWidth + 10, w);
1563 if (i > 0) w = std::max(container->GetMaxSubnameWidth(i) + 40, (Int_t)w);
1564 } else {
1565 w = fColHeader[i]->GetWidth();
1566 }
1567 w = std::max(fMinColumnSize, w);
1568 if ( fColHeader[i]->GetDefaultWidth() > w ) {
1569 for (int j = fColNames[i].Length() - 1 ; j > 0; j--) {
1570 fColHeader[i]->SetText( fColNames[i](0,j) + "..." );
1571 if ( fColHeader[i]->GetDefaultWidth() < w )
1572 break;
1573 }
1574 }
1575
1576 if ((TGFrame *)fColHeader[i] == head) {
1577 if (oldPos > 0) {
1578 gVirtualX->DrawLine(container->GetId(), container->GetLineGC()(),
1579 oldPos - posx, 0, oldPos - posx, fVport->GetHeight());
1580 }
1581 gVirtualX->DrawLine(container->GetId(), container->GetLineGC()(),
1582 xl + w - posx, 0, xl + w - posx, fVport->GetHeight());
1583 oldPos = xl + w;
1584 }
1585
1586 fColHeader[i]->MoveResize(xl - posx, 0, w, h);
1587 fColHeader[i]->MapWindow();
1588 xl += w;
1589 fSplitHeader[i]->Move(xl, 0);
1590 fSplitHeader[i]->MapWindow();
1591 fColumns[i] = xl-2; // -2 is fSep in the layout routine
1592 }
1593 fColHeader[i]->MoveResize(xl - posx, 0, fVport->GetWidth()-xl, h);
1594 fColHeader[i]->MapWindow();
1596 fSplitHeader[i]->MapWindow();
1598 }
1600}
1601
1602////////////////////////////////////////////////////////////////////////////////
1603/// Handle messages generated by the list view components.
1604
1606{
1608
1609 const TGLVEntry *entry;
1610 void *p = 0;
1611
1612 entry = (TGLVEntry *) cnt->GetNextSelected(&p);
1613
1614 switch (GET_SUBMSG(msg)) {
1615 case kCT_ITEMCLICK:
1616 if ((cnt->NumSelected() == 1) && (entry != 0)) {
1617 Int_t x = (Int_t)(parm2 & 0xffff);
1618 Int_t y = (Int_t)((parm2 >> 16) & 0xffff);
1621 }
1622 break;
1623 case kCT_ITEMDBLCLICK:
1624 if ((cnt->NumSelected() == 1) && (entry!=0)) {
1625 Int_t x = (Int_t)(parm2 & 0xffff);
1626 Int_t y = (Int_t)((parm2 >> 16) & 0xffff);
1629 }
1630 break;
1631 case kCT_SELCHANGED:
1633 break;
1634 default:
1635 break;
1636 }
1638}
1639
1640////////////////////////////////////////////////////////////////////////////////
1641/// Emit Clicked() signal.
1642
1644{
1645 Longptr_t args[2];
1646
1647 args[0] = (Longptr_t)entry;
1648 args[1] = btn;
1649
1650 Emit("Clicked(TGLVEntry*,Int_t)", args);
1651}
1652
1653////////////////////////////////////////////////////////////////////////////////
1654/// Emit Clicked() signal.
1655
1657{
1658 Longptr_t args[4];
1659
1660 args[0] = (Longptr_t)entry;
1661 args[1] = btn;
1662 args[2] = x;
1663 args[3] = y;
1664
1665 Emit("Clicked(TGLVEntry*,Int_t,Int_t,Int_t)", args);
1666}
1667
1668////////////////////////////////////////////////////////////////////////////////
1669/// Emit DoubleClicked() signal.
1670
1672{
1673 Longptr_t args[2];
1674
1675 args[0] = (Longptr_t)entry;
1676 args[1] = btn;
1677
1678 Emit("DoubleClicked(TGLVEntry*,Int_t)", args);
1679}
1680
1681////////////////////////////////////////////////////////////////////////////////
1682/// Emit DoubleClicked() signal.
1683
1685{
1686 Longptr_t args[4];
1687
1688 args[0] = (Longptr_t)entry;
1689 args[1] = btn;
1690 args[2] = x;
1691 args[3] = y;
1692
1693 Emit("DoubleClicked(TGLVEntry*,Int_t,Int_t,Int_t)", args);
1694}
1695
1696////////////////////////////////////////////////////////////////////////////////
1697/// Return the default font structure in use.
1698
1700{
1701 if (!fgDefaultFont)
1702 fgDefaultFont = gClient->GetResourcePool()->GetIconFont();
1703 return fgDefaultFont->GetFontStruct();
1704}
1705
1706////////////////////////////////////////////////////////////////////////////////
1707/// Return the default graphics context in use.
1708
1710{
1711 if (!fgDefaultGC) {
1712 fgDefaultGC = new TGGC(*gClient->GetResourcePool()->GetFrameGC());
1713 fgDefaultGC->SetFont(fgDefaultFont->GetFontHandle());
1714 }
1715 return *fgDefaultGC;
1716}
1717
1718////////////////////////////////////////////////////////////////////////////////
1719/// Save a list view widget as a C++ statement(s) on output stream out.
1720
1721void TGListView::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
1722{
1723 // save options and color if necessary
1725
1726 out << "\n // list view\n";
1727 out << " TGListView *" << GetName() << " = new TGListView(" << fParent->GetName() << "," << GetWidth() << ","
1728 << GetHeight() << extra_args << ");\n";
1729
1730 if (option && strstr(option, "keep_names"))
1731 out << " " << GetName() << "->SetName(\"" << GetName() << "\");\n";
1732
1734
1735 out << " \n";
1736 out << " " << GetName() << "->SetContainer(" << GetContainer()->GetName() << ");\n";
1737 out << " " << GetName() << "->SetViewMode(";
1738 switch (fViewMode) {
1739 case kLVLargeIcons: out << "kLVLargeIcons"; break;
1740 case kLVSmallIcons: out << "kLVSmallIcons"; break;
1741 case kLVList: out << "kLVList"; break;
1742 case kLVDetails: out << "kLVDetails"; break;
1743 }
1744 out << ");\n";
1745
1746 out << " " << GetContainer()->GetName() << "->Resize();\n";
1747
1749 out << " " << GetName() << "->SetHsbPosition(" << GetHsbPosition() << ");\n";
1750
1752 out << " " << GetName() << "->SetVsbPosition(" << GetVsbPosition() << ");\n";
1753}
1754
1755////////////////////////////////////////////////////////////////////////////////
1756/// Save a list view container as a C++ statement(s) on output stream out.
1757
1758void TGLVContainer::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
1759{
1760 // save options and color if necessary
1762
1763 out << "\n // list view container\n";
1764 out << " TGLVContainer *" << GetName() << " = new TGLVContainer(";
1765 if ((fParent->GetParent())->InheritsFrom(TGCanvas::Class()))
1766 out << GetCanvas()->GetName();
1767 else
1768 out << fParent->GetName() << ", " << GetWidth() << "," << GetHeight();
1769 out << extra_args << ");\n";
1770
1771 if (option && strstr(option, "keep_names"))
1772 out << " " << GetName() << "->SetName(\"" << GetName() << "\");\n";
1773}
@ kButtonRelease
Definition GuiTypes.h:60
@ kButtonPress
Definition GuiTypes.h:60
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
const Mask_t kKeyShiftMask
Definition GuiTypes.h:195
@ kChildFrame
Definition GuiTypes.h:379
@ kRaisedFrame
Definition GuiTypes.h:384
@ kSunkenFrame
Definition GuiTypes.h:383
@ kDoubleBorder
Definition GuiTypes.h:385
@ kFixedWidth
Definition GuiTypes.h:387
const Mask_t kKeyControlMask
Definition GuiTypes.h:197
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
@ kButton4
Definition GuiTypes.h:215
@ kButton5
Definition GuiTypes.h:215
ULongptr_t Handle_t
Generic resource handle.
Definition GuiTypes.h:26
Handle_t FontStruct_t
Pointer to font structure.
Definition GuiTypes.h:39
#define f(i)
Definition RSha256.hxx:104
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
Definition RtypesCore.h:89
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:208
@ kButtonDisabled
Definition TGButton.h:56
#define gClient
Definition TGClient.h:157
@ kLHintsExpandY
Definition TGLayout.h:31
@ kLHintsCenterY
Definition TGLayout.h:28
@ kLHintsCenterX
Definition TGLayout.h:25
@ kLHintsExpandX
Definition TGLayout.h:30
EListViewMode
Definition TGListView.h:21
@ kLVDetails
Definition TGListView.h:25
@ kLVSmallIcons
Definition TGListView.h:23
@ kLVList
Definition TGListView.h:24
@ kLVLargeIcons
Definition TGListView.h:22
@ kTextCenterX
Definition TGWidget.h:25
@ kTextLeft
Definition TGWidget.h:23
@ kTextRight
Definition TGWidget.h:24
@ kTextCenterY
Definition TGWidget.h:28
static unsigned int total
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
char name[80]
Definition TGX11.cxx:110
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2495
R__EXTERN TSystem * gSystem
Definition TSystem.h:572
#define gVirtualX
Definition TVirtualX.h:337
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
@ kCT_SELCHANGED
@ kCT_ITEMCLICK
@ kCT_ITEMDBLCLICK
@ kC_CONTAINER
Int_t GET_SUBMSG(Long_t val)
virtual void SetToolTipText(const char *text, Long_t delayms=400)
Set tool tip text associated with this button.
Definition TGButton.cxx:439
virtual void SetStyle(UInt_t newstyle)
Set the button style (modern or classic).
Definition TGButton.cxx:265
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition TGButton.cxx:229
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition TGCanvas.h:192
virtual void SetContainer(TGFrame *f)
Definition TGCanvas.h:222
TGFrame * GetContainer() const
Definition TGCanvas.h:216
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
virtual Int_t GetVsbPosition() const
Get position of vertical scrollbar.
TGViewPort * fVport
viewport through which we look at contents
Definition TGCanvas.h:195
TGHScrollBar * fHScrollbar
horizontal scrollbar
Definition TGCanvas.h:196
TGVScrollBar * fVScrollbar
vertical scrollbar
Definition TGCanvas.h:197
virtual Int_t GetHsbPosition() const
Get position of horizontal scrollbar.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Handle message generated by the canvas scrollbars.
void Layout() override
Create layout for canvas.
static TClass * Class()
const TGResourcePool * GetResourcePool() const
Definition TGClient.h:124
TGMimeTypes * GetMimeTypeList() const
Definition TGClient.h:147
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition TGClient.cxx:288
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:380
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
Definition TGFrame.cxx:992
Int_t MustCleanup() const override
Definition TGFrame.h:362
Bool_t fMapSubwindows
kTRUE - map subwindows
Definition TGFrame.h:297
TList * fList
container of frame elements
Definition TGFrame.h:294
Manages a content area.
Definition TGCanvas.h:31
virtual void ActivateItem(TGFrameElement *el)
Activate item.
Definition TGCanvas.cxx:698
virtual void RemoveItem(TGFrame *item)
Remove item from container.
Definition TGCanvas.cxx:657
TGCanvas * fCanvas
pointer to canvas
Definition TGCanvas.h:41
TTimer * fScrollTimer
autoscroll timer
Definition TGCanvas.h:50
Int_t fYf
other corner of rubber band box
Definition TGCanvas.h:46
virtual void UnSelectAll()
Unselect all items in the container.
Definition TGCanvas.cxx:586
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in container.
Definition TGCanvas.cxx:926
const TGWindow * fMsgWindow
window handling container messages
Definition TGCanvas.h:42
virtual TGFrameElement * FindFrame(Int_t x, Int_t y, Bool_t exclude=kTRUE)
Find frame located int container at position x,y.
Int_t fYp
previous pointer position
Definition TGCanvas.h:44
virtual void AdjustPosition()
Move content to position of highlighted/activated frame.
virtual void Clicked(TGFrame *f, Int_t btn)
Emit Clicked() signal.
Definition TGCanvas.cxx:507
void Layout() override
Layout container entries.
Definition TGCanvas.cxx:419
Int_t fY0
corner of rubber band box
Definition TGCanvas.h:45
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
TGCanvas * GetCanvas() const
Definition TGCanvas.h:99
Int_t fSelected
number of selected items
Definition TGCanvas.h:49
virtual void SetHsbPosition(Int_t newPos)
set new hor. position
Bool_t fScrolling
kTRUE - when scrolling is ON
Definition TGCanvas.h:59
Int_t fX0
Definition TGCanvas.h:45
Int_t fXp
Definition TGCanvas.h:44
static const TGGC & GetLineGC()
Get graphics context for line drawing.
Bool_t fDragging
true if in dragging mode
Definition TGCanvas.h:47
TGViewPort * fViewPort
container viewport
Definition TGCanvas.h:40
Int_t fTotal
total items
Definition TGCanvas.h:48
void RemoveAll() override
Remove all items from the container.
Definition TGCanvas.cxx:638
virtual TGPosition GetPagePosition() const
Returns page position.
Definition TGCanvas.cxx:734
virtual TGHScrollBar * GetHScrollbar() const
returns pointer to hor. scroll bar
TGFrameElement * fLastActiveEl
last active item
Definition TGCanvas.h:43
virtual void DeActivateItem(TGFrameElement *el)
DeActivate item.
Definition TGCanvas.cxx:721
Int_t fXf
Definition TGCanvas.h:46
UInt_t fHeight
Definition TGDimension.h:21
UInt_t fWidth
Definition TGDimension.h:20
Encapsulate fonts used in the GUI system.
Definition TGFont.h:140
TGFrame * fFrame
Definition TGLayout.h:112
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
Definition TGFrame.cxx:621
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:597
UInt_t fHeight
frame height
Definition TGFrame.h:88
virtual UInt_t GetDefaultWidth() const
Definition TGFrame.h:192
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:193
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a frame widget as a C++ statement(s) on output stream out.
Definition TGFrame.cxx:3144
Int_t fBorderWidth
frame border width
Definition TGFrame.h:93
static Pixel_t fgDefaultSelectedBackground
Definition TGFrame.h:102
void MapWindow() override
map window
Definition TGFrame.h:206
void Move(Int_t x, Int_t y) override
Move frame.
Definition TGFrame.cxx:585
Int_t GetX() const
Definition TGFrame.h:233
void UnmapWindow() override
unmap window
Definition TGFrame.h:208
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
Definition TGFrame.cxx:637
UInt_t fWidth
frame width
Definition TGFrame.h:87
UInt_t GetHeight() const
Definition TGFrame.h:227
TString SaveCtorArgs(std::ostream &out, UInt_t dflt_options=kChildFrame, Bool_t check_white_pixel=kFALSE)
Return options and custom color as constructor args Used in the SavePrimitive methods,...
Definition TGFrame.cxx:2493
Int_t GetY() const
Definition TGFrame.h:234
static Pixel_t fgWhitePixel
Definition TGFrame.h:103
UInt_t GetWidth() const
Definition TGFrame.h:226
static Pixel_t fgBlackPixel
Definition TGFrame.h:104
Encapsulate a graphics context used in the low level graphics.
Definition TGGC.h:22
The TGHScrollBar will generate the following event messages: kC_HSCROLL, kSB_SLIDERPOS,...
Horizontal Frame used to contain header buttons and splitters in a list view.
Definition TGFrame.h:582
void SetColumnsInfo(Int_t nColumns, TGTextButton **colHeader, TGVFileSplitter **splitHeader)
Set columns information in the header frame.
Definition TGFrame.cxx:2371
TGHotString is a string with a "hot" character underlined.
Definition TGString.h:42
void LineRight(Bool_t select=kFALSE) override
Move current position one column right.
TGListView * fListView
listview which contains this container
Definition TGListView.h:190
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in container.
void LineDown(Bool_t select=kFALSE) override
Move one line down.
TList * GetSelectedItems()
Get list of selected items in container.
virtual void SetColumns(Int_t *cpos, Int_t *jmode)
Set column information for list items.
void LineLeft(Bool_t select=kFALSE) override
Move current position one column left.
virtual void SetColHeaders(const char *n1="", const char *n2="", const char *n3="", const char *n4="", const char *n5="", const char *n6="", const char *n7="", const char *n8="", const char *n9="", const char *n10="", const char *n11="", const char *n12="")
set columns headers
virtual void SelectEntry(TGLVEntry *item)
Select the TGLVEntry given as argument and de-select the previous one if the container is not in mult...
Bool_t fMultiSelect
true = multiple file selection
Definition TGListView.h:189
void DeActivateItem(TGFrameElement *el) override
Unselect/deactivate item.
TGLayoutHints * fItemLayout
item layout hints
Definition TGListView.h:185
virtual Int_t GetMaxSubnameWidth(Int_t idx) const
Get width of largest subname in container.
virtual void SetViewMode(EListViewMode viewMode)
Set list view mode for container.
TGLVEntry * fLastActive
last active item
Definition TGListView.h:191
virtual void RemoveItemWithData(void *userData)
Remove item with fUserData == userData from container.
void ActivateItem(TGFrameElement *el) override
Select/activate item.
Int_t * fCpos
position of sub names
Definition TGListView.h:187
TGLVContainer(const TGLVContainer &)=delete
TList * GetSelectedEntries()
Get list of selected items in container.
Int_t * fJmode
alignment of sub names
Definition TGListView.h:188
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a list view container as a C++ statement(s) on output stream out.
TGDimension GetPageDimension() const override
Returns page dimension.
~TGLVContainer() override
Delete list view container.
static TClass * Class()
void LineUp(Bool_t select=kFALSE) override
Make current position first line in window by scrolling up.
EListViewMode fViewMode
list view viewing mode
Definition TGListView.h:186
virtual TGDimension GetMaxItemSize() const
Get size of largest item in container.
const TGPicture * fCurrent
current icon
Definition TGListView.h:55
void * fUserData
pointer to user data structure
Definition TGListView.h:60
UInt_t fTHeight
height of name
Definition TGListView.h:49
~TGLVEntry() override
Delete a list view item.
virtual void SetPictures(const TGPicture *bigpic=nullptr, const TGPicture *smallpic=nullptr)
change pictures
TGString ** fSubnames
sub names of item (details)
Definition TGListView.h:44
void DoRedraw() override
Redraw list view item.
Int_t * fCpos
position of sub names
Definition TGListView.h:45
UInt_t fTWidth
width of name
Definition TGListView.h:48
TGDimension GetDefaultSize() const override
Get default size of list item.
void Activate(Bool_t a) override
Make list view item active.
Bool_t fActive
true if item is active
Definition TGListView.h:50
void DrawCopy(Handle_t id, Int_t x, Int_t y) override
Draw list view item in other window.
FontStruct_t fFontStruct
text font
Definition TGListView.h:59
EListViewMode fViewMode
list view viewing mode
Definition TGListView.h:52
GContext_t fNormGC
drawing graphics context
Definition TGListView.h:58
TGString * fItemName
name of item
Definition TGListView.h:43
const TGPicture * fBigPic
big icon
Definition TGListView.h:53
virtual void SetViewMode(EListViewMode viewMode)
Set the view mode for this list item.
Bool_t fChecked
true if item is checked
Definition TGListView.h:51
TGLVEntry(const TGLVEntry &)=delete
Int_t * fCtw
width of sub names
Definition TGListView.h:47
TGSelectedPicture * fSelPic
selected icon
Definition TGListView.h:57
const TGPicture * fSmallPic
small icon
Definition TGListView.h:54
Int_t * fJmode
alignment for sub names
Definition TGListView.h:46
virtual void SetSubnames(const char *n1="", const char *n2="", const char *n3="", const char *n4="", const char *n5="", const char *n6="", const char *n7="", const char *n8="", const char *n9="", const char *n10="", const char *n11="", const char *n12="")
Sets new subnames.
static const TGGC & GetDefaultGC()
Return the default graphics context in use.
static FontStruct_t GetDefaultFontStruct()
Return the default font structure in use.
const TGPicture * fCheckMark
checkmark
Definition TGListView.h:56
static TGGC * fgDefaultGC
Definition TGListView.h:63
static const TGFont * fgDefaultFont
Definition TGListView.h:62
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
Frame layout manager.
Definition TGLayout.h:135
This is a layout manager for the TGListView widget.
Definition TGLayout.h:355
This is a layout manager for the TGListView widget.
Definition TGLayout.h:335
A list view is a widget that can contain a number of items arranged in a grid or list.
Definition TGListView.h:115
Int_t * fJmode
column text alignment
Definition TGListView.h:124
static FontStruct_t GetDefaultFontStruct()
Return the default font structure in use.
virtual void DoubleClicked(TGLVEntry *entry, Int_t btn)
Emit DoubleClicked() signal.
virtual void ResizeColumns()
Resize column headers to show whole item names.
EListViewMode fViewMode
view mode if list view widget
Definition TGListView.h:125
virtual void ScrollHeader(Int_t pos)
Scroll header buttons with horizontal scrollbar.
TGListView(const TGListView &)=delete
Int_t * fColumns
column width
Definition TGListView.h:123
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a list view widget as a C++ statement(s) on output stream out.
static TClass * Class()
virtual void SetHeader(const char *s, Int_t hmode, Int_t cmode, Int_t idx)
Set header button idx [0-fNColumns>, hmode is the x text alignmode (ETextJustification) for the heade...
void Layout() override
Layout list view components (container and contents of container).
FontStruct_t fFontStruct
text font
Definition TGListView.h:131
virtual void SetIncrements(Int_t hInc, Int_t vInc)
Set horizontal and vertical scrollbar increments.
void SetContainer(TGFrame *f) override
Set list view container.
virtual void SetViewMode(EListViewMode viewMode)
Set list view mode.
GContext_t fNormGC
drawing graphics context
Definition TGListView.h:130
static const TGGC & GetDefaultGC()
Return the default graphics context in use.
~TGListView() override
Delete a list view widget.
Int_t fNColumns
number of columns
Definition TGListView.h:122
TGDimension fMaxSize
maximum item size
Definition TGListView.h:126
TGHeaderFrame * fHeader
frame used as container for column headers
Definition TGListView.h:132
virtual void SetHeaders(Int_t ncolumns)
Set number of headers, i.e.
TString * fColNames
column titles for in detailed mode
Definition TGListView.h:128
virtual void SelectionChanged()
Definition TGListView.h:168
UInt_t fMinColumnSize
Minimun column size.
Definition TGListView.h:134
TGTextButton ** fColHeader
column headers for in detailed mode
Definition TGListView.h:127
virtual void SetDefaultHeaders()
Default headers are: Name, Attributes, Size, Owner, Group, Modified.
virtual void Clicked(TGLVEntry *entry, Int_t btn)
Emit Clicked() signal.
virtual void LayoutHeader(TGFrame *head)
Layout list view components (container and contents of container).
Bool_t fJustChanged
Indicate whether the view mode was just changed to Detail.
Definition TGListView.h:133
virtual void SetDefaultColumnWidth(TGVFileSplitter *splitter)
Set default column width of the columns headers.
static const TGFont * fgDefaultFont
Definition TGListView.h:136
TGVFileSplitter ** fSplitHeader
column splitters
Definition TGListView.h:129
virtual const char * GetHeader(Int_t idx) const
Returns name of header idx.
TGDimension GetMaxItemSize() const
Definition TGListView.h:166
static TGGC * fgDefaultGC
Definition TGListView.h:137
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Handle messages generated by the list view components.
const TGPicture * GetIcon(const char *filename, Bool_t small_icon)
Return icon belonging to mime type of filename.
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Handle_t fId
X11/Win32 Window identifier.
Definition TGObject.h:24
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
void Draw(Option_t *="") override
Default Draw method for all objects.
Definition TGPicture.h:46
Int_t fY
y position
Definition TGDimension.h:39
Int_t fX
x position
Definition TGDimension.h:38
virtual void SetSmallIncrement(Int_t increment)
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
Definition TGString.h:20
Int_t GetLength() const
Definition TGString.h:29
const char * GetString() const
Definition TGString.h:30
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw string.
Definition TGString.cxx:54
Yield an action as soon as it is clicked.
Definition TGButton.h:142
virtual void SetTextJustify(Int_t tmode)
Set text justification.
Definition TGButton.cxx:689
virtual void SetText(TGHotString *new_label)
Set new button text.
Definition TGButton.cxx:638
TString GetString() const
Definition TGButton.h:191
This is a layout manager for the TGListView widget.
Definition TGLayout.h:303
void SetRange(Int_t range, Int_t page_size) override
Set range of vertical scrollbar.
void SetFrame(TGFrame *frame, Bool_t left) override
Set frame to be resized.
TGFrame * GetContainer() const
Definition TGCanvas.h:173
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:72
ROOT GUI Window base class.
Definition TGWindow.h:23
const TGWindow * fParent
Parent window.
Definition TGWindow.h:28
virtual void DestroyWindow()
destroy window
Definition TGWindow.cxx:190
const TGWindow * GetParent() const
Definition TGWindow.h:83
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
Definition TGWindow.cxx:293
virtual void RaiseWindow()
raise window
Definition TGWindow.cxx:206
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:334
A doubly linked list.
Definition TList.h:38
TObject * Last() const override
Return the last object in the list. Returns 0 when list is empty.
Definition TList.cxx:690
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:656
Collectable string class.
Definition TObjString.h:28
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition TQObject.h:164
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition TQObject.cxx:865
Basic string class.
Definition TString.h:138
Ssiz_t Length() const
Definition TString.h:425
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
Definition TSystem.cxx:479
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Event structure.
Definition GuiTypes.h:174
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:175
Int_t fXRoot
Definition GuiTypes.h:179
UInt_t fState
key or button mask
Definition GuiTypes.h:181
Int_t fYRoot
coordinates relative to root
Definition GuiTypes.h:179
UInt_t fCode
key or button code
Definition GuiTypes.h:180
Longptr_t fUser[5]
5 longs can be used by client message events NOTE: only [0], [1] and [2] may be used.
Definition GuiTypes.h:187