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