Logo ROOT  
Reference Guide
TGCanvas.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Fons Rademakers 11/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 TGCanvas
25 \ingroup guiwidgets
26
27A frame containing two scrollbars (a horizontal and
28a vertical) and a viewport. The viewport acts as the window through
29which we look at the contents of the container frame.
30
31\class TGContainer
32\ingroup guiwidgets
33
34Manages a content area. It can display and
35control a hierarchy of multi-column items, and provides the ability
36to add new items at any time. By default it doesn't map subwindows
37which are items of the container. In this case subwindow must
38provide DrawCopy method, see for example TGLVEntry class.
39It is also possible to use option which allow to map subwindows.
40This option has much slower drawing speed in case of more than 1000
41items placed in container. To activate this option the fMapSubwindows
42data member must be set to kTRUE (for example TTVLVContainer class)
43
44 The TGContainer class can handle the keys:
45
46 - F7, Ctnrl-F - activate search dialog
47 - F3, Ctnrl-G - continue search
48 - End - go to the last item in container
49 - Home - go to the first item in container
50 - PageUp,PageDown,arrow keys - navigate inside container
51 - Return/Enter - equivalent to double click of the mouse button
52 - Ctnrl-A - select/activate all items.
53 - Space - invert selection.
54
55*/
56
57
58#include "TGCanvas.h"
59#include "TGListView.h"
60#include "TGScrollBar.h"
61#include "TTimer.h"
62#include "KeySymbols.h"
63#include "TSystem.h"
64#include "TGTextEditDialogs.h"
65#include "TGMsgBox.h"
66#include "TGResourcePool.h"
67#include "TList.h"
68#include "TClass.h"
69#include "TGMimeTypes.h"
70#include "TKey.h"
71#include "TKeyMapFile.h"
72#include "TGDNDManager.h"
73#include "RConfigure.h"
74#include "TVirtualX.h"
75
76#include <iostream>
77#include <cstdlib>
78
79
81
83const Int_t kAcceleration[kAutoScrollFudge+1] = {1,1,1,2,3,4,6,7,8,16,32};
84const Int_t kKeyboardTime = 700;
85
89
90
91////////////////////////////////////////////////////////////////////////////////
92
94private:
96public:
98 Bool_t Notify();
99};
100
101////////////////////////////////////////////////////////////////////////////////
102/// single shot timer
103
105{
107 Reset();
108 if (gSystem) gSystem->RemoveTimer(this);
109 return kFALSE;
110}
111
112////////////////////////////////////////////////////////////////////////////////
113
115private:
117public:
119 Bool_t Notify();
120};
121
122////////////////////////////////////////////////////////////////////////////////
123/// on-timeout
124
126{
128 Reset();
129 return kFALSE;
130}
131
132
133////////////////////////////////////////////////////////////////////////////////
134/// Create a viewport object.
135
137 UInt_t options, ULong_t back) :
138 TGCompositeFrame(p, w, h, options, back)
139{
140 fContainer = 0;
141 fX0 = fY0 = 0;
142
146}
147
148////////////////////////////////////////////////////////////////////////////////
149/// Add container frame to the viewport. We must make sure that the added
150/// container is at least a TGCompositeFrame (TGCanvas::AddFrame depends
151/// on it).
152
154{
155 if (!f) {
157 fContainer = 0;
158 return;
159 }
160
161 if (!fContainer) {
162 fContainer = f;
163 AddFrame(f, 0);
165
167 ((TGContainer*)fContainer)->fViewPort = this;
169 ((TGContainer*)fContainer)->fCanvas = (TGCanvas*)fParent;
170 }
171 }
172 }
173}
174
175////////////////////////////////////////////////////////////////////////////////
176/// Moves content of container frame in horizontal direction.
177
179{
180 Int_t diff;
181
182 if (!fContainer) return;
183
185 fContainer->Move(fX0 = xpos, fY0);
186 return;
187 } else {
189 fContainer->Move(fX0 = xpos, fY0);
190 return;
191 }
192 }
193
194 if (-xpos < 0) return;
195 else diff = xpos - fX0;
196
197 if (!diff) return;
198
199 fX0 = xpos;
200
201#if defined(R__HAS_COCOA)
202 //In the current version of cocoa back-end, it's very expensive
203 //to read window's pixels, skip "optimization".
204 ((TGContainer*)fContainer)->DrawRegion(0, 0, fWidth, fHeight);
205#else
206 UInt_t adiff = TMath::Abs(diff);
207
208 if (adiff < fWidth) {
209 if (diff < 0) {
210 gVirtualX->CopyArea(fContainer->GetId(), fContainer->GetId(), GetWhiteGC()(),
211 adiff, 0, fWidth - adiff, fHeight, 0, 0);
212 adiff += 20; // draw larger region
213 ((TGContainer*)fContainer)->DrawRegion(fWidth - adiff, 0, adiff, fHeight);
214 } else {
215 gVirtualX->CopyArea(fContainer->GetId(), fContainer->GetId(), GetWhiteGC()(),
216 0, 0, fWidth - adiff, fHeight, adiff, 0);
217 adiff += 20; // draw larger region
218 ((TGContainer*)fContainer)->DrawRegion(0, 0, adiff, fHeight);
219 }
220 } else {
221 ((TGContainer*)fContainer)->DrawRegion(0, 0, fWidth, fHeight);
222 }
223#endif
224}
225
226////////////////////////////////////////////////////////////////////////////////
227/// Moves content of container frame in vertical direction.
228
230{
231 Int_t diff;
232
233 if (!fContainer) return;
234
235 // for backward compatibility
237 fContainer->Move(fX0, fY0 = ypos);
238 return;
239 } else {
241 fContainer->Move(fX0, fY0 = ypos);
242 return;
243 }
244 }
245
246 if (-ypos < 0) return;
247 else diff = ypos - fY0;
248
249 if (!diff) return;
250
251 fY0 = ypos;
252
253#if defined(R__HAS_COCOA)
254 //In the current version of cocoa back-end, it's very expensive
255 //to read window's pixels, skip "optimization".
256 ((TGContainer*)fContainer)->DrawRegion(0, 0, fWidth, fHeight);
257#else
258 UInt_t adiff = TMath::Abs(diff);
259
260 if (adiff < fHeight) {
261 if (diff < 0) {
262 gVirtualX->CopyArea(fContainer->GetId(), fContainer->GetId(), GetWhiteGC()(),
263 0, adiff, fWidth, fHeight - adiff, 0, 0);
264 adiff += 20; // draw larger region
265 ((TGContainer*)fContainer)->DrawRegion(0, fHeight - adiff, fWidth, adiff);
266 } else {
267 gVirtualX->CopyArea(fContainer->GetId(), fContainer->GetId(), GetWhiteGC()(),
268 0, 0, fWidth, fHeight - adiff, 0, adiff);
269 adiff += 20; // draw larger region
270 ((TGContainer*)fContainer)->DrawRegion(0, 0, fWidth, adiff);
271 }
272 } else {
273 ((TGContainer*)fContainer)->DrawRegion(0, 0, fWidth, fHeight);
274 }
275#endif
276}
277
278////////////////////////////////////////////////////////////////////////////////
279/// Goto new position.
280
282{
283 if (!fContainer) return;
284
285 SetHPos(fX0 = xpos);
286 SetVPos(fY0 = ypos);
287}
288
289////////////////////////////////////////////////////////////////////////////////
290/// Handle resize events.
291
293{
296 return kTRUE;
297 }
298
300
301 // protection
302 if ((event->fWidth > 32768) || (event->fHeight > 32768)) {
303 return kFALSE;
304 }
305
306 cont->DrawRegion(event->fX, event->fY, event->fWidth, event->fHeight);
307
308 return kTRUE;
309}
310
311////////////////////////////////////////////////////////////////////////////////
312/// Create a canvas container. This is the (large) frame that contains
313/// all the list items. It will be shown through a TGViewPort (which is
314/// created by the TGCanvas).
315
317 UInt_t options, ULong_t back) :
318 TGCompositeFrame(p, w, h, options, back)
319{
320 fXp = fYp = fX0 = fY0 = fXf = fYf = fXDND = fYDND = 0;
321 fViewPort = 0;
322 fBdown = kFALSE;
323 fMsgWindow = p;
325 fTotal = fSelected = 0;
328 fLastActiveEl = 0;
329 fLastDir = kTRUE;
332 fLastName = "";
337 fCanvas = 0;
339
340 gVirtualX->GrabButton(fId, kAnyButton, kAnyModifier,
343
346
349 wattr.fBitGravity = 1; // NorthWestGravity
350 wattr.fWinGravity = 1;
351 gVirtualX->ChangeWindowAttributes(fId, &wattr);
352
354}
355
356////////////////////////////////////////////////////////////////////////////////
357/// Create a canvas container. This is the (large) frame that contains
358/// all the list items. It will be shown through a TGViewPort (which is
359/// created by the TGCanvas).
360
362 TGCompositeFrame(p->GetViewPort(), p->GetWidth(), p->GetHeight(), options, back)
363{
364 fXp = fYp = fX0 = fY0 = fXf = fYf = fXDND = fYDND = 0;
365 fViewPort = 0;
366 fBdown = kFALSE;
367 fMsgWindow = p->GetViewPort();
368 fCanvas = p;
371
373 fTotal = fSelected = 0;
376 fLastActiveEl = 0;
377 fLastDir = kTRUE;
380 fLastName = "";
386
387 gVirtualX->GrabButton(fId, kAnyButton, kAnyModifier,
390
393
396 wattr.fBitGravity = 1; // NorthWestGravity
397 wattr.fWinGravity = 1;
398 gVirtualX->ChangeWindowAttributes(fId, &wattr);
399
401}
402
403////////////////////////////////////////////////////////////////////////////////
404/// Delete canvas container.
405
407{
410 }
411
412 delete fScrollTimer;
413 fScrollTimer = 0;
414
415 delete fKeyTimer;
416 fKeyTimer = 0;
417}
418
419////////////////////////////////////////////////////////////////////////////////
420/// Layout container entries.
421
423{
426
427 // clear content if positions of subframes changed after layout
428 if (lm && lm->IsModified()) ClearViewPort();
429}
430
431////////////////////////////////////////////////////////////////////////////////
432/// Emit signal when current position changed.
433
435{
436 Long_t args[2];
437
438 args[0] = x;
439 args[1] = y;
440
441 Emit("CurrentChanged(Int_t,Int_t)",args);
442}
443
444////////////////////////////////////////////////////////////////////////////////
445/// Emit signal when current selected frame changed.
446
448{
449 Emit("CurrentChanged(TGFrame*)", (Long_t)f);
450}
451
452////////////////////////////////////////////////////////////////////////////////
453/// Signal emitted when keyboard key pressed
454///
455/// frame - activated frame
456/// keysym - defined in "KeySymbols.h"
457/// mask - modifier key mask, defined in "GuiTypes.h"
458///
459/// const Mask_t kKeyShiftMask = BIT(0);
460/// const Mask_t kKeyLockMask = BIT(1);
461/// const Mask_t kKeyControlMask = BIT(2);
462/// const Mask_t kKeyMod1Mask = BIT(3); // typically the Alt key
463/// const Mask_t kButton1Mask = BIT(8);
464/// const Mask_t kButton2Mask = BIT(9);
465/// const Mask_t kButton3Mask = BIT(10);
466/// const Mask_t kButton4Mask = BIT(11);
467/// const Mask_t kButton5Mask = BIT(12);
468/// const Mask_t kAnyModifier = BIT(15);
469
471{
472 Long_t args[3];
473 args[0] = (Long_t)frame;
474 args[1] = (Long_t)keysym;
475 args[2] = (Long_t)mask;
476 Emit("KeyPressed(TGFrame*,UInt_t,UInt_t)", args);
478}
479
480////////////////////////////////////////////////////////////////////////////////
481/// Signal emitted when Return/Enter key pressed.
482/// It's equivalent to "double click" of mouse button.
483
485{
486 Emit("ReturnPressed(TGFrame*)", (Long_t)f);
487}
488
489////////////////////////////////////////////////////////////////////////////////
490/// Signal emitted when space key pressed.
491/// Pressing space key inverts selection.
492
494{
495 Emit("SpacePressed(TGFrame*)", (Long_t)f);
496}
497
498////////////////////////////////////////////////////////////////////////////////
499/// Signal emitted when pointer is over entry.
500
502{
503 if (!fOnMouseOver) Emit("OnMouseOver(TGFrame*)", (Long_t)f);
505}
506
507////////////////////////////////////////////////////////////////////////////////
508/// Emit Clicked() signal.
509
511{
512 Long_t args[2];
513
514 args[0] = (Long_t)entry;
515 args[1] = btn;
516
517 Emit("Clicked(TGFrame*,Int_t)", args);
518}
519
520////////////////////////////////////////////////////////////////////////////////
521/// Emit Clicked() signal.
522
524{
525 Long_t args[4];
526
527 args[0] = (Long_t)entry;
528 args[1] = btn;
529 args[2] = x;
530 args[3] = y;
531
532 Emit("Clicked(TGFrame*,Int_t,Int_t,Int_t)", args);
533}
534
535////////////////////////////////////////////////////////////////////////////////
536/// Emit DoubleClicked() signal.
537
539{
540 Long_t args[2];
541
542 args[0] = (Long_t)entry;
543 args[1] = btn;
544
545 Emit("DoubleClicked(TGFrame*,Int_t)", args);
546}
547
548////////////////////////////////////////////////////////////////////////////////
549/// Emit DoubleClicked() signal.
550
552{
553 Long_t args[4];
554
555 args[0] = (Long_t)entry;
556 args[1] = btn;
557 args[2] = x;
558 args[3] = y;
559
560 Emit("DoubleClicked(TGFrame*,Int_t,Int_t,Int_t)", args);
561}
562
563////////////////////////////////////////////////////////////////////////////////
564/// Select all items in the container.
565/// SelectAll() signal emitted.
566
568{
569 TIter next(fList);
570 TGFrameElement *el;
571 TGFrame *fr;
572
573 while ((el = (TGFrameElement *) next())) {
574 fr = el->fFrame;
575 if (!fr->IsActive()) {
576 ActivateItem(el);
577 }
578 }
582
583 Emit("SelectAll()");
584}
585
586////////////////////////////////////////////////////////////////////////////////
587/// Unselect all items in the container.
588
590{
591 TIter next(fList);
592 TGFrameElement *el;
593 TGFrame *fr;
594
595 while ((el = (TGFrameElement *) next())) {
596 fr = el->fFrame;
597 if (fr->IsActive()) {
598 DeActivateItem(el);
599 }
600 }
601 fLastActiveEl = 0;
602 fSelected = 0;
603
606
607 Emit("UnSelectAll()");
608}
609
610////////////////////////////////////////////////////////////////////////////////
611/// Invert the selection, all selected items become unselected and
612/// vice versa.
613
615{
616 int selected = 0;
617
618 TIter next(fList);
619 TGFrameElement *el;
620
621 while ((el = (TGFrameElement *) next())) {
622 if (!el->fFrame->IsActive()) {
623 ActivateItem(el);
624 ++selected;
625 } else {
626 DeActivateItem(el);
627 }
628 }
629 ClearViewPort(); // full redraw
630 fSelected = selected;
631
634
635 Emit("InvertSelection()");
636}
637
638////////////////////////////////////////////////////////////////////////////////
639/// Remove all items from the container.
640
642{
643 TGFrameElement *el;
644 TIter next(fList);
645
646 while ((el = (TGFrameElement *) next())) {
647 el->fFrame->DestroyWindow();
648 delete el->fFrame;
649 fList->Remove(el);
650 delete el;
651 }
652 fLastActiveEl = 0;
653 fSelected = fTotal = 0;
654 ClearViewPort(); // full redraw
655}
656
657////////////////////////////////////////////////////////////////////////////////
658/// Remove item from container.
659
661{
662 TGFrameElement *el;
663 TIter next(fList);
664 while ((el = (TGFrameElement *) next())) {
665 if (item == el->fFrame) {
666 if (fLastActiveEl && item == fLastActiveEl->fFrame) fLastActiveEl = 0;
667 item->DestroyWindow();
668 delete item;
669 fList->Remove(el);
670 delete el;
671 break;
672 }
673 }
674 ClearViewPort(); // fill redraw
675}
676
677////////////////////////////////////////////////////////////////////////////////
678/// Return the next selected item. If the "current" pointer is 0, the first
679/// selected item will be returned.
680
682{
683 TGFrame *f;
684 TObjLink *lnk = (TObjLink *) *current;
685
686 lnk = (lnk == 0) ? fList->FirstLink() : lnk->Next();
687 while (lnk) {
688 f = (TGFrame *) ((TGFrameElement *) lnk->GetObject())->fFrame;
689 if (f->IsActive()) {
690 *current = (void *) lnk;
691 return f;
692 }
693 lnk = lnk->Next();
694 }
695 return 0;
696}
697
698////////////////////////////////////////////////////////////////////////////////
699/// Activate item.
700
702{
703 TGFrame *fr = el->fFrame;
704 fr->Activate(kTRUE);
705
706 if (fLastActiveEl != el) {
707 fLastActiveEl = el;
710 fSelected++;
711 }
712
713 if (!fSelected) fSelected = 1;
714
716
718 DrawRegion(fr->GetX() - pos.fX, fr->GetY() - pos.fY, fr->GetWidth(), fr->GetHeight());
719}
720
721////////////////////////////////////////////////////////////////////////////////
722/// DeActivate item.
723
725{
726 TGFrame *fr = el->fFrame;
727 fr->Activate(kFALSE);
729
731 DrawRegion(fr->GetX() - pos.fX, fr->GetY() - pos.fY, fr->GetWidth(), fr->GetHeight());
732}
733
734////////////////////////////////////////////////////////////////////////////////
735/// Returns page position.
736
738{
739 TGPosition ret;
740 if (!fViewPort) return ret;
741
742 ret.fX = -fViewPort->GetHPos();
743 ret.fY = -fViewPort->GetVPos();
744
745 return ret;
746}
747
748////////////////////////////////////////////////////////////////////////////////
749/// Returns page dimension.
750
752{
753 TGDimension ret;
754 if (!fViewPort) return ret;
755
756 ret.fWidth = fViewPort->GetWidth();
757 ret.fHeight = fViewPort->GetHeight();
758 return ret;
759}
760
761////////////////////////////////////////////////////////////////////////////////
762/// Set page position.
763
765{
766 if (!fViewPort) return;
767 fViewPort->SetPos(pos.fX, pos.fY);
768}
769
770////////////////////////////////////////////////////////////////////////////////
771/// Set page position.
772
774{
775 if (!fViewPort) return;
776 fViewPort->SetPos(x, y);
777}
778
779////////////////////////////////////////////////////////////////////////////////
780/// Set page dimension.
781
783{
784 if (!fViewPort) return;
785 fViewPort->Resize(dim);
786}
787
788////////////////////////////////////////////////////////////////////////////////
789/// Set page dimension.
790
792{
793 if (!fViewPort) return;
794 fViewPort->Resize(w, h);
795}
796
797////////////////////////////////////////////////////////////////////////////////
798/// Redraw content of container in the viewport region.
799
801{
802#ifdef R__HAS_COCOA
803 DrawRegion(0, 0, GetWidth(), GetHeight());
804#else
805 if (!fExposedRegion.IsEmpty()) {
808
810 }
811#endif
812}
813
814////////////////////////////////////////////////////////////////////////////////
815/// Draw a region of container in viewport.
816/// x, y, w, h are position and dimension of area to be
817/// redrawn in viewport coordinates.
818
820{
821 static GContext_t gcBg = 0;
822 Pixmap_t pixmap = 0;
823
824 if (!fViewPort) return;
825 // sanity checks
826 if ((x > (Int_t)fViewPort->GetWidth()) || (y > (Int_t)fViewPort->GetHeight())) {
827 return;
828 }
829 x = x < 0 ? 0 : x;
830 y = y < 0 ? 0 : y;
831
832 w = x + w > fViewPort->GetWidth() ? fViewPort->GetWidth() - x : w;
833 h = y + h > fViewPort->GetHeight() ? fViewPort->GetHeight() - y : h;
834
835 if (((Int_t)w < 1) || ((Int_t)h < 1)) {
836 return;
837 }
838
839 if (!fMapSubwindows) {
840 pixmap = gVirtualX->CreatePixmap(fId, w, h);
841
842 if (!gcBg) {
843 GCValues_t gcValues;
844 gcValues.fForeground = fBackground;
845 gcValues.fBackground = fBackground;
846 gcValues.fGraphicsExposures = kTRUE;
848 gcBg = gVirtualX->CreateGC(fId, &gcValues);
849 }
850
851 gVirtualX->SetForeground(gcBg, fBackground);
852 gVirtualX->FillRectangle(pixmap, gcBg, 0, 0, w, h);
853 }
854
856
857 // translate coordinates in viewport into coordinates in container
858 Int_t xx = pos.fX + x;
859 Int_t yy = pos.fY + y;
860
861 TIter next(fList);
862 TGFrameElement *el;
863
864 while ((el = (TGFrameElement *) next())) {
865 if ((Int_t(el->fFrame->GetY()) > yy - (Int_t)el->fFrame->GetHeight()) &&
866 (Int_t(el->fFrame->GetX()) > xx - (Int_t)el->fFrame->GetWidth()) &&
867 (Int_t(el->fFrame->GetY()) < yy + Int_t(h + el->fFrame->GetHeight())) &&
868 (Int_t(el->fFrame->GetX()) < xx + Int_t(w + el->fFrame->GetWidth()))) {
869
870 // draw either in container window or in double-buffer
871 if (!fMapSubwindows) {
872 Int_t fx = el->fFrame->GetX() - xx;
873 Int_t fy = el->fFrame->GetY() - yy;
874 el->fFrame->DrawCopy(pixmap, fx, fy);
875 } else {
877 }
878 }
879 }
880
881 if (fMapSubwindows) return;
882
883 gVirtualX->CopyArea(pixmap, fId, gcBg, 0, 0, w, h, x, y);
884 gVirtualX->DeletePixmap(pixmap);
885 gVirtualX->Update(kFALSE);
886}
887
888////////////////////////////////////////////////////////////////////////////////
889/// Clear view port and redraw full content
890
892{
893 if (!fViewPort) return;
897 fClient->NeedRedraw(this);
898}
899
900////////////////////////////////////////////////////////////////////////////////
901/// Handle expose events. Do not use double buffer.
902
904{
906
907 if (event->fWindow == GetId()) {
908 TGPosition pos(event->fX, event->fY);
909 TGDimension dim(event->fWidth, event->fHeight);
910 TGRectangle rect(pos, dim);
911
912 if (fExposedRegion.IsEmpty()) {
913 fExposedRegion = rect;
914 } else {
915 fExposedRegion.Merge(rect);
916 }
917
918 fClient->NeedRedraw(this);
919 } else {
921 }
922
923 return kTRUE;
924}
925
926////////////////////////////////////////////////////////////////////////////////
927/// Handle mouse button event in container.
928
930{
931 Int_t total, selected, page = 0;
932
935 Int_t newpos;
936 page = dim.fHeight/4;
937
938 if (event->fCode == kButton4) {
939 //scroll up
940 newpos = pos.fY - page;
941 if (newpos < 0) newpos = 0;
942 fCanvas->SetVsbPosition(newpos);
943 return kTRUE;
944 }
945 if (event->fCode == kButton5) {
946 // scroll down
947 newpos = fCanvas->GetVsbPosition() + page;
948 fCanvas->SetVsbPosition(newpos);
949 return kTRUE;
950 }
951
952 Int_t xx = pos.fX + event->fX; // translate coordinates
953 Int_t yy = pos.fY + event->fY;
954
955 if (event->fType == kButtonPress) {
956 gVirtualX->SetInputFocus(fId);
957
958 fXp = pos.fX + event->fX;
959 fYp = pos.fY + event->fY;
960
961 fXDND = event->fX;
962 fYDND = event->fY;
963 fBdown = kTRUE;
964
965 UnSelectAll();
966 total = selected = 0;
967
968 TGFrameElement *el;
969 TIter next(fList);
970 Bool_t select_frame = kFALSE;
971
972 while ((el = (TGFrameElement *) next())) {
973 select_frame = kFALSE;
974
975 if (!fMapSubwindows) {
976 if ((Int_t(el->fFrame->GetY()) + (Int_t)el->fFrame->GetHeight() > yy ) &&
977 (Int_t(el->fFrame->GetX()) + (Int_t)el->fFrame->GetWidth() > xx ) &&
978 (Int_t(el->fFrame->GetY()) < yy) &&
979 (Int_t(el->fFrame->GetX()) < xx)) {
980 select_frame = kTRUE;
981 }
982 } else {
983 if (el->fFrame->GetId() == (Window_t)event->fUser[0]) {
984 select_frame = kTRUE;
985 }
986 }
987
988 if (select_frame) {
989 selected++;
990 ActivateItem(el);
991 Clicked(el->fFrame, event->fCode);
992 Clicked(el->fFrame, event->fCode, event->fXRoot, event->fYRoot);
993 }
994 total++;
995 }
996
997 if (fTotal != total || fSelected != selected) {
998 fTotal = total;
999 fSelected = selected;
1001 fTotal, fSelected);
1002 }
1003
1004 if ( selected == 0 ) {
1005 fDragging = kTRUE;
1006 fX0 = fXf = fXp;
1007 fY0 = fYf = fYp;
1008 gVirtualX->DrawRectangle(fId, GetLineGC()(), fX0-pos.fX, fY0-pos.fY,
1009 fXf-fX0, fYf-fY0);
1010 }
1011 }
1012
1013 if (event->fType == kButtonRelease) {
1014 gVirtualX->SetInputFocus(fId);
1015
1016 fBdown = kFALSE;
1017 if (fDragging) {
1018 fDragging = kFALSE;
1020
1022 gVirtualX->DrawRectangle(fId, GetLineGC()(), fX0-pos.fX, fY0-pos.fY,
1023 fXf-fX0, fYf-fY0);
1024 ClearViewPort();
1025
1026 } else {
1028 event->fCode, (event->fYRoot << 16) | event->fXRoot);
1029 }
1030 }
1031 DoRedraw();
1032 return kTRUE;
1033}
1034
1035////////////////////////////////////////////////////////////////////////////////
1036/// Retrieve icons associated with class "name". Association is made
1037/// via the user's ~/.root.mimes file or via $ROOTSYS/etc/root.mimes.
1038
1040{
1041 TObject *obj = 0;
1042 TClass *cl;
1043 const TGPicture *pic=0;
1044 const char *iconname = 0;
1045
1046 if (f->InheritsFrom("TGLVEntry")) {
1047 obj = (TObject *)((TGLVEntry *)f)->GetUserData();
1048 if (obj) {
1049 if (obj->IsA() == TKey::Class()) {
1050 cl = TClass::GetClass(((TKey *)obj)->GetClassName());
1051 } else if (obj->IsA() == TKeyMapFile::Class()) {
1052 cl = TClass::GetClass(((TKeyMapFile *)obj)->GetTitle());
1053 } else {
1054 cl = obj->IsA();
1055 }
1056 const char *name = obj->GetIconName();
1057 if (((name == 0) || (!name[0])) && (cl != 0))
1058 name = cl->GetName();
1059 iconname = ((name != 0) && (strlen(name) > 0)) ? name : obj->GetName();
1060
1061 if (obj->IsA()->InheritsFrom("TGeoVolume")) {
1062 iconname = obj->GetIconName() ? obj->GetIconName() : obj->IsA()->GetName();
1063 }
1064 pic = fClient->GetMimeTypeList()->GetIcon(iconname, kFALSE);
1065 }
1066 }
1067 if (pic == 0) {
1068 if (obj && obj->IsFolder()) {
1069 pic = fClient->GetPicture("folder_s.xpm");
1070 } else {
1071 pic = fClient->GetPicture("doc_s.xpm");
1072 }
1073 }
1074 return pic;
1075}
1076
1077////////////////////////////////////////////////////////////////////////////////
1078/// Set drag window pixmaps and hotpoint.
1079
1081{
1082 Pixmap_t pic, mask;
1083 TGPicture *selpic = new TGSelectedPicture(gClient, p);
1084 pic = selpic->GetPicture();
1085 mask = selpic->GetMask();
1086
1087 if (gDNDManager) {
1088 gDNDManager->SetDragPixmap(pic, mask, p->GetWidth()/2, 2+p->GetHeight()/2);
1089 } else {
1090 gVirtualX->DeletePixmap(pic);
1091 gVirtualX->DeletePixmap(mask);
1092 }
1093}
1094
1095////////////////////////////////////////////////////////////////////////////////
1096/// Handle double click mouse event.
1097
1099{
1100 TGFrameElement *el;
1101 TIter next(fList);
1102
1104
1105 Int_t xx = pos.fX + event->fX; // translate coordinates
1106 Int_t yy = pos.fY + event->fY;
1107
1108 Bool_t select_frame = kFALSE;
1109
1110 while ((el = (TGFrameElement *) next())) {
1111 select_frame = kFALSE;
1112
1113 if (!fMapSubwindows) {
1114 if ((Int_t(el->fFrame->GetY()) + (Int_t)el->fFrame->GetHeight() > yy) &&
1115 (Int_t(el->fFrame->GetX()) + (Int_t)el->fFrame->GetWidth() > xx) &&
1116 (Int_t(el->fFrame->GetY()) < yy) &&
1117 (Int_t(el->fFrame->GetX()) < xx)) {
1118 select_frame = kTRUE;
1119 }
1120 } else {
1121 if (el->fFrame->GetId() == (Window_t)event->fUser[0]) {
1122 select_frame = kTRUE;
1123 }
1124 }
1125
1126 if (select_frame) {
1128 event->fCode, (event->fYRoot << 16) | event->fXRoot);
1129
1130 DoubleClicked(el->fFrame, event->fCode);
1131 DoubleClicked(el->fFrame, event->fCode, event->fXRoot, event->fYRoot);
1132 return kTRUE;
1133 }
1134 }
1135 return kTRUE;
1136}
1137
1138////////////////////////////////////////////////////////////////////////////////
1139/// Handle mouse motion events.
1140
1142{
1143 int xf0, yf0, xff, yff, total, selected;
1144
1147 Int_t x = pos.fX + event->fX;
1148 Int_t y = pos.fY + event->fY;
1149 TGFrameElement *el = 0;
1150 TGFrame *f = 0;
1152
1153 Bool_t wasScrolling = fScrolling;
1154
1155 if (gDNDManager->IsDragging()) {
1156 gDNDManager->Drag(event->fXRoot, event->fYRoot,
1158 }
1159 else if (fDragging) {
1160
1161 gVirtualX->DrawRectangle(fId, GetLineGC()(), fX0-pos.fX, fY0-pos.fY,
1162 fXf-fX0, fYf-fY0);
1163 fX0 = TMath::Min(fXp,x);
1164 fY0 = TMath::Min(fYp,y);
1165 fXf = TMath::Max(fXp,x);
1166 fYf = TMath::Max(fYp,y);
1167
1168 total = selected = 0;
1169
1170 if (event->fX > Int_t(dim.fWidth) - kAutoScrollFudge) {
1171 //fCanvas->SetHsbPosition(x - dim.fWidth);
1172 fScrolling = kTRUE;
1173 } else if (event->fX < kAutoScrollFudge) {
1174 //fCanvas->SetHsbPosition(x);
1175 fScrolling = kTRUE;
1176 } else if (event->fY > Int_t(dim.fHeight) - kAutoScrollFudge) {
1177 //fCanvas->SetVsbPosition(y - dim.fHeight);
1178 fScrolling = kTRUE;
1179 } else if (event->fY < kAutoScrollFudge) {
1180 //fCanvas->SetVsbPosition(y);
1181 fScrolling = kTRUE;
1182 }
1183 else {
1185 }
1186
1187 TIter next(fList);
1188
1189 while ((el = (TGFrameElement *) next())) {
1190 f = el->fFrame;
1191 ++total;
1192 xf0 = f->GetX() + (f->GetWidth() >> 3);
1193 yf0 = f->GetY() + (f->GetHeight() >> 3);
1194 xff = xf0 + f->GetWidth() - (f->GetWidth() >> 2);
1195 yff = yf0 + f->GetHeight() - (f->GetHeight() >> 2);
1196
1197 if (((xf0 > fX0 && xf0 < fXf) ||
1198 (xff > fX0 && xff < fXf)) &&
1199 ((yf0 > fY0 && yf0 < fYf) ||
1200 (yff > fY0 && yff < fYf))) {
1201 if (!el->fFrame->IsActive())
1202 ActivateItem(el);
1203 gVirtualX->SetCursor(fId, gVirtualX->CreateCursor(kHand));
1204 OnMouseOver(f);
1205 ++selected;
1206 } else {
1207 if (el->fFrame->IsActive())
1208 DeActivateItem(el);
1209 }
1210 }
1211
1212 if (fTotal != total || fSelected != selected) {
1213 fTotal = total;
1214 fSelected = selected;
1216 fTotal, fSelected);
1217 }
1218 gVirtualX->DrawRectangle(fId, GetLineGC()(), fX0-pos.fX, fY0-pos.fY,
1219 fXf-fX0, fYf-fY0);
1220 }
1221 else {
1222 TGFrame *over_frame = 0;
1223
1224 TIter next(fList);
1225
1226 while ((el = (TGFrameElement *) next())) {
1227 if (!fMapSubwindows) {
1228 if ((Int_t(el->fFrame->GetY()) + (Int_t)el->fFrame->GetHeight() > y) &&
1229 (Int_t(el->fFrame->GetX()) + (Int_t)el->fFrame->GetWidth() > x) &&
1230 (Int_t(el->fFrame->GetY()) < y) &&
1231 (Int_t(el->fFrame->GetX()) < x)) {
1232 over_frame = el->fFrame;
1233 break;
1234 }
1235 } else {
1236 if (el->fFrame->GetId() == (Window_t)event->fUser[0]) {
1237 over_frame = el->fFrame;
1238 break;
1239 }
1240 }
1241 }
1242 if (over_frame) {
1243 if (!gDNDManager->IsDragging()) {
1244 if (fBdown && ((abs(event->fX - fXDND) > 2) || (abs(event->fY - fYDND) > 2))) {
1245 if (gDNDManager && over_frame->IsDNDSource()) {
1246 const TGPicture *drag_pic = GetObjPicture(over_frame);
1247 if (drag_pic) SetDragPixmap(drag_pic);
1248 gDNDManager->StartDrag(over_frame, event->fXRoot, event->fYRoot);
1249 }
1250 }
1251 }
1252 if (gDNDManager->IsDragging()) {
1253 gDNDManager->Drag(event->fXRoot, event->fYRoot,
1255 } else {
1256 OnMouseOver(over_frame);
1257 gVirtualX->SetCursor(fId, gVirtualX->CreateCursor(kHand));
1258 }
1259 } else {
1260 gVirtualX->SetCursor(fId, gVirtualX->CreateCursor(kPointer));
1261 }
1262 }
1263
1264 if (!wasScrolling && fScrolling) {
1265 if (gSystem) {
1268 }
1269 }
1270
1271 return kTRUE;
1272}
1273
1274////////////////////////////////////////////////////////////////////////////////
1275/// The key press event handler converts a key press to some line editor
1276/// action.
1277
1279{
1280 char input[10];
1281 Int_t n;
1282 UInt_t keysym;
1283
1284 if (event->fType == kGKeyPress) {
1285 gVirtualX->LookupString(event, input, sizeof(input), keysym);
1286 n = strlen(input);
1287
1288 KeyPressed(fLastActiveEl?fLastActiveEl->fFrame:0, keysym, event->fState);
1289
1290 switch ((EKeySym)keysym) {
1291 case kKey_Enter:
1292 case kKey_Return:
1293 // treat 'Enter' and 'Return' as a double click
1295 kButton1, (event->fYRoot << 16) | event->fXRoot);
1297 break;
1298 case kKey_Shift:
1299 case kKey_Control:
1300 case kKey_Meta:
1301 case kKey_Alt:
1302 case kKey_CapsLock:
1303 case kKey_NumLock:
1304 case kKey_ScrollLock:
1305 return kTRUE;
1306 case kKey_Space:
1307 if (fLastActiveEl) {
1310 }
1311 break;
1312 default:
1313 break;
1314 }
1315
1316 if (event->fState & kKeyControlMask) { // Cntrl key modifier pressed
1317 switch((EKeySym)keysym & ~0x20) { // treat upper and lower the same
1318 case kKey_A:
1319 SelectAll();
1320 break;
1321 case kKey_B:
1322 LineLeft();
1323 break;
1324 case kKey_C:
1325 return kTRUE;
1326 case kKey_D:
1327 break;
1328 case kKey_E:
1329 End();
1330 break;
1331 case kKey_F:
1332 Search();
1333 break;
1334 case kKey_G:
1335 RepeatSearch();
1336 break;
1337 case kKey_H:
1338 LineLeft();
1339 break;
1340 case kKey_K:
1341 End();
1342 break;
1343 case kKey_U:
1344 Home();
1345 break;
1346 case kKey_V:
1347 case kKey_Y:
1348 return kTRUE;
1349 case kKey_X:
1350 return kTRUE;
1351 default:
1352 return kTRUE;
1353 }
1354 }
1355 if (n && keysym >= 32 && keysym < 127 && // printable keys
1356 !(event->fState & kKeyControlMask) &&
1357 (EKeySym)keysym != kKey_Delete &&
1358 (EKeySym)keysym != kKey_Backspace) {
1359
1360 if (fKeyTimerActive) {
1361 fKeyInput += input;
1362 } else {
1363 fKeyInput = input;
1365 fKeyTimer->Reset();
1367 }
1368 } else {
1369
1370 switch ((EKeySym)keysym) {
1371 case kKey_F3:
1372 RepeatSearch();
1373 break;
1374 case kKey_F5:
1375 Layout();
1376 break;
1377 case kKey_F7:
1378 Search();
1379 break;
1380 case kKey_Left:
1381 LineLeft(event->fState & kKeyShiftMask);
1382 break;
1383 case kKey_Right:
1384 LineRight(event->fState & kKeyShiftMask);
1385 break;
1386 case kKey_Up:
1387 LineUp(event->fState & kKeyShiftMask);
1388 break;
1389 case kKey_Down:
1390 LineDown(event->fState & kKeyShiftMask);
1391 break;
1392 case kKey_PageUp:
1393 PageUp(event->fState & kKeyShiftMask);
1394 break;
1395 case kKey_PageDown:
1396 PageDown(event->fState & kKeyShiftMask);
1397 break;
1398 case kKey_Home:
1399 Home(event->fState & kKeyShiftMask);
1400 break;
1401 case kKey_End:
1402 End(event->fState & kKeyShiftMask);
1403 break;
1404 default:
1405 break;
1406 }
1407 }
1408 }
1409 DoRedraw();
1410 return kTRUE;
1411}
1412
1413////////////////////////////////////////////////////////////////////////////////
1414/// Find frame by name.
1415
1417{
1418 if (!IsMapped()) return 0;
1419
1420 Bool_t direction = kTRUE;
1421 Bool_t caseSensitive = kFALSE;
1422 Bool_t subString = kFALSE;
1423
1427 }
1428 TString sname(name);
1429 if (sname.Contains("*")) {
1430 subString = kTRUE;
1431 sname.ReplaceAll("*", "");
1432 }
1433
1434 TGFrameElement *fe = (TGFrameElement*)FindItem(sname.Data(), direction,
1435 caseSensitive, subString);
1436 if (!fe) { // find again
1438 fLastActiveEl = 0;
1440
1441 if (!fe) {
1443 TString msg = "Couldn't find \"" + fLastName + '\"';
1444 gVirtualX->Bell(20);
1445 new TGMsgBox(fClient->GetDefaultRoot(), fCanvas, "Container", msg.Data(),
1447 }
1448 return 0;
1449 } else {
1451 ActivateItem(fe);
1453 return fe->fFrame;
1454 }
1455 } else {
1457 ActivateItem(fe);
1459 return fe->fFrame;
1460 }
1461 return 0;
1462}
1463
1464////////////////////////////////////////////////////////////////////////////////
1465/// Invokes search dialog. Looks for item with the entered name.
1466
1468{
1469 static TGSearchType *srch = 0;
1470 Int_t ret = 0;
1471
1472 if (!srch) srch = new TGSearchType;
1473 srch->fClose = close;
1474 srch->fBuffer = 0;
1475
1476 if (!close) {
1479 fCanvas, 400, 150, srch, &ret);
1480 }
1481 TGSearchDialog::SearchDialog()->Connect("TextEntered(char *)", "TGContainer", this,
1482 "FindFrameByName(char *)");
1484 } else {
1485 new TGSearchDialog(fClient->GetDefaultRoot(), fCanvas, 400, 150, srch, &ret);
1486 if (ret) {
1487 FindFrameByName(srch->fBuffer);
1488 }
1489 }
1490}
1491
1492////////////////////////////////////////////////////////////////////////////////
1493/// Autoscroll while close to & beyond The Wall
1494
1496{
1497 TGFrameElement *el = 0;
1498 TGFrame *f = 0;
1499 int xf0, yf0, xff, yff, total, selected;
1500
1503
1504 Window_t dum1, dum2;
1505 Event_t ev;
1506 ev.fType = kButtonPress;
1507 Int_t x,y;
1508
1509 // Autoscroll while close to the wall
1510 Int_t dx = 0;
1511 Int_t dy = 0;
1512
1513 // Where's the cursor?
1514 gVirtualX->QueryPointer(fId,dum1,dum2,ev.fXRoot,ev.fYRoot,x,y,ev.fState);
1515
1516 // Figure scroll amount x
1517 if (x < kAutoScrollFudge)
1518 dx = kAutoScrollFudge - x;
1519 else if ((Int_t)dim.fWidth-kAutoScrollFudge <= x)
1520 dx = dim.fWidth - kAutoScrollFudge - x;
1521
1522 // Figure scroll amount y
1523 if (y < kAutoScrollFudge)
1524 dy = kAutoScrollFudge - y;
1525 else if ((Int_t)dim.fHeight - kAutoScrollFudge <= y)
1526 dy = dim.fHeight - kAutoScrollFudge - y;
1527
1528 if (dx || dy) {
1529 if (dx) dx /= 5;
1530 if (dy) dy /= 5;
1531 Int_t adx = TMath::Abs(dx);
1532 Int_t ady = TMath::Abs(dy);
1533 if (adx > kAutoScrollFudge) adx = kAutoScrollFudge;
1534 if (ady > kAutoScrollFudge) ady = kAutoScrollFudge;
1535
1536 dx *= kAcceleration[adx];
1537 dy *= kAcceleration[ady];
1538
1539 Int_t nx = pos.fX-dx;
1540 Int_t ny = pos.fY-dy;
1541
1544
1545 // position inside container
1546 x += pos.fX;
1547 y += pos.fY;
1548
1549 fX0 = TMath::Min(fXp, x);
1550 fY0 = TMath::Min(fYp, y);
1551 fXf = TMath::Max(fXp, x);
1552 fYf = TMath::Max(fYp ,y);
1553
1554 total = selected = 0;
1555
1556 TIter next(fList);
1557
1558 while ((el = (TGFrameElement *) next())) {
1559 f = el->fFrame;
1560 ++total;
1561 xf0 = f->GetX() + (f->GetWidth() >> 3);
1562 yf0 = f->GetY() + (f->GetHeight() >> 3);
1563 xff = xf0 + f->GetWidth() - (f->GetWidth() >> 2);
1564 yff = yf0 + f->GetHeight() - (f->GetHeight() >> 2);
1565
1566 if (((xf0 > fX0 && xf0 < fXf) ||
1567 (xff > fX0 && xff < fXf)) &&
1568 ((yf0 > fY0 && yf0 < fYf) ||
1569 (yff > fY0 && yff < fYf))) {
1570 if (!el->fFrame->IsActive())
1571 ActivateItem(el);
1572 ++selected;
1573 } else {
1574 if (el->fFrame->IsActive())
1575 DeActivateItem(el);
1576 }
1577 }
1578 gVirtualX->DrawRectangle(fId, GetLineGC()(), fX0-pos.fX, fY0-pos.fY,
1579 fXf-fX0, fYf-fY0);
1580
1581 if (fTotal != total || fSelected != selected) {
1582 fTotal = total;
1583 fSelected = selected;
1585 fTotal, fSelected);
1586 }
1587 ClearViewPort();
1588 DoRedraw();
1589 gVirtualX->DrawRectangle(fId, GetLineGC()(), fX0-pos.fX, fY0-pos.fY,
1590 fXf-fX0, fYf-fY0);
1591 }
1592}
1593
1594////////////////////////////////////////////////////////////////////////////////
1595/// Search for entry which name begins with pattern.
1596
1598{
1599 TGFrameElement *fe = 0;
1600 TIter next(fList);
1601 TString str;
1602
1603 while ((fe=( TGFrameElement*)next())) {
1604 str = fe->fFrame->GetTitle();
1605
1607 if (fLastActiveEl && (fLastActiveEl!=fe) ) {
1609 }
1610 ActivateItem(fe);
1612 break;
1613 }
1614 }
1615
1616 fKeyInput = ""; //clear
1618}
1619
1620////////////////////////////////////////////////////////////////////////////////
1621/// Repeats search.
1622
1624{
1625 TGFrameElement *fe = 0;
1626
1627 if (fLastName == "")
1628 return Search();
1629
1631
1632 if (!fe) {
1634 fLastActiveEl = 0;
1636
1637 if (!fe) {
1638 TString msg = "Couldn't find \"" + fLastName + '\"';
1639 gVirtualX->Bell(50);
1640 new TGMsgBox(fClient->GetDefaultRoot(), fCanvas, "Container", msg.Data(),
1642 } else {
1644 ActivateItem(fe);
1646 }
1647 } else {
1649 ActivateItem(fe);
1651 }
1652}
1653
1654////////////////////////////////////////////////////////////////////////////////
1655/// Find frame located int container at position x,y.
1656
1658{
1659 TIter next(fList);
1660 TGFrameElement *el;
1661 TGFrameElement *ret = 0;
1662 Int_t dx = 0;
1663 Int_t dy = 0;
1664 Int_t d = 0;
1665 Int_t dd;
1666
1667 el = (TGFrameElement *) next();
1668 if (!el) return 0;
1669
1670 dx = TMath::Abs(el->fFrame->GetX()-x);
1671 dy = TMath::Abs(el->fFrame->GetY()-y);
1672 d = dx + dy;
1673
1674 while ((el = (TGFrameElement *) next())) {
1675 if (exclude && (el==fLastActiveEl) ) continue;
1676 dx = TMath::Abs(el->fFrame->GetX()-x);
1677 dy = TMath::Abs(el->fFrame->GetY()-y);
1678 dd = dx+dy;
1679
1680 if (dd<d) {
1681 d = dd;
1682 ret = el;
1683 }
1684 }
1685 return ret;
1686}
1687
1688////////////////////////////////////////////////////////////////////////////////
1689
1691 Bool_t caseSensitive, Bool_t subString)
1692{
1693 // Find a frame which associated object has a name containing a "name"
1694 // string.
1695
1696 if (name.IsNull()) return 0;
1697 int idx = kNPOS;
1698
1699 TGFrameElement *el = 0;
1700 TString str;
1702
1703 fLastDir = direction;
1704 fLastCase = caseSensitive;
1705 fLastName = name;
1706 fLastSubstring = subString;
1707
1708 if (fLastActiveEl) {
1709 el = fLastActiveEl;
1710
1711 if (direction) {
1712 el = (TGFrameElement *)fList->After(el);
1713 } else {
1714 el = (TGFrameElement *)fList->Before(el);
1715 }
1716 } else {
1717 if (direction) el = (TGFrameElement *)fList->First();
1718 else el = (TGFrameElement *)fList->Last();
1719 }
1720
1721 while (el) {
1722 str = el->fFrame->GetTitle();
1723 idx = str.Index(name, 0, cmp);
1724
1725 if (idx != kNPOS) {
1726 if (subString) {
1727 return el;
1728 } else {
1729 if (str.Length() == name.Length()) return el;
1730 }
1731 }
1732
1733 if (direction) {
1734 el = (TGFrameElement *)fList->After(el);
1735 } else {
1736 el = (TGFrameElement *)fList->Before(el);
1737 }
1738 }
1739 return 0;
1740}
1741
1742////////////////////////////////////////////////////////////////////////////////
1743/// returns pointer to hor. scroll bar
1744
1746{
1747 return fCanvas ? fCanvas->GetHScrollbar() : 0;
1748}
1749
1750////////////////////////////////////////////////////////////////////////////////
1751/// returns pointer to vert. scroll bar
1752
1754{
1755 return fCanvas ? fCanvas->GetVScrollbar() : 0;
1756}
1757
1758////////////////////////////////////////////////////////////////////////////////
1759/// Set position of vertical scrollbar.
1760
1762{
1763 if (!fViewPort) return;
1765
1766 if (vb && vb->IsMapped()) {
1768 vb->SetPosition(newPos);
1769 } else {
1770 fViewPort->SetVPos(0);
1771 }
1772}
1773
1774////////////////////////////////////////////////////////////////////////////////
1775/// set new hor. position
1776
1778{
1779 if (!fViewPort) return;
1781
1782 if (hb && hb->IsMapped()) {
1784 hb->SetPosition(newPos);
1785 } else {
1786 fViewPort->SetHPos(0);
1787 }
1788}
1789
1790////////////////////////////////////////////////////////////////////////////////
1791/// Move content to position of highlighted/activated frame.
1792
1794{
1795 if (!fViewPort) return;
1796 if (!fLastActiveEl) return;
1798
1799 Int_t vh = 0;
1800 Int_t v = 0;
1801
1804 Int_t pos = GetPagePosition().fY;
1805 Int_t pg;
1806
1807
1808 if (vb && vb->IsMapped()) {
1809 pg = (vb->GetPageSize()*GetHeight())/fViewPort->GetHeight();
1810 vh = pos + (Int_t)fViewPort->GetHeight();
1811
1812 if (f->GetY() < pos) {
1813 v = TMath::Max(0, f->GetY() - (Int_t)fViewPort->GetHeight()/2);
1814 v = (v*pg)/GetHeight();
1815
1817 } else if (f->GetY() + (Int_t)f->GetHeight() > vh) {
1819 f->GetY() + (Int_t)f->GetHeight() - (Int_t)fViewPort->GetHeight()/2);
1820 v = (v*pg)/GetHeight();
1822 }
1823 }
1824
1825 Int_t hw = 0;
1826 Int_t h = 0;
1827
1828 if (hb && hb->IsMapped() && (!vb || (vb && !vb->IsMapped()))) {
1829 pg = (hb->GetPageSize()*GetWidth())/fViewPort->GetWidth();
1830 pos =GetPagePosition().fX;
1831 hw = pos + (Int_t)fViewPort->GetWidth();
1832
1833 if (f->GetX() < pos) {
1834 h = TMath::Max(0, f->GetX() - (Int_t)fViewPort->GetWidth()/2);
1835 h = (h*pg)/GetWidth();
1836
1838 } else if (f->GetX() + (Int_t)f->GetWidth() > hw) {
1840 f->GetX() + (Int_t)f->GetWidth() - (Int_t)fViewPort->GetWidth()/2);
1841 h = (h*pg)/GetWidth();
1842
1844 }
1845 }
1846}
1847
1848////////////////////////////////////////////////////////////////////////////////
1849/// Move current position one column left.
1850
1852{
1855
1857 if (!fe) return; // empty list
1858
1860
1861 if (old) DeActivateItem(old); //
1862 else fLastActiveEl = fe;
1863
1865 Int_t dx = la->fLayout->GetPadLeft() + la->fLayout->GetPadRight();
1866 Int_t dy = la->fLayout->GetPadTop() + la->fLayout->GetPadBottom();
1867 Int_t y = la->fFrame->GetY();
1868 Int_t x = la->fFrame->GetX() - dx;
1869
1870 Int_t hw = pos.fX + dim.fWidth;
1871
1873 if (x<=0 && (hb && !hb->IsMapped())) { // move to previous line
1874 x = hw;
1875 y = y - la->fFrame->GetDefaultHeight() - dy;
1876 }
1877
1878 fe = FindFrame(x, y);
1879 if (!fe) fe = (TGFrameElement*)fList->First();
1880
1881 if (!select) fSelected=1;
1882
1883 ActivateItem(fe);
1885}
1886
1887////////////////////////////////////////////////////////////////////////////////
1888/// Move current position one column right.
1889
1891{
1894
1896 if (!fe) return;
1897
1899
1900 if (old) DeActivateItem(old);
1902
1907
1908 Int_t hw = pos.fX + dim.fWidth - dx;
1909
1911 if (x >= hw && (hb && !hb->IsMapped())) { // move one line down
1912 x = 0;
1914 }
1915
1916 fe = FindFrame(x, y);
1917 if (!fe) fe = (TGFrameElement*)fList->Last();
1918 if (!select) fSelected = 1;
1919
1920 ActivateItem(fe);
1922}
1923
1924////////////////////////////////////////////////////////////////////////////////
1925/// Make current position first line in window by scrolling up.
1926
1928{
1930 if (!fe) return;
1931
1933
1934 if (old) {
1935 DeActivateItem(old);
1936 } else {
1938 }
1939
1941 Int_t y = fLastActiveEl->fFrame->GetY() - dy;
1943
1944 fe = FindFrame(x, y);
1945 if (!fe) fe = (TGFrameElement*)fList->First();
1946 if (fe->fFrame->GetY() > fLastActiveEl->fFrame->GetY()) fe = fLastActiveEl;
1947 if (!select) fSelected = 1;
1948
1949 ActivateItem(fe);
1951}
1952
1953////////////////////////////////////////////////////////////////////////////////
1954/// Move one line down.
1955
1957{
1959 if (!fe) return;
1960
1962
1963 if (old) DeActivateItem(old);
1965
1970
1971 fe = FindFrame(x, y);
1972 if (!fe) fe = (TGFrameElement*)fList->Last();
1973 if (fe->fFrame->GetY() < fLastActiveEl->fFrame->GetY()) fe = fLastActiveEl;
1974 if (!select) fSelected = 1;
1975
1976 ActivateItem(fe);
1978}
1979
1980////////////////////////////////////////////////////////////////////////////////
1981/// Move position one page up.
1982
1984{
1986
1988 if (!fe) return;
1989
1991
1992 if (old) DeActivateItem(old);
1994
1997
2000
2001 if (vb && vb->IsMapped()) {
2002 y -= dim.fHeight;
2003 } else {
2004 if (hb && hb->IsMapped()) {
2005 x -= dim.fWidth;
2006 } else {
2007 Home();
2008 return;
2009 }
2010 }
2011
2012 fe = FindFrame(x, y);
2013
2014 if (!fe || fe->fFrame->GetY()>fLastActiveEl->fFrame->GetY()) {
2015 fe = (TGFrameElement*)fList->First();
2016 }
2017
2018 if (!select) fSelected = 1;
2019
2020 ActivateItem(fe);
2022}
2023
2024////////////////////////////////////////////////////////////////////////////////
2025/// Move position one page down.
2026
2028{
2030
2031 TList *li = GetList();
2033 if (!fe) return;
2034
2036
2037 if (old) DeActivateItem(old);
2039
2042
2045
2046 if (vb && vb->IsMapped()) {
2047 y += dim.fHeight;
2048 } else {
2049 if (hb && hb->IsMapped()) {
2050 x += dim.fWidth;
2051 } else {
2052 End();
2053 return;
2054 }
2055 }
2056
2057 fe = FindFrame(x, y);
2058 if (!fe || fe->fFrame->GetY()<fLastActiveEl->fFrame->GetY() ) {
2059 fe = (TGFrameElement*)li->Last();
2060 }
2061
2062 if (!select) fSelected = 1;
2063
2064 ActivateItem(fe);
2066}
2067
2068////////////////////////////////////////////////////////////////////////////////
2069/// Move to upper-left corner of container.
2070
2072{
2074 if (!fe) return;
2075
2077 if (old) DeActivateItem(old);
2078
2079 if (!select) fSelected = 1;
2080
2081 ActivateItem(fe);
2083}
2084
2085////////////////////////////////////////////////////////////////////////////////
2086/// Move to the bottom-right corner of container.
2087
2089{
2091 if (!fe) return;
2092
2094 if (old) DeActivateItem(old);
2095
2096 if (!select) fSelected = 1;
2097
2098 ActivateItem(fe);
2100}
2101
2102////////////////////////////////////////////////////////////////////////////////
2103/// Get graphics context for line drawing.
2104
2106{
2107 if (!fgLineGC) {
2108 GCValues_t gval;
2114 gval.fFunction = kGXxor;
2115 gval.fLineWidth = 0;
2117 gval.fFillStyle = kFillSolid;
2120 fgLineGC = gClient->GetGC(&gval, kTRUE);
2122 fgLineGC->SetDashList("\x1\x1", 2);
2123 }
2124 return *fgLineGC;
2125}
2126
2127////////////////////////////////////////////////////////////////////////////////
2128/// Create a canvas object.
2129
2131 UInt_t options, ULong_t back) :
2132 TGFrame(p, w, h, options, back)
2133{
2134 fVport = new TGViewPort(this, w-4, h-4, kChildFrame | kOwnBackground,
2135 fgWhitePixel);
2138
2140
2141 fHScrollbar->Associate(this);
2142 fVScrollbar->Associate(this);
2143
2145
2146 SetWindowName();
2147
2150}
2151
2152////////////////////////////////////////////////////////////////////////////////
2153/// Delete canvas.
2154
2156{
2157 delete fHScrollbar;
2158 delete fVScrollbar;
2159 delete fVport;
2160}
2161
2162////////////////////////////////////////////////////////////////////////////////
2163/// Map all canvas sub windows.
2164
2166{
2169
2170 if (fVport) {
2171 TGFrame *container = fVport->GetContainer();
2172 if (!container) {
2173 Error("MapSubwindows", "no canvas container set yet");
2174 return;
2175 }
2176 container->MapSubwindows();
2178 fVport->MapWindow();
2179 Layout();
2180 }
2181}
2182
2183////////////////////////////////////////////////////////////////////////////////
2184/// Adding a frame to a canvas is actually adding the frame to the
2185/// viewport container. The viewport container must be at least a
2186/// TGCompositeFrame for this method to succeed.
2187
2189{
2190 TGFrame *container = fVport->GetContainer();
2191 if (!container) {
2192 Error("AddFrame", "no canvas container set yet");
2193 return;
2194 }
2195 if (container->InheritsFrom(TGCompositeFrame::Class()))
2196 ((TGCompositeFrame*)container)->AddFrame(f, l);
2197 else
2198 Error("AddFrame", "canvas container must inherit from TGCompositeFrame");
2199}
2200
2201////////////////////////////////////////////////////////////////////////////////
2202/// Draw canvas border.
2203
2205{
2208 gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, fWidth-2, 0);
2209 gVirtualX->DrawLine(fId, GetShadowGC()(), 0, 0, 0, fHeight-2);
2210 gVirtualX->DrawLine(fId, GetBlackGC()(), 1, 1, fWidth-3, 1);
2211 gVirtualX->DrawLine(fId, GetBlackGC()(), 1, 1, 1, fHeight-3);
2212 if (gClient->GetStyle() > 1) break;
2213 gVirtualX->DrawLine(fId, GetHilightGC()(), 0, fHeight-1, fWidth-1, fHeight-1);
2214 gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth-1, fHeight-1, fWidth-1, 0);
2215 gVirtualX->DrawLine(fId, GetBckgndGC()(), 1, fHeight-2, fWidth-2, fHeight-2);
2216 gVirtualX->DrawLine(fId, GetBckgndGC()(), fWidth-2, 1, fWidth-2, fHeight-2);
2217 break;
2218
2219 default:
2221 break;
2222 }
2223}
2224
2225////////////////////////////////////////////////////////////////////////////////
2226/// Create layout for canvas. Depending on the size of the container
2227/// we need to add the scrollbars.
2228
2230{
2231 Bool_t need_vsb, need_hsb;
2232 UInt_t cw, ch, tcw, tch;
2233
2234 need_vsb = need_hsb = kFALSE;
2235
2236 TGFrame *container = fVport->GetContainer();
2237 if (!container) {
2238 Error("Layout", "no canvas container set yet");
2239 return;
2240 }
2241
2242 Bool_t fixedw = container->IsLayoutBroken() || (container->GetOptions() & kFixedWidth) ?
2243 kTRUE : kFALSE;
2244 Bool_t fixedh = container->IsLayoutBroken() || (container->GetOptions() & kFixedHeight) ?
2245 kTRUE : kFALSE;
2246
2247 // test whether we need scrollbars
2248 cw = fWidth - UInt_t(fBorderWidth << 1);
2249 ch = fHeight - UInt_t(fBorderWidth << 1);
2250
2251 if (!fixedw) container->SetWidth(cw);
2252 if (!fixedh) container->SetHeight(ch);
2253
2254 if (container->GetDefaultWidth() > cw) {
2256 need_hsb = kTRUE;
2258 if ((Int_t) ch < 0) {
2259 //Warning("Layout", "height would become too small, setting to 10");
2260 ch = 10;
2261 }
2262 if (!fixedh) container->SetHeight(ch);
2263 }
2264 }
2265
2266 if (container->GetDefaultHeight() > ch) {
2268 need_vsb = kTRUE;
2270 if ((Int_t) cw < 0) {
2271 //Warning("Layout", "width would become too small, setting to 10");
2272 cw = 10;
2273 }
2274 if (!fixedw) container->SetWidth(cw);
2275 }
2276 }
2277
2278 // re-check again (putting the vertical scrollbar could have changed things)
2279
2280 if (container->GetDefaultWidth() > cw) {
2281 if (!need_hsb) {
2283 need_hsb = kTRUE;
2285 if ((Int_t) ch < 0) {
2286 //Warning("Layout", "height would become too small, setting to 10");
2287 ch = 10;
2288 }
2289 if (!fixedh) container->SetHeight(ch);
2290 }
2291 }
2292 }
2293
2295
2296 tcw = TMath::Max(container->GetDefaultWidth(), cw);
2297 tch = TMath::Max(container->GetDefaultHeight(), ch);
2298 UInt_t curw = container->GetDefaultWidth();
2299
2300 container->SetWidth(0); // force a resize in TGFrame::Resize
2301
2302 if (fixedw && fixedh) {
2303 container->Resize(curw, container->GetDefaultHeight());
2304 } else if (fixedw) {
2305 container->Resize(curw, tch);
2306 } else if (fixedh) {
2307 container->Resize(tcw, container->GetDefaultHeight());
2308 } else {
2309 container->Resize(tcw, tch);
2310 }
2311
2312 if (fHScrollbar) {
2313 if (need_hsb) {
2315 fHScrollbar->SetRange((Int_t)container->GetWidth(), (Int_t)fVport->GetWidth());
2317 } else {
2320 if (container->IsLayoutBroken()) {
2321 container->Resize(fVport->GetWidth(), container->GetHeight());
2322 }
2323 }
2324 }
2325
2326 if (fVScrollbar) {
2327 if (need_vsb) {
2331 } else {
2334 if (container->IsLayoutBroken()) {
2335 container->Resize(container->GetWidth(), fVport->GetHeight());
2336 }
2337 }
2338 }
2339}
2340
2341////////////////////////////////////////////////////////////////////////////////
2342/// Handle message generated by the canvas scrollbars.
2343
2345{
2346 switch (GET_MSG(msg)) {
2347 case kC_HSCROLL:
2348 switch (GET_SUBMSG(msg)) {
2349 case kSB_SLIDERTRACK:
2350 case kSB_SLIDERPOS:
2351 fVport->SetHPos((Int_t)-parm1);
2352 break;
2353 }
2354 break;
2355
2356 case kC_VSCROLL:
2357 switch (GET_SUBMSG(msg)) {
2358 case kSB_SLIDERTRACK:
2359 case kSB_SLIDERPOS:
2360 fVport->SetVPos((Int_t)-parm1);
2361 break;
2362 }
2363 break;
2364
2365 default:
2366 break;
2367 }
2368 return kTRUE;
2369}
2370
2371////////////////////////////////////////////////////////////////////////////////
2372/// Get position of horizontal scrollbar.
2373
2375{
2377 return fHScrollbar->GetPosition();
2378 return 0;
2379}
2380
2381////////////////////////////////////////////////////////////////////////////////
2382/// Get position of vertical scrollbar.
2383
2385{
2387 return fVScrollbar->GetPosition();
2388 return 0;
2389}
2390
2391////////////////////////////////////////////////////////////////////////////////
2392/// Set position of horizontal scrollbar.
2393
2395{
2396 if (fHScrollbar && fHScrollbar->IsMapped()) {
2397 TGFrame *container = fVport->GetContainer();
2398 fHScrollbar->SetRange((Int_t)container->GetWidth(), (Int_t)fVport->GetWidth());
2399 fHScrollbar->SetPosition(newPos);
2400 } else {
2401 fVport->SetHPos(0);
2402 }
2403}
2404
2405////////////////////////////////////////////////////////////////////////////////
2406/// Set position of vertical scrollbar.
2407
2409{
2410 if (fVScrollbar && fVScrollbar->IsMapped()) {
2411 TGFrame *container = fVport->GetContainer();
2413 fVScrollbar->SetPosition(newPos);
2414 } else {
2415 fVport->SetVPos(0);
2416 }
2417}
2418
2419////////////////////////////////////////////////////////////////////////////////
2420/// Set scrolling policy. Use values defined by the enum: kCanvasNoScroll,
2421/// kCanvasScrollHorizontal, kCanvasScrollVertical, kCanvasScrollBoth.
2422
2424{
2425 if (scrolling != fScrolling) {
2426 fScrolling = scrolling;
2427 Layout();
2428 }
2429}
2430
2431////////////////////////////////////////////////////////////////////////////////
2432/// Clear view port and redraw content.
2433
2435{
2436 TGFrame *cont = GetContainer();
2437 if (!cont) return;
2438
2439 gVirtualX->ClearArea(cont->GetId(), 0, 0, fVport->GetWidth(), fVport->GetHeight());
2440 fClient->NeedRedraw(cont);
2441}
2442
2443////////////////////////////////////////////////////////////////////////////////
2444/// Save a canvas widget as a C++ statement(s) on output stream out.
2445
2446void TGCanvas::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
2447{
2449
2450 out << std::endl << " // canvas widget" << std::endl;
2451
2452 out << " TGCanvas *";
2453 out << GetName() << " = new TGCanvas("<< fParent->GetName()
2454 << "," << GetWidth() << "," << GetHeight();
2455
2457 if (GetOptions() == (kSunkenFrame | kDoubleBorder)) {
2458 out << ");" << std::endl;
2459 } else {
2460 out << "," << GetOptionString() << ");" << std::endl;
2461 }
2462 } else {
2463 out << "," << GetOptionString() << ",ucolor);" << std::endl;
2464 }
2465 if (option && strstr(option, "keep_names"))
2466 out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
2467
2468 TGViewPort *vp = GetViewPort();
2469 out << std::endl << " // canvas viewport" << std::endl;
2470 out << " TGViewPort *" << vp->GetName() << " = " << GetName()
2471 << "->GetViewPort();" << std::endl;
2472
2474 cont->SavePrimitive(out, option);
2475
2476 out << " " << vp->GetName() << "->AddFrame(" << cont->GetName()
2477 << ");" << std::endl;
2478
2479 out << " " << cont->GetName() << "->SetLayoutManager(";
2480 cont->GetLayoutManager()->SavePrimitive(out, option);
2481 out << ");"<< std::endl;
2482
2483 out << " " << cont->GetName() << "->MapSubwindows();" << std::endl;
2484
2485 out << " " << GetName() << "->SetContainer(" << cont->GetName()
2486 << ");" << std::endl;
2487
2488 out << " " << GetName() << "->MapSubwindows();" << std::endl;
2489
2491 out << " " << GetName() << "->SetHsbPosition(" << GetHsbPosition()
2492 << ");" << std::endl;
2493
2494
2496 out << " " << GetName() << "->SetVsbPosition(" << GetVsbPosition()
2497 << ");" << std::endl;
2498
2499}
2500
2501////////////////////////////////////////////////////////////////////////////////
2502/// Save a canvas container as a C++ statement(s) on output stream out.
2503
2504void TGContainer::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
2505{
2507
2508 out << std::endl << " // canvas container" << std::endl;
2509
2510 if ((fParent->GetParent())->InheritsFrom(TGCanvas::Class())) {
2511 out << GetName() << " = new TGContainer(" << GetCanvas()->GetName();
2512 } else {
2513 out << GetName() << " = new TGContainer(" << fParent->GetName();
2514 out << "," << GetWidth() << "," << GetHeight();
2515 }
2516
2518 if (GetOptions() == (kSunkenFrame | kDoubleBorder)) {
2519 out <<");" << std::endl;
2520 } else {
2521 out << "," << GetOptionString() <<");" << std::endl;
2522 }
2523 } else {
2524 out << "," << GetOptionString() << ",ucolor);" << std::endl;
2525 }
2526 if (option && strstr(option, "keep_names"))
2527 out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
2528}
int Int_t
Definition: CPyCppyy.h:43
unsigned int UInt_t
Definition: CPyCppyy.h:44
unsigned long ULong_t
Definition: CPyCppyy.h:51
long Long_t
Definition: CPyCppyy.h:50
void Class()
Definition: Class.C:29
@ kGKeyPress
Definition: GuiTypes.h:60
@ kButtonRelease
Definition: GuiTypes.h:60
@ kButtonPress
Definition: GuiTypes.h:60
const Mask_t kWABitGravity
Definition: GuiTypes.h:144
const Mask_t kGCBackground
Definition: GuiTypes.h:289
const Mask_t kGCForeground
Definition: GuiTypes.h:288
const Mask_t kGCLineStyle
Definition: GuiTypes.h:291
const Mask_t kGCSubwindowMode
Definition: GuiTypes.h:301
const Mask_t kGCLineWidth
Definition: GuiTypes.h:290
const Mask_t kButtonPressMask
Definition: GuiTypes.h:161
const Mask_t kGCFillStyle
Definition: GuiTypes.h:294
const Mask_t kWAWinGravity
Definition: GuiTypes.h:145
const Mask_t kGCFunction
Definition: GuiTypes.h:286
const Mask_t kAnyModifier
Definition: GuiTypes.h:210
@ kGXxor
src XOR dst
Definition: GuiTypes.h:74
Handle_t Pixmap_t
Pixmap handle.
Definition: GuiTypes.h:30
const Mask_t kKeyPressMask
Definition: GuiTypes.h:159
@ kDefaultScrollBarWidth
Definition: GuiTypes.h:86
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:163
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
@ kFixedHeight
Definition: GuiTypes.h:389
@ kOwnBackground
Definition: GuiTypes.h:391
const Handle_t kNone
Definition: GuiTypes.h:88
const Mask_t kKeyControlMask
Definition: GuiTypes.h:197
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:166
@ kIncludeInferiors
Definition: GuiTypes.h:53
@ kFillSolid
Definition: GuiTypes.h:51
@ kLineOnOffDash
Definition: GuiTypes.h:48
Handle_t GContext_t
Graphics context handle.
Definition: GuiTypes.h:38
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:162
const Mask_t kGCGraphicsExposures
Definition: GuiTypes.h:302
@ kHand
Definition: GuiTypes.h:374
@ kPointer
Definition: GuiTypes.h:375
@ kButton4
Definition: GuiTypes.h:215
@ kButton5
Definition: GuiTypes.h:215
@ kButton1
Definition: GuiTypes.h:214
@ kAnyButton
Definition: GuiTypes.h:214
Handle_t Window_t
Window handle.
Definition: GuiTypes.h:29
EKeySym
Definition: KeySymbols.h:25
@ kKey_Right
Definition: KeySymbols.h:42
@ kKey_Down
Definition: KeySymbols.h:43
@ kKey_G
Definition: KeySymbols.h:132
@ kKey_Meta
Definition: KeySymbols.h:51
@ kKey_Space
Definition: KeySymbols.h:93
@ kKey_Y
Definition: KeySymbols.h:150
@ kKey_B
Definition: KeySymbols.h:127
@ kKey_PageDown
Definition: KeySymbols.h:47
@ kKey_F
Definition: KeySymbols.h:131
@ kKey_CapsLock
Definition: KeySymbols.h:53
@ kKey_F5
Definition: KeySymbols.h:61
@ kKey_Up
Definition: KeySymbols.h:41
@ kKey_Return
Definition: KeySymbols.h:30
@ kKey_Alt
Definition: KeySymbols.h:52
@ kKey_C
Definition: KeySymbols.h:128
@ kKey_ScrollLock
Definition: KeySymbols.h:55
@ kKey_Delete
Definition: KeySymbols.h:33
@ kKey_A
Definition: KeySymbols.h:126
@ kKey_F3
Definition: KeySymbols.h:59
@ kKey_Left
Definition: KeySymbols.h:40
@ kKey_Shift
Definition: KeySymbols.h:49
@ kKey_E
Definition: KeySymbols.h:130
@ kKey_Backspace
Definition: KeySymbols.h:29
@ kKey_D
Definition: KeySymbols.h:129
@ kKey_X
Definition: KeySymbols.h:149
@ kKey_Home
Definition: KeySymbols.h:38
@ kKey_U
Definition: KeySymbols.h:146
@ kKey_Enter
Definition: KeySymbols.h:31
@ kKey_Control
Definition: KeySymbols.h:50
@ kKey_H
Definition: KeySymbols.h:133
@ kKey_End
Definition: KeySymbols.h:39
@ kKey_NumLock
Definition: KeySymbols.h:54
@ kKey_PageUp
Definition: KeySymbols.h:45
@ kKey_K
Definition: KeySymbols.h:136
@ kKey_V
Definition: KeySymbols.h:147
@ kKey_F7
Definition: KeySymbols.h:63
#define d(i)
Definition: RSha256.hxx:102
#define f(i)
Definition: RSha256.hxx:104
#define h(i)
Definition: RSha256.hxx:106
const Ssiz_t kNPOS
Definition: RtypesCore.h:124
const Bool_t kFALSE
Definition: RtypesCore.h:101
bool Bool_t
Definition: RtypesCore.h:63
const Bool_t kTRUE
Definition: RtypesCore.h:100
const char Option_t
Definition: RtypesCore.h:66
#define ClassImp(name)
Definition: Rtypes.h:364
const Int_t kKeyboardTime
Definition: TGCanvas.cxx:84
const Int_t kAutoScrollFudge
Definition: TGCanvas.cxx:82
const Int_t kAcceleration[kAutoScrollFudge+1]
Definition: TGCanvas.cxx:83
#define gClient
Definition: TGClient.h:157
R__EXTERN TGDNDManager * gDNDManager
Definition: TGDNDManager.h:201
@ kMBOk
Definition: TGMsgBox.h:33
@ kMBIconExclamation
Definition: TGMsgBox.h:24
static unsigned int total
R__EXTERN void * gTQSender
Definition: TQObject.h:44
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
#define gVirtualX
Definition: TVirtualX.h:338
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Int_t GET_MSG(Long_t val)
@ kCT_SELCHANGED
@ kSB_SLIDERTRACK
@ kSB_SLIDERPOS
@ kC_VSCROLL
@ kCT_ITEMCLICK
@ kCT_KEY
@ kC_HSCROLL
@ kCT_ITEMDBLCLICK
@ kC_CONTAINER
Int_t GET_SUBMSG(Long_t val)
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Definition: TClass.cxx:2955
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition: TGCanvas.h:192
TGVScrollBar * GetVScrollbar() const
Definition: TGCanvas.h:219
virtual void MapSubwindows()
Map all canvas sub windows.
Definition: TGCanvas.cxx:2165
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a canvas widget as a C++ statement(s) on output stream out.
Definition: TGCanvas.cxx:2446
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
Definition: TGCanvas.cxx:2408
virtual void SetHsbPosition(Int_t newPos)
Set position of horizontal scrollbar.
Definition: TGCanvas.cxx:2394
virtual Int_t GetVsbPosition() const
Get position of vertical scrollbar.
Definition: TGCanvas.cxx:2384
TGViewPort * fVport
viewport through which we look at contents
Definition: TGCanvas.h:195
Int_t fScrolling
flag which scrolling modes are allowed
Definition: TGCanvas.h:198
virtual void DrawBorder()
Draw canvas border.
Definition: TGCanvas.cxx:2204
TGHScrollBar * fHScrollbar
horizontal scrollbar
Definition: TGCanvas.h:196
TGHScrollBar * GetHScrollbar() const
Definition: TGCanvas.h:218
TGVScrollBar * fVScrollbar
vertical scrollbar
Definition: TGCanvas.h:197
TGFrame * GetContainer() const
Definition: TGCanvas.h:216
@ kCanvasScrollVertical
Definition: TGCanvas.h:207
@ kCanvasScrollBoth
Definition: TGCanvas.h:208
@ kCanvasScrollHorizontal
Definition: TGCanvas.h:206
virtual Int_t GetHsbPosition() const
Get position of horizontal scrollbar.
Definition: TGCanvas.cxx:2374
virtual void ClearViewPort()
Clear view port and redraw content.
Definition: TGCanvas.cxx:2434
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Adding a frame to a canvas is actually adding the frame to the viewport container.
Definition: TGCanvas.cxx:2188
virtual void Layout()
Create layout for canvas.
Definition: TGCanvas.cxx:2229
void SetScrolling(Int_t scrolling)
Set scrolling policy.
Definition: TGCanvas.cxx:2423
TGViewPort * GetViewPort() const
Definition: TGCanvas.h:217
TGCanvas(const TGCanvas &)=delete
virtual ~TGCanvas()
Delete canvas.
Definition: TGCanvas.cxx:2155
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Handle message generated by the canvas scrollbars.
Definition: TGCanvas.cxx:2344
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:236
TGMimeTypes * GetMimeTypeList() const
Definition: TGClient.h:146
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:291
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:374
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
virtual TGLayoutManager * GetLayoutManager() const
Definition: TGFrame.h:338
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1257
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1164
Bool_t fMapSubwindows
kTRUE - map subwindows
Definition: TGFrame.h:295
virtual TList * GetList() const
Definition: TGFrame.h:310
TList * fList
container of frame elements
Definition: TGFrame.h:292
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1149
TGContainer * fContainer
Definition: TGCanvas.cxx:95
Bool_t Notify()
single shot timer
Definition: TGCanvas.cxx:104
TGContainerKeyboardTimer(TGContainer *t)
Definition: TGCanvas.cxx:97
Bool_t Notify()
on-timeout
Definition: TGCanvas.cxx:125
TGContainerScrollTimer(TGContainer *t)
Definition: TGCanvas.cxx:118
TGContainer * fContainer
Definition: TGCanvas.cxx:116
Manages a content area.
Definition: TGCanvas.h:31
virtual Bool_t HandleExpose(Event_t *event)
Handle expose events. Do not use double buffer.
Definition: TGCanvas.cxx:903
TGRectangle fExposedRegion
exposed area
Definition: TGCanvas.h:62
virtual void ActivateItem(TGFrameElement *el)
Activate item.
Definition: TGCanvas.cxx:701
const TGWindow * GetMessageWindow() const
Definition: TGCanvas.h:100
Bool_t fKeyTimerActive
kTRUE - keyboard timer is active
Definition: TGCanvas.h:58
virtual void RemoveItem(TGFrame *item)
Remove item from container.
Definition: TGCanvas.cxx:660
TGCanvas * fCanvas
pointer to canvas
Definition: TGCanvas.h:41
TTimer * fScrollTimer
autoscroll timer
Definition: TGCanvas.h:50
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion events.
Definition: TGCanvas.cxx:1141
virtual void RepeatSearch()
Repeats search.
Definition: TGCanvas.cxx:1623
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:589
TGCanvas * GetCanvas() const
Definition: TGCanvas.h:99
virtual Bool_t HandleKey(Event_t *event)
The key press event handler converts a key press to some line editor action.
Definition: TGCanvas.cxx:1278
virtual void PageDown(Bool_t select=kFALSE)
Move position one page down.
Definition: TGCanvas.cxx:2027
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in container.
Definition: TGCanvas.cxx:929
virtual void LineLeft(Bool_t select=kFALSE)
Move current position one column left.
Definition: TGCanvas.cxx:1851
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
virtual TGFrameElement * FindFrame(Int_t x, Int_t y, Bool_t exclude=kTRUE)
Find frame located int container at position x,y.
Definition: TGCanvas.cxx:1657
Int_t fYp
previous pointer position
Definition: TGCanvas.h:44
virtual void AdjustPosition()
Move content to position of highlighted/activated frame.
Definition: TGCanvas.cxx:1793
virtual void OnMouseOver(TGFrame *)
Signal emitted when pointer is over entry.
Definition: TGCanvas.cxx:501
virtual void Clicked(TGFrame *f, Int_t btn)
Emit Clicked() signal.
Definition: TGCanvas.cxx:510
virtual void InvertSelection()
Invert the selection, all selected items become unselected and vice versa.
Definition: TGCanvas.cxx:614
virtual void PageUp(Bool_t select=kFALSE)
Move position one page up.
Definition: TGCanvas.cxx:1983
virtual void LineDown(Bool_t select=kFALSE)
Move one line down.
Definition: TGCanvas.cxx:1956
virtual const TGFrame * GetNextSelected(void **current)
Return the next selected item.
Definition: TGCanvas.cxx:681
virtual void Search(Bool_t close=kTRUE)
Invokes search dialog. Looks for item with the entered name.
Definition: TGCanvas.cxx:1467
virtual ~TGContainer()
Delete canvas container.
Definition: TGCanvas.cxx:406
virtual void LineUp(Bool_t select=kFALSE)
Make current position first line in window by scrolling up.
Definition: TGCanvas.cxx:1927
Bool_t fLastDir
direction of last search
Definition: TGCanvas.h:52
Int_t fY0
corner of rubber band box
Definition: TGCanvas.h:45
virtual void Home(Bool_t select=kFALSE)
Move to upper-left corner of container.
Definition: TGCanvas.cxx:2071
virtual void KeyPressed(TGFrame *, UInt_t keysym, UInt_t mask)
Signal emitted when keyboard key pressed.
Definition: TGCanvas.cxx:470
virtual void SetDragPixmap(const TGPicture *pic)
Set drag window pixmaps and hotpoint.
Definition: TGCanvas.cxx:1080
const TGPicture * GetObjPicture(TGFrame *f)
Retrieve icons associated with class "name".
Definition: TGCanvas.cxx:1039
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
Definition: TGCanvas.cxx:1761
Int_t fXDND
Definition: TGCanvas.h:60
virtual void ReturnPressed(TGFrame *)
Signal emitted when Return/Enter key pressed.
Definition: TGCanvas.cxx:484
virtual void SearchPattern()
Search for entry which name begins with pattern.
Definition: TGCanvas.cxx:1597
virtual void SetPageDimension(const TGDimension &dim)
Set page dimension.
Definition: TGCanvas.cxx:782
virtual void LineRight(Bool_t select=kFALSE)
Move current position one column right.
Definition: TGCanvas.cxx:1890
TGContainer(const TGContainer &)=delete
Int_t fSelected
number of selected items
Definition: TGCanvas.h:49
Bool_t fBdown
Definition: TGCanvas.h:61
virtual void SpacePressed(TGFrame *)
Signal emitted when space key pressed.
Definition: TGCanvas.cxx:493
virtual void SetHsbPosition(Int_t newPos)
set new hor. position
Definition: TGCanvas.cxx:1777
Bool_t fScrolling
kTRUE - when scrolling is ON
Definition: TGCanvas.h:59
virtual void DoRedraw()
Redraw content of container in the viewport region.
Definition: TGCanvas.cxx:800
Int_t fX0
Definition: TGCanvas.h:45
virtual TGDimension GetPageDimension() const
Returns page dimension.
Definition: TGCanvas.cxx:751
TString fLastName
the name of object of last search
Definition: TGCanvas.h:55
virtual void Layout()
Layout container entries.
Definition: TGCanvas.cxx:422
virtual void OnAutoScroll()
Autoscroll while close to & beyond The Wall.
Definition: TGCanvas.cxx:1495
Int_t fXp
Definition: TGCanvas.h:44
static const TGGC & GetLineGC()
Get graphics context for line drawing.
Definition: TGCanvas.cxx:2105
static TGGC * fgLineGC
Definition: TGCanvas.h:64
Bool_t fDragging
true if in dragging mode
Definition: TGCanvas.h:47
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a canvas container as a C++ statement(s) on output stream out.
Definition: TGCanvas.cxx:2504
virtual void CurrentChanged(Int_t x, Int_t y)
Emit signal when current position changed.
Definition: TGCanvas.cxx:434
virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
Draw a region of container in viewport.
Definition: TGCanvas.cxx:819
virtual void RemoveAll()
Remove all items from the container.
Definition: TGCanvas.cxx:641
friend class TGContainerScrollTimer
Definition: TGCanvas.h:36
TGViewPort * fViewPort
container viewport
Definition: TGCanvas.h:40
virtual TGVScrollBar * GetVScrollbar() const
returns pointer to vert. scroll bar
Definition: TGCanvas.cxx:1753
virtual TGFrame * FindFrameByName(const char *name)
Find frame by name.
Definition: TGCanvas.cxx:1416
Int_t fYDND
Definition: TGCanvas.h:60
friend class TGContainerKeyboardTimer
Definition: TGCanvas.h:35
virtual void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t subString=kFALSE)
Definition: TGCanvas.cxx:1690
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click mouse event.
Definition: TGCanvas.cxx:1098
Bool_t fOnMouseOver
kTRUE when mouse pointer is over entry
Definition: TGCanvas.h:51
Bool_t fLastCase
case sensitivity of last search
Definition: TGCanvas.h:53
Int_t fTotal
total items
Definition: TGCanvas.h:48
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
virtual void End(Bool_t select=kFALSE)
Move to the bottom-right corner of container.
Definition: TGCanvas.cxx:2088
Bool_t fLastSubstring
substring search option of last search
Definition: TGCanvas.h:54
virtual void SetPagePosition(const TGPosition &pos)
Set page position.
Definition: TGCanvas.cxx:764
virtual TGHScrollBar * GetHScrollbar() const
returns pointer to hor. scroll bar
Definition: TGCanvas.cxx:1745
TGFrameElement * fLastActiveEl
last active item
Definition: TGCanvas.h:43
virtual void SelectAll()
Select all items in the container.
Definition: TGCanvas.cxx:567
TString fKeyInput
keyboard input (buffer)
Definition: TGCanvas.h:57
TTimer * fKeyTimer
keyboard timer
Definition: TGCanvas.h:56
virtual void DeActivateItem(TGFrameElement *el)
DeActivate item.
Definition: TGCanvas.cxx:724
Int_t fXf
Definition: TGCanvas.h:46
Bool_t IsDragging() const
Definition: TGDNDManager.h:173
Bool_t StartDrag(TGFrame *src, Int_t x_root, Int_t y_root, Window_t grabWin=kNone)
Start dragging.
void SetDragPixmap(Pixmap_t pic, Pixmap_t mask, Int_t hot_x, Int_t hot_y)
Set drag window pixmaps and hotpoint.
Bool_t Drag(Int_t x_root, Int_t y_root, Atom_t action, Time_t timestamp)
Process drag event.
static Atom_t GetDNDActionCopy()
UInt_t fHeight
Definition: TGDimension.h:21
UInt_t fWidth
Definition: TGDimension.h:20
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
virtual void DrawCopy(Handle_t, Int_t, Int_t)
Definition: TGFrame.h:209
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:339
virtual Bool_t IsLayoutBroken() const
Definition: TGFrame.h:216
static const TGGC & GetBlackGC()
Get black graphics context.
Definition: TGFrame.cxx:735
UInt_t fOptions
frame options
Definition: TGFrame.h:94
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
Definition: TGFrame.cxx:443
virtual Bool_t IsActive() const
Definition: TGFrame.h:211
virtual void MapRaised()
map raised
Definition: TGFrame.h:205
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
virtual void DrawBorder()
Draw frame border.
Definition: TGFrame.cxx:421
Int_t fBorderWidth
frame border width
Definition: TGFrame.h:93
virtual void Activate(Bool_t)
Definition: TGFrame.h:210
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition: TGFrame.cxx:755
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:312
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:645
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
Int_t GetX() const
Definition: TGFrame.h:231
virtual UInt_t GetOptions() const
Definition: TGFrame.h:197
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2480
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition: TGFrame.cxx:765
virtual void Move(Int_t x, Int_t y)
Move frame.
Definition: TGFrame.cxx:593
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:605
UInt_t fWidth
frame width
Definition: TGFrame.h:87
UInt_t GetHeight() const
Definition: TGFrame.h:225
Bool_t IsDNDSource() const
Definition: TGFrame.h:272
Int_t GetY() const
Definition: TGFrame.h:232
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
Definition: TGFrame.cxx:629
virtual void SetWidth(UInt_t w)
Definition: TGFrame.h:246
virtual void MapWindow()
map window
Definition: TGFrame.h:204
static const TGGC & GetWhiteGC()
Get white graphics context.
Definition: TGFrame.cxx:745
static Pixel_t fgWhitePixel
Definition: TGFrame.h:103
UInt_t GetWidth() const
Definition: TGFrame.h:224
virtual void MapSubwindows()
map sub windows
Definition: TGFrame.h:200
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition: TGFrame.cxx:2453
virtual void SetHeight(UInt_t h)
Definition: TGFrame.h:247
Pixel_t fBackground
frame background color
Definition: TGFrame.h:95
static Pixel_t fgBlackPixel
Definition: TGFrame.h:104
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition: TGFrame.cxx:775
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:206
Encapsulate a graphics context used in the low level graphics.
Definition: TGGC.h:22
void SetDashOffset(Int_t v)
Patterned/dashed line offset.
Definition: TGGC.cxx:477
void SetDashList(const char v[], Int_t len)
Set dash pattern. First use SetDashOffset() if not 0.
Definition: TGGC.cxx:488
The TGHScrollBar will generate the following event messages: kC_HSCROLL, kSB_SLIDERPOS,...
Definition: TGScrollBar.h:141
virtual void SetRange(Int_t range, Int_t page_size)
Set range of horizontal scrollbar.
virtual void SetPosition(Int_t pos)
Set logical slider position of horizontal scrollbar.
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
Int_t GetPadRight() const
Definition: TGLayout.h:86
Int_t GetPadBottom() const
Definition: TGLayout.h:84
Int_t GetPadTop() const
Definition: TGLayout.h:83
Int_t GetPadLeft() const
Definition: TGLayout.h:85
Frame layout manager.
Definition: TGLayout.h:135
virtual Bool_t IsModified() const
Definition: TGLayout.h:146
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:27
Handle_t GetId() const
Definition: TGObject.h:37
Handle_t fId
X11/Win32 Window identifier.
Definition: TGObject.h:26
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition: TGPicture.h:25
Pixmap_t GetMask() const
Definition: TGPicture.h:55
UInt_t GetHeight() const
Definition: TGPicture.h:53
Pixmap_t GetPicture() const
Definition: TGPicture.h:54
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
Bool_t IsEmpty() const
Definition: TGDimension.h:124
void Empty()
Definition: TGDimension.h:123
UInt_t fH
height
Definition: TGDimension.h:94
UInt_t fW
width
Definition: TGDimension.h:93
Int_t fX
x position
Definition: TGDimension.h:91
void Merge(const TGRectangle &r)
Definition: TGDimension.cxx:49
Int_t fY
y position
Definition: TGDimension.h:92
virtual Int_t GetPageSize() const
Definition: TGScrollBar.h:114
virtual Int_t GetPosition() const
Definition: TGScrollBar.h:113
virtual void MapSubwindows()
map sub windows
Definition: TGScrollBar.h:124
virtual void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0)
Move and/or resize the frame.
Definition: TGScrollBar.h:117
static TGSearchDialog *& SearchDialog()
Return global search dialog.
virtual TGSearchType * GetType() const
The TGVScrollBar will generate the following event messages: kC_VSCROLL, kSB_SLIDERPOS,...
Definition: TGScrollBar.h:164
virtual void SetPosition(Int_t pos)
Set logical slider position of vertical scrollbar.
virtual void SetRange(Int_t range, Int_t page_size)
Set range of vertical scrollbar.
Int_t GetHPos() const
Definition: TGCanvas.h:184
Int_t GetVPos() const
Definition: TGCanvas.h:185
TGFrame * fContainer
Definition: TGCanvas.h:162
TGViewPort(const TGViewPort &)=delete
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handle resize events.
Definition: TGCanvas.cxx:292
Int_t fX0
Definition: TGCanvas.h:161
void SetContainer(TGFrame *f)
Add container frame to the viewport.
Definition: TGCanvas.cxx:153
virtual void SetHPos(Int_t xpos)
Moves content of container frame in horizontal direction.
Definition: TGCanvas.cxx:178
virtual void SetVPos(Int_t ypos)
Moves content of container frame in vertical direction.
Definition: TGCanvas.cxx:229
void SetPos(Int_t xpos, Int_t ypos)
Goto new position.
Definition: TGCanvas.cxx:281
Int_t fY0
Definition: TGCanvas.h:161
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
virtual void SetWindowName(const char *name=0)
Set window name.
Definition: TGWindow.cxx:129
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:336
virtual UInt_t GetEditDisabled() const
Definition: TGWindow.h:105
virtual void SetEditDisabled(UInt_t on=kEditDisable)
Definition: TGWindow.h:106
virtual Bool_t HandleExpose(Event_t *event)
Definition: TGWindow.h:94
const TGWindow * fParent
Parent window.
Definition: TGWindow.h:28
const TGWindow * GetParent() const
Definition: TGWindow.h:76
@ kEditDisableBtnEnable
window can handle mouse button events
Definition: TGWindow.h:57
@ kEditDisableGrab
window grab cannot be edited
Definition: TGWindow.h:52
@ kEditDisable
disable edit of this window
Definition: TGWindow.h:50
virtual void DestroyWindow()
destroy window
Definition: TGWindow.cxx:192
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
Definition: TGWindow.cxx:295
UInt_t fEditDisabled
flags used for "guibuilding"
Definition: TGWindow.h:32
Utility class for browsing TMapFile objects.
Definition: TKeyMapFile.h:20
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Definition: TKey.h:28
A doubly linked list.
Definition: TList.h:44
virtual TObjLink * FirstLink() const
Definition: TList.h:108
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
Definition: TList.cxx:330
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:822
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition: TList.cxx:693
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
Definition: TList.cxx:371
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:659
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
Mother of all ROOT objects.
Definition: TObject.h:37
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: TObject.cxx:475
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:359
virtual const char * GetIconName() const
Returns mime type name of object.
Definition: TObject.cxx:369
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TObject.cxx:666
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:445
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:893
virtual const char * GetTitle() const
Returns title of object.
Definition: TObject.cxx:403
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:869
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Definition: TQObject.cxx:1027
Basic string class.
Definition: TString.h:136
Ssiz_t Length() const
Definition: TString.h:410
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
ECaseCompare
Definition: TString.h:268
@ kIgnoreCase
Definition: TString.h:268
@ kExact
Definition: TString.h:268
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition: TString.h:615
const char * Data() const
Definition: TString.h:369
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:639
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
Definition: TSystem.cxx:474
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
Definition: TSystem.cxx:484
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
void Reset()
Reset the timer.
Definition: TTimer.cxx:157
Double_t y[n]
Definition: legend1.C:17
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
static const std::string name("name")
Short_t Max(Short_t a, Short_t b)
Definition: TMathBase.h:212
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:180
Short_t Abs(Short_t d)
Definition: TMathBase.h:120
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
Graphics context structure.
Definition: GuiTypes.h:224
ULong_t fBackground
background pixel
Definition: GuiTypes.h:228
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
Bool_t fGraphicsExposures
boolean, should exposures be generated
Definition: GuiTypes.h:244
ULong_t fForeground
foreground pixel
Definition: GuiTypes.h:227
Int_t fFillStyle
kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled
Definition: GuiTypes.h:234
EGraphicsFunction fFunction
logical operation
Definition: GuiTypes.h:225
Int_t fSubwindowMode
kClipByChildren, kIncludeInferiors
Definition: GuiTypes.h:243
Attributes that can be used when creating or changing a window.
Definition: GuiTypes.h:93
Mask_t fMask
bit mask specifying which fields are valid
Definition: GuiTypes.h:110
Int_t fWinGravity
one of the window gravity values
Definition: GuiTypes.h:100
Int_t fBitGravity
one of bit gravity values
Definition: GuiTypes.h:99
auto * l
Definition: textangle.C:4