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 
27 A frame containing two scrollbars (a horizontal and
28 a vertical) and a viewport. The viewport acts as the window through
29 which we look at the contents of the container frame.
30 
31 \class TGContainer
32 \ingroup guiwidgets
33 
34 Manages a content area. It can display and
35 control a hierarchy of multi-column items, and provides the ability
36 to add new items at any time. By default it doesn't map subwindows
37 which are items of the container. In this case subwindow must
38 provide DrawCopy method, see for example TGLVEntry class.
39 It is also possible to use option which allow to map subwindows.
40 This option has much slower drawing speed in case of more than 1000
41 items placed in container. To activate this option the fMapSubwindows
42 data 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 
80 TGGC *TGContainer::fgLineGC = nullptr;
81 
83 const Int_t kAcceleration[kAutoScrollFudge+1] = {1,1,1,2,3,4,6,7,8,16,32};
84 const Int_t kKeyboardTime = 700;
85 
89 
90 
91 ////////////////////////////////////////////////////////////////////////////////
92 
93 class TGContainerKeyboardTimer : public TTimer {
94 private:
95  TGContainer *fContainer;
96 public:
97  TGContainerKeyboardTimer(TGContainer *t) : TTimer(kKeyboardTime) { fContainer = t; }
98  Bool_t Notify();
99 };
100 
101 ////////////////////////////////////////////////////////////////////////////////
102 /// single shot timer
103 
104 Bool_t TGContainerKeyboardTimer::Notify()
105 {
106  fContainer->SearchPattern();
107  Reset();
108  if (gSystem) gSystem->RemoveTimer(this);
109  return kFALSE;
110 }
111 
112 ////////////////////////////////////////////////////////////////////////////////
113 
114 class TGContainerScrollTimer : public TTimer {
115 private:
116  TGContainer *fContainer;
117 public:
118  TGContainerScrollTimer(TGContainer *t) : TTimer(50) { fContainer = t; }
119  Bool_t Notify();
120 };
121 
122 ////////////////////////////////////////////////////////////////////////////////
123 /// on-timeout
124 
125 Bool_t TGContainerScrollTimer::Notify()
126 {
127  fContainer->OnAutoScroll();
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 
144  SetWindowName();
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;
324  fDragging = kFALSE;
325  fTotal = fSelected = 0;
328  fLastActiveEl = 0;
329  fLastDir = kTRUE;
330  fLastCase = kTRUE;
332  fLastName = "";
336  fScrolling = kFALSE;
337  fCanvas = 0;
339 
340  gVirtualX->GrabButton(fId, kAnyButton, kAnyModifier,
343 
345  SetWindowName();
346 
347  SetWindowAttributes_t wattr;
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;
369  fCanvas->GetViewPort()->SetContainer(this);
370  p->GetViewPort()->SetBackgroundColor(back);
371 
372  fDragging = kFALSE;
373  fTotal = fSelected = 0;
376  fLastActiveEl = 0;
377  fLastDir = kTRUE;
378  fLastCase = kTRUE;
380  fLastName = "";
384  fScrolling = kFALSE;
386 
387  gVirtualX->GrabButton(fId, kAnyButton, kAnyModifier,
390 
392  SetWindowName();
393 
394  SetWindowAttributes_t wattr;
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 
470 void TGContainer::KeyPressed(TGFrame *frame, UInt_t keysym, UInt_t mask)
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  }
579  fSelected = fTotal;
581  fTotal, fSelected);
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 
605  fTotal, fSelected);
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 
633  fTotal, fSelected);
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 
681 const TGFrame *TGContainer::GetNextSelected(void **current)
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 
717  TGPosition pos = GetPagePosition();
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 
730  TGPosition pos = GetPagePosition();
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 
855  TGPosition pos = GetPagePosition();
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 {
876  fClient->NeedRedraw(el->fFrame);
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 
933  TGPosition pos = GetPagePosition();
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;
1019  fScrolling = 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 
1103  TGPosition pos = GetPagePosition();
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 
1145  TGPosition pos = GetPagePosition();
1146  TGDimension dim = GetPageDimension();
1147  Int_t x = pos.fX + event->fX;
1148  Int_t y = pos.fY + event->fY;
1149  TGFrameElement *el = 0;
1150  TGFrame *f = 0;
1151  fOnMouseOver = kFALSE;
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 {
1184  fScrolling = kFALSE;
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) {
1266  fScrollTimer->Reset();
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 
1425  caseSensitive = TGSearchDialog::SearchDialog()->GetType()->fCaseSensitive;
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);
1452  AdjustPosition();
1453  return fe->fFrame;
1454  }
1455  } else {
1457  ActivateItem(fe);
1458  AdjustPosition();
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 
1501  TGDimension dim = GetPageDimension();
1502  TGPosition pos = GetPagePosition();
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 
1542  fCanvas->SetHsbPosition(nx);
1543  fCanvas->SetVsbPosition(ny);
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);
1611  AdjustPosition();
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);
1645  AdjustPosition();
1646  }
1647  } else {
1649  ActivateItem(fe);
1650  AdjustPosition();
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 
1690 void *TGContainer::FindItem(const TString& name, Bool_t direction,
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;
1764  TGVScrollBar *vb = GetVScrollbar();
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;
1780  TGHScrollBar *hb = GetHScrollbar();
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 
1802  TGHScrollBar *hb = GetHScrollbar();
1803  TGVScrollBar *vb = GetVScrollbar();
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 
1816  SetVsbPosition(v);
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();
1821  SetVsbPosition(v);
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 
1837  SetHsbPosition(h);
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 
1843  SetHsbPosition(h);
1844  }
1845  }
1846 }
1847 
1848 ////////////////////////////////////////////////////////////////////////////////
1849 /// Move current position one column left.
1850 
1852 {
1853  TGPosition pos = GetPagePosition();
1854  TGDimension dim = GetPageDimension();
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 
1872  TGHScrollBar *hb = GetHScrollbar();
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);
1884  AdjustPosition();
1885 }
1886 
1887 ////////////////////////////////////////////////////////////////////////////////
1888 /// Move current position one column right.
1889 
1891 {
1892  TGPosition pos = GetPagePosition();
1893  TGDimension dim = GetPageDimension();
1894 
1896  if (!fe) return;
1897 
1899 
1900  if (old) DeActivateItem(old);
1902 
1907 
1908  Int_t hw = pos.fX + dim.fWidth - dx;
1909 
1910  TGHScrollBar *hb = GetHScrollbar();
1911  if (x >= hw && (hb && !hb->IsMapped())) { // move one line down
1912  x = 0;
1913  y = y + fLastActiveEl->fFrame->GetDefaultHeight() + dy;
1914  }
1915 
1916  fe = FindFrame(x, y);
1917  if (!fe) fe = (TGFrameElement*)fList->Last();
1918  if (!select) fSelected = 1;
1919 
1920  ActivateItem(fe);
1921  AdjustPosition();
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);
1950  AdjustPosition();
1951 }
1952 
1953 ////////////////////////////////////////////////////////////////////////////////
1954 /// Move one line down.
1955 
1957 {
1959  if (!fe) return;
1960 
1962 
1963  if (old) DeActivateItem(old);
1965 
1967  Int_t y = fLastActiveEl->fFrame->GetY() +
1968  fLastActiveEl->fFrame->GetHeight() + dy;
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);
1977  AdjustPosition();
1978 }
1979 
1980 ////////////////////////////////////////////////////////////////////////////////
1981 /// Move position one page up.
1982 
1984 {
1985  TGDimension dim = GetPageDimension();
1986 
1988  if (!fe) return;
1989 
1991 
1992  if (old) DeActivateItem(old);
1994 
1997 
1998  TGVScrollBar *vb = GetVScrollbar();
1999  TGHScrollBar *hb = GetHScrollbar();
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);
2021  AdjustPosition();
2022 }
2023 
2024 ////////////////////////////////////////////////////////////////////////////////
2025 /// Move position one page down.
2026 
2028 {
2029  TGDimension dim = GetPageDimension();
2030 
2031  TList *li = GetList();
2033  if (!fe) return;
2034 
2036 
2037  if (old) DeActivateItem(old);
2039 
2042 
2043  TGVScrollBar *vb = GetVScrollbar();
2044  TGHScrollBar *hb = GetHScrollbar();
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);
2065  AdjustPosition();
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);
2082  AdjustPosition();
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);
2099  AdjustPosition();
2100 }
2101 
2102 ////////////////////////////////////////////////////////////////////////////////
2103 /// Get graphics context for line drawing.
2104 
2106 {
2107  if (!fgLineGC) {
2108  GCValues_t gval;
2113  gval.fBackground = fgWhitePixel;
2114  gval.fFunction = kGXxor;
2115  gval.fLineWidth = 0;
2116  gval.fLineStyle = kLineOnOffDash;
2117  gval.fFillStyle = kFillSolid;
2119  gval.fGraphicsExposures = kFALSE;
2120  fgLineGC = gClient->GetGC(&gval, kTRUE);
2121  fgLineGC->SetDashOffset(0);
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();
2177  fVport->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 {
2206  switch (fOptions & (kSunkenFrame | kRaisedFrame | kDoubleBorder)) {
2207  case kSunkenFrame | kDoubleBorder:
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;
2257  ch -= fHScrollbar->GetDefaultHeight();
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;
2269  cw -= fVScrollbar->GetDefaultWidth();
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;
2284  ch -= fHScrollbar->GetDefaultHeight();
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) {
2329  fVScrollbar->SetRange((Int_t)container->GetHeight(), (Int_t)fVport->GetHeight());
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 {
2376  if (fHScrollbar && fHScrollbar->IsMapped())
2377  return fHScrollbar->GetPosition();
2378  return 0;
2379 }
2380 
2381 ////////////////////////////////////////////////////////////////////////////////
2382 /// Get position of vertical scrollbar.
2383 
2385 {
2386  if (fVScrollbar && fVScrollbar->IsMapped())
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();
2412  fVScrollbar->SetRange((Int_t)container->GetHeight(), (Int_t)fVport->GetHeight());
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 
2446 void TGCanvas::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
2447 {
2448  if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
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 
2473  TGContainer *cont = (TGContainer*)GetContainer();
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 
2490  if (fHScrollbar && fHScrollbar->IsMapped())
2491  out << " " << GetName() << "->SetHsbPosition(" << GetHsbPosition()
2492  << ");" << std::endl;
2493 
2494 
2495  if (fVScrollbar && fVScrollbar->IsMapped())
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 
2504 void TGContainer::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
2505 {
2506  if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
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 }
TGWindow::SetWindowName
virtual void SetWindowName(const char *name=0)
Set window name.
Definition: TGWindow.cxx:129
kKey_X
@ kKey_X
Definition: KeySymbols.h:149
TGContainer::LineUp
virtual void LineUp(Bool_t select=kFALSE)
Make current position first line in window by scrolling up.
Definition: TGCanvas.cxx:1927
kKey_Down
@ kKey_Down
Definition: KeySymbols.h:43
l
auto * l
Definition: textangle.C:4
Event_t::fType
EGEventType fType
of event (see EGEventType)
Definition: GuiTypes.h:175
TGContainer::fSelected
Int_t fSelected
number of selected items
Definition: TGCanvas.h:49
TGClient::GetDefaultRoot
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:236
TGCanvas::GetHsbPosition
virtual Int_t GetHsbPosition() const
Get position of horizontal scrollbar.
Definition: TGCanvas.cxx:2374
TGCanvas::ProcessMessage
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Handle message generated by the canvas scrollbars.
Definition: TGCanvas.cxx:2344
n
const Int_t n
Definition: legend1.C:16
Event_t::fState
UInt_t fState
key or button mask
Definition: GuiTypes.h:181
GET_MSG
Int_t GET_MSG(Long_t val)
Definition: WidgetMessageTypes.h:110
kDefaultScrollBarWidth
@ kDefaultScrollBarWidth
Definition: GuiTypes.h:86
TGContainer::DoRedraw
virtual void DoRedraw()
Redraw content of container in the viewport region.
Definition: TGCanvas.cxx:800
TGFrame::GetHeight
UInt_t GetHeight() const
Definition: TGFrame.h:225
kKey_E
@ kKey_E
Definition: KeySymbols.h:130
TGContainer::Clicked
virtual void Clicked(TGFrame *f, Int_t btn)
Emit Clicked() signal.
Definition: TGCanvas.cxx:510
TGVScrollBar::SetRange
virtual void SetRange(Int_t range, Int_t page_size)
Set range of vertical scrollbar.
Definition: TGScrollBar.cxx:892
kKey_Delete
@ kKey_Delete
Definition: KeySymbols.h:33
TQObject::Disconnect
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
TObject::SavePrimitive
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
Event_t::fY
Int_t fY
pointer x, y coordinates in event window
Definition: GuiTypes.h:178
SetWindowAttributes_t::fBitGravity
Int_t fBitGravity
one of bit gravity values
Definition: GuiTypes.h:99
Event_t::fX
Int_t fX
Definition: GuiTypes.h:178
TGFrameElement::fLayout
TGLayoutHints * fLayout
Definition: TGLayout.h:114
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
kSB_SLIDERPOS
@ kSB_SLIDERPOS
Definition: WidgetMessageTypes.h:47
TGPosition::fY
Int_t fY
y position
Definition: TGDimension.h:39
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
Pixmap_t
Handle_t Pixmap_t
Pixmap handle.
Definition: GuiTypes.h:30
kFixedWidth
@ kFixedWidth
Definition: GuiTypes.h:387
TGCompositeFrame::GetList
virtual TList * GetList() const
Definition: TGFrame.h:310
TGVScrollBar
The TGVScrollBar will generate the following event messages: kC_VSCROLL, kSB_SLIDERPOS,...
Definition: TGScrollBar.h:164
TGFrame::fgBlackPixel
static Pixel_t fgBlackPixel
Definition: TGFrame.h:104
kSB_SLIDERTRACK
@ kSB_SLIDERTRACK
Definition: WidgetMessageTypes.h:46
TGContainer::fCanvas
TGCanvas * fCanvas
pointer to canvas
Definition: TGCanvas.h:41
TGCompositeFrame::GetLayoutManager
virtual TGLayoutManager * GetLayoutManager() const
Definition: TGFrame.h:338
TGPicture
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition: TGPicture.h:25
kAnyModifier
const Mask_t kAnyModifier
Definition: GuiTypes.h:210
f
#define f(i)
Definition: RSha256.hxx:104
TGCanvas::kCanvasScrollBoth
@ kCanvasScrollBoth
Definition: TGCanvas.h:208
TGFrame::IsLayoutBroken
virtual Bool_t IsLayoutBroken() const
Definition: TGFrame.h:216
TGDimension
Definition: TGDimension.h:18
TGCanvas::fHScrollbar
TGHScrollBar * fHScrollbar
horizontal scrollbar
Definition: TGCanvas.h:196
TGFrame::SetBackgroundColor
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
Definition: TGFrame.cxx:312
Option_t
const char Option_t
Definition: RtypesCore.h:66
TMath::Max
Short_t Max(Short_t a, Short_t b)
Definition: TMathBase.h:212
TKeyMapFile.h
TGScrollBar::GetPageSize
virtual Int_t GetPageSize() const
Definition: TGScrollBar.h:114
TGViewPort::GetHPos
Int_t GetHPos() const
Definition: TGCanvas.h:184
TGDNDManager::SetDragPixmap
void SetDragPixmap(Pixmap_t pic, Pixmap_t mask, Int_t hot_x, Int_t hot_y)
Set drag window pixmaps and hotpoint.
Definition: TGDNDManager.cxx:892
TGPicture::GetWidth
UInt_t GetWidth() const
Definition: TGPicture.h:52
kPointerMotionMask
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:163
kNPOS
const Ssiz_t kNPOS
Definition: RtypesCore.h:124
kKey_F3
@ kKey_F3
Definition: KeySymbols.h:59
TGViewPort::TGViewPort
TGViewPort(const TGViewPort &)=delete
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
TGContainer::GetLineGC
static const TGGC & GetLineGC()
Get graphics context for line drawing.
Definition: TGCanvas.cxx:2105
kAnyButton
@ kAnyButton
Definition: GuiTypes.h:214
TSystem::RemoveTimer
virtual TTimer * RemoveTimer(TTimer *t)
Remove timer from list of system timers.
Definition: TSystem.cxx:483
TString::Data
const char * Data() const
Definition: TString.h:369
kKey_Up
@ kKey_Up
Definition: KeySymbols.h:41
TGContainer::fScrolling
Bool_t fScrolling
kTRUE - when scrolling is ON
Definition: TGCanvas.h:59
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGContainer::Home
virtual void Home(Bool_t select=kFALSE)
Move to upper-left corner of container.
Definition: TGCanvas.cxx:2071
EKeySym
EKeySym
Definition: KeySymbols.h:25
TGTextEditDialogs.h
TGDNDManager::StartDrag
Bool_t StartDrag(TGFrame *src, Int_t x_root, Int_t y_root, Window_t grabWin=kNone)
Start dragging.
Definition: TGDNDManager.cxx:904
TGRectangle::IsEmpty
Bool_t IsEmpty() const
Definition: TGDimension.h:124
kKey_ScrollLock
@ kKey_ScrollLock
Definition: KeySymbols.h:55
Event_t::fHeight
UInt_t fHeight
width and height of exposed area
Definition: GuiTypes.h:182
TGFrame::fWidth
UInt_t fWidth
frame width
Definition: TGFrame.h:87
TGContainer::FindFrame
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
kKey_Shift
@ kKey_Shift
Definition: KeySymbols.h:49
TGCanvas::GetContainer
TGFrame * GetContainer() const
Definition: TGCanvas.h:216
TGMsgBox
Definition: TGMsgBox.h:52
kAutoScrollFudge
const Int_t kAutoScrollFudge
Definition: TGCanvas.cxx:82
TObject::GetIconName
virtual const char * GetIconName() const
Returns mime type name of object.
Definition: TObject.cxx:369
TGViewPort::fY0
Int_t fY0
Definition: TGCanvas.h:161
TGViewPort::SetHPos
virtual void SetHPos(Int_t xpos)
Moves content of container frame in horizontal direction.
Definition: TGCanvas.cxx:178
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:893
TGPicture::GetMask
Pixmap_t GetMask() const
Definition: TGPicture.h:55
TGCanvas::ClearViewPort
virtual void ClearViewPort()
Clear view port and redraw content.
Definition: TGCanvas.cxx:2434
TString::kIgnoreCase
@ kIgnoreCase
Definition: TString.h:268
TGScrollBar::MoveResize
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
TGSearchType::fBuffer
char * fBuffer
Definition: TGTextEditDialogs.h:23
TGFrame::GetDefaultHeight
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:191
kButton4
@ kButton4
Definition: GuiTypes.h:215
GCValues_t
Graphics context structure.
Definition: GuiTypes.h:224
TGContainer::CurrentChanged
virtual void CurrentChanged(Int_t x, Int_t y)
Emit signal when current position changed.
Definition: TGCanvas.cxx:434
TGWindow::kEditDisable
@ kEditDisable
disable edit of this window
Definition: TGWindow.h:50
TGContainer::GetObjPicture
const TGPicture * GetObjPicture(TGFrame *f)
Retrieve icons associated with class "name".
Definition: TGCanvas.cxx:1039
TGFrame::fOptions
UInt_t fOptions
frame options
Definition: TGFrame.h:94
TGLayoutHints::GetPadBottom
Int_t GetPadBottom() const
Definition: TGLayout.h:84
kKey_B
@ kKey_B
Definition: KeySymbols.h:127
TGFrame::DrawCopy
virtual void DrawCopy(Handle_t, Int_t, Int_t)
Definition: TGFrame.h:209
gTQSender
R__EXTERN void * gTQSender
Definition: TQObject.h:44
kKey_NumLock
@ kKey_NumLock
Definition: KeySymbols.h:54
kKey_F
@ kKey_F
Definition: KeySymbols.h:131
TGLVEntry
Definition: TGListView.h:36
kFillSolid
@ kFillSolid
Definition: GuiTypes.h:51
Int_t
int Int_t
Definition: RtypesCore.h:45
TGCanvas::GetHScrollbar
TGHScrollBar * GetHScrollbar() const
Definition: TGCanvas.h:218
TGContainer::OnAutoScroll
virtual void OnAutoScroll()
Autoscroll while close to & beyond The Wall.
Definition: TGCanvas.cxx:1495
TGRectangle::fY
Int_t fY
y position
Definition: TGDimension.h:92
TGVScrollBar::SetPosition
virtual void SetPosition(Int_t pos)
Set logical slider position of vertical scrollbar.
Definition: TGScrollBar.cxx:927
TGSearchDialog::SearchDialog
static TGSearchDialog *& SearchDialog()
Return global search dialog.
Definition: TGTextEditDialogs.cxx:303
GCValues_t::fFillStyle
Int_t fFillStyle
kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled
Definition: GuiTypes.h:234
TString::Contains
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
kCT_SELCHANGED
@ kCT_SELCHANGED
Definition: WidgetMessageTypes.h:56
TGContainer::GetPageDimension
virtual TGDimension GetPageDimension() const
Returns page dimension.
Definition: TGCanvas.cxx:751
x
Double_t x[n]
Definition: legend1.C:17
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
TGCanvas::Layout
virtual void Layout()
Create layout for canvas.
Definition: TGCanvas.cxx:2229
TGMimeTypes.h
kKeyboardTime
const Int_t kKeyboardTime
Definition: TGCanvas.cxx:84
TString::kExact
@ kExact
Definition: TString.h:268
TClass.h
TGFrame::fgWhitePixel
static Pixel_t fgWhitePixel
Definition: TGFrame.h:103
TList.h
TGLayoutHints::GetPadLeft
Int_t GetPadLeft() const
Definition: TGLayout.h:85
TList::Last
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Definition: TList.cxx:693
kButton1
@ kButton1
Definition: GuiTypes.h:214
TGSelectedPicture
Definition: TGPicture.h:67
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
TGCanvas::GetVScrollbar
TGVScrollBar * GetVScrollbar() const
Definition: TGCanvas.h:219
TVirtualX.h
TKeyMapFile
Utility class for browsing TMapFile objects.
Definition: TKeyMapFile.h:20
TGContainer::End
virtual void End(Bool_t select=kFALSE)
Move to the bottom-right corner of container.
Definition: TGCanvas.cxx:2088
TMath::Abs
Short_t Abs(Short_t d)
Definition: TMathBase.h:120
TGWindow::GetEditDisabled
virtual UInt_t GetEditDisabled() const
Definition: TGWindow.h:105
Event_t::fUser
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
TGContainer::fLastName
TString fLastName
the name of object of last search
Definition: TGCanvas.h:55
TTimer.h
TObject::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TObject.cxx:403
kKey_Home
@ kKey_Home
Definition: KeySymbols.h:38
TGContainer::SavePrimitive
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
TGContainer::PageUp
virtual void PageUp(Bool_t select=kFALSE)
Move position one page up.
Definition: TGCanvas.cxx:1983
TGDNDManager.h
TGFrame::GetBlackGC
static const TGGC & GetBlackGC()
Get black graphics context.
Definition: TGFrame.cxx:735
TString
Basic string class.
Definition: TString.h:136
TGGC::SetDashOffset
void SetDashOffset(Int_t v)
Patterned/dashed line offset.
Definition: TGGC.cxx:477
TGFrame::DrawBorder
virtual void DrawBorder()
Draw frame border.
Definition: TGFrame.cxx:421
TGFrame
Definition: TGFrame.h:80
TGContainer::fExposedRegion
TGRectangle fExposedRegion
exposed area
Definition: TGCanvas.h:62
kButtonPressMask
const Mask_t kButtonPressMask
Definition: GuiTypes.h:161
SetWindowAttributes_t::fMask
Mask_t fMask
bit mask specifying which fields are valid
Definition: GuiTypes.h:110
TGFrame::MapSubwindows
virtual void MapSubwindows()
map sub windows
Definition: TGFrame.h:200
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TGObject::GetId
Handle_t GetId() const
Definition: TGObject.h:37
kC_VSCROLL
@ kC_VSCROLL
Definition: WidgetMessageTypes.h:41
TGCanvas::GetVsbPosition
virtual Int_t GetVsbPosition() const
Get position of vertical scrollbar.
Definition: TGCanvas.cxx:2384
kDoubleBorder
@ kDoubleBorder
Definition: GuiTypes.h:385
kCT_ITEMDBLCLICK
@ kCT_ITEMDBLCLICK
Definition: WidgetMessageTypes.h:55
TGWindow::HandleExpose
virtual Bool_t HandleExpose(Event_t *event)
Definition: TGWindow.h:94
TObject::InheritsFrom
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:445
TGFrame::SetHeight
virtual void SetHeight(UInt_t h)
Definition: TGFrame.h:247
v
@ v
Definition: rootcling_impl.cxx:3664
kOwnBackground
@ kOwnBackground
Definition: GuiTypes.h:391
TSystem::AddTimer
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
Definition: TSystem.cxx:473
TGCanvas::SetVsbPosition
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
Definition: TGCanvas.cxx:2408
kKey_Y
@ kKey_Y
Definition: KeySymbols.h:150
TGFrame::MapWindow
virtual void MapWindow()
map window
Definition: TGFrame.h:204
TGLayoutManager::IsModified
virtual Bool_t IsModified() const
Definition: TGLayout.h:146
bool
kGCLineStyle
const Mask_t kGCLineStyle
Definition: GuiTypes.h:291
TString::ReplaceAll
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
TGScrollBar::MapSubwindows
virtual void MapSubwindows()
map sub windows
Definition: TGScrollBar.h:124
TGFrame::GetWidth
UInt_t GetWidth() const
Definition: TGFrame.h:224
TGContainer::fYp
Int_t fYp
previous pointer position
Definition: TGCanvas.h:44
TGCompositeFrame::fList
TList * fList
container of frame elements
Definition: TGFrame.h:292
TGContainer::LineDown
virtual void LineDown(Bool_t select=kFALSE)
Move one line down.
Definition: TGCanvas.cxx:1956
kKey_G
@ kKey_G
Definition: KeySymbols.h:132
TGContainer::AdjustPosition
virtual void AdjustPosition()
Move content to position of highlighted/activated frame.
Definition: TGCanvas.cxx:1793
TGWindow::kEditDisableBtnEnable
@ kEditDisableBtnEnable
window can handle mouse button events
Definition: TGWindow.h:57
TGFrameElement::fFrame
TGFrame * fFrame
Definition: TGLayout.h:112
kKey_Right
@ kKey_Right
Definition: KeySymbols.h:42
TGFrame::GetOptionString
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2480
TGLayoutManager
Frame layout manager.
Definition: TGLayout.h:135
kWABitGravity
const Mask_t kWABitGravity
Definition: GuiTypes.h:144
TGFrame::GetOptions
virtual UInt_t GetOptions() const
Definition: TGFrame.h:197
kCT_KEY
@ kCT_KEY
Definition: WidgetMessageTypes.h:57
TGLayoutHints::GetPadTop
Int_t GetPadTop() const
Definition: TGLayout.h:83
TGCanvas::DrawBorder
virtual void DrawBorder()
Draw canvas border.
Definition: TGCanvas.cxx:2204
TGWindow::DestroyWindow
virtual void DestroyWindow()
destroy window
Definition: TGWindow.cxx:192
GContext_t
Handle_t GContext_t
Graphics context handle.
Definition: GuiTypes.h:38
TGContainer::RemoveItem
virtual void RemoveItem(TGFrame *item)
Remove item from container.
Definition: TGCanvas.cxx:660
TGContainer::fYDND
Int_t fYDND
Definition: TGCanvas.h:60
TGCanvas::fScrolling
Int_t fScrolling
flag which scrolling modes are allowed
Definition: TGCanvas.h:198
kAcceleration
const Int_t kAcceleration[kAutoScrollFudge+1]
Definition: TGCanvas.cxx:83
gClient
#define gClient
Definition: TGClient.h:157
TGContainer::SelectAll
virtual void SelectAll()
Select all items in the container.
Definition: TGCanvas.cxx:567
TGContainer::fMsgWindow
const TGWindow * fMsgWindow
window handling container messages
Definition: TGCanvas.h:42
TList::First
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Definition: TList.cxx:659
TObject::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:359
TGHScrollBar::SetRange
virtual void SetRange(Int_t range, Int_t page_size)
Set range of horizontal scrollbar.
Definition: TGScrollBar.cxx:632
total
static unsigned int total
Definition: TGWin32ProxyDefs.h:40
GCValues_t::fSubwindowMode
Int_t fSubwindowMode
kClipByChildren, kIncludeInferiors
Definition: GuiTypes.h:243
TGContainer::OnMouseOver
virtual void OnMouseOver(TGFrame *)
Signal emitted when pointer is over entry.
Definition: TGCanvas.cxx:501
TGContainer::HandleExpose
virtual Bool_t HandleExpose(Event_t *event)
Handle expose events. Do not use double buffer.
Definition: TGCanvas.cxx:903
TGRectangle
Definition: TGDimension.h:89
TGFrame::AddInput
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:339
kNone
const Handle_t kNone
Definition: GuiTypes.h:88
TGFrame::GetHilightGC
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition: TGFrame.cxx:755
TList::After
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
Definition: TList.cxx:330
TGContainer::GetVScrollbar
virtual TGVScrollBar * GetVScrollbar() const
returns pointer to vert. scroll bar
Definition: TGCanvas.cxx:1753
TString::ECaseCompare
ECaseCompare
Definition: TString.h:268
TGContainer::fY0
Int_t fY0
corner of rubber band box
Definition: TGCanvas.h:45
TGScrollBar::GetPosition
virtual Int_t GetPosition() const
Definition: TGScrollBar.h:113
TGDNDManager::GetDNDActionCopy
static Atom_t GetDNDActionCopy()
Definition: TGDNDManager.cxx:283
TTimer
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
TGContainer::GetPagePosition
virtual TGPosition GetPagePosition() const
Returns page position.
Definition: TGCanvas.cxx:737
TGCanvas::SetScrolling
void SetScrolling(Int_t scrolling)
Set scrolling policy.
Definition: TGCanvas.cxx:2423
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TGContainer::HandleDoubleClick
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click mouse event.
Definition: TGCanvas.cxx:1098
TGViewPort::fContainer
TGFrame * fContainer
Definition: TGCanvas.h:162
kLineOnOffDash
@ kLineOnOffDash
Definition: GuiTypes.h:48
TGContainer::GetHScrollbar
virtual TGHScrollBar * GetHScrollbar() const
returns pointer to hor. scroll bar
Definition: TGCanvas.cxx:1745
TGContainer::fKeyTimer
TTimer * fKeyTimer
keyboard timer
Definition: TGCanvas.h:56
TGContainer::Search
virtual void Search(Bool_t close=kTRUE)
Invokes search dialog. Looks for item with the entered name.
Definition: TGCanvas.cxx:1467
kKey_A
@ kKey_A
Definition: KeySymbols.h:126
TList::FirstLink
virtual TObjLink * FirstLink() const
Definition: TList.h:108
kFixedHeight
@ kFixedHeight
Definition: GuiTypes.h:389
TGWindow::kEditDisableGrab
@ kEditDisableGrab
window grab cannot be edited
Definition: TGWindow.h:52
TGContainer::~TGContainer
virtual ~TGContainer()
Delete canvas container.
Definition: TGCanvas.cxx:406
TSystem.h
TGPosition::fX
Int_t fX
x position
Definition: TGDimension.h:38
kKey_D
@ kKey_D
Definition: KeySymbols.h:129
kGCFillStyle
const Mask_t kGCFillStyle
Definition: GuiTypes.h:294
TGDimension::fHeight
UInt_t fHeight
Definition: TGDimension.h:21
TGCanvas::kCanvasScrollVertical
@ kCanvasScrollVertical
Definition: TGCanvas.h:207
SetWindowAttributes_t::fWinGravity
Int_t fWinGravity
one of the window gravity values
Definition: GuiTypes.h:100
h
#define h(i)
Definition: RSha256.hxx:106
kGKeyPress
@ kGKeyPress
Definition: GuiTypes.h:60
TGContainer::SetHsbPosition
virtual void SetHsbPosition(Int_t newPos)
set new hor. position
Definition: TGCanvas.cxx:1777
TGContainer::Layout
virtual void Layout()
Layout container entries.
Definition: TGCanvas.cxx:422
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:336
TGViewPort::SetVPos
virtual void SetVPos(Int_t ypos)
Moves content of container frame in vertical direction.
Definition: TGCanvas.cxx:229
TGCanvas::fVScrollbar
TGVScrollBar * fVScrollbar
vertical scrollbar
Definition: TGCanvas.h:197
TGCompositeFrame::MapSubwindows
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Definition: TGFrame.cxx:1164
TGContainer::fLastActiveEl
TGFrameElement * fLastActiveEl
last active item
Definition: TGCanvas.h:43
TGGC
Encapsulate a graphics context used in the low level graphics.
Definition: TGGC.h:22
TList::Before
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
Definition: TList.cxx:371
TGContainer::fKeyTimerActive
Bool_t fKeyTimerActive
kTRUE - keyboard timer is active
Definition: TGCanvas.h:58
TGWidget::Associate
virtual void Associate(const TGWindow *w)
Definition: TGWidget.h:72
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:605
TGHScrollBar
The TGHScrollBar will generate the following event messages: kC_HSCROLL, kSB_SLIDERPOS,...
Definition: TGScrollBar.h:141
TGHScrollBar::SetPosition
virtual void SetPosition(Int_t pos)
Set logical slider position of horizontal scrollbar.
Definition: TGScrollBar.cxx:665
TGContainer::fXp
Int_t fXp
Definition: TGCanvas.h:44
TGObject::fId
Handle_t fId
X11/Win32 Window identifier.
Definition: TGObject.h:26
kKey_Control
@ kKey_Control
Definition: KeySymbols.h:50
TGContainer::fXDND
Int_t fXDND
Definition: TGCanvas.h:60
kMBIconExclamation
@ kMBIconExclamation
Definition: TGMsgBox.h:24
kGCFunction
const Mask_t kGCFunction
Definition: GuiTypes.h:286
Event_t::fCode
UInt_t fCode
key or button code
Definition: GuiTypes.h:180
kKey_Meta
@ kKey_Meta
Definition: KeySymbols.h:51
TGDNDManager::IsDragging
Bool_t IsDragging() const
Definition: TGDNDManager.h:173
TGFrame::SendMessage
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:645
kWAWinGravity
const Mask_t kWAWinGravity
Definition: GuiTypes.h:145
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
kKey_PageUp
@ kKey_PageUp
Definition: KeySymbols.h:45
GCValues_t::fLineStyle
Int_t fLineStyle
kLineSolid, kLineOnOffDash, kLineDoubleDash
Definition: GuiTypes.h:230
kKey_C
@ kKey_C
Definition: KeySymbols.h:128
kGCForeground
const Mask_t kGCForeground
Definition: GuiTypes.h:288
Event_t::fWidth
UInt_t fWidth
Definition: GuiTypes.h:182
TGFrame::fBorderWidth
Int_t fBorderWidth
frame border width
Definition: TGFrame.h:93
kButtonPress
@ kButtonPress
Definition: GuiTypes.h:60
Long_t
long Long_t
Definition: RtypesCore.h:54
kGCGraphicsExposures
const Mask_t kGCGraphicsExposures
Definition: GuiTypes.h:302
kButtonReleaseMask
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:162
TGDimension::fWidth
UInt_t fWidth
Definition: TGDimension.h:20
kButtonRelease
@ kButtonRelease
Definition: GuiTypes.h:60
TGContainer::fScrollTimer
TTimer * fScrollTimer
autoscroll timer
Definition: TGCanvas.h:50
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
TGRectangle::fX
Int_t fX
x position
Definition: TGDimension.h:91
TGSearchType::fClose
Bool_t fClose
Definition: TGTextEditDialogs.h:24
TGContainer::HandleKey
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
TGFrame::SaveUserColor
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition: TGFrame.cxx:2453
TGCanvas::SavePrimitive
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
TGLayoutHints::GetPadRight
Int_t GetPadRight() const
Definition: TGLayout.h:86
TGFrame::MapRaised
virtual void MapRaised()
map raised
Definition: TGFrame.h:205
TGContainer::TGContainerScrollTimer
friend class TGContainerScrollTimer
Definition: TGCanvas.h:36
kKey_F7
@ kKey_F7
Definition: KeySymbols.h:63
TGCanvas::fVport
TGViewPort * fVport
viewport through which we look at contents
Definition: TGCanvas.h:195
kC_CONTAINER
@ kC_CONTAINER
Definition: WidgetMessageTypes.h:53
kKey_U
@ kKey_U
Definition: KeySymbols.h:146
TGClient::GetPicture
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:291
TGContainer::FindItem
virtual void * FindItem(const TString &name, Bool_t direction=kTRUE, Bool_t caseSensitive=kTRUE, Bool_t subString=kFALSE)
Definition: TGCanvas.cxx:1690
GCValues_t::fBackground
ULong_t fBackground
background pixel
Definition: GuiTypes.h:228
TGViewPort
Definition: TGCanvas.h:158
kGCLineWidth
const Mask_t kGCLineWidth
Definition: GuiTypes.h:290
TGSearchDialog::GetType
virtual TGSearchType * GetType() const
Definition: TGTextEditDialogs.h:70
TGContainer::InvertSelection
virtual void InvertSelection()
Invert the selection, all selected items become unselected and vice versa.
Definition: TGCanvas.cxx:614
Window_t
Handle_t Window_t
Window handle.
Definition: GuiTypes.h:29
UInt_t
unsigned int UInt_t
Definition: RtypesCore.h:46
TString::BeginsWith
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition: TString.h:615
TGContainer::ClearViewPort
virtual void ClearViewPort()
Clear view port and redraw full content.
Definition: TGCanvas.cxx:891
TClass::GetClass
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:2946
TGContainer::GetCanvas
TGCanvas * GetCanvas() const
Definition: TGCanvas.h:99
y
Double_t y[n]
Definition: legend1.C:17
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
TGContainer::SpacePressed
virtual void SpacePressed(TGFrame *)
Signal emitted when space key pressed.
Definition: TGCanvas.cxx:493
kKey_K
@ kKey_K
Definition: KeySymbols.h:136
TGGC::SetDashList
void SetDashList(const char v[], Int_t len)
Set dash pattern. First use SetDashOffset() if not 0.
Definition: TGGC.cxx:488
TGFrame::IsActive
virtual Bool_t IsActive() const
Definition: TGFrame.h:211
GCValues_t::fGraphicsExposures
Bool_t fGraphicsExposures
boolean, should exposures be generated
Definition: GuiTypes.h:244
KeySymbols.h
Event_t::fXRoot
Int_t fXRoot
Definition: GuiTypes.h:179
TGContainer::fX0
Int_t fX0
Definition: TGCanvas.h:45
TGContainer::fLastCase
Bool_t fLastCase
case sensitivity of last search
Definition: TGCanvas.h:53
kGCBackground
const Mask_t kGCBackground
Definition: GuiTypes.h:289
kKey_Alt
@ kKey_Alt
Definition: KeySymbols.h:52
TGFrame::GetX
Int_t GetX() const
Definition: TGFrame.h:231
TGContainer::DrawRegion
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
TGContainer::fXf
Int_t fXf
Definition: TGCanvas.h:46
TGCompositeFrame::RemoveFrame
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Definition: TGFrame.cxx:1149
TGFrame::GetBckgndGC
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition: TGFrame.cxx:775
kKey_F5
@ kKey_F5
Definition: KeySymbols.h:61
Event_t::fWindow
Window_t fWindow
window reported event is relative to
Definition: GuiTypes.h:176
TGContainer::DoubleClicked
virtual void DoubleClicked(TGFrame *f, Int_t btn)
Emit DoubleClicked() signal.
Definition: TGCanvas.cxx:538
TGContainer::fKeyInput
TString fKeyInput
keyboard input (buffer)
Definition: TGCanvas.h:57
kPointer
@ kPointer
Definition: GuiTypes.h:375
kKeyPressMask
const Mask_t kKeyPressMask
Definition: GuiTypes.h:159
gDNDManager
R__EXTERN TGDNDManager * gDNDManager
Definition: TGDNDManager.h:201
Event_t::fYRoot
Int_t fYRoot
coordinates relative to root
Definition: GuiTypes.h:179
kRaisedFrame
@ kRaisedFrame
Definition: GuiTypes.h:384
kKey_H
@ kKey_H
Definition: KeySymbols.h:133
TMath::Min
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:180
TGContainer::FindFrameByName
virtual TGFrame * FindFrameByName(const char *name)
Find frame by name.
Definition: TGCanvas.cxx:1416
kHand
@ kHand
Definition: GuiTypes.h:374
unsigned int
kMBOk
@ kMBOk
Definition: TGMsgBox.h:33
TGClient::GetMimeTypeList
TGMimeTypes * GetMimeTypeList() const
Definition: TGClient.h:146
TGRectangle::fW
UInt_t fW
width
Definition: TGDimension.h:93
TString::Index
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:639
kKey_Return
@ kKey_Return
Definition: KeySymbols.h:30
TGViewPort::GetContainer
TGFrame * GetContainer() const
Definition: TGCanvas.h:173
ROOT::Math::detail::close
@ close
Definition: GenVectorIO.h:35
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TKey
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Definition: TKey.h:28
kKeyControlMask
const Mask_t kKeyControlMask
Definition: GuiTypes.h:197
TGContainer::UnSelectAll
virtual void UnSelectAll()
Unselect all items in the container.
Definition: TGCanvas.cxx:589
TGContainer::GetMessageWindow
const TGWindow * GetMessageWindow() const
Definition: TGCanvas.h:100
kKey_Left
@ kKey_Left
Definition: KeySymbols.h:40
TGCompositeFrame::fMapSubwindows
Bool_t fMapSubwindows
kTRUE - map subwindows
Definition: TGFrame.h:295
TGWindow::GetParent
const TGWindow * GetParent() const
Definition: TGWindow.h:76
kKey_Enter
@ kKey_Enter
Definition: KeySymbols.h:31
TGContainer::SetDragPixmap
virtual void SetDragPixmap(const TGPicture *pic)
Set drag window pixmaps and hotpoint.
Definition: TGCanvas.cxx:1080
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:374
TQObject::Connect
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
TGFrame::IsDNDSource
Bool_t IsDNDSource() const
Definition: TGFrame.h:272
TGContainer
Manages a content area.
Definition: TGCanvas.h:31
TGContainer::LineRight
virtual void LineRight(Bool_t select=kFALSE)
Move current position one column right.
Definition: TGCanvas.cxx:1890
TGSearchType::fCaseSensitive
Bool_t fCaseSensitive
Definition: TGTextEditDialogs.h:22
TGFrame::UnmapWindow
virtual void UnmapWindow()
unmap window
Definition: TGFrame.h:206
TGContainer::SetPagePosition
virtual void SetPagePosition(const TGPosition &pos)
Set page position.
Definition: TGCanvas.cxx:764
TGFrame::SetWidth
virtual void SetWidth(UInt_t w)
Definition: TGFrame.h:246
TList::Remove
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:822
TGMsgBox.h
GCValues_t::fMask
Mask_t fMask
bit mask specifying which fields are valid
Definition: GuiTypes.h:251
TGObject::fClient
TGClient * fClient
Connection to display server.
Definition: TGObject.h:27
TGFrame::MoveResize
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
TGCanvas::kCanvasScrollHorizontal
@ kCanvasScrollHorizontal
Definition: TGCanvas.h:206
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TGPicture::GetPicture
Pixmap_t GetPicture() const
Definition: TGPicture.h:54
TGContainer::fLastDir
Bool_t fLastDir
direction of last search
Definition: TGCanvas.h:52
TGFrame::Move
virtual void Move(Int_t x, Int_t y)
Move frame.
Definition: TGFrame.cxx:593
TGCanvas::SetHsbPosition
virtual void SetHsbPosition(Int_t newPos)
Set position of horizontal scrollbar.
Definition: TGCanvas.cxx:2394
Event_t::fTime
Time_t fTime
time event event occurred in ms
Definition: GuiTypes.h:177
TGContainer::DeActivateItem
virtual void DeActivateItem(TGFrameElement *el)
DeActivate item.
Definition: TGCanvas.cxx:724
TGContainer::TGContainerKeyboardTimer
friend class TGContainerKeyboardTimer
Definition: TGCanvas.h:35
kKey_Backspace
@ kKey_Backspace
Definition: KeySymbols.h:29
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TGWindow::SetEditDisabled
virtual void SetEditDisabled(UInt_t on=kEditDisable)
Definition: TGWindow.h:106
kKey_Space
@ kKey_Space
Definition: KeySymbols.h:93
TGFrame::HandleConfigureNotify
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
Definition: TGFrame.cxx:443
TGContainer::ActivateItem
virtual void ActivateItem(TGFrameElement *el)
Activate item.
Definition: TGCanvas.cxx:701
GCValues_t::fFunction
EGraphicsFunction fFunction
logical operation
Definition: GuiTypes.h:225
Event_t
Event structure.
Definition: GuiTypes.h:174
GET_SUBMSG
Int_t GET_SUBMSG(Long_t val)
Definition: WidgetMessageTypes.h:111
name
char name[80]
Definition: TGX11.cxx:110
GCValues_t::fForeground
ULong_t fForeground
foreground pixel
Definition: GuiTypes.h:227
TTimer::Notify
virtual Bool_t Notify()
Notify when timer times out.
Definition: TTimer.cxx:143
kButton5
@ kButton5
Definition: GuiTypes.h:215
TGCanvas.h
TGContainer::fDragging
Bool_t fDragging
true if in dragging mode
Definition: TGCanvas.h:47
TGContainer::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion events.
Definition: TGCanvas.cxx:1141
TGFrameElement
Definition: TGLayout.h:105
d
#define d(i)
Definition: RSha256.hxx:102
TGFrame::GetY
Int_t GetY() const
Definition: TGFrame.h:232
TGFrame::GetShadowGC
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition: TGFrame.cxx:765
TGContainer::fgLineGC
static TGGC * fgLineGC
Definition: TGCanvas.h:64
TGContainer::fViewPort
TGViewPort * fViewPort
container viewport
Definition: TGCanvas.h:40
kKey_End
@ kKey_End
Definition: KeySymbols.h:39
TGCanvas::TGCanvas
TGCanvas(const TGCanvas &)=delete
TGContainer::TGContainer
TGContainer(const TGContainer &)=delete
TIter
Definition: TCollection.h:233
kC_HSCROLL
@ kC_HSCROLL
Definition: WidgetMessageTypes.h:40
kCT_ITEMCLICK
@ kCT_ITEMCLICK
Definition: WidgetMessageTypes.h:54
TGResourcePool.h
TGSearchType::fDirection
Bool_t fDirection
Definition: TGTextEditDialogs.h:21
TGContainer::RepeatSearch
virtual void RepeatSearch()
Repeats search.
Definition: TGCanvas.cxx:1623
kStructureNotifyMask
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:166
kKey_CapsLock
@ kKey_CapsLock
Definition: KeySymbols.h:53
TGContainer::fLastSubstring
Bool_t fLastSubstring
substring search option of last search
Definition: TGCanvas.h:54
TGContainer::PageDown
virtual void PageDown(Bool_t select=kFALSE)
Move position one page down.
Definition: TGCanvas.cxx:2027
TGCanvas::AddFrame
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
TGFrame::GetWhiteGC
static const TGGC & GetWhiteGC()
Get white graphics context.
Definition: TGFrame.cxx:745
TGRectangle::Empty
void Empty()
Definition: TGDimension.h:123
TGFrame::fHeight
UInt_t fHeight
frame height
Definition: TGFrame.h:88
TGFrame::fBackground
Pixel_t fBackground
frame background color
Definition: TGFrame.h:95
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
TGViewPort::fX0
Int_t fX0
Definition: TGCanvas.h:161
TGContainer::SetVsbPosition
virtual void SetVsbPosition(Int_t newPos)
Set position of vertical scrollbar.
Definition: TGCanvas.cxx:1761
TGFrame::Activate
virtual void Activate(Bool_t)
Definition: TGFrame.h:210
TGWindow::fEditDisabled
UInt_t fEditDisabled
flags used for "guibuilding"
Definition: TGWindow.h:32
TKey.h
TGDNDManager::Drag
Bool_t Drag(Int_t x_root, Int_t y_root, Atom_t action, Time_t timestamp)
Process drag event.
Definition: TGDNDManager.cxx:993
TGSearchDialog
Definition: TGTextEditDialogs.h:38
kIncludeInferiors
@ kIncludeInferiors
Definition: GuiTypes.h:53
TGCanvas::GetViewPort
TGViewPort * GetViewPort() const
Definition: TGCanvas.h:217
Class
void Class()
Definition: Class.C:29
TGViewPort::SetPos
void SetPos(Int_t xpos, Int_t ypos)
Goto new position.
Definition: TGCanvas.cxx:281
TGViewPort::HandleConfigureNotify
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handle resize events.
Definition: TGCanvas.cxx:292
TGViewPort::SetContainer
void SetContainer(TGFrame *f)
Add container frame to the viewport.
Definition: TGCanvas.cxx:153
TGPosition
Definition: TGDimension.h:36
TGContainer::KeyPressed
virtual void KeyPressed(TGFrame *, UInt_t keysym, UInt_t mask)
Signal emitted when keyboard key pressed.
Definition: TGCanvas.cxx:470
TGListView.h
TGCompositeFrame
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
TGCanvas
A frame containing two scrollbars (a horizontal and a vertical) and a viewport.
Definition: TGCanvas.h:192
TTimer::Reset
void Reset()
Reset the timer.
Definition: TTimer.cxx:157
TGPicture::GetHeight
UInt_t GetHeight() const
Definition: TGPicture.h:53
TGContainer::RemoveAll
virtual void RemoveAll()
Remove all items from the container.
Definition: TGCanvas.cxx:641
TGContainer::fTotal
Int_t fTotal
total items
Definition: TGCanvas.h:48
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
TGFrame::GetDefaultWidth
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:190
TObject::IsFolder
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: TObject.cxx:475
TGScrollBar.h
TGCompositeFrame::Layout
virtual void Layout()
Layout the elements of the composite frame.
Definition: TGFrame.cxx:1257
kKey_PageDown
@ kKey_PageDown
Definition: KeySymbols.h:47
TGViewPort::GetVPos
Int_t GetVPos() const
Definition: TGCanvas.h:185
TGContainer::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in container.
Definition: TGCanvas.cxx:929
TGRectangle::fH
UInt_t fH
height
Definition: TGDimension.h:94
MK_MSG
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Definition: WidgetMessageTypes.h:108
TGContainer::ReturnPressed
virtual void ReturnPressed(TGFrame *)
Signal emitted when Return/Enter key pressed.
Definition: TGCanvas.cxx:484
TGWindow::fParent
const TGWindow * fParent
Parent window.
Definition: TGWindow.h:28
TGMimeTypes::GetIcon
const TGPicture * GetIcon(const char *filename, Bool_t small_icon)
Return icon belonging to mime type of filename.
Definition: TGMimeTypes.cxx:203
TGContainer::fOnMouseOver
Bool_t fOnMouseOver
kTRUE when mouse pointer is over entry
Definition: TGCanvas.h:51
kKeyShiftMask
const Mask_t kKeyShiftMask
Definition: GuiTypes.h:195
TGContainer::SetPageDimension
virtual void SetPageDimension(const TGDimension &dim)
Set page dimension.
Definition: TGCanvas.cxx:782
TGContainer::SearchPattern
virtual void SearchPattern()
Search for entry which name begins with pattern.
Definition: TGCanvas.cxx:1597
TList
A doubly linked list.
Definition: TList.h:44
TGContainer::fYf
Int_t fYf
other corner of rubber band box
Definition: TGCanvas.h:46
TGRectangle::Merge
void Merge(const TGRectangle &r)
Definition: TGDimension.cxx:49
kGXxor
@ kGXxor
src XOR dst
Definition: GuiTypes.h:74
TQObject::Emit
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
TGCanvas::~TGCanvas
virtual ~TGCanvas()
Delete canvas.
Definition: TGCanvas.cxx:2155
TGCanvas::MapSubwindows
virtual void MapSubwindows()
Map all canvas sub windows.
Definition: TGCanvas.cxx:2165
kKey_V
@ kKey_V
Definition: KeySymbols.h:147
TGSearchType
Definition: TGTextEditDialogs.h:19
GCValues_t::fLineWidth
Int_t fLineWidth
line width
Definition: GuiTypes.h:229
kChildFrame
@ kChildFrame
Definition: GuiTypes.h:379
int
TGContainer::LineLeft
virtual void LineLeft(Bool_t select=kFALSE)
Move current position one column left.
Definition: TGCanvas.cxx:1851
SetWindowAttributes_t
Attributes that can be used when creating or changing a window.
Definition: GuiTypes.h:93
kGCSubwindowMode
const Mask_t kGCSubwindowMode
Definition: GuiTypes.h:301
TGContainer::fBdown
Bool_t fBdown
Definition: TGCanvas.h:61
TGContainer::GetNextSelected
virtual const TGFrame * GetNextSelected(void **current)
Return the next selected item.
Definition: TGCanvas.cxx:681
TGWindow::IsMapped
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
Definition: TGWindow.cxx:295