Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGListBox.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 12/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 TGListBox
25 \ingroup guiwidgets
26
27A listbox is a box, possibly with scrollbar, containing entries.
28Currently entries are simple text strings (TGTextLBEntry).
29A TGListBox looks a lot like a TGCanvas. It has a TGViewPort
30containing a TGLBContainer which contains the entries and it also
31has a vertical scrollbar which becomes visible if there are more
32items than fit in the visible part of the container.
33
34The TGListBox is user callable. The other classes are service
35classes of the listbox.
36
37A listbox contains a container frame which is viewed through a
38viewport. If the container is larger than the viewport than a
39vertical scrollbar is added.
40
41Selecting an item in the listbox will generate the event:
42 - kC_COMMAND, kCM_LISTBOX, listbox id, item id.
43
44\class TGLBEntry
45\ingroup guiwidgets
46
47Basic listbox entries.
48Listbox entries are created by a TGListBox and not by the user.
49
50\class TGTextLBEntry
51\ingroup guiwidgets
52
53Text string listbox entries.
54A TGTextLBEntry is for TGListBox internal use.
55
56\class TGLineLBEntry
57\ingroup guiwidgets
58
59Line style and width listbox entries.
60Line example and width number
61
62\class TGIconLBEntry
63\ingroup guiwidgets
64
65Icon + text listbox entry.
66
67\class TGLBContainer
68\ingroup guiwidgets
69
70A Composite frame that contains a list of TGLBEnties.
71A TGLBContainer is for TGListBox internal use.
72
73*/
74
75
76#include "TGPicture.h"
77#include "TGListBox.h"
78#include "TGResourcePool.h"
79#include "TSystem.h"
80#include "TMath.h"
81#include "TVirtualX.h"
82
83#include <cstdlib>
84#include <iostream>
85
86
89
95
96////////////////////////////////////////////////////////////////////////////////
97/// Base class entry constructor.
98
99TGLBEntry::TGLBEntry(const TGWindow *p, Int_t id, UInt_t options, Pixel_t back) :
100 TGFrame(p, 10, 10, options | kOwnBackground, back)
101{
102 fActive = kFALSE;
103 fEntryId = id;
104 fBkcolor = back;
106
108}
109
110////////////////////////////////////////////////////////////////////////////////
111/// Toggle active state of listbox entry.
112
114{
115 if (fActive == a) return;
116 fActive = a;
117 DoRedraw();
118}
119
120////////////////////////////////////////////////////////////////////////////////
121/// Toggle active state of listbox entry.
122
124{
125 fActive = !fActive;
126 DoRedraw();
127}
128
129
130////////////////////////////////////////////////////////////////////////////////
131/// Create a text listbox entry. The TGString is adopted.
132
134 GContext_t norm, FontStruct_t font, UInt_t options, Pixel_t back) :
135 TGLBEntry(p, id, options, back)
136{
137 fText = s;
139 fFontStruct = font;
140 fNormGC = norm;
141 fTWidth = 0;
142
143 int max_ascent, max_descent;
144
145 if (fText) fTWidth = gVirtualX->TextWidth(fFontStruct, fText->GetString(), fText->GetLength());
146 gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
147 fTHeight = max_ascent + max_descent;
148 Resize(fTWidth, fTHeight + 1);
151}
152
153////////////////////////////////////////////////////////////////////////////////
154/// Delete text listbox entry.
155
157{
158 if (fText) delete fText;
159}
160
161////////////////////////////////////////////////////////////////////////////////
162/// Draw text listbox entry on window/pixmap.
163
165{
166 int max_ascent, max_descent;
167
168 y += (fHeight - fTHeight) >> 1;
169
170 gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
171
172 if (fActive) {
174 gVirtualX->FillRectangle(id,fNormGC, x, y, fWidth, fHeight);
176 fText->Draw(id, fNormGC, x + 3, y + max_ascent);
177 } else {
178 gVirtualX->SetForeground(fNormGC, fBkcolor);
179 gVirtualX->FillRectangle(id, fNormGC, x, y, fWidth, fHeight);
180 gVirtualX->SetForeground(fNormGC, GetForeground());
181 fText->Draw(id, fNormGC, x + 3, y + max_ascent);
182 }
183}
184
185////////////////////////////////////////////////////////////////////////////////
186/// Redraw text listbox entry.
187
189{
190 if (fId) DrawCopy(fId, 0, 0);
191}
192
193////////////////////////////////////////////////////////////////////////////////
194/// Set or change text in text entry.
195
197{
198 if (fText) delete fText;
199 fText = new_text;
201
202 int max_ascent, max_descent;
204 gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
205 fTHeight = max_ascent + max_descent;
206
207 Resize(fTWidth + 3, fTHeight + 1);
208
209 DoRedraw();
210}
211
212////////////////////////////////////////////////////////////////////////////////
213/// Return default font structure in use for a text listbox entry.
214
216{
217 if (!fgDefaultFont)
218 fgDefaultFont = gClient->GetResourcePool()->GetDefaultFont();
220}
221
222////////////////////////////////////////////////////////////////////////////////
223/// Return default graphics context in use for a text listbox entry.
224
226{
227 if (!fgDefaultGC)
228 fgDefaultGC = new TGGC(*gClient->GetResourcePool()->GetFrameGC());
229 return *fgDefaultGC;
230}
231
232
233////////////////////////////////////////////////////////////////////////////////
234/// Create the line style listbox entry.
235
236TGLineLBEntry::TGLineLBEntry(const TGWindow *p, Int_t id, const char *str,
237 UInt_t w, Style_t style, UInt_t options, Pixel_t back) :
238 TGTextLBEntry(p, new TGString(str), id, GetDefaultGC()(),
239 GetDefaultFontStruct(), options, back)
240{
241 GCValues_t gcv;
242
244 fLineWidth = gcv.fLineWidth = w;
246 gcv.fDashLen = 2;
247 gcv.fDashOffset = 0;
248 memcpy(gcv.fDashes, "\x5\x5", 3);
250 fLineGC = fClient->GetGC(&gcv, kTRUE);
252
253 int max_ascent, max_descent;
254
255 fTWidth = gVirtualX->TextWidth(GetDefaultFontStruct(), "8", 1);
256 fTWidth += 15; // for drawing
257 gVirtualX->GetFontProperties(GetDefaultFontStruct(),
258 max_ascent, max_descent);
259 fTHeight = max_ascent + max_descent;
260 fLineLength = 0;
261
262 Resize(fTWidth, fTHeight + 1);
265}
266
267////////////////////////////////////////////////////////////////////////////////
268/// Delete line style listbox entry.
269
271{
273}
274
275////////////////////////////////////////////////////////////////////////////////
276/// Update line style listbox entry.
277
279{
281
283 fLineGC = ((TGLineLBEntry *)e)->GetLineGC();
285}
286
287////////////////////////////////////////////////////////////////////////////////
288/// Set the line style corresponding to the TPad line styles.
289
291{
292 static const char* dashed = "\x3\x3";
293 static const char* dotted= "\x1\x2";
294 static const char* dasheddotted = "\x3\x4\x1\x4";
295 static const char* ls05 = "\x5\x3\x1\x3";
296 static const char* ls06 = "\x5\x3\x1\x3\x1\x3\x1\x3";
297 static const char* ls07 = "\x5\x5";
298 static const char* ls08 = "\x5\x3\x1\x3\x1\x3";
299 static const char* ls09 = "\x20\x5";
300 static const char* ls10 = "\x20\x10\x1\x10";
301
302
303 if (linestyle <= 1) {
305 } else {
306 switch (linestyle) {
307 case 2:
308 fLineGC->SetDashList(dashed, 2);
309 break;
310 case 3:
311 fLineGC->SetDashList(dotted, 2);
312 break;
313 case 4:
314 fLineGC->SetDashList(dasheddotted, 4);
315 break;
316 case 5:
317 fLineGC->SetDashList(ls05, 4);
318 break;
319 case 6:
320 fLineGC->SetDashList(ls06, 8);
321 break;
322 case 7:
323 fLineGC->SetDashList(ls07, 2);
324 break;
325 case 8:
326 fLineGC->SetDashList(ls08, 6);
327 break;
328 case 9:
329 fLineGC->SetDashList(ls09, 2);
330 break;
331 case 10:
332 fLineGC->SetDashList(ls10, 4);
333 break;
334 }
335 }
336 fLineGC->SetCapStyle(0); // flat cap
337 fLineStyle = linestyle;
338}
339
340////////////////////////////////////////////////////////////////////////////////
341/// Set or change line width in an entry.
342
344{
347}
348
349////////////////////////////////////////////////////////////////////////////////
350/// Draw copy on window/pixmap.
351
353{
355 if (!strcmp(TGTextLBEntry::GetTitle(),"None")) return;
356 if (fActive) {
357 gVirtualX->SetForeground(fLineGC->GetGC(),
359 } else {
360 gVirtualX->SetForeground(fLineGC->GetGC(),
362 }
363 gVirtualX->DrawLine(id, fLineGC->GetGC(), x + fTWidth + 5, y + fHeight/2,
364 x + fWidth - 5, y + fHeight/2);
365}
366
367////////////////////////////////////////////////////////////////////////////////
368/// Redraw line style listbox entry.
369
371{
372 if (fId) DrawCopy(fId, 0, 0);
373}
374
375
376////////////////////////////////////////////////////////////////////////////////
377/// Create the icon & text listbox entry.
378
379TGIconLBEntry::TGIconLBEntry(const TGWindow *p, Int_t id, const char *str,
380 const TGPicture *pic,
381 UInt_t /*w*/, Style_t /*style*/, UInt_t options, Pixel_t back) :
382 TGTextLBEntry(p, new TGString(str), id, GetDefaultGC()(),
383 GetDefaultFontStruct(), options, back)
384{
385 int max_ascent, max_descent;
386
387 fPicture = pic;
388 if (fPicture) {
389 fTWidth += fPicture->GetWidth() + 4;
390 ((TGPicture *)fPicture)->AddReference();
391 }
392 else
393 fTWidth += 20;
394 gVirtualX->GetFontProperties(GetDefaultFontStruct(),
395 max_ascent, max_descent);
396 fTHeight = max_ascent + max_descent;
399
400 Resize(fTWidth, fTHeight + 1);
403}
404
405////////////////////////////////////////////////////////////////////////////////
406/// Delete icon & text listbox entry.
407
409{
411}
412
413////////////////////////////////////////////////////////////////////////////////
414/// Update icon & text listbox entry.
415
417{
419}
420
421////////////////////////////////////////////////////////////////////////////////
422/// Draw copy on window/pixmap.
423
425{
426 Int_t off_x = 0;
427 if (fPicture) {
428 fPicture->Draw(id, fNormGC, x + 2, y);
429 off_x = fPicture->GetWidth() + 4;
430 }
431 TGTextLBEntry::DrawCopy(id, x + off_x, y);
432}
433
434////////////////////////////////////////////////////////////////////////////////
435/// Redraw icon & text listbox entry.
436
438{
439 if (fId) DrawCopy(fId, 0, 0);
440}
441
442////////////////////////////////////////////////////////////////////////////////
443/// Change the icon of listbox entry containing icon & text.
444
446{
448
449 if (pic) ((TGPicture *)pic)->AddReference();
450
451 fPicture = pic;
452}
453
454/////////////////////////////////////////////////////////////////////////////////
456public:
458 ~TGLBFrameElement() override {}
459
460 Bool_t IsSortable() const override { return kTRUE; }
461 Int_t Compare(const TObject *obj) const override
462 {
464 return 0;
465 }
468
469
470 double d1, d2;
471 const char *t1 = f1->GetText()->Data();
472 const char *t2 = f2->GetText()->Data();
473
474 if ((d1 = atof(t1)) && (d2 = atof(t2))) {
475 return (d1 > d2);
476 } else {
477 return strcmp(t1, t2);
478 }
479 return 0;
480 }
481};
482
483
484////////////////////////////////////////////////////////////////////////////////
485/// Create a listbox container.
486
488 UInt_t options, Pixel_t back) :
489 TGContainer(p, w, h, options, back)
490{
491 fLastActive = 0;
492 fMsgWindow = p;
495 fListBox = 0;
496
499}
500
501////////////////////////////////////////////////////////////////////////////////
502/// Delete the listbox container.
503
505{
506 Cleanup();
507}
508
509////////////////////////////////////////////////////////////////////////////////
510/// Layout container
511
513{
516}
517
518////////////////////////////////////////////////////////////////////////////////
519/// redraw
520
522{
523 return TGContainer::DoRedraw();
524}
525
526////////////////////////////////////////////////////////////////////////////////
527/// Add listbox entry with hints to container. To show entry call
528/// MapSubwindows() and Layout().
529
531{
532 // DEPRECATED: the color should always be set in the TGLBEntry ctor
533 //lbe->SetBackgroundColor(fgWhitePixel);
534
535 TGLBFrameElement *nw = new TGLBFrameElement(lbe, lhints ? lhints : fgDefaultHints);
536 fList->Add(nw);
538}
539
540////////////////////////////////////////////////////////////////////////////////
541/// Insert listbox entry after specified entry with id afterID. If afterID = -1
542/// then add entry at head of list. To show entry call MapSubwindows() and
543/// Layout().
544
546{
547 // DEPRECATED: the color should always be set in the TGLBEntry ctor
548 //lbe->SetBackgroundColor(fgWhitePixel);
549
550 TGLBEntry *e;
551 TGFrameElement *el, *nw;
552 TIter next(fList);
553
554 while ((el = (TGFrameElement *) next())) {
555 e = (TGLBEntry *) el->fFrame;
556 if (e->EntryId() == afterID) break;
557 }
558
559 if (!el && afterID != -1) {
560 nw = new TGLBFrameElement(lbe, lhints ? lhints : fgDefaultHints);
561 fList->Add(nw);
562 } else {
563 nw = new TGLBFrameElement(lbe, lhints);
564 nw->fFrame = lbe;
565 nw->fLayout = lhints;
566 nw->fState = 1;
567 //lbe->SetFrameElement(nw);
568
569 if (afterID == -1)
570 fList->AddFirst(nw);
571 else
572 fList->AddAfter(el, nw);
573 }
575}
576
577////////////////////////////////////////////////////////////////////////////////
578/// Insert listbox entry before the list box entry with a higher id.
579/// To show entry call MapSubwindows() and Layout().
580
582{
583 // DEPRECATED: the color should always be set in the TGLBEntry ctor
584 //lbe->SetBackgroundColor(fgWhitePixel);
585
586 TGLBEntry *e;
587 TGFrameElement *el, *nw;
588 TIter next(fList);
589
590 while ((el = (TGFrameElement *) next())) {
591 e = (TGLBEntry *) el->fFrame;
592 if (e->EntryId() > lbe->EntryId()) break;
593 }
594
595 if (!el) {
596 nw = new TGLBFrameElement(lbe, lhints ? lhints : fgDefaultHints);
597 fList->Add(nw);
598 } else {
599 nw = new TGLBFrameElement(lbe, lhints);
600 nw->fFrame = lbe;
601 nw->fLayout = lhints;
602 nw->fState = 1;
603 //lbe->SetFrameElement(nw);
604
605 fList->AddBefore(el, nw);
606 }
608}
609
610////////////////////////////////////////////////////////////////////////////////
611/// Remove the entry with specified id from the listbox container.
612/// To update the listbox call Layout().
613
615{
616 TGLBEntry *e;
617 TGFrameElement *el;
619
620 TIter next(fList);
621
622 while ((el = (TGFrameElement *) next())) {
623 e = (TGLBEntry *) el->fFrame;
624 l = el->fLayout;
625 if (e->EntryId() == id) {
626 if (fLastActive == e) fLastActive = 0;
627 e->DestroyWindow();
628 fList->Remove(el); // avoid calling RemoveFrame(e)
629 delete el; // item
630 delete e;
631 delete l;
632 break;
633 }
634 }
636}
637
638////////////////////////////////////////////////////////////////////////////////
639/// Remove entries from from_ID to to_ID (including).
640/// To update the listbox call Layout().
641
643{
644 TGLBEntry *e;
645 TGFrameElement *el;
647
648 TIter next(fList);
649
650 while ((el = (TGFrameElement *) next())) {
651 e = (TGLBEntry *) el->fFrame;
652 l = el->fLayout;
653 if ((e->EntryId() >= from_ID) && (e->EntryId() <= to_ID)) {
654 if (fLastActive == e) fLastActive = 0;
655 e->DestroyWindow();
656 fList->Remove(el); // avoid calling RemoveFrame(e)
657 delete el; // idem
658 delete e;
659 delete l;
660 }
661 }
663}
664
665////////////////////////////////////////////////////////////////////////////////
666/// Remove all entries in this container.
667
669{
670 TGLBEntry *e;
671 TGFrameElement *el;
673
674 TIter next(fList);
675
676 while ((el = (TGFrameElement *) next())) {
677 e = (TGLBEntry *) el->fFrame;
678 l = el->fLayout;
679 if (fLastActive == e) fLastActive = 0;
680 if (e)
681 e->DestroyWindow();
682 fList->Remove(el); // avoid calling RemoveFrame(e)
683 delete el; // item
684 delete e;
685 delete l;
686 }
688}
689
690////////////////////////////////////////////////////////////////////////////////
691/// Select the entry with the specified id.
692/// Returns the selected TGLBEntry.
693
695{
696 return Select(id, kTRUE);
697}
698
699////////////////////////////////////////////////////////////////////////////////
700/// Select / deselect the entry with the specified id.
701/// Returns the selected TGLBEntry.
702
704{
705 TGLBEntry *f;
706 TGFrameElement *el;
707
708 if (!fMultiSelect && fLastActive) {
710 fLastActive = 0;
711 }
712
713 TIter next(fList);
714 while ((el = (TGFrameElement *) next())) {
715 f = (TGLBEntry *) el->fFrame;
716 if (f->EntryId() == id) {
717 f->Activate(sel);
718 if (fMultiSelect == kFALSE && sel == kTRUE) {
719 fLastActive = f;
720 fLastActiveEl = el;
721 }
723 return f;
724 }
725 }
726
727 return 0;
728}
729
730////////////////////////////////////////////////////////////////////////////////
731/// Returns id of selected entry. In case of no selected entry or
732/// if multi selection is switched on returns -1.
733
735{
736 if (fLastActive == 0) return -1;
737 return fLastActive->EntryId();
738}
739
740////////////////////////////////////////////////////////////////////////////////
741/// Returns kTrue if entry id is selected.
742
744{
745 TGLBEntry *f;
746 TGFrameElement *el;
747
748 TIter next(fList);
749 while ((el = (TGFrameElement *) next())) {
750 f = (TGLBEntry *) el->fFrame;
751 if (f->EntryId() == id)
752 return f->IsActive();
753 }
754
755 return kFALSE;
756}
757
758////////////////////////////////////////////////////////////////////////////////
759/// Adds all selected entries (TGLBEntry) of the list box into
760/// the list selected.
761
763{
764 TGLBEntry *f;
765 TGFrameElement *el;
766
767 TIter next(fList);
768 while ((el = (TGFrameElement *) next())) {
769 f = (TGLBEntry *) el->fFrame;
770 if (f->IsActive()) {
771 selected->Add(f);
772 }
773 }
774}
775
776////////////////////////////////////////////////////////////////////////////////
777/// Enables and disables multiple selections of entries.
778
780{
781 TGFrameElement *el;
782
783 fMultiSelect = multi;
784 if (!fMultiSelect) {
785 // deselect all entries
786 TIter next(fList);
787 while ((el = (TGFrameElement *) next())) {
788 ((TGLBEntry *)(el->fFrame))->Activate(kFALSE);
789 }
790 }
791 fLastActive = 0;
792 fLastActiveEl = 0;
794}
795
796////////////////////////////////////////////////////////////////////////////////
797/// Return a pointer to vertical scroll bar.
798
800{
801 return fListBox ? fListBox->GetVScrollbar() : 0;
802}
803
804////////////////////////////////////////////////////////////////////////////////
805/// Set new vertical scroll bar position.
806
808{
810
811 if (vb && vb->IsMapped()) {
812 vb->SetPosition(newPos);
813 }
814}
815
816////////////////////////////////////////////////////////////////////////////////
817/// Handle mouse button event in the listbox container.
818
820{
821 int xf0, yf0, xff, yff;
822
823 TGLBEntry *f;
824 TGFrameElement *el;
825 TGLBEntry *last = fLastActive;
826
828 Int_t x = pos.fX + event->fX;
829 Int_t y = pos.fY + event->fY;
830 Bool_t activate = kFALSE;
831
832 // do not handle "context menu button" during guibuilding
833 if (fClient->IsEditable() && (event->fCode == kButton3)) {
834 return kTRUE;
835 }
836
838
839 if ((event->fCode == kButton4) && vb){
840 // scroll 2 lines up (a button down is always followed by a button up)
841 Int_t newpos = vb->GetPosition() - 1;
842 if (newpos < 0) newpos = 0;
843 vb->SetPosition(newpos);
845 return kTRUE;
846 }
847 if ((event->fCode == kButton5) && vb) {
848 // scroll 2 lines down (a button down is always followed by a button up)
849 Int_t newpos = vb->GetPosition() + 1;
850 vb->SetPosition(newpos);
852 return kTRUE;
853 }
854
855 gVirtualX->SetInputFocus(fId);
856
857 if (fMultiSelect) {
858 if (event->fType == kButtonPress) {
859 TIter next(fList);
860 while ((el = (TGFrameElement *) next())) {
861 f = (TGLBEntry *) el->fFrame;
862 xf0 = f->GetX();
863 yf0 = f->GetY();
864 xff = xf0 + f->GetWidth();
865 yff = yf0 + f->GetHeight();
866
867 activate = fMapSubwindows ? (f->GetId() == (Window_t)event->fUser[0]) :
868 (x > xf0) && (x < xff) && (y > yf0) && (y < yff);
869
870 if (activate) {
871 fLastActive = f;
872 fLastActiveEl = el;
873 f->Toggle();
874 fChangeStatus = f->IsActive() ? 1 : 0;
876 f->EntryId(), 0);
877 break;
878 }
879 }
880 } else {
881 fChangeStatus = -1;
882 }
883 } else {
884 if (event->fType == kButtonPress) {
885 if (fLastActive) {
887 fLastActive = 0;
888 }
889 TIter next(fList);
890 while ((el = (TGFrameElement *) next())) {
891 f = (TGLBEntry *) el->fFrame;
892 xf0 = f->GetX();
893 yf0 = f->GetY();
894 xff = xf0 + f->GetWidth();
895 yff = yf0 + f->GetHeight();
896
897 activate = fMapSubwindows ? (f->GetId() == (Window_t)event->fUser[0]) :
898 (x > xf0) && (x < xff) && (y > yf0) && (y < yff) && !f->IsActive();
899
900 if (activate) {
901 f->Activate(kTRUE);
902 fLastActive = f;
903 fLastActiveEl = el;
904 } else {
905 f->Activate(kFALSE);
906 }
907 }
908 } else {
909 if (fLastActive) {
910 f = fLastActive;
912 f->EntryId(), 0);
913 }
914 }
915 }
916 if (event->fType == kButtonRelease) {
919 }
920 if (fChangeStatus || (last != fLastActive))
922 // trick to avoid mouse move events between the mouse click
923 // and the unmapping...
924 if (fListBox->GetParent()->InheritsFrom("TGComboBoxPopup"))
926 return kTRUE;
927}
928
929////////////////////////////////////////////////////////////////////////////////
930/// Handle double click mouse event in the listbox container.
931
933{
934 if (!fMultiSelect) {
935 if (fLastActive) {
938 f->EntryId(), 0);
939 DoubleClicked(f, ev->fCode);
940 DoubleClicked(f, ev->fCode, ev->fXRoot, ev->fYRoot);
941 }
942 return kTRUE;
943 }
945}
946
947////////////////////////////////////////////////////////////////////////////////
948/// Handle mouse motion event in listbox container.
949
951{
952 int xf0, yf0, xff, yff;
953
954 static Long64_t was = gSystem->Now();
955 Long64_t now = gSystem->Now();
956
957 if ((now-was) < 50) return kFALSE;
958 was = now;
959
960 TGLBEntry *f;
961 TGFrameElement *el;
964 Int_t x = pos.fX + event->fX;
965 Int_t y = pos.fY + event->fY;
966 Bool_t activate = kFALSE;
967 TGLBEntry *last = fLastActive;
968
969 if (fMultiSelect) {
970
971 if ((event->fY < 10) || (event->fY > Int_t(dim.fHeight) - 10)) {
972 if (!fScrolling) {
975 }
977 }
978 else if (fChangeStatus >= 0) {
979 TIter next(fList);
980 while ((el = (TGFrameElement *) next())) {
981 f = (TGLBEntry *) el->fFrame;
982 xf0 = f->GetX();
983 yf0 = f->GetY();
984 xff = xf0 + f->GetWidth();
985 yff = yf0 + f->GetHeight();
986 activate = fMapSubwindows ? (f->GetId() == (Window_t)event->fUser[0]) :
987 (x > xf0) && (x < xff) && (y > yf0) && (y < yff);
988
989 if (activate) {
990 if (fChangeStatus != (f->IsActive() ? 1 : 0)) {
991 f->Toggle();
994 f->EntryId(), 0);
995 }
996 break;
997 }
998 }
999 }
1000 } else if (fListBox->GetParent()->InheritsFrom("TGComboBoxPopup")) {
1001 TIter next(fList);
1002 while ((el = (TGFrameElement *) next())) {
1003 f = (TGLBEntry *) el->fFrame;
1004 xf0 = f->GetX();
1005 yf0 = f->GetY();
1006 xff = xf0 + f->GetWidth();
1007 yff = yf0 + f->GetHeight();
1008
1009 activate = fMapSubwindows ? (f->GetId() == (Window_t)event->fUser[0]) :
1010 (x > xf0) && (x < xff) && (y > yf0) && (y < yff) && !f->IsActive();
1011
1012 if (activate) {
1013 f->Activate(kTRUE);
1014 fLastActive = f;
1015 fLastActiveEl = el;
1016 } else {
1017 f->Activate(kFALSE);
1018 }
1019 if (last != fLastActive) {
1020 ClearViewPort();
1021 }
1022 }
1023 }
1024 return kTRUE;
1025}
1026
1027////////////////////////////////////////////////////////////////////////////////
1028/// Autoscroll while close to & beyond The Wall
1029
1031{
1032 TGFrameElement* el = 0;
1033 TGLBEntry *f = 0;
1034 Int_t yf0, yff;
1035 Bool_t changed = kFALSE;
1036
1039
1040 Window_t dum1, dum2;
1041 Event_t ev;
1042 ev.fType = kButtonPress;
1043 Int_t x, y;
1044
1045 // Where's the cursor?
1046 gVirtualX->QueryPointer(fId,dum1,dum2,ev.fXRoot,ev.fYRoot,x,y,ev.fState);
1048 if (vb && y > 0 && y < 10) {
1049 // scroll 1 line up
1050 Int_t newpos = vb->GetPosition() - 1;
1051 if (newpos < 0) newpos = 0;
1052 vb->SetPosition(newpos);
1053 changed = kTRUE;
1054 }
1055 else if (vb && y > (Int_t)dim.fHeight - 10 && y < (Int_t)dim.fHeight) {
1056 // scroll 1 line down
1057 Int_t newpos = vb->GetPosition() + 1;
1058 vb->SetPosition(newpos);
1059 changed = kTRUE;
1060 }
1061 if (changed && fChangeStatus >= 0) {
1062 pos = GetPagePosition();
1063 TIter next(fList);
1064 while ((el = (TGFrameElement *) next())) {
1065 f = (TGLBEntry *) el->fFrame;
1066 yf0 = f->GetY();
1067 yff = yf0 + f->GetHeight();
1068 if ((y + pos.fY > yf0) && (y + pos.fY < yff)) {
1069 if (fChangeStatus != (f->IsActive() ? 1 : 0)) {
1070 f->Toggle();
1071 ClearViewPort();
1073 f->EntryId(), 0);
1074 }
1075 break;
1076 }
1077 }
1078 }
1079}
1080
1081////////////////////////////////////////////////////////////////////////////////
1082/// Activate item.
1083
1085{
1087 fLastActive = (TGLBEntry *)el->fFrame;
1088}
1089
1090////////////////////////////////////////////////////////////////////////////////
1091/// Returns the position in the list box of the entry id.
1092/// The first position has position no 0. Returns -1 if entry id
1093/// is not in the list of entries.
1094
1096{
1097 Int_t pos = 0;
1098 TGLBEntry *f;
1099 TGFrameElement *el;
1100
1101 TIter next(fList);
1102 while ((el = (TGFrameElement *) next())) {
1103 f = (TGLBEntry *) el->fFrame;
1104 if (f->EntryId() == id)
1105 return pos;
1106 pos++;
1107 }
1108
1109 return -1;
1110}
1111
1112
1113////////////////////////////////////////////////////////////////////////////////
1114/// Create a listbox.
1115
1117 UInt_t options, Pixel_t back) :
1118 TGCompositeFrame(p, 10, 10, options, back)
1119{
1120 fMsgWindow = p;
1121 fWidgetId = id;
1122
1123 fItemVsize = 1;
1125
1126 InitListBox();
1127}
1128
1129////////////////////////////////////////////////////////////////////////////////
1130/// Delete a listbox widget.
1131
1133{
1134 if (!MustCleanup()) {
1135 delete fVScrollbar;
1136 delete fVport;
1137 delete fLbc;
1138 }
1139}
1140
1141////////////////////////////////////////////////////////////////////////////////
1142/// Initiate the internal classes of a list box.
1143
1145{
1150 fLbc->Associate(this);
1151 fLbc->SetListBox(this);
1153
1154 AddFrame(fVport, 0);
1156
1157 fVScrollbar->Associate(this);
1158
1163
1168
1169 // layout manager is not used
1170 delete fLayoutManager;
1171 fLayoutManager = 0;
1172}
1173
1174////////////////////////////////////////////////////////////////////////////////
1175/// Draw borders of the list box widget.
1176
1178{
1180
1182 gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, fWidth-2, 0);
1183 gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, 0, fHeight-2);
1184 gVirtualX->DrawLine(fId, GetBlackGC()(), 1, 1, fWidth-3, 1);
1185 gVirtualX->DrawLine(fId, GetBlackGC()(), 1, 1, 1, fHeight-3);
1186 if (gClient->GetStyle() > 1) break;
1187 gVirtualX->DrawLine(fId, GetHilightGC()(), 0, fHeight-1, fWidth-1, fHeight-1);
1188 gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth-1, fHeight-1, fWidth-1, 0);
1189 gVirtualX->DrawLine(fId, GetBckgndGC()(), 1, fHeight-2, fWidth-2, fHeight-2);
1190 gVirtualX->DrawLine(fId, GetBckgndGC()(), fWidth-2, 1, fWidth-2, fHeight-2);
1191 break;
1192
1193 default:
1195 break;
1196 }
1197}
1198
1199////////////////////////////////////////////////////////////////////////////////
1200/// Add entry with specified string and id to listbox. The id will be
1201/// used in the event processing routine when the item is selected.
1202/// The string will be adopted by the listbox.
1203
1205{
1206 TGTextLBEntry *lbe;
1207 TGLayoutHints *lhints;
1208
1209 lbe = new TGTextLBEntry(fLbc, s, id);
1210 lhints = new TGLayoutHints(kLHintsExpandX | kLHintsTop);
1212 fLbc->AddEntry(lbe, lhints);
1213}
1214
1215////////////////////////////////////////////////////////////////////////////////
1216/// Add entry with specified string and id to listbox. The id will be
1217/// used in the event processing routine when the item is selected.
1218
1219void TGListBox::AddEntry(const char *s, Int_t id)
1220{
1221 AddEntry(new TGString(s), id);
1222}
1223
1224////////////////////////////////////////////////////////////////////////////////
1225/// Add specified TGLBEntry and TGLayoutHints to listbox. The
1226/// entry and layout will be adopted and later deleted by the listbox.
1227
1229{
1231 fLbc->AddEntry(lbe, lhints);
1232}
1233
1234////////////////////////////////////////////////////////////////////////////////
1235/// Add entry with specified string and id to listbox sorted by increasing id.
1236/// This sorting works properly only if EntrySort functions are used to add
1237/// entries without mixing them with other add or insert functions. The id will be
1238/// used in the event processing routine when the item is selected.
1239/// The string will be adopted by the listbox.
1240
1242{
1243 TGTextLBEntry *lbe;
1244 TGLayoutHints *lhints;
1245
1246 lbe = new TGTextLBEntry(fLbc, s, id);
1247 lhints = new TGLayoutHints(kLHintsExpandX | kLHintsTop);
1249 fLbc->AddEntrySort(lbe, lhints);
1250}
1251
1252////////////////////////////////////////////////////////////////////////////////
1253/// Add entry with specified string and id to listbox sorted by increasing id.
1254/// This sorting works properly only if EntrySort functions are used to add
1255/// entries without mixing them with other add or insert functions. The id will be
1256/// used in the event processing routine when the item is selected.
1257
1258void TGListBox::AddEntrySort(const char *s, Int_t id)
1259{
1260 AddEntrySort(new TGString(s), id);
1261}
1262
1263////////////////////////////////////////////////////////////////////////////////
1264/// Add specified TGLBEntry and TGLayoutHints to listbox sorted by increasing id.
1265/// This sorting works properly only if EntrySort functions are used to add
1266/// entries without mixing them with other add or insert functions. The
1267/// entry and layout will be adopted and later deleted by the listbox.
1268
1270{
1272 fLbc->AddEntrySort(lbe, lhints);
1273}
1274
1275////////////////////////////////////////////////////////////////////////////////
1276/// Insert entry with specified string and id behind the entry with afterID.
1277/// The string will be adopted and later deleted by the listbox.
1278
1280{
1281 TGTextLBEntry *lbe;
1282 TGLayoutHints *lhints;
1283
1284 lbe = new TGTextLBEntry(fLbc, s, id);
1285 lhints = new TGLayoutHints(kLHintsExpandX | kLHintsTop);
1287 fLbc->InsertEntry(lbe, lhints, afterID);
1288}
1289
1290////////////////////////////////////////////////////////////////////////////////
1291/// Insert entry with specified string and id behind the entry with afterID.
1292
1293void TGListBox::InsertEntry(const char *s, Int_t id, Int_t afterID)
1294{
1295 InsertEntry(new TGString(s), id, afterID);
1296}
1297
1298////////////////////////////////////////////////////////////////////////////////
1299/// method used to add entry via context menu
1300
1301void TGListBox::NewEntry(const char *s)
1302{
1303 Int_t selected = fLbc->GetSelected();
1304
1305 // no selected entry or the last entry
1306 if ((selected < 0) || (selected == GetNumberOfEntries())) {
1308 } else {
1309 InsertEntry(s, GetNumberOfEntries()+1, selected);
1310 }
1311 Layout();
1312}
1313
1314////////////////////////////////////////////////////////////////////////////////
1315/// remove entry with id.
1316/// If id = -1 - the selected entry/entries is/are removed.
1317///
1318
1320{
1321 if (id >= 0) {
1322 fLbc->RemoveEntry(id);
1323 Layout();
1324 return;
1325 }
1326 if (!fLbc->GetMultipleSelections()) {
1328 Layout();
1329 return;
1330 }
1331 TList li;
1333 TGLBEntry *e;
1334 TIter next(&li);
1335
1336 while ((e = (TGLBEntry*)next())) {
1337 fLbc->RemoveEntry(e->EntryId());
1338 }
1339 Layout();
1340}
1341
1342////////////////////////////////////////////////////////////////////////////////
1343/// Remove all entries.
1344
1346{
1347 fLbc->RemoveAll();
1348 Layout();
1349}
1350
1351////////////////////////////////////////////////////////////////////////////////
1352/// Remove a range of entries defined by from_ID and to_ID.
1353
1355{
1356 fLbc->RemoveEntries(from_ID, to_ID);
1357 Layout();
1358}
1359
1360////////////////////////////////////////////////////////////////////////////////
1361/// Insert the specified TGLBEntry and layout hints behind afterID.
1362/// The entry and layout will be adopted and later deleted by the listbox.
1363
1365{
1367 fLbc->InsertEntry(lbe, lhints, afterID);
1368}
1369
1370////////////////////////////////////////////////////////////////////////////////
1371/// Returns list box entry with specified id.
1372
1374{
1375 TIter next(fLbc->GetList());
1376 TGFrameElement *el;
1377
1378 while ((el = (TGFrameElement *)next())) {
1379 TGLBEntry *lbe = (TGLBEntry *)el->fFrame;
1380 if (lbe->EntryId() == id) return lbe;
1381 }
1382 return 0;
1383}
1384
1385////////////////////////////////////////////////////////////////////////////////
1386/// Scroll the entry with id to the top of the listbox.
1387
1389{
1390 Int_t idPos;
1391
1392 idPos = fLbc->GetPos(id);
1393
1394 // id not found in list of entries
1395 if (idPos < 0)
1396 return;
1397
1398 // call layout to define the range of the scroll bars
1399 Layout();
1400
1401 // SetPosition will send a message which will handled by
1402 // the function TGListBox::ProcessMessage. Now ProcessMessage will
1403 // set the viewport. SetPosition also will check that the idPos is
1404 // not out of range.
1405 fVScrollbar->SetPosition(idPos);
1406}
1407
1408////////////////////////////////////////////////////////////////////////////////
1409/// Resize the listbox widget. If fIntegralHeight is true make the height
1410/// an integral number of the maximum height of a single entry.
1411
1413{
1414 if (fIntegralHeight)
1416 + (fBorderWidth << 1);
1417
1419 DoRedraw();
1420}
1421
1422////////////////////////////////////////////////////////////////////////////////
1423/// Move and resize the listbox widget.
1424
1426{
1427 if (fIntegralHeight)
1429 + (fBorderWidth << 1);
1431 DoRedraw();
1432}
1433
1434////////////////////////////////////////////////////////////////////////////////
1435/// Return default size of listbox widget.
1436
1438{
1439 UInt_t h;
1440
1441 if (fIntegralHeight)
1443 + (fBorderWidth << 1);
1444 else
1445 h = fHeight;
1446
1447 return TGDimension(fWidth, h);
1448}
1449
1450////////////////////////////////////////////////////////////////////////////////
1451/// Layout the listbox components.
1452
1454{
1455 TGFrame *container;
1456 UInt_t cw, ch, tch;
1457 Bool_t need_vsb;
1458
1459 need_vsb = kFALSE;
1460
1461 container = fVport->GetContainer();
1462
1463 // test whether we need vertical scrollbar or not
1464
1465 cw = fWidth - (fBorderWidth << 1);
1466 ch = fHeight - (fBorderWidth << 1);
1467
1468 container->SetWidth(cw);
1469 container->SetHeight(ch);
1470
1471 if (container->GetDefaultHeight() > ch) {
1472 need_vsb = kTRUE;
1474 if ((Int_t) cw < 0) {
1475 Warning("Layout", "width would become too small, setting to 10");
1476 cw = 10;
1477 }
1478 container->SetWidth(cw);
1479 }
1480
1482 container->Layout();
1483
1484 tch = TMath::Max(container->GetDefaultHeight(), ch);
1485 container->SetHeight(0); // force a resize in TGFrame::Resize
1486 container->Resize(cw, tch);
1487 //fVport->SetPos(0, 0);
1488
1489 if (need_vsb) {
1492 } else {
1495 }
1496
1499 //fClient->NeedRedraw(container);
1500 ((TGContainer *)container)->ClearViewPort();
1501}
1502
1503////////////////////////////////////////////////////////////////////////////////
1504/// Sort entries by name
1505
1507{
1508 fLbc->GetList()->Sort(ascend);
1509 Layout();
1511}
1512
1513////////////////////////////////////////////////////////////////////////////////
1514/// Return id of selected listbox item.
1515
1517{
1519 return ct->GetSelected();
1520}
1521
1522////////////////////////////////////////////////////////////////////////////////
1523/// Adds all selected entries (TGLBEntry) of the list box into
1524/// the list selected.
1525
1527{
1528 fLbc->GetSelectedEntries(selected);
1529}
1530
1531////////////////////////////////////////////////////////////////////////////////
1532/// Change background to all entries
1533
1535{
1536 fBackground = back;
1537
1538 TIter next(fLbc->GetList());
1539 TGFrameElement *el;
1540
1541 while ((el = (TGFrameElement *)next())) {
1542 TGLBEntry *lbe = (TGLBEntry *)el->fFrame;
1543 lbe->SetBackgroundColor(back);
1544 }
1546}
1547
1548////////////////////////////////////////////////////////////////////////////////
1549/// Process messages generated by the listbox container and forward
1550/// messages to the listbox message handling window.
1551
1553{
1554 switch (GET_MSG(msg)) {
1555 case kC_VSCROLL:
1556 switch (GET_SUBMSG(msg)) {
1557 case kSB_SLIDERTRACK:
1558 case kSB_SLIDERPOS:
1559 fVport->SetVPos(Int_t(-parm1 * fItemVsize));
1560 break;
1561 }
1562 break;
1563
1564 case kC_CONTAINER:
1565 switch (GET_SUBMSG(msg)) {
1566 case kCT_ITEMCLICK:
1567 {
1569 fWidgetId, parm1);
1571 TGLBEntry *entry = GetSelectedEntry();
1572 if (entry) {
1573 if (entry->InheritsFrom(TGTextLBEntry::Class())) {
1574 const char *text;
1575 text = ((TGTextLBEntry*)entry)->GetText()->GetString();
1576 Selected(text);
1577 }
1578 Selected(fWidgetId, (Int_t) parm1);
1579 Selected((Int_t) parm1);
1580 }
1581 }
1582 break;
1583 case kCT_ITEMDBLCLICK:
1584 if (!GetMultipleSelections()) {
1585 TGLBEntry *entry = GetSelectedEntry();
1586 if (entry) {
1587 if (entry->InheritsFrom(TGTextLBEntry::Class())) {
1588 const char *text;
1589 text = ((TGTextLBEntry*)entry)->GetText()->GetString();
1591 }
1592 DoubleClicked(fWidgetId, (Int_t) parm1);
1593 DoubleClicked((Int_t) parm1);
1594 }
1595 }
1596 break;
1597 }
1598 break;
1599
1600 default:
1601 break;
1602
1603 }
1604 return kTRUE;
1605}
1606
1607////////////////////////////////////////////////////////////////////////////////
1608/// Emit Selected signal with list box id and entry id.
1609
1611{
1612 Longptr_t args[2];
1613
1614 args[0] = widgetId;
1615 args[1] = id;
1616
1617 Emit("Selected(Int_t,Int_t)", args);
1618}
1619
1620////////////////////////////////////////////////////////////////////////////////
1621/// Emit DoubleClicked signal with list box id and entry id.
1622
1624{
1625 Longptr_t args[2];
1626
1627 args[0] = widgetId;
1628 args[1] = id;
1629
1630 Emit("DoubleClicked(Int_t,Int_t)", args);
1631}
1632
1633////////////////////////////////////////////////////////////////////////////////
1634/// Find entry by name.
1635
1637{
1638 TList *list = fLbc->GetList();
1639 TGFrameElement *el = (TGFrameElement *)list->First();
1640 while (el) {
1641 if (el->fFrame->GetTitle() == TString(name))
1642 return (TGLBEntry *)el->fFrame;
1643 el = (TGFrameElement *)list->After(el);
1644 }
1645 return 0;
1646}
1647
1648////////////////////////////////////////////////////////////////////////////////
1649/// Save a list box widget as a C++ statement(s) on output stream out.
1650
1651void TGListBox::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
1652{
1654
1655 out << std::endl << " // list box" << std::endl;
1656
1657 out<<" TGListBox *";
1658 out << GetName() << " = new TGListBox(" << fParent->GetName();
1659
1660 if (fBackground == GetWhitePixel()) {
1661 if (GetOptions() == (kSunkenFrame | kDoubleBorder)) {
1662 if (fWidgetId == -1) {
1663 out <<");" << std::endl;
1664 } else {
1665 out << "," << fWidgetId << ");" << std::endl;
1666 }
1667 } else {
1668 out << "," << fWidgetId << "," << GetOptionString() <<");" << std::endl;
1669 }
1670 } else {
1671 out << "," << fWidgetId << "," << GetOptionString() << ",ucolor);" << std::endl;
1672 }
1673 if (option && strstr(option, "keep_names"))
1674 out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
1675
1676 if (!fLbc->GetList()) return;
1677
1678 TGFrameElement *el;
1679 TIter next(fLbc->GetList());
1680
1681 while ((el = (TGFrameElement *) next())) {
1682 out << " " << GetName() << "->AddEntry(";
1683 el->fFrame->SavePrimitive(out, option);
1684 out << ");"<< std::endl;
1685 }
1686 out << " " << GetName() << "->Resize(" << GetWidth() << "," << GetHeight()
1687 << ");" << std::endl;
1688}
1689
1690////////////////////////////////////////////////////////////////////////////////
1691/// Save a list box entry widget as a C++ statement(s) on output stream out.
1692
1693void TGTextLBEntry::SavePrimitive(std::ostream &out, Option_t * /*= ""*/)
1694{
1695 TString content = GetText()->GetString();
1696 content.ReplaceAll('\\', "\\\\");
1697 content.ReplaceAll("\"", "\\\"");
1698 char quote = '"';
1699 out << quote << content << quote << "," << EntryId();
1700}
@ kButtonRelease
Definition GuiTypes.h:60
@ kButtonPress
Definition GuiTypes.h:60
const Mask_t kGCLineStyle
Definition GuiTypes.h:291
const Mask_t kGCLineWidth
Definition GuiTypes.h:290
const Mask_t kButtonMotionMask
Definition GuiTypes.h:164
const Mask_t kButtonPressMask
Definition GuiTypes.h:161
const Mask_t kGCDashList
Definition GuiTypes.h:307
const Mask_t kGCFillStyle
Definition GuiTypes.h:294
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
Handle_t GContext_t
Graphics context handle.
Definition GuiTypes.h:38
const Mask_t kPointerMotionMask
Definition GuiTypes.h:163
@ kChildFrame
Definition GuiTypes.h:379
@ kRaisedFrame
Definition GuiTypes.h:384
@ kSunkenFrame
Definition GuiTypes.h:383
@ kVerticalFrame
Definition GuiTypes.h:381
@ kDoubleBorder
Definition GuiTypes.h:385
@ kOwnBackground
Definition GuiTypes.h:391
@ kDefaultScrollBarWidth
Definition GuiTypes.h:86
@ kFillSolid
Definition GuiTypes.h:51
@ kLineSolid
Definition GuiTypes.h:48
@ kLineOnOffDash
Definition GuiTypes.h:48
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:162
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
@ kButton4
Definition GuiTypes.h:215
@ kButton5
Definition GuiTypes.h:215
@ kButton3
Definition GuiTypes.h:214
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
#define e(i)
Definition RSha256.hxx:103
short Style_t
Definition RtypesCore.h:89
int Int_t
Definition RtypesCore.h:45
long Longptr_t
Definition RtypesCore.h:82
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
long long Long64_t
Definition RtypesCore.h:80
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:377
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition TError.cxx:229
#define gClient
Definition TGClient.h:156
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
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 ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t width
Option_t Option_t style
Option_t Option_t TPoint TPoint const char text
char name[80]
Definition TGX11.cxx:110
R__EXTERN TSystem * gSystem
Definition TSystem.h:555
#define gVirtualX
Definition TVirtualX.h:337
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Int_t GET_MSG(Long_t val)
@ kSB_SLIDERTRACK
@ kSB_SLIDERPOS
@ kC_VSCROLL
@ kCT_ITEMCLICK
@ kC_COMMAND
@ kCM_LISTBOX
@ kCT_ITEMDBLCLICK
@ kC_CONTAINER
Int_t GET_SUBMSG(Long_t val)
Bool_t IsEditable() const
Definition TGClient.h:89
TGGC * GetGC(GCValues_t *values, Bool_t rw=kFALSE)
Get graphics context from the gc pool.
Definition TGClient.cxx:320
void FreeGC(const TGGC *gc)
Free a graphics context.
Definition TGClient.cxx:328
const TGResourcePool * GetResourcePool() const
Definition TGClient.h:124
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition TGClient.cxx:308
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
TGLayoutManager * fLayoutManager
layout manager
Definition TGFrame.h:291
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual TList * GetList() const
Definition TGFrame.h:310
Int_t MustCleanup() const override
Definition TGFrame.h:360
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
Definition TGFrame.cxx:967
Bool_t fMapSubwindows
kTRUE - map subwindows
Definition TGFrame.h:295
TList * fList
container of frame elements
Definition TGFrame.h:292
static TGLayoutHints * fgDefaultHints
Definition TGFrame.h:297
void SetEditDisabled(UInt_t on=1) override
Set edit disable flag for this frame and subframes.
Definition TGFrame.cxx:1022
Manages a content area.
Definition TGCanvas.h:31
virtual void ActivateItem(TGFrameElement *el)
Activate item.
Definition TGCanvas.cxx:701
TTimer * fScrollTimer
autoscroll timer
Definition TGCanvas.h:50
Bool_t HandleDoubleClick(Event_t *event) override
Handle double click mouse event.
virtual void ClearViewPort()
Clear view port and redraw full content.
Definition TGCanvas.cxx:891
const TGWindow * fMsgWindow
window handling container messages
Definition TGCanvas.h:42
void Layout() override
Layout container entries.
Definition TGCanvas.cxx:422
void DoRedraw() override
Redraw content of container in the viewport region.
Definition TGCanvas.cxx:800
Bool_t fScrolling
kTRUE - when scrolling is ON
Definition TGCanvas.h:59
virtual TGDimension GetPageDimension() const
Returns page dimension.
Definition TGCanvas.cxx:751
TGViewPort * fViewPort
container viewport
Definition TGCanvas.h:40
virtual void DoubleClicked(TGFrame *f, Int_t btn)
Emit DoubleClicked() signal.
Definition TGCanvas.cxx:538
virtual TGPosition GetPagePosition() const
Returns page position.
Definition TGCanvas.cxx:737
TGFrameElement * fLastActiveEl
last active item
Definition TGCanvas.h:43
UInt_t fHeight
Definition TGDimension.h:21
Encapsulate fonts used in the GUI system.
Definition TGFont.h:140
FontStruct_t GetFontStruct() const
Definition TGFont.h:184
TGLayoutHints * fLayout
Definition TGLayout.h:114
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 AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition TGFrame.cxx:339
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:629
static const TGGC & GetBlackGC()
Get black graphics context.
Definition TGFrame.cxx:735
UInt_t fOptions
frame options
Definition TGFrame.h:94
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
Definition TGFrame.cxx:605
void RemoveInput(UInt_t emask)
Remove events specified in emask from the events the frame should handle.
Definition TGFrame.cxx:348
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition TGFrame.cxx:709
UInt_t fHeight
frame height
Definition TGFrame.h:88
virtual UInt_t GetDefaultWidth() const
Definition TGFrame.h:190
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:191
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:3230
virtual void DrawBorder()
Draw frame border.
Definition TGFrame.cxx:421
Int_t fBorderWidth
frame border width
Definition TGFrame.h:93
static Pixel_t fgDefaultSelectedBackground
Definition TGFrame.h:102
virtual void Activate(Bool_t)
Definition TGFrame.h:210
void DoRedraw() override
Redraw the frame.
Definition TGFrame.cxx:430
void MapWindow() override
map window
Definition TGFrame.h:204
virtual Pixel_t GetForeground() const
Return frame foreground color.
Definition TGFrame.cxx:303
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition TGFrame.cxx:755
virtual UInt_t GetOptions() const
Definition TGFrame.h:197
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition TGFrame.cxx:2506
void UnmapWindow() override
unmap window
Definition TGFrame.h:206
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
Definition TGFrame.cxx:645
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition TGFrame.cxx:765
UInt_t fWidth
frame width
Definition TGFrame.h:87
UInt_t GetHeight() const
Definition TGFrame.h:225
virtual void Layout()
Definition TGFrame.h:199
virtual void SetWidth(UInt_t w)
Definition TGFrame.h:246
static Pixel_t fgWhitePixel
Definition TGFrame.h:103
UInt_t GetWidth() const
Definition TGFrame.h:224
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition TGFrame.cxx:2479
virtual void SetHeight(UInt_t h)
Definition TGFrame.h:247
Pixel_t fBackground
frame background color
Definition TGFrame.h:95
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition TGFrame.cxx:775
Encapsulate a graphics context used in the low level graphics.
Definition TGGC.h:22
GContext_t GetGC() const
Definition TGGC.h:41
void SetLineWidth(Int_t v)
Set line width.
Definition TGGC.cxx:300
void SetCapStyle(Int_t v)
Set cap style (kCapNotLast, kCapButt, kCapRound, kCapProjecting).
Definition TGGC.cxx:322
void SetDashList(const char v[], Int_t len)
Set dash pattern. First use SetDashOffset() if not 0.
Definition TGGC.cxx:488
void SetLineStyle(Int_t v)
Set line style (kLineSolid, kLineOnOffDash, kLineDoubleDash).
Definition TGGC.cxx:311
void DoRedraw() override
Redraw icon & text listbox entry.
~TGIconLBEntry() override
Delete icon & text listbox entry.
virtual void SetPicture(const TGPicture *pic=nullptr)
Change the icon of listbox entry containing icon & text.
void DrawCopy(Handle_t id, Int_t x, Int_t y) override
Draw copy on window/pixmap.
TGIconLBEntry(const TGIconLBEntry &)=delete
const TGPicture * fPicture
Definition TGListBox.h:139
void Update(TGLBEntry *e) override
Update icon & text listbox entry.
A Composite frame that contains a list of TGLBEnties.
Definition TGListBox.h:163
TGLBContainer(const TGLBContainer &)=delete
Bool_t fMultiSelect
true if multi selection is switched on
Definition TGListBox.h:174
virtual Bool_t GetSelection(Int_t id)
Returns kTrue if entry id is selected.
void OnAutoScroll() override
Autoscroll while close to & beyond The Wall.
virtual void SetListBox(TGListBox *lb)
Definition TGListBox.h:196
void RemoveAll() override
Remove all entries in this container.
void SetVsbPosition(Int_t newPos) override
Set new vertical scroll bar position.
TGVScrollBar * GetVScrollbar() const override
Return a pointer to vertical scroll bar.
Int_t fChangeStatus
defines the changes (select or unselect) while the mouse moves over a multi selectable list box
Definition TGListBox.h:175
virtual Int_t GetSelected() const
Returns id of selected entry.
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in the listbox container.
virtual Bool_t GetMultipleSelections() const
Definition TGListBox.h:215
void Layout() override
Layout container.
void ActivateItem(TGFrameElement *el) override
Activate item.
virtual TGLBEntry * Select(Int_t id, Bool_t sel)
Select / deselect the entry with the specified id.
TGLBEntry * fLastActive
last active listbox entry in single selection listbox
Definition TGListBox.h:172
Bool_t HandleDoubleClick(Event_t *event) override
Handle double click mouse event in the listbox container.
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove entries from from_ID to to_ID (including).
TGListBox * fListBox
list box which contains this container
Definition TGListBox.h:173
virtual void AddEntry(TGLBEntry *lbe, TGLayoutHints *lhints)
Add listbox entry with hints to container.
virtual Int_t GetPos(Int_t id)
Returns the position in the list box of the entry id.
virtual void AddEntrySort(TGLBEntry *lbe, TGLayoutHints *lhints)
Insert listbox entry before the list box entry with a higher id.
virtual void InsertEntry(TGLBEntry *lbe, TGLayoutHints *lhints, Int_t afterID)
Insert listbox entry after specified entry with id afterID.
virtual void RemoveEntry(Int_t id)
Remove the entry with specified id from the listbox container.
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
void DoRedraw() override
redraw
void Associate(const TGWindow *w) override
Definition TGListBox.h:195
~TGLBContainer() override
Delete the listbox container.
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion event in listbox container.
virtual void SetMultipleSelections(Bool_t multi)
Enables and disables multiple selections of entries.
Basic listbox entries.
Definition TGListBox.h:24
Pixel_t fBkcolor
entry background color
Definition TGListBox.h:28
Int_t fEntryId
message id of listbox entry
Definition TGListBox.h:27
void DoRedraw() override
Redraw the frame.
Definition TGListBox.h:31
virtual void Toggle()
Toggle active state of listbox entry.
Int_t EntryId() const
Definition TGListBox.h:40
Bool_t fActive
true if entry is active
Definition TGListBox.h:29
void SetBackgroundColor(Pixel_t col) override
Set background color (override from TGWindow base class).
Definition TGListBox.h:42
TGLBEntry(const TGWindow *p=nullptr, Int_t id=-1, UInt_t options=kHorizontalFrame, Pixel_t back=GetWhitePixel())
Base class entry constructor.
Definition TGListBox.cxx:99
void Activate(Bool_t a) override
Toggle active state of listbox entry.
TGLBFrameElement(TGFrame *f, TGLayoutHints *l)
Int_t Compare(const TObject *obj) const override
Compare abstract method.
~TGLBFrameElement() override
Bool_t IsSortable() const override
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
Line style and width listbox entries.
Definition TGListBox.h:97
Style_t fLineStyle
line style
Definition TGListBox.h:105
TGGC * fLineGC
line graphics context
Definition TGListBox.h:107
UInt_t fLineLength
line length
Definition TGListBox.h:106
UInt_t fLineWidth
line width
Definition TGListBox.h:104
void DrawCopy(Handle_t id, Int_t x, Int_t y) override
Draw copy on window/pixmap.
void DoRedraw() override
Redraw line style listbox entry.
void Update(TGLBEntry *e) override
Update line style listbox entry.
virtual void SetLineWidth(Int_t width)
Set or change line width in an entry.
virtual void SetLineStyle(Style_t style)
Set the line style corresponding to the TPad line styles.
~TGLineLBEntry() override
Delete line style listbox entry.
TGLineLBEntry(const TGLineLBEntry &)=delete
A listbox is a box, possibly with scrollbar, containing entries.
Definition TGListBox.h:221
virtual void InitListBox()
Initiate the internal classes of a list box.
Bool_t fIntegralHeight
true if height should be multiple of fItemVsize
Definition TGListBox.h:229
virtual void AddEntrySort(TGString *s, Int_t id)
Add entry with specified string and id to listbox sorted by increasing id.
TGListBox(const TGListBox &)=delete
virtual void SortByName(Bool_t ascend=kTRUE)
Sort entries by name.
virtual TGVScrollBar * GetVScrollbar() const
Definition TGListBox.h:270
TGViewPort * fVport
listbox viewport (see TGCanvas.h)
Definition TGListBox.h:231
UInt_t fItemVsize
maximum height of single entry
Definition TGListBox.h:228
TGDimension GetDefaultSize() const override
Return default size of listbox widget.
virtual Int_t GetNumberOfEntries() const
Definition TGListBox.h:263
TGLBContainer * fLbc
listbox container
Definition TGListBox.h:230
virtual TGLBEntry * GetSelectedEntry() const
Definition TGListBox.h:288
virtual void RemoveEntry(Int_t id=-1)
remove entry with id.
virtual void NewEntry(const char *s="Entry")
method used to add entry via context menu
void Resize(UInt_t w, UInt_t h) override
Resize the listbox widget.
virtual Int_t GetSelected() const
Return id of selected listbox item.
~TGListBox() override
Delete a listbox widget.
void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h) override
Move and resize the listbox widget.
virtual void SetTopEntry(Int_t id=-1)
Scroll the entry with id to the top of the listbox.
void ChangeBackground(Pixel_t back) override
Change background to all entries.
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
void Layout() override
Layout the listbox components.
virtual void DoubleClicked(Int_t widgetId, Int_t id)
Emit DoubleClicked signal with list box id and entry id.
virtual void InsertEntry(TGString *s, Int_t id, Int_t afterID)
Insert entry with specified string and id behind the entry with afterID.
virtual void SelectionChanged()
Definition TGListBox.h:300
virtual Bool_t GetMultipleSelections() const
Definition TGListBox.h:261
void SetContainer(TGFrame *f)
Definition TGListBox.h:234
TGVScrollBar * fVScrollbar
vertical scrollbar
Definition TGListBox.h:232
void DrawBorder() override
Draw borders of the list box widget.
virtual TGLBEntry * GetEntry(Int_t id) const
Returns list box entry with specified id.
virtual TGViewPort * GetViewPort() const
Definition TGListBox.h:268
virtual TGFrame * GetContainer() const
Definition TGListBox.h:267
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a list box widget as a C++ statement(s) on output stream out.
virtual void GetSelectedEntries(TList *selected)
Adds all selected entries (TGLBEntry) of the list box into the list selected.
virtual void RemoveEntries(Int_t from_ID, Int_t to_ID)
Remove a range of entries defined by from_ID and to_ID.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages generated by the listbox container and forward messages to the listbox message handl...
virtual TGLBEntry * FindEntry(const char *s) const
Find entry by name.
void RemoveAll() override
Remove all entries.
virtual void Selected(Int_t widgetId, Int_t id)
Emit Selected signal with list box id and entry id.
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
UInt_t GetHeight() const
Definition TGPicture.h:53
UInt_t GetWidth() const
Definition TGPicture.h:52
Int_t fY
y position
Definition TGDimension.h:39
Int_t fX
x position
Definition TGDimension.h:38
Pixel_t GetBlackColor() const
Pixel_t GetSelectedFgndColor() const
virtual Int_t GetPosition() const
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
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:56
Text string listbox entries.
Definition TGListBox.h:48
UInt_t fTWidth
text width
Definition TGListBox.h:52
Bool_t fTextChanged
true if text has been changed
Definition TGListBox.h:54
const TGString * GetText() const
Definition TGListBox.h:79
GContext_t fNormGC
text drawing graphics context
Definition TGListBox.h:55
static const TGFont * fgDefaultFont
Definition TGListBox.h:60
void DoRedraw() override
Redraw text listbox entry.
void SavePrimitive(std::ostream &out, Option_t *="") override
Save a list box entry widget as a C++ statement(s) on output stream out.
void DrawCopy(Handle_t id, Int_t x, Int_t y) override
Draw text listbox entry on window/pixmap.
const char * GetTitle() const override
Returns title of object.
Definition TGListBox.h:81
UInt_t fTHeight
text height
Definition TGListBox.h:53
~TGTextLBEntry() override
Delete text listbox entry.
TGString * fText
entry text string
Definition TGListBox.h:51
void Update(TGLBEntry *e) override
Definition TGListBox.h:85
FontStruct_t fFontStruct
font used to draw string
Definition TGListBox.h:56
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use for a text listbox entry.
static const TGGC & GetDefaultGC()
Return default graphics context in use for a text listbox entry.
static TClass * Class()
TGTextLBEntry(const TGTextLBEntry &)=delete
static TGGC * fgDefaultGC
Definition TGListBox.h:61
void SetText(TGString *new_text)
Set or change text in text entry.
The TGVScrollBar will generate the following event messages: kC_VSCROLL, kSB_SLIDERPOS,...
void SetRange(Int_t range, Int_t page_size) override
Set range of vertical scrollbar.
void SetPosition(Int_t pos) override
Set logical slider position of vertical scrollbar.
TGFrame * GetContainer() const
Definition TGCanvas.h:173
virtual void SetVPos(Int_t ypos)
Moves content of container frame in vertical direction.
Definition TGCanvas.cxx:229
Int_t fWidgetId
the widget id (used for event processing)
Definition TGWidget.h:46
virtual void Associate(const TGWindow *w)
Definition TGWidget.h:72
const TGWindow * fMsgWindow
window which handles widget events
Definition TGWidget.h:48
ROOT GUI Window base class.
Definition TGWindow.h:23
virtual void SetEditDisabled(UInt_t on=kEditDisable)
Definition TGWindow.h:113
const TGWindow * fParent
Parent window.
Definition TGWindow.h:28
@ kEditDisableLayout
window layout cannot be edited
Definition TGWindow.h:60
@ kEditDisableBtnEnable
window can handle mouse button events
Definition TGWindow.h:64
@ kEditDisableGrab
window grab cannot be edited
Definition TGWindow.h:59
@ kEditDisable
disable edit of this window
Definition TGWindow.h:57
@ kEditDisableKeyEnable
window can handle keyboard events
Definition TGWindow.h:65
virtual void DestroyWindow()
destroy window
Definition TGWindow.cxx:192
virtual void SetWindowName(const char *name=nullptr)
Set window name.
Definition TGWindow.cxx:129
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:295
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:336
UInt_t fEditDisabled
flags used for "guibuilding"
Definition TGWindow.h:32
A doubly linked list.
Definition TList.h:38
void AddAfter(const TObject *after, TObject *obj) override
Insert object after object after in the list.
Definition TList.cxx:248
TObject * After(const TObject *obj) const override
Returns the object after object obj.
Definition TList.cxx:328
void Add(TObject *obj) override
Definition TList.h:83
TObject * Remove(TObject *obj) override
Remove object from the list.
Definition TList.cxx:820
TObject * First() const override
Return the first object in the list. Returns 0 when list is empty.
Definition TList.cxx:657
void AddBefore(const TObject *before, TObject *obj) override
Insert object before object before in the list.
Definition TList.cxx:194
void AddFirst(TObject *obj) override
Add object at the beginning of the list.
Definition TList.cxx:98
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
Definition TList.cxx:935
Mother of all ROOT objects.
Definition TObject.h:41
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:525
virtual const char * GetTitle() const
Returns title of object.
Definition TObject.cxx:483
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition TQObject.h:164
void AddReference()
Definition TRefCnt.h:40
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:376
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition TString.h:704
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
Definition TSystem.cxx:463
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
Definition TSystem.cxx:471
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
Definition TSystem.cxx:481
void Reset()
Reset the timer.
Definition TTimer.cxx:159
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
TF1 * f1
Definition legend1.C:11
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Definition TMathBase.h:250
Double_t Ceil(Double_t x)
Rounds x upward, returning the smallest integral value that is not less than x.
Definition TMath.h:668
Event structure.
Definition GuiTypes.h:174
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:175
Int_t fY
pointer x, y coordinates in event window
Definition GuiTypes.h:178
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
Graphics context structure.
Definition GuiTypes.h:224
Int_t fDashOffset
patterned/dashed line information
Definition GuiTypes.h:248
Int_t fLineWidth
line width
Definition GuiTypes.h:229
Mask_t fMask
bit mask specifying which fields are valid
Definition GuiTypes.h:251
Int_t fLineStyle
kLineSolid, kLineOnOffDash, kLineDoubleDash
Definition GuiTypes.h:230
Char_t fDashes[8]
dash pattern list (dash length per byte)
Definition GuiTypes.h:249
Int_t fFillStyle
kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled
Definition GuiTypes.h:234
Int_t fDashLen
number of dashes in fDashes
Definition GuiTypes.h:250
TLine l
Definition textangle.C:4
auto * t1
Definition textangle.C:20