Logo ROOT  
Reference Guide
TGScrollBar.cxx
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 10/01/98
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 /**************************************************************************
12 
13  This source is based on Xclass95, a Win95-looking GUI toolkit.
14  Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15 
16  Xclass95 is free software; you can redistribute it and/or
17  modify it under the terms of the GNU Library General Public
18  License as published by the Free Software Foundation; either
19  version 2 of the License, or (at your option) any later version.
20 
21 **************************************************************************/
22 
23 
24 /** \class TGScrollBar
25  \ingroup guiwidgets
26 
27 The classes in this file implement scrollbars. Scrollbars can be
28 either placed horizontal or vertical. A scrollbar contains three
29 
30 \class TGScrollBarElements
31 \ingroup guiwidgets
32 The "head", "tail" and "slider". The head and
33 tail are fixed at either end and have the typical arrows in them.
34 
35 \class TGHScrollBar
36 \ingroup guiwidgets
37 The TGHScrollBar will generate the following event messages:
38 kC_HSCROLL, kSB_SLIDERPOS, position, 0
39 kC_HSCROLL, kSB_SLIDERTRACK, position, 0
40 
41 \class TGVScrollBar
42 \ingroup guiwidgets
43 The TGVScrollBar will generate the following event messages:
44 kC_VSCROLL, kSB_SLIDERPOS, position, 0
45 kC_VSCROLL, kSB_SLIDERTRACK, position, 0
46 
47 */
48 
49 
50 #include "TGScrollBar.h"
51 #include "TGResourcePool.h"
52 #include "TGPicture.h"
53 #include "TImage.h"
54 #include "TSystem.h"
55 #include "TTimer.h"
56 #include "TEnv.h"
57 #include "TVirtualX.h"
58 
59 #include <iostream>
60 
61 
64 
69 
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 
73 class TSBRepeatTimer : public TTimer {
74 private:
75  TGScrollBar *fScrollBar; // scroll bar
76  Int_t fSmallInc; // step
77 public:
79  { fScrollBar = s; fSmallInc = inc; }
80 
81  Bool_t Notify();
82  Int_t GetSmallInc() const { return fSmallInc; }
83 };
84 
85 ////////////////////////////////////////////////////////////////////////////////
86 /// Notify when timer times out and reset the timer.
87 
89 {
90  fScrollBar->HandleTimer(this);
91  Reset();
92  return kFALSE;
93 }
94 
95 ////////////////////////////////////////////////////////////////////////////////
96 /// Constructor.
97 
99  UInt_t w, UInt_t h, UInt_t options, Pixel_t back) :
100  TGFrame(p, w, h, options | kOwnBackground, back)
101 {
102  fPic = fPicN = pic;
103  fState = kButtonUp;
104  fPicD = 0;
105  fStyle = 0;
106  if ((gClient->GetStyle() > 1) || (p && p->InheritsFrom("TGScrollBar")))
107  fStyle = gClient->GetStyle();
108 
110  fHighColor = gClient->GetResourcePool()->GetHighLightColor();
112 }
113 
114 ////////////////////////////////////////////////////////////////////////////////
115 /// destructor
116 
118 {
119  if (fPicD) {
121  }
122 }
123 
124 ////////////////////////////////////////////////////////////////////////////////
125 /// Change state of scrollbar element (either up or down).
126 
128 {
129  if (state != fState) {
130  switch (state) {
131  case kButtonDown:
134  break;
135  case kButtonUp:
136  case kButtonDisabled:
139  break;
140  }
141  fState = state;
142  fClient->NeedRedraw(this);
143  }
144 }
145 
146 ////////////////////////////////////////////////////////////////////////////////
147 /// Enable/Disable scroll bar button chaging the state.
148 
150 {
151  if (on) {
152  if (fState == kButtonUp) {
153  return;
154  }
156  fPic = fPicN;
157  } else {
158  if (fState == kButtonDisabled) {
159  return;
160  }
162 
163  if (!fPicD) {
164  TImage *img = TImage::Create();
165  if (!img) return;
166  TImage *img2 = TImage::Create();
167  if (!img2) {
168  if (img) delete img;
169  return;
170  }
171  TString back = gEnv->GetValue("Gui.BackgroundColor", "#c0c0c0");
172  img2->FillRectangle(back.Data(), 0, 0, fPic->GetWidth(), fPic->GetHeight());
173  img->SetImage(fPicN->GetPicture(), fPicN->GetMask());
174  Pixmap_t mask = img->GetMask();
175  img2->Merge(img, "overlay");
176 
177  TString name = "disbl_";
178  name += fPic->GetName();
179  fPicD = fClient->GetPicturePool()->GetPicture(name.Data(), img2->GetPixmap(),
180  mask);
181  delete img;
182  delete img2;
183  }
184  fPic = fPicD;
185  }
186  fClient->NeedRedraw(this);
187 }
188 
189 ////////////////////////////////////////////////////////////////////////////////
190 /// Draw border around scollbar element.
191 
193 {
194  switch (fOptions & (kSunkenFrame | kRaisedFrame)) {
195  case kSunkenFrame: // pressed
196  gVirtualX->DrawLine(fId, GetBlackGC()(), 0, 0, fWidth-2, 0);
197  gVirtualX->DrawLine(fId, GetBlackGC()(), 0, 0, 0, fHeight-2);
198  gVirtualX->DrawLine(fId, GetShadowGC()(), 1, 1, fWidth-3, 1);
199  gVirtualX->DrawLine(fId, GetShadowGC()(), 1, 1, 1, fHeight-3);
200 
201  gVirtualX->DrawLine(fId, GetWhiteGC()(), 0, fHeight-1, fWidth-1, fHeight-1);
202  gVirtualX->DrawLine(fId, GetWhiteGC()(), fWidth-1, fHeight-1, fWidth-1, 1);
203  gVirtualX->DrawLine(fId, GetBckgndGC()(), 1, fHeight-2, fWidth-2, fHeight-2);
204  gVirtualX->DrawLine(fId, GetBckgndGC()(), fWidth-2, fHeight-2, fWidth-2, 2);
205 
206  if (fPic) {
207  int x = (fWidth - fPic->GetWidth()) >> 1;
208  int y = (fHeight - fPic->GetHeight()) >> 1;
209  fPic->Draw(fId, GetBckgndGC()(), x+1, y+1); // 3, 3
210  }
211  break;
212 
213  case kRaisedFrame: // normal
214  case kButtonDisabled:
215  if (fStyle > 0) {
216  // new modern (flat) version
217  if (fBackground == fHighColor) {
218  gVirtualX->DrawRectangle(fId, GetShadowGC()(), 0, 0, fWidth-1, fHeight-1);
219  }
220  else {
221  if (fPic == 0)
222  gVirtualX->DrawRectangle(fId, GetShadowGC()(), 0, 0, fWidth-1, fHeight-1);
223  else
224  gVirtualX->DrawRectangle(fId, GetBckgndGC()(), 0, 0, fWidth-1, fHeight-1);
225  }
226  if (fParent && fParent->InheritsFrom("TGHScrollBar")) {
227  if (fWidth > 20) {
228  gVirtualX->DrawLine(fId, GetShadowGC()(), (fWidth/2)-3, 4, (fWidth/2)-3, fHeight-5);
229  gVirtualX->DrawLine(fId, GetShadowGC()(), (fWidth/2), 4, (fWidth/2), fHeight-5);
230  gVirtualX->DrawLine(fId, GetShadowGC()(), (fWidth/2)+3, 4, (fWidth/2)+3, fHeight-5);
231  }
232  }
233  else if (fParent && fParent->InheritsFrom("TGVScrollBar")) {
234  if (fHeight > 20) {
235  gVirtualX->DrawLine(fId, GetShadowGC()(), 4, (fHeight/2)-3, fWidth-5, (fHeight/2)-3);
236  gVirtualX->DrawLine(fId, GetShadowGC()(), 4, (fHeight/2) , fWidth-5, (fHeight/2));
237  gVirtualX->DrawLine(fId, GetShadowGC()(), 4, (fHeight/2)+3, fWidth-5, (fHeight/2)+3);
238  }
239  }
240  else { // not used in a scroll bar (e.g. in a combo box)
241  gVirtualX->DrawRectangle(fId, GetShadowGC()(), 0, 0, fWidth-1, fHeight-1);
242  }
243  }
244  else {
245  gVirtualX->DrawLine(fId, GetBckgndGC()(), 0, 0, fWidth-2, 0);
246  gVirtualX->DrawLine(fId, GetBckgndGC()(), 0, 0, 0, fHeight-2);
247  gVirtualX->DrawLine(fId, GetHilightGC()(), 1, 1, fWidth-3, 1);
248  gVirtualX->DrawLine(fId, GetHilightGC()(), 1, 1, 1, fHeight-3);
249 
250  gVirtualX->DrawLine(fId, GetShadowGC()(), 1, fHeight-2, fWidth-2, fHeight-2);
251  gVirtualX->DrawLine(fId, GetShadowGC()(), fWidth-2, fHeight-2, fWidth-2, 1);
252  gVirtualX->DrawLine(fId, GetBlackGC()(), 0, fHeight-1, fWidth-1, fHeight-1);
253  gVirtualX->DrawLine(fId, GetBlackGC()(), fWidth-1, fHeight-1, fWidth-1, 0);
254  }
255  if (fPic) {
256  int x = (fWidth - fPic->GetWidth()) >> 1;
257  int y = (fHeight - fPic->GetHeight()) >> 1;
258  fPic->Draw(fId, GetBckgndGC()(), x, y); // 2, 2
259  }
260  break;
261 
262  default:
263  break;
264  }
265 }
266 
267 ////////////////////////////////////////////////////////////////////////////////
268 /// Handle mouse crossing event.
269 
271 {
272  if (fStyle > 0) {
273  TGScrollBarElement *el = 0;
274  TGScrollBar *bar = 0;
275  if ((event->fType == kEnterNotify) && (fState != kButtonDisabled)) {
277  } else {
279  }
280  if (event->fType == kLeaveNotify) {
282  }
283  gVirtualX->SetWindowBackground(fId, fBgndColor);
285  DrawBorder();
286  if (fParent && fParent->InheritsFrom("TGScrollBar")) {
287  bar = (TGScrollBar *)fParent;
288  if ((el = bar->GetHead()) != this) {
290  el->DrawBorder();
291  }
292  if ((el = bar->GetTail()) != this) {
294  el->DrawBorder();
295  }
296  if ((el = bar->GetSlider()) != this) {
298  el->DrawBorder();
299  }
300  }
301  }
302  return kTRUE;
303 }
304 
305 ////////////////////////////////////////////////////////////////////////////////
306 /// Constructor.
307 
309  UInt_t options, Pixel_t back) :
310  TGFrame(p, w, h, options | kOwnBackground, back),
311  fX0(0), fY0(0), fXp(0), fYp(0), fDragging(kFALSE), fGrabPointer(kTRUE),
312  fRange(0), fPsize(0), fPos(0), fSliderSize(0), fSliderRange(0),
313  fSmallInc(1), fHead(0), fTail(0), fSlider(0), fHeadPic(0),
314  fTailPic(0), fRepeat(0), fSubw()
315 {
317 
319  fHighColor = gClient->GetResourcePool()->GetHighLightColor();
320 
321  fMsgWindow = p;
322  if (gClient->GetStyle() == 0)
324  SetWindowName();
326 }
327 
328 ////////////////////////////////////////////////////////////////////////////////
329 /// Delete a scrollbar (either horizontal or vertical).
330 
332 {
333  delete fHead;
334  delete fTail;
335  delete fSlider;
338  if (fRepeat) { delete fRepeat; fRepeat = 0; }
339 }
340 
341 ////////////////////////////////////////////////////////////////////////////////
342 /// Handle mouse crossing event.
343 
345 {
346  if (gClient->GetStyle() > 0) {
347  if (event->fType == kEnterNotify) {
349  } else {
351  }
352  if (event->fType == kLeaveNotify) {
354  }
358  fHead->DrawBorder();
359  fTail->DrawBorder();
360  fSlider->DrawBorder();
361  }
362  return kTRUE;
363 }
364 
365 ////////////////////////////////////////////////////////////////////////////////
366 /// Handle repeat timer for horizontal or vertical scrollbar. Every time
367 /// timer times out we move slider.
368 
370 {
371  // shorten time out time to 50 milli seconds
372  t->SetTime(50);
373 
374  Window_t dum1, dum2;
375  Event_t ev;
376 
377  ev.fCode = kButton1;
378  ev.fType = kButtonPress;
379  ev.fUser[0] = fSubw;
380 
381  if (IsAccelerated()) {
382  ++fSmallInc;
383  if (fSmallInc > 100) fSmallInc = 100;
384  }
385 
386  gVirtualX->QueryPointer(fId, dum1, dum2, ev.fXRoot, ev.fYRoot, ev.fX, ev.fY,
387  ev.fState);
388 
389  HandleButton(&ev);
390 
391  return kTRUE;
392 }
393 
394 ////////////////////////////////////////////////////////////////////////////////
395 /// Static method returning scrollbar background pixmap.
396 
398 {
399  static Bool_t init = kFALSE;
400  if (!init) {
401  fgBckgndPixmap = gClient->GetResourcePool()->GetCheckeredPixmap();
402  init = kTRUE;
403  }
404  return fgBckgndPixmap;
405 }
406 
407 ////////////////////////////////////////////////////////////////////////////////
408 /// Static method returning the scrollbar width.
409 
411 {
412  return fgScrollBarWidth;
413 }
414 
415 ////////////////////////////////////////////////////////////////////////////////
416 /// Change background color
417 
419 {
421  fHead->ChangeBackground(back);
422  fTail->ChangeBackground(back);
423  fSlider->ChangeBackground(back);
424 }
425 
426 ////////////////////////////////////////////////////////////////////////////////
427 /// Create a horizontal scrollbar widget.
428 
430  UInt_t options, ULong_t back) :
431  TGScrollBar(p, w, h, options, back)
432 {
433  fHeadPic = fClient->GetPicture("arrow_left.xpm");
434  fTailPic = fClient->GetPicture("arrow_right.xpm");
435 
436  if (!fHeadPic || !fTailPic) {
437  Error("TGHScrollBar", "arrow_*.xpm not found");
438  return;
439  }
441  kRaisedFrame);
443  kRaisedFrame);
444  fSlider = new TGScrollBarElement(this, 0, fgScrollBarWidth, 50,
445  kRaisedFrame);
446 
449 
450  fDragging = kFALSE;
452  fPos = 0;
453 
454  fRange = TMath::Max((Int_t) w - (fgScrollBarWidth << 1), 1);
455  fPsize = fRange >> 1;
456 
457  fSliderSize = 50;
458  fSliderRange = 1;
459 
464 }
465 
466 ////////////////////////////////////////////////////////////////////////////////
467 /// Layout and move horizontal scrollbar components.
468 
470 {
471  // Should also recalculate the slider size and range, etc.
472  fHead->Move(0, 0);
476 
477  if (fSlider->GetX() != fX0) {
478  fSlider->Move(fX0, 0);
481  }
482 }
483 
484 ////////////////////////////////////////////////////////////////////////////////
485 /// Handle a mouse button event in a horizontal scrolbar.
486 
488 {
489  Int_t newpos;
490 
491  if (event->fCode == kButton4) {
492  if (!fHead->IsEnabled()) {
493  return kFALSE;
494  }
495  //scroll left
496  newpos = fPos - fPsize;
497  if (newpos<0) newpos = 0;
498  SetPosition(newpos);
499  return kTRUE;
500  }
501  if (event->fCode == kButton5) {
502  if (!fTail->IsEnabled()) {
503  return kFALSE;
504  }
505  // scroll right
506  newpos = fPos + fPsize;
507  SetPosition(newpos);
508  return kTRUE;
509  }
510 
511  if (event->fType == kButtonPress) {
512  if (event->fCode == kButton3) {
513  fX0 = event->fX - fSliderSize/2;
517  fPos = (Int_t)pos;
518 
519  fPos = TMath::Max(fPos, 0);
521  fSlider->Move(fX0, 0);
522 
525  return kTRUE;
526  }
527 
528  // fUser[0] contains the subwindow (child) in which the event occured
529  // (see GX11Gui.cxx)
530  Window_t subw = (Window_t)event->fUser[0];
531 
532  if (subw == fSlider->GetId()) {
533  fXp = event->fX - fX0;
534  fYp = event->fY - fY0;
535  fDragging = kTRUE;
536 
537  } else {
538 
539  if (!fRepeat)
540  fRepeat = new TSBRepeatTimer(this, 400, fSmallInc); // 500
541  fRepeat->Reset();
543  fSubw = subw;
544 
545  if (subw == fHead->GetId()) {
546  //if (!fHead->IsEnabled()) {
547  // return kFALSE;
548  //}
550  fPos -= fSmallInc;
551  } else if (subw == fTail->GetId()) {
552  //if (!fTail->IsEnabled()) {
553  // return kFALSE;
554  // }
556  fPos += fSmallInc;
557  } else if (event->fX > fgScrollBarWidth && event->fX < fX0)
558  fPos -= fPsize;
559  else if (event->fX > fX0+fSliderSize && event->fX < (Int_t)fWidth-fgScrollBarWidth)
560  fPos += fPsize;
561 
562  fPos = TMath::Max(fPos, 0);
564 
566 
569 
570  fSlider->Move(fX0, 0);
571 
574  }
575 
576  // last argument kFALSE forces all specified events to this window
577  if (fGrabPointer && !fClient->IsEditable())
580  kTRUE, kFALSE);
581  } else {
584 
585  if (fRepeat) {
586  fRepeat->Remove();
587  fRepeat->SetTime(400); // might have been shortened in HandleTimer()
588  fSmallInc = ((TSBRepeatTimer*)fRepeat)->GetSmallInc();
589  }
590 
591  fDragging = kFALSE;
592 
593  fPos = TMath::Max(fPos, 0);
595 
598 
599  if (fGrabPointer)
600  gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
601  }
602  return kTRUE;
603 }
604 
605 ////////////////////////////////////////////////////////////////////////////////
606 /// Handle mouse motion event in a horizontal scrollbar.
607 
609 {
610  if (fDragging) {
611  fX0 = event->fX - fXp;
612  fY0 = event->fY - fYp;
613 
616  fSlider->Move(fX0, 0);
618  fPos = (Int_t)pos;
619 
620  fPos = TMath::Max(fPos, 0);
622 
625  }
626  return kTRUE;
627 }
628 
629 ////////////////////////////////////////////////////////////////////////////////
630 /// Set range of horizontal scrollbar.
631 
632 void TGHScrollBar::SetRange(Int_t range, Int_t page_size)
633 {
634  fRange = TMath::Max(range, 1);
635  fPsize = TMath::Max(page_size, 0);
636  fPos = TMath::Max(fPos, 0);
638 
640  fRange, (UInt_t) 6);
642 
644  (UInt_t) 1);
645 
649 
650  fSlider->Move(fX0, 0);
653 
654  // fPos = (fX0 - fgScrollBarWidth) * (fRange-fPsize) / fSliderRange;
655 
660 }
661 
662 ////////////////////////////////////////////////////////////////////////////////
663 /// Set logical slider position of horizontal scrollbar.
664 
666 {
667  fPos = TMath::Max(pos, 0);
668  fPos = TMath::Min(pos, fRange-fPsize);
669 
673 
674  fSlider->Move(fX0, 0);
677 
680 }
681 
682 
683 ////////////////////////////////////////////////////////////////////////////////
684 /// Create a vertical scrollbar.
685 
687  UInt_t options, ULong_t back) :
688  TGScrollBar(p, w, h, options, back)
689 {
690  fHeadPic = fClient->GetPicture("arrow_up.xpm");
691  fTailPic = fClient->GetPicture("arrow_down.xpm");
692 
693  if (!fHeadPic || !fTailPic) {
694  Error("TGVScrollBar", "arrow_*.xpm not found");
695  return;
696  }
698  kRaisedFrame);
700  kRaisedFrame);
701  fSlider = new TGScrollBarElement(this, 0, fgScrollBarWidth, 50,
702  kRaisedFrame);
703 
706 
707  fDragging = kFALSE;
709  fPos = 0;
710 
711  fRange = TMath::Max((Int_t) h - (fgScrollBarWidth << 1), 1);
712  fPsize = fRange >> 1;
713 
714  fSliderSize = 50;
715  fSliderRange = 1;
716 
721 }
722 
723 ////////////////////////////////////////////////////////////////////////////////
724 /// Layout and move vertical scrollbar components.
725 
727 {
728  // Should recalculate fSliderSize, fSliderRange, fX0, fY0, etc. too...
729  fHead->Move(0, 0);
733 
734  if (fSlider->GetY() != fY0) {
735  fSlider->Move(0, fY0);
738  }
739 }
740 
741 ////////////////////////////////////////////////////////////////////////////////
742 /// Handle mouse button event in vertical scrollbar.
743 
745 {
746  Int_t newpos;
747 
748  if (event->fCode == kButton4) {
749  if (!fHead->IsEnabled()) {
750  return kFALSE;
751  }
752  //scroll up
753  newpos = fPos - fPsize;
754  if (newpos<0) newpos = 0;
755  SetPosition(newpos);
756  return kTRUE;
757  }
758  if (event->fCode == kButton5) {
759  if (!fTail->IsEnabled()) {
760  return kFALSE;
761  }
762 
763  // scroll down
764  newpos = fPos + fPsize;
765  SetPosition(newpos);
766  return kTRUE;
767  }
768 
769  if (event->fType == kButtonPress) {
770  if (event->fCode == kButton3) {
771  fY0 = event->fY - fSliderSize/2;
775  fPos = (Int_t)pos;
776 
777  fPos = TMath::Max(fPos, 0);
779  fSlider->Move(0, fY0);
780 
783  return kTRUE;
784  }
785 
786  // fUser[0] contains the subwindow (child) in which the event occured
787  // (see GX11Gui.cxx)
788  Window_t subw = (Window_t)event->fUser[0];
789 
790  if (subw == fSlider->GetId()) {
791  fXp = event->fX - fX0;
792  fYp = event->fY - fY0;
793  fDragging = kTRUE;
794 
795  } else {
796 
797  if (!fRepeat)
798  fRepeat = new TSBRepeatTimer(this, 400, fSmallInc); // 500
799  fRepeat->Reset();
801  fSubw = subw;
802 
803  if (subw == fHead->GetId()) {
804  //if (!fHead->IsEnabled()) {
805  // return kFALSE;
806  // }
808  fPos -= fSmallInc;
809  } else if (subw == fTail->GetId()) {
810  //if (!fTail->IsEnabled()) {
811  // return kFALSE;
812  //}
814  fPos += fSmallInc;
815  } else if (event->fY > fgScrollBarWidth && event->fY < fY0)
816  fPos -= fPsize;
817  else if (event->fY > fY0+fSliderSize && event->fY < (Int_t)fHeight-fgScrollBarWidth)
818  fPos += fPsize;
819 
820  fPos = TMath::Max(fPos, 0);
822 
824  fY0 = (Int_t)y0;
825 
828 
829  fSlider->Move(0, fY0);
830 
833  }
834 
835  // last argument kFALSE forces all specified events to this window
836  if (fGrabPointer && !fClient->IsEditable())
839  kTRUE, kFALSE);
840  } else {
843 
844  if (fRepeat) {
845  fRepeat->Remove();
846  fRepeat->SetTime(400); // might have been shortened in HandleTimer()
847  fSmallInc = ((TSBRepeatTimer*)fRepeat)->GetSmallInc();
848  }
849 
850  fDragging = kFALSE;
851 
852  fPos = TMath::Max(fPos, 0);
854 
857 
858  if (fGrabPointer) {
859  gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
860  }
861  }
862  return kTRUE;
863 }
864 
865 ////////////////////////////////////////////////////////////////////////////////
866 /// Handle mouse motion in a vertical scrollbar.
867 
869 {
870  if (fDragging) {
871  fX0 = event->fX - fXp;
872  fY0 = event->fY - fYp;
873 
876  fSlider->Move(0, fY0);
878  fPos = (Int_t)pos;
879 
880  fPos = TMath::Max(fPos, 0);
882 
885  }
886  return kTRUE;
887 }
888 
889 ////////////////////////////////////////////////////////////////////////////////
890 /// Set range of vertical scrollbar.
891 
892 void TGVScrollBar::SetRange(Int_t range, Int_t page_size)
893 {
894  fRange = TMath::Max(range, 1);
895  fPsize = TMath::Max(page_size, 0);
896  fPos = TMath::Max(fPos, 0);
898 
900  fRange, (UInt_t) 6);
902 
904  (UInt_t)1);
905 
907  fY0 = (Int_t)y0;
910 
911  fSlider->Move(0, fY0);
914 
915  // fPos = (fY0 - fgScrollBarWidth) * (fRange-fPsize) / fSliderRange;
916 
917 
922 }
923 
924 ////////////////////////////////////////////////////////////////////////////////
925 /// Set logical slider position of vertical scrollbar.
926 
928 {
929  fPos = TMath::Max(pos, 0);
930  fPos = TMath::Min(pos, fRange-fPsize);
931 
933  fY0 = (Int_t)y0;
936 
937  fSlider->Move(0, fY0);
940 
943 }
944 
945 ////////////////////////////////////////////////////////////////////////////////
946 /// Save an horizontal scrollbar as a C++ statement(s) on output stream out.
947 
948 void TGHScrollBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
949 {
950  if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
951 
952  out <<" TGHScrollBar *";
953  out << GetName() << " = new TGHScrollBar(" << fParent->GetName()
954  << "," << GetWidth() << "," << GetHeight();
955 
957  if (!GetOptions()) {
958  out <<");" << std::endl;
959  } else {
960  out << "," << GetOptionString() <<");" << std::endl;
961  }
962  } else {
963  out << "," << GetOptionString() << ",ucolor);" << std::endl;
964  }
965  if (option && strstr(option, "keep_names"))
966  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
967 
968  out << " " << GetName() <<"->SetRange(" << GetRange() << "," << GetPageSize() << ");" << std::endl;
969  out << " " << GetName() <<"->SetPosition(" << GetPosition() << ");" << std::endl;
970 }
971 
972 ////////////////////////////////////////////////////////////////////////////////
973 /// Save an vertical scrollbar as a C++ statement(s) on output stream out.
974 
975 void TGVScrollBar::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
976 {
977  if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
978 
979  out<<" TGVScrollBar *";
980  out << GetName() <<" = new TGVScrollBar("<< fParent->GetName()
981  << "," << GetWidth() << "," << GetHeight();
982 
984 
985  if (!GetOptions()) {
986  out <<");" << std::endl;
987  } else {
988  out << "," << GetOptionString() <<");" << std::endl;
989  }
990  } else {
991  out << "," << GetOptionString() << ",ucolor);" << std::endl;
992  }
993  if (option && strstr(option, "keep_names"))
994  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
995 
996  out << " " << GetName() <<"->SetRange(" << GetRange() << "," << GetPageSize() << ");" << std::endl;
997  out << " " << GetName() <<"->SetPosition(" << GetPosition() << ");" << std::endl;
998 }
TGWindow::SetWindowName
virtual void SetWindowName(const char *name=0)
Set window name.
Definition: TGWindow.cxx:129
TGHScrollBar::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an horizontal scrollbar as a C++ statement(s) on output stream out.
Definition: TGScrollBar.cxx:948
Event_t::fType
EGEventType fType
of event (see EGEventType)
Definition: GuiTypes.h:175
TGHScrollBar::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in a horizontal scrollbar.
Definition: TGScrollBar.cxx:608
TGScrollBar::fSubw
Window_t fSubw
sub window in which mouse is pressed
Definition: TGScrollBar.h:84
TGScrollBar::IsAccelerated
Bool_t IsAccelerated() const
Definition: TGScrollBar.h:122
Event_t::fState
UInt_t fState
key or button mask
Definition: GuiTypes.h:181
kDefaultScrollBarWidth
@ kDefaultScrollBarWidth
Definition: GuiTypes.h:86
TGFrame::GetHeight
UInt_t GetHeight() const
Definition: TGFrame.h:225
TGVScrollBar::SetRange
virtual void SetRange(Int_t range, Int_t page_size)
Set range of vertical scrollbar.
Definition: TGScrollBar.cxx:892
TGScrollBar::fBgndColor
Pixel_t fBgndColor
background color
Definition: TGScrollBar.h:86
Event_t::fY
Int_t fY
pointer x, y coordinates in event window
Definition: GuiTypes.h:178
Event_t::fX
Int_t fX
Definition: GuiTypes.h:178
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
TGScrollBarElement::SetEnabled
virtual void SetEnabled(Bool_t on=kTRUE)
Enable/Disable scroll bar button chaging the state.
Definition: TGScrollBar.cxx:149
kSB_SLIDERPOS
@ kSB_SLIDERPOS
Definition: WidgetMessageTypes.h:47
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
Pixmap_t
Handle_t Pixmap_t
Pixmap handle.
Definition: GuiTypes.h:30
TGVScrollBar::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion in a vertical scrollbar.
Definition: TGScrollBar.cxx:868
TGScrollBar::fTail
TGScrollBarElement * fTail
tail button of scrollbar
Definition: TGScrollBar.h:79
TGVScrollBar
The TGVScrollBar will generate the following event messages: kC_VSCROLL, kSB_SLIDERPOS,...
Definition: TGScrollBar.h:164
TGScrollBar::HandleCrossing
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
Definition: TGScrollBar.cxx:344
kSB_SLIDERTRACK
@ kSB_SLIDERTRACK
Definition: WidgetMessageTypes.h:46
TGPicture
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition: TGPicture.h:25
kAnyModifier
const Mask_t kAnyModifier
Definition: GuiTypes.h:210
TGScrollBar
The classes in this file implement scrollbars.
Definition: TGScrollBar.h:61
TImage::Merge
virtual void Merge(const TImage *, const char *="alphablend", Int_t=0, Int_t=0)
Definition: TImage.h:172
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
TGScrollBar::GetPageSize
virtual Int_t GetPageSize() const
Definition: TGScrollBar.h:114
TGPicture::GetWidth
UInt_t GetWidth() const
Definition: TGPicture.h:52
kLeaveNotify
@ kLeaveNotify
Definition: GuiTypes.h:61
kPointerMotionMask
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:163
TImage::Create
static TImage * Create()
Create an image.
Definition: TImage.cxx:35
TGScrollBar::fSlider
TGScrollBarElement * fSlider
slider
Definition: TGScrollBar.h:80
TGScrollBar::GetScrollBarWidth
static Int_t GetScrollBarWidth()
Static method returning the scrollbar width.
Definition: TGScrollBar.cxx:410
gEnv
R__EXTERN TEnv * gEnv
Definition: TEnv.h:171
TGScrollBar::fHead
TGScrollBarElement * fHead
head button of scrollbar
Definition: TGScrollBar.h:78
TSBRepeatTimer::Notify
Bool_t Notify()
Notify when timer times out and reset the timer.
Definition: TGScrollBar.cxx:88
TGScrollBarElement::fPicN
const TGPicture * fPicN
picture for normal state of scrollbar element
Definition: TGScrollBar.h:38
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
kAnyButton
@ kAnyButton
Definition: GuiTypes.h:214
kButtonDown
@ kButtonDown
Definition: TGButton.h:54
TString::Data
const char * Data() const
Definition: TString.h:369
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGPicture.h
TGFrame::fWidth
UInt_t fWidth
frame width
Definition: TGFrame.h:87
TGScrollBarElement::fPic
const TGPicture * fPic
picture in scrollbar element
Definition: TGScrollBar.h:37
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:893
TGWindow::kEditDisableLayout
@ kEditDisableLayout
window layout cannot be edited
Definition: TGWindow.h:53
TGPicture::GetMask
Pixmap_t GetMask() const
Definition: TGPicture.h:55
TGScrollBarElement
Definition: TGScrollBar.h:29
kButton4
@ kButton4
Definition: GuiTypes.h:215
kButtonUp
@ kButtonUp
Definition: TGButton.h:53
TGWindow::kEditDisable
@ kEditDisable
disable edit of this window
Definition: TGWindow.h:50
TGFrame::fOptions
UInt_t fOptions
frame options
Definition: TGFrame.h:94
TGHScrollBar::TGHScrollBar
TGHScrollBar(const TGWindow *p=nullptr, UInt_t w=4, UInt_t h=2, UInt_t options=kHorizontalFrame, Pixel_t back=GetDefaultFrameBackground())
Create a horizontal scrollbar widget.
Definition: TGScrollBar.cxx:429
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
TGClient::IsEditable
Bool_t IsEditable() const
Definition: TGClient.h:89
TSBRepeatTimer::GetSmallInc
Int_t GetSmallInc() const
Definition: TGScrollBar.cxx:82
Int_t
int Int_t
Definition: RtypesCore.h:45
TGScrollBar::fPsize
Int_t fPsize
logical page size of scrollbar
Definition: TGScrollBar.h:73
TGVScrollBar::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an vertical scrollbar as a C++ statement(s) on output stream out.
Definition: TGScrollBar.cxx:975
TGVScrollBar::SetPosition
virtual void SetPosition(Int_t pos)
Set logical slider position of vertical scrollbar.
Definition: TGScrollBar.cxx:927
TImage
An abstract interface to image processing library.
Definition: TImage.h:29
TGScrollBar::fGrabPointer
Bool_t fGrabPointer
grab pointer when dragging
Definition: TGScrollBar.h:71
event
Definition: triangle.c:552
kEnterNotify
@ kEnterNotify
Definition: GuiTypes.h:61
TGPicture::Draw
void Draw(Option_t *="")
Default Draw method for all objects.
Definition: TGPicture.h:46
x
Double_t x[n]
Definition: legend1.C:17
TGWindow::kEditDisableHeight
@ kEditDisableHeight
window height cannot be edited
Definition: TGWindow.h:55
kButton1
@ kButton1
Definition: GuiTypes.h:214
TEnv::GetValue
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition: TEnv.cxx:491
TGVScrollBar::Layout
virtual void Layout()
Layout and move vertical scrollbar components.
Definition: TGScrollBar.cxx:726
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
TGScrollBar::fTailPic
const TGPicture * fTailPic
picture in tail (down or right arrow)
Definition: TGScrollBar.h:82
TVirtualX.h
TGClient::FreePicture
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition: TGClient.cxx:310
TGWindow::SetBackgroundPixmap
virtual void SetBackgroundPixmap(Pixmap_t pixmap)
set background pixmap
Definition: TGWindow.cxx:248
Event_t::fUser
Longptr_t fUser[5]
5 longs can be used by client message events NOTE: only [0], [1] and [2] may be used.
Definition: GuiTypes.h:187
TTimer.h
TSBRepeatTimer
Definition: TGScrollBar.cxx:73
TEnv.h
TGScrollBarElement::fStyle
Int_t fStyle
modern or classic style
Definition: TGScrollBar.h:42
TGFrame::GetBlackGC
static const TGGC & GetBlackGC()
Get black graphics context.
Definition: TGFrame.cxx:735
TString
Basic string class.
Definition: TString.h:136
TGScrollBar::fHeadPic
const TGPicture * fHeadPic
picture in head (up or left arrow)
Definition: TGScrollBar.h:81
TGFrame
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition: TGFrame.h:80
TGeant4Unit::bar
static constexpr double bar
Definition: TGeant4SystemOfUnits.h:221
TGScrollBar::fDragging
Bool_t fDragging
in dragging mode?
Definition: TGScrollBar.h:70
kButtonPressMask
const Mask_t kButtonPressMask
Definition: GuiTypes.h:161
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TGObject::GetId
Handle_t GetId() const
Definition: TGObject.h:37
kC_VSCROLL
@ kC_VSCROLL
Definition: WidgetMessageTypes.h:41
TObject::InheritsFrom
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:445
TGClient::GetPicturePool
TGPicturePool * GetPicturePool() const
Definition: TGClient.h:126
kOwnBackground
@ kOwnBackground
Definition: GuiTypes.h:391
TSystem::AddTimer
virtual void AddTimer(TTimer *t)
Add timer to list of system timers.
Definition: TSystem.cxx:473
bool
kLeaveWindowMask
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:168
TGFrame::GetWidth
UInt_t GetWidth() const
Definition: TGFrame.h:224
TGWindow::kEditDisableBtnEnable
@ kEditDisableBtnEnable
window can handle mouse button events
Definition: TGWindow.h:57
TImage.h
TGFrame::GetOptionString
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2480
TGFrame::GetOptions
virtual UInt_t GetOptions() const
Definition: TGFrame.h:197
gClient
#define gClient
Definition: TGClient.h:157
TGHScrollBar::SetRange
virtual void SetRange(Int_t range, Int_t page_size)
Set range of horizontal scrollbar.
Definition: TGScrollBar.cxx:632
TGScrollBarElement::fPicD
const TGPicture * fPicD
picture for disabled state of scrollbar element
Definition: TGScrollBar.h:39
TGVScrollBar::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in vertical scrollbar.
Definition: TGScrollBar.cxx:744
TGFrame::AddInput
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:339
kNone
const Handle_t kNone
Definition: GuiTypes.h:88
TGFrame::GetHilightGC
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition: TGFrame.cxx:755
TGScrollBar::GetBckgndPixmap
static Pixmap_t GetBckgndPixmap()
Static method returning scrollbar background pixmap.
Definition: TGScrollBar.cxx:397
TGFrame::ChangeBackground
virtual void ChangeBackground(Pixel_t back)
Change frame background color.
Definition: TGFrame.cxx:293
TGScrollBar::GetPosition
virtual Int_t GetPosition() const
Definition: TGScrollBar.h:113
TTimer
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
kSunkenFrame
@ kSunkenFrame
Definition: GuiTypes.h:383
TGPicturePool::GetPicture
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
Definition: TGPicture.cxx:82
TGScrollBarElement::fState
Int_t fState
state of scrollbar element (button up or down)
Definition: TGScrollBar.h:36
TGHScrollBar::Layout
virtual void Layout()
Layout and move horizontal scrollbar components.
Definition: TGScrollBar.cxx:469
TGWindow::kEditDisableGrab
@ kEditDisableGrab
window grab cannot be edited
Definition: TGWindow.h:52
TSystem.h
TGScrollBar::PageSizeChanged
virtual void PageSizeChanged(Int_t range)
Definition: TGScrollBar.h:131
TGScrollBar::GetRange
virtual Int_t GetRange() const
Definition: TGScrollBar.h:115
h
#define h(i)
Definition: RSha256.hxx:106
TGWidget::fMsgWindow
const TGWindow * fMsgWindow
window which handles widget events
Definition: TGWidget.h:48
kButton3
@ kButton3
Definition: GuiTypes.h:214
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:336
TGScrollBar::HandleTimer
virtual Bool_t HandleTimer(TTimer *t)
Handle repeat timer for horizontal or vertical scrollbar.
Definition: TGScrollBar.cxx:369
TGScrollBar::~TGScrollBar
virtual ~TGScrollBar()
Delete a scrollbar (either horizontal or vertical).
Definition: TGScrollBar.cxx:331
TGFrame::Resize
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:605
TGHScrollBar
The TGHScrollBar will generate the following event messages: kC_HSCROLL, kSB_SLIDERPOS,...
Definition: TGScrollBar.h:141
TImage::FillRectangle
virtual void FillRectangle(const char *=0, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
Definition: TImage.h:192
TGHScrollBar::SetPosition
virtual void SetPosition(Int_t pos)
Set logical slider position of horizontal scrollbar.
Definition: TGScrollBar.cxx:665
TGScrollBar::fgScrollBarWidth
static Int_t fgScrollBarWidth
Definition: TGScrollBar.h:90
TGObject::fId
Handle_t fId
X11/Win32 Window identifier.
Definition: TGObject.h:26
Event_t::fCode
UInt_t fCode
key or button code
Definition: GuiTypes.h:180
TGFrame::SendMessage
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:645
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TGScrollBar::fAccelerated
Bool_t fAccelerated
kFALSE - normal, kTRUE - accelerated
Definition: TGScrollBar.h:85
TGScrollBar::fRepeat
TTimer * fRepeat
repeat rate timer (when mouse stays pressed)
Definition: TGScrollBar.h:83
TImage::GetMask
virtual Pixmap_t GetMask()
Definition: TImage.h:236
kButtonPress
@ kButtonPress
Definition: GuiTypes.h:60
Long_t
long Long_t
Definition: RtypesCore.h:54
TGScrollBarElement::fBgndColor
Pixel_t fBgndColor
background color
Definition: TGScrollBar.h:40
TGScrollBar::fYp
Int_t fYp
previous slider position in pixels
Definition: TGScrollBar.h:69
kButtonReleaseMask
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:162
TTimer::Remove
void Remove()
Definition: TTimer.h:85
TGFrame::SaveUserColor
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition: TGFrame.cxx:2453
TGScrollBar::fRange
Int_t fRange
logical upper range of scrollbar
Definition: TGScrollBar.h:72
TGScrollBar::fPos
Int_t fPos
logical current position
Definition: TGScrollBar.h:74
TGScrollBarElement::~TGScrollBarElement
virtual ~TGScrollBarElement()
destructor
Definition: TGScrollBar.cxx:117
TGClient::GetPicture
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:291
TGScrollBarElement::HandleCrossing
virtual Bool_t HandleCrossing(Event_t *event)
Handle mouse crossing event.
Definition: TGScrollBar.cxx:270
TGScrollBarElement::TGScrollBarElement
TGScrollBarElement(const TGScrollBarElement &)=delete
Window_t
Handle_t Window_t
Window handle.
Definition: GuiTypes.h:29
TGScrollBar::fgBckgndPixmap
static Pixmap_t fgBckgndPixmap
Definition: TGScrollBar.h:89
y
Double_t y[n]
Definition: legend1.C:17
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
TTimer::SetTime
void SetTime(Long_t milliSec)
Definition: TTimer.h:90
TGScrollBar::fSliderRange
Int_t fSliderRange
logical slider range
Definition: TGScrollBar.h:76
Event_t::fXRoot
Int_t fXRoot
Definition: GuiTypes.h:179
TGFrame::GetX
Int_t GetX() const
Definition: TGFrame.h:231
TGFrame::GetBckgndGC
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition: TGFrame.cxx:775
TGScrollBar::RangeChanged
virtual void RangeChanged(Int_t range)
Definition: TGScrollBar.h:130
Event_t::fYRoot
Int_t fYRoot
coordinates relative to root
Definition: GuiTypes.h:179
kRaisedFrame
@ kRaisedFrame
Definition: GuiTypes.h:384
TMath::Min
Short_t Min(Short_t a, Short_t b)
Definition: TMathBase.h:180
unsigned int
TSBRepeatTimer::fSmallInc
Int_t fSmallInc
Definition: TGScrollBar.cxx:76
TGScrollBarElement::SetState
virtual void SetState(Int_t state)
Change state of scrollbar element (either up or down).
Definition: TGScrollBar.cxx:127
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TGScrollBarElement::fHighColor
Pixel_t fHighColor
highlight color
Definition: TGScrollBar.h:41
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:374
TGObject::fClient
TGClient * fClient
Connection to display server.
Definition: TGObject.h:27
TGPicture::GetPicture
Pixmap_t GetPicture() const
Definition: TGPicture.h:54
TGFrame::Move
virtual void Move(Int_t x, Int_t y)
Move frame.
Definition: TGFrame.cxx:593
TGScrollBarElement::DrawBorder
virtual void DrawBorder()
Draw border around scollbar element.
Definition: TGScrollBar.cxx:192
TGHScrollBar::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle a mouse button event in a horizontal scrolbar.
Definition: TGScrollBar.cxx:487
TGWindow::SetEditDisabled
virtual void SetEditDisabled(UInt_t on=kEditDisable)
Definition: TGWindow.h:106
TGScrollBar::fSmallInc
Int_t fSmallInc
Small Increment in the sliding algorithm.
Definition: TGScrollBar.h:77
TImage::GetPixmap
virtual Pixmap_t GetPixmap()
Definition: TImage.h:235
Event_t
Event structure.
Definition: GuiTypes.h:174
name
char name[80]
Definition: TGX11.cxx:110
TGPicture::GetName
const char * GetName() const
Returns name of object.
Definition: TGPicture.h:51
TGScrollBar::ChangeBackground
virtual void ChangeBackground(Pixel_t back)
Change background color.
Definition: TGScrollBar.cxx:418
kButton5
@ kButton5
Definition: GuiTypes.h:215
TGScrollBarElement::IsEnabled
virtual Bool_t IsEnabled() const
Definition: TGScrollBar.h:54
TGFrame::GetY
Int_t GetY() const
Definition: TGFrame.h:232
TGFrame::GetShadowGC
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition: TGFrame.cxx:765
TGScrollBar::TGScrollBar
TGScrollBar(const TGScrollBar &)=delete
kC_HSCROLL
@ kC_HSCROLL
Definition: WidgetMessageTypes.h:40
TImage::SetImage
virtual void SetImage(const Double_t *, UInt_t, UInt_t, TImagePalette *=0)
Definition: TImage.h:116
TGWindow::kEditDisableWidth
@ kEditDisableWidth
window width cannot be edited
Definition: TGWindow.h:56
TGResourcePool.h
TGScrollBar::fX0
Int_t fX0
Definition: TGScrollBar.h:68
TGFrame::GetWhiteGC
static const TGGC & GetWhiteGC()
Get white graphics context.
Definition: TGFrame.cxx:745
TGeant4Unit::ms
static constexpr double ms
Definition: TGeant4SystemOfUnits.h:163
TGFrame::fHeight
UInt_t fHeight
frame height
Definition: TGFrame.h:88
TSBRepeatTimer::fScrollBar
TGScrollBar * fScrollBar
Definition: TGScrollBar.cxx:75
TGFrame::fBackground
Pixel_t fBackground
frame background color
Definition: TGFrame.h:95
TSBRepeatTimer::TSBRepeatTimer
TSBRepeatTimer(TGScrollBar *s, Long_t ms, Int_t inc)
Definition: TGScrollBar.cxx:78
kEnterWindowMask
const Mask_t kEnterWindowMask
Definition: GuiTypes.h:167
TGWindow::fEditDisabled
UInt_t fEditDisabled
flags used for "guibuilding"
Definition: TGWindow.h:32
TGScrollBar::fSliderSize
Int_t fSliderSize
logical slider size
Definition: TGScrollBar.h:75
TGScrollBar::PositionChanged
virtual void PositionChanged(Int_t pos)
Definition: TGScrollBar.h:129
TGScrollBar::HandleButton
virtual Bool_t HandleButton(Event_t *event)=0
TGScrollBar::fY0
Int_t fY0
current slider position in pixels
Definition: TGScrollBar.h:68
TTimer::Reset
void Reset()
Reset the timer.
Definition: TTimer.cxx:157
TGPicture::GetHeight
UInt_t GetHeight() const
Definition: TGPicture.h:53
TGScrollBar.h
TGVScrollBar::TGVScrollBar
TGVScrollBar(const TGWindow *p=nullptr, UInt_t w=2, UInt_t h=4, UInt_t options=kVerticalFrame, Pixel_t back=GetDefaultFrameBackground())
Create a vertical scrollbar.
Definition: TGScrollBar.cxx:686
TGScrollBar::fXp
Int_t fXp
Definition: TGScrollBar.h:69
MK_MSG
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
Definition: WidgetMessageTypes.h:108
TGWindow::fParent
const TGWindow * fParent
Parent window.
Definition: TGWindow.h:28
kButtonDisabled
@ kButtonDisabled
Definition: TGButton.h:56
int
TGScrollBar::fHighColor
Pixel_t fHighColor
highlight color
Definition: TGScrollBar.h:87
TGFrame::DoRedraw
virtual void DoRedraw()
Redraw the frame.
Definition: TGFrame.cxx:430