Logo ROOT  
Reference Guide
TGTripleSlider.cxx
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Bertrand Bellenot 20/01/06
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 /** \class TGTripleVSlider
26  \ingroup guiwidgets
27 
28 TripleSlider inherit from DoubleSlider widgets and allow easy
29 selection of a min, max and pointer value out of a range.
30 The pointer position can be constrained to edges of slider and / or
31 can be relative to the slider position.
32 
33 To change the min value press the mouse near to the left / bottom
34 edge of the slider.
35 To change the max value press the mouse near to the right / top
36 edge of the slider.
37 To change both values simultaneously press the mouse near to the
38 center of the slider.
39 To change pointer value press the mouse on the pointer and drag it
40 to the desired position
41 
42 Dragging the slider will generate the event:
43  - kC_VSLIDER, kSL_POS, slider id, 0
44 
45 Pressing the mouse will generate the event:
46  - kC_VSLIDER, kSL_PRESS, slider id, 0
47 
48 Releasing the mouse will generate the event:
49  - kC_VSLIDER, kSL_RELEASE, slider id, 0
50 
51 Moving the pointer will generate the event:
52  - kC_VSLIDER, kSL_POINTER, slider id, 0
53 
54 Use the functions GetMinPosition(), GetMaxPosition() and
55 GetPosition() to retrieve the position of the slider.
56 Use the function GetPointerPosition() to retrieve the position of
57 the pointer
58 
59 */
60 
61 
62 /** \class TGTripleHSlider
63  \ingroup guiwidgets
64 TripleSlider inherit from DoubleSlider widgets and allow easy
65 selection of a min, max and pointer value out of a range.
66 The pointer position can be constrained to edges of slider and / or
67 can be relative to the slider position.
68 
69 To change the min value press the mouse near to the left / bottom
70 edge of the slider.
71 To change the max value press the mouse near to the right / top
72 edge of the slider.
73 To change both values simultaneously press the mouse near to the
74 center of the slider.
75 To change pointer value press the mouse on the pointer and drag it
76 to the desired position
77 
78 Dragging the slider will generate the event:
79  - kC_HSLIDER, kSL_POS, slider id, 0
80 
81 Pressing the mouse will generate the event:
82  - kC_HSLIDER, kSL_PRESS, slider id, 0
83 
84 Releasing the mouse will generate the event:
85  - kC_HSLIDER, kSL_RELEASE, slider id, 0
86 
87 Moving the pointer will generate the event:
88  - kC_HSLIDER, kSL_POINTER, slider id, 0
89 
90 Use the functions GetMinPosition(), GetMaxPosition() and
91 GetPosition() to retrieve the position of the slider.
92 Use the function GetPointerPosition() to retrieve the position of
93 the pointer
94 
95 */
96 
97 
98 #include "TGTripleSlider.h"
99 #include "TGPicture.h"
100 #include "TSystem.h"
101 #include "TVirtualX.h"
102 
103 #include <iostream>
104 #include <cstdlib>
105 
108 
109 ////////////////////////////////////////////////////////////////////////////////
110 /// Create a vertical slider widget.
111 
113  UInt_t options, ULong_t back,
114  Bool_t reversed, Bool_t mark_ends,
115  Bool_t constrained, Bool_t relative)
116  : TGDoubleVSlider(p, h, type, id, options, back, reversed, mark_ends)
117 {
118  fPointerPic = fClient->GetPicture("slider1h.xpm");
119  if (!fPointerPic)
120  Error("TGTripleVSlider", "slider1h.xpm not found");
121  fConstrained = constrained;
122  fRelative = relative;
123  fCz = 0;
124  fSCz = 0;
126  SetWindowName();
127 }
128 
129 ////////////////////////////////////////////////////////////////////////////////
130 /// Delete vertical slider widget.
131 
133 {
135 }
136 
137 ////////////////////////////////////////////////////////////////////////////////
138 /// Redraw vertical slider widget.
139 
141 {
143  // Draw Pointer
144  DrawPointer();
145 }
146 
147 ////////////////////////////////////////////////////////////////////////////////
148 /// Draw slider pointer
149 
151 {
152  if (fPointerPic) fPointerPic->Draw(fId, GetBckgndGC()(), fWidth/2-7, fCz-5);
153 }
154 
155 ////////////////////////////////////////////////////////////////////////////////
156 /// Handle mouse button event in vertical slider.
157 
159 {
160  if (event->fType == kButtonPress && event->fCode == kButton1) {
161  // constrain to the slider width
162  if (event->fX < (Int_t)fWidth/2-7 || event->fX > (Int_t)fWidth/2+7) {
163  return kTRUE;
164  }
165  fPressPoint = event->fY;
166  fPressSmin = fSmin;
167  fPressSmax = fSmax;
168 
169  int relMin = (int)((fHeight-16) * (fSmin - fVmin) / (fVmax - fVmin)) + 1;
170  int relMax = (int)((fHeight-16) * (fSmax - fVmin) / (fVmax - fVmin) + 15);
171  if (fPressPoint > (fCz - 5) && fPressPoint < (fCz + 5) &&
172  event->fX > ((Int_t)fWidth / 2) - 7 && event->fX < ((Int_t)fWidth / 2) + 5)
173  // move pointer
174  fMove = 4;
175  else if (fPressPoint < (relMax - relMin) / 4 + relMin)
176  // move only min value
177  fMove = 1;
178  else if (fPressPoint > (relMax - relMin) / 4 * 3 + relMin)
179  // move only max value
180  fMove = 2;
181  else
182  // move min and max value
183  fMove = 3;
184 
187  Pressed();
188 
189  // last argument kFALSE forces all specified events to this window
192  kTRUE, kFALSE);
193  } else if (event->fType == kButtonRelease && event->fCode == kButton1) {
196  Released();
197  fMove = 0;
198  gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
199  } else
200  fMove = 0;
201 
202  return kTRUE;
203 }
204 
205 ////////////////////////////////////////////////////////////////////////////////
206 /// Handles resize events for this widget.
207 
209 {
212  return kTRUE;
213 }
214 
215 ////////////////////////////////////////////////////////////////////////////////
216 /// Handle mouse motion event in vertical slider.
217 
219 {
220  if (fMove < 3) {
221  // if the mouse pointer is on the cursor,
222  // and we are not moving anything,
223  // set the cursor shape as Pointer
224  if (event->fY > (fCz - 5) && event->fY < (fCz + 5) &&
225  event->fX > ((Int_t)fWidth / 2) - 7 &&
226  event->fX < ((Int_t)fWidth / 2) + 5 &&
227  fMove == 0)
228  gVirtualX->SetCursor(fId, kNone);
229  else
231  }
232  static int oldDiff = 0;
233  static Long64_t was = gSystem->Now();
234  Long64_t now = gSystem->Now();
235 
236  if (fMove == 0) return kTRUE;
237  if ((now-was) < 50) return kTRUE;
238  was = now;
239 
240  int diff;
241  Double_t oldMin, oldMax;
242 
243  diff = event->fY - fPressPoint;
244  oldMin = fSmin;
245  oldMax = fSmax;
246 
247  if (fMove == 1) {
248  // change of min value
249  oldDiff = 0;
250  fSmin = fPressSmin + diff * (fVmax - fVmin) / (fHeight-16);
251  if (fSmin < fVmin) fSmin = fVmin;
252  if (fSmin > fSmax) fSmin = fSmax;
253  } else if (fMove == 2) {
254  // change of max value
255  oldDiff = 0;
256  fSmax = fPressSmax + diff * (fVmax - fVmin) / (fHeight-16);
257  if (fSmax > fVmax) fSmax = fVmax;
258  if (fSmax < fSmin) fSmax = fSmin;
259  } else if (fMove == 3) {
260  // change of min and of max value
261  Double_t logicalDiff;
262  logicalDiff = diff * (fVmax - fVmin) / (fHeight-16);
263  if (fPressSmax + logicalDiff > fVmax)
264  logicalDiff = fVmax - fPressSmax;
265  if (fPressSmin + logicalDiff < fVmin)
266  logicalDiff = fVmin - fPressSmin;
267  fSmax = fPressSmax + logicalDiff;
268  fSmin = fPressSmin + logicalDiff;
269  if (fRelative) {
270  if (abs(diff) < 3) oldDiff = diff;
271  SetPointerPos(diff - oldDiff, 3);
272  oldDiff = diff;
273  }
274  }
275  else if (fMove == 4) {
276  // change pointer position
277  oldDiff = 0;
278  SetPointerPos(event->fY, 1);
279  }
280  if (fMove != 4){
281  SetPointerPos(0, 2);
282  }
283  // check if position has changed
284  if (fMove != 0 && (fSmax != oldMax || fSmin != oldMin)) {
285  fClient->NeedRedraw(this);
288  PositionChanged();
289  }
290  return kTRUE;
291 }
292 
293 ////////////////////////////////////////////////////////////////////////////////
294 /// Set pointer position constrained in the slider range.
295 
297 {
298  fConstrained = on;
299 
300  if (fConstrained) {
303  else if (GetPointerPosition() >= GetMaxPosition())
305  }
306 }
307 
308 ////////////////////////////////////////////////////////////////////////////////
309 /// Set slider pointer position in pixel value.
310 
312 {
313  static Long64_t was = gSystem->Now();
314  Bool_t lcheck = (opt == 1);
315  Int_t oldPos = fCz;
316 
317  if (opt < 2) {
318  fCz = z;
319 
320  if (fCz < 7)
321  fCz = 7;
322  else if (fCz >= (Int_t)fHeight - 7)
323  fCz = (Int_t)fHeight - 7;
324  }
325  if (opt == 3) {
326  lcheck = kTRUE;
327  fCz += z;
328  if (fCz < 7)
329  fCz = 7;
330  else if (fCz >= (Int_t)fHeight-7)
331  fCz = (Int_t)fHeight - 7;
332  }
333  if (fConstrained) {
334  int relMin = (int)((fHeight-16) * (fSmin - fVmin) / (fVmax - fVmin)) + 1;
335  int relMax = (int)((fHeight-16) * (fSmax - fVmin) / (fVmax - fVmin) + 15);
336  if(fCz < relMin+7) {
337  fCz = relMin+7;
338  lcheck = kTRUE;
339  }
340  if(fCz > relMax-7) {
341  fCz = relMax-7;
342  lcheck = kTRUE;
343  }
344  }
345  if (lcheck)
346  fSCz = fVmin + ((Double_t)(fCz-8) * (fVmax - fVmin) / (Double_t)(fHeight-16));
347  if(fSCz < fVmin) fSCz = fVmin;
348  if(fSCz > fVmax) fSCz = fVmax;
349  if (fConstrained) {
350  if(fSCz < fSmin) fSCz = fSmin;
351  if(fSCz > fSmax) fSCz = fSmax;
352  }
353 
354  DrawPointer();
355  fClient->NeedRedraw(this);
356  if (fCz != oldPos) {
357  Long64_t now = gSystem->Now();
358  if ((fMove != 4) && ((now-was) < 150)) return;
359  was = now;
363  fClient->NeedRedraw(this);
364  }
365 }
366 
367 ////////////////////////////////////////////////////////////////////////////////
368 /// Set pointer position in scaled (real) value
369 
371 {
372  if (fReversedScale) {
373  fSCz = fVmin + fVmax - pos;
374  }
375  else {
376  fSCz = pos;
377  }
378  Double_t absPos = (fSCz - fVmin) * (fHeight-16) / (fVmax - fVmin);
379  SetPointerPos((int)(absPos+5.0), 0);
380 }
381 
382 ////////////////////////////////////////////////////////////////////////////////
383 /// Create horizontal slider widget.
384 
386  UInt_t options, ULong_t back,
387  Bool_t reversed, Bool_t mark_ends,
388  Bool_t constrained, Bool_t relative)
389  : TGDoubleHSlider(p, w, type, id, options, back, reversed, mark_ends)
390 {
391  fPointerPic = fClient->GetPicture("slider1v.xpm");
392  if (!fPointerPic)
393  Error("TGTripleVSlider", "slider1v.xpm not found");
394  fConstrained = constrained;
395  fRelative = relative;
396  fCz = 0;
397  fSCz = 0;
399  SetWindowName();
400 }
401 
402 ////////////////////////////////////////////////////////////////////////////////
403 /// Delete a horizontal slider widget.
404 
406 {
408 }
409 
410 ////////////////////////////////////////////////////////////////////////////////
411 /// Redraw horizontal slider widget.
412 
414 {
416  // Draw Pointer
417  DrawPointer();
418 }
419 
420 ////////////////////////////////////////////////////////////////////////////////
421 /// Draw slider pointer
422 
424 {
425  if (fPointerPic) fPointerPic->Draw(fId, GetBckgndGC()(), fCz-5, fHeight/2-7);
426 }
427 
428 ////////////////////////////////////////////////////////////////////////////////
429 /// Handle mouse button event in horizontal slider widget.
430 
432 {
433  if (event->fType == kButtonPress && event->fCode == kButton1) {
434  // constrain to the slider height
435  if (event->fY < (Int_t)fHeight/2-7 || event->fY > (Int_t)fHeight/2+7) {
436  return kTRUE;
437  }
438  fPressPoint = event->fX;
439  fPressSmin = fSmin;
440  fPressSmax = fSmax;
441 
442  int relMin = (int)((fWidth-16) * (fSmin - fVmin) / (fVmax - fVmin)) + 1;
443  int relMax = (int)((fWidth-16) * (fSmax - fVmin) / (fVmax - fVmin) + 15);
444  if (fPressPoint > (fCz - 5) && fPressPoint < (fCz + 5) &&
445  event->fY > ((Int_t)fHeight / 2) - 7 && event->fY < ((Int_t)fHeight / 2) + 5)
446  // move pointer
447  fMove = 4;
448  else if (fPressPoint < (relMax - relMin) / 4 + relMin)
449  // move only min value
450  fMove = 1;
451  else if (fPressPoint > (relMax - relMin) / 4 * 3 + relMin)
452  // move only max value
453  fMove = 2;
454  else
455  // move min and max value
456  fMove = 3;
457 
460  Pressed();
461 
462  // last argument kFALSE forces all specified events to this window
465  kTRUE, kFALSE);
466  } else if (event->fType == kButtonRelease && event->fCode == kButton1) {
469  Released();
470  fMove = 0;
471  gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
472  } else
473  fMove = 0;
474 
475  return kTRUE;
476 }
477 
478 ////////////////////////////////////////////////////////////////////////////////
479 /// Handles resize events for this widget.
480 
482 {
485  return kTRUE;
486 }
487 
488 ////////////////////////////////////////////////////////////////////////////////
489 /// Handle mouse motion event in horizontal slide widget.
490 
492 {
493  if (fMove < 3) {
494  // if the mouse pointer is on the cursor,
495  // and we are not moving anything,
496  // set the cursor shape as Pointer
497  if (event->fX > (fCz - 5) && event->fX < (fCz + 5) &&
498  event->fY > ((Int_t)fHeight / 2) - 7 &&
499  event->fY < ((Int_t)fHeight / 2) + 5 &&
500  fMove == 0)
501  gVirtualX->SetCursor(fId, kNone);
502  else
504  }
505  static int oldDiff = 0;
506  static Long64_t was = gSystem->Now();
507  Long64_t now = gSystem->Now();
508 
509  if (fMove == 0) return kTRUE;
510  if ((now-was) < 50) return kTRUE;
511  was = now;
512 
513  int diff;
514  Double_t oldMin, oldMax;
515 
516  diff = event->fX - fPressPoint;
517  oldMin = fSmin;
518  oldMax = fSmax;
519 
520  if (fMove == 1) {
521  // change of min value
522  oldDiff = 0;
523  fSmin = fPressSmin + diff * (fVmax - fVmin) / (fWidth-16);
524  if (fSmin < fVmin) fSmin = fVmin;
525  if (fSmin > fSmax) fSmin = fSmax;
526  } else if (fMove == 2) {
527  // change of max value
528  oldDiff = 0;
529  fSmax = fPressSmax + diff * (fVmax - fVmin) / (fWidth-16);
530  if (fSmax > fVmax) fSmax = fVmax;
531  if (fSmax < fSmin) fSmax = fSmin;
532  } else if (fMove == 3) {
533  // change of min and of max value
534  Double_t logicalDiff;
535  logicalDiff = diff * (fVmax - fVmin) / (fWidth-16);
536  if (fPressSmax + logicalDiff > fVmax)
537  logicalDiff = fVmax - fPressSmax;
538  if (fPressSmin + logicalDiff < fVmin)
539  logicalDiff = fVmin - fPressSmin;
540  fSmax = fPressSmax + logicalDiff;
541  fSmin = fPressSmin + logicalDiff;
542  if (fRelative) {
543  if (abs(diff) < 3) oldDiff = diff;
544  SetPointerPos(diff - oldDiff, 3);
545  oldDiff = diff;
546  }
547  }
548  else if (fMove == 4) {
549  // change pointer position
550  oldDiff = 0;
551  SetPointerPos(event->fX, 1);
552  }
553  if (fMove != 4) {
554  SetPointerPos(0, 2);
555  }
556  // check if position has changed
557  if (fMove != 0 && (fSmax != oldMax || fSmin != oldMin)) {
558  fClient->NeedRedraw(this);
561  PositionChanged();
562  }
563  return kTRUE;
564 }
565 
566 ////////////////////////////////////////////////////////////////////////////////
567 /// Set pointer position constrained in the slider range.
568 
570 {
571  fConstrained = on;
572 
573  if (fConstrained) {
576  else if (GetPointerPosition() >= GetMaxPosition())
578  }
579 }
580 
581 ////////////////////////////////////////////////////////////////////////////////
582 /// Set slider pointer position in pixel value.
583 
585 {
586  static Long64_t was = gSystem->Now();
587  Bool_t lcheck = (opt == 1);
588  Int_t oldPos = fCz;
589 
590  if (opt < 2) {
591  fCz = z;
592 
593  if (fCz < 7)
594  fCz = 7;
595  else if (fCz >= (Int_t)fWidth-7)
596  fCz = (Int_t)fWidth-7;
597  }
598  if (opt == 3) {
599  lcheck = kTRUE;
600  fCz += z;
601  if (fCz < 7)
602  fCz = 7;
603  else if (fCz >= (Int_t)fWidth-7)
604  fCz = (Int_t)fWidth-7;
605  }
606  if (fConstrained) {
607  int relMin = (int)((fWidth-16) * (fSmin - fVmin) / (fVmax - fVmin)) + 1;
608  int relMax = (int)((fWidth-16) * (fSmax - fVmin) / (fVmax - fVmin) + 15);
609  if(fCz < relMin+7) {
610  fCz = relMin+7;
611  lcheck = kTRUE;
612  }
613  if(fCz > relMax-7) {
614  fCz = relMax-7;
615  lcheck = kTRUE;
616  }
617  }
618  if (lcheck)
619  fSCz = fVmin + ((Double_t)(fCz-8) * (fVmax - fVmin) / (Double_t)(fWidth-16));
620  if(fSCz < fVmin) fSCz = fVmin;
621  if(fSCz > fVmax) fSCz = fVmax;
622  if (fConstrained) {
623  if(fSCz < fSmin) fSCz = fSmin;
624  if(fSCz > fSmax) fSCz = fSmax;
625  }
626 
627  DrawPointer();
628  fClient->NeedRedraw(this);
629  if (fCz != oldPos) {
630  Long64_t now = gSystem->Now();
631  if ((fMove != 4) && ((now-was) < 150)) return;
632  was = now;
636  fClient->NeedRedraw(this);
637  }
638 }
639 
640 ////////////////////////////////////////////////////////////////////////////////
641 /// Set pointer position in scaled (real) value
642 
644 {
645  if (fReversedScale) {
646  fSCz = fVmin + fVmax - pos;
647  }
648  else {
649  fSCz = pos;
650  }
651  Double_t absPos = (fSCz - fVmin) * (fWidth-16) / (fVmax - fVmin);
652  SetPointerPos((int)(absPos+5.0), 0);
653 }
654 
655 ////////////////////////////////////////////////////////////////////////////////
656 /// Save an horizontal slider as a C++ statement(s) on output stream out.
657 
658 void TGTripleHSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
659 {
660  SaveUserColor(out, option);
661 
662  out <<" TGTripleHSlider *";
663  out << GetName() << " = new TGTripleHSlider(" << fParent->GetName()
664  << "," << GetWidth() << ",";
665  out << GetSString() << "," << WidgetId() << ",";
666  out << GetOptionString() << ",ucolor";
667  if (fMarkEnds) {
668  if (fReversedScale)
669  out << ",kTRUE,kTRUE";
670  else
671  out << ",kFALSE,kTRUE";
672  } else if (fReversedScale) {
673  out << ",kTRUE,kFALSE";
674  } else {
675  out << ",kFALSE,kFALSE";
676  }
677  if (!fConstrained) {
678  if (fRelative)
679  out << ",kFALSE,kTRUE);" << std::endl;
680  else
681  out << ",kFALSE,kFALSE);" << std::endl;
682  }
683  else if (fRelative) {
684  out << ",kTRUE);" << std::endl;
685  }
686  else {
687  out << ");" << std::endl;
688  }
689  if (option && strstr(option, "keep_names"))
690  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
691 
692  if (fVmin != 0 || fVmax != (Int_t)fWidth)
693  out << " " << GetName() << "->SetRange(" << fVmin << "," << fVmax
694  << ");" << std::endl;
695 
696  if (fSmin != fWidth/8*3 || fSmax != fWidth/8*5)
697  out << " " << GetName() << "->SetPosition(" << GetMinPosition()
698  << "," << GetMaxPosition() << ");" << std::endl;
699 
700  if (fScale != 10)
701  out << " " << GetName() << "->SetScale(" << fScale << ");" << std::endl;
702 
703  out << " " << GetName() << "->SetPointerPosition(" << fSCz << ");" << std::endl;
704 }
705 
706 ////////////////////////////////////////////////////////////////////////////////
707 /// Save an horizontal slider as a C++ statement(s) on output stream out.
708 
709 void TGTripleVSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
710 {
711  SaveUserColor(out, option);
712 
713  out<<" TGTripleVSlider *";
714  out << GetName() << " = new TGTripleVSlider("<< fParent->GetName()
715  << "," << GetHeight() << ",";
716  out << GetSString() << "," << WidgetId() << ",";
717  out << GetOptionString() << ",ucolor";
718  if (fMarkEnds) {
719  if (fReversedScale)
720  out << ",kTRUE,kTRUE";
721  else
722  out << ",kFALSE,kTRUE";
723  } else if (fReversedScale) {
724  out << ",kTRUE,kFALSE";
725  } else {
726  out << ",kFALSE,kFALSE";
727  }
728  if (!fConstrained) {
729  if (fRelative)
730  out << ",kFALSE,kTRUE);" << std::endl;
731  else
732  out << ",kFALSE,kFALSE);" << std::endl;
733  }
734  else if (fRelative) {
735  out << ",kTRUE);" << std::endl;
736  }
737  else {
738  out << ");" << std::endl;
739  }
740  if (option && strstr(option, "keep_names"))
741  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
742 
743  if (fVmin != 0 || fVmax != (Int_t)fHeight)
744  out << " " << GetName() <<"->SetRange(" << fVmin << "," << fVmax
745  << ");" << std::endl;
746 
747  if (fSmin != fHeight/8*3 || fSmax != fHeight/8*5)
748  out << " " << GetName() << "->SetPosition(" << GetMinPosition()
749  << "," << GetMaxPosition() << ");" << std::endl;
750 
751  if (fScale != 10)
752  out << " " << GetName() << "->SetScale(" << fScale << ");" << std::endl;
753 
754  out << " " << GetName() << "->SetPointerPosition(" << fSCz << ");" << std::endl;
755 }
TGWindow::SetWindowName
virtual void SetWindowName(const char *name=0)
Set window name.
Definition: TGWindow.cxx:129
TGDoubleSlider::GetSString
TString GetSString() const
returns scaling type as string
Definition: TGDoubleSlider.cxx:146
TGFrame::GetHeight
UInt_t GetHeight() const
Definition: TGFrame.h:225
kSL_POINTER
@ kSL_POINTER
Definition: WidgetMessageTypes.h:64
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TGDoubleSlider::PositionChanged
virtual void PositionChanged()
Definition: TGDoubleSlider.h:162
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGClient::ProcessLine
void ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2)
Execute string "cmd" via the interpreter.
Definition: TGClient.cxx:916
kPointerMotionMask
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:163
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGPicture.h
TGFrame::fWidth
UInt_t fWidth
frame width
Definition: TGFrame.h:87
TGTripleVSlider::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in vertical slider.
Definition: TGTripleSlider.cxx:158
TGTripleHSlider::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in horizontal slide widget.
Definition: TGTripleSlider.cxx:491
TGTripleVSlider::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an horizontal slider as a C++ statement(s) on output stream out.
Definition: TGTripleSlider.cxx:709
TGDoubleHSlider::DoRedraw
virtual void DoRedraw()
Redraw horizontal slider widget.
Definition: TGDoubleSlider.cxx:460
TGTripleVSlider::DrawPointer
virtual void DrawPointer()
Draw slider pointer.
Definition: TGTripleSlider.cxx:150
TGTripleVSlider::SetPointerPosition
virtual void SetPointerPosition(Double_t pos)
Set pointer position in scaled (real) value.
Definition: TGTripleSlider.cxx:370
Long64_t
long long Long64_t
Definition: RtypesCore.h:80
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:893
TGTripleHSlider::SetPointerPosition
virtual void SetPointerPosition(Double_t pos)
Set pointer position in scaled (real) value.
Definition: TGTripleSlider.cxx:643
TGDoubleSlider::fVmin
Double_t fVmin
logical lower limit of slider
Definition: TGDoubleSlider.h:47
event
Definition: triangle.c:552
TGPicture::Draw
void Draw(Option_t *="")
Default Draw method for all objects.
Definition: TGPicture.h:46
TGTripleSlider.h
kSL_RELEASE
@ kSL_RELEASE
Definition: WidgetMessageTypes.h:63
kButton1
@ kButton1
Definition: GuiTypes.h:214
TVirtualX.h
TGTripleVSlider::fRelative
Bool_t fRelative
kTRUE if pointer position is relative to slider
Definition: TGTripleSlider.h:26
TGClient::FreePicture
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition: TGClient.cxx:310
TGTripleHSlider::fRelative
Bool_t fRelative
kTRUE if pointer position is relative to slider
Definition: TGTripleSlider.h:79
TGDoubleSlider::fSmax
Double_t fSmax
logical position of max value of Slider
Definition: TGDoubleSlider.h:45
TGTripleHSlider::HandleConfigureNotify
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handles resize events for this widget.
Definition: TGTripleSlider.cxx:481
TGDoubleSlider::fMove
Int_t fMove
1: move min value 2: move max value 3: move min and max value 0: don't move any value
Definition: TGDoubleSlider.h:54
kButtonPressMask
const Mask_t kButtonPressMask
Definition: GuiTypes.h:161
TGTripleVSlider::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in vertical slider.
Definition: TGTripleSlider.cxx:218
TGTripleVSlider::SetPointerPos
virtual void SetPointerPos(Int_t z, Int_t opt=0)
Set slider pointer position in pixel value.
Definition: TGTripleSlider.cxx:311
TGDoubleSlider::Pressed
virtual void Pressed()
Definition: TGDoubleSlider.h:163
bool
TGFrame::GetWidth
UInt_t GetWidth() const
Definition: TGFrame.h:224
TGTripleHSlider::fPointerPic
const TGPicture * fPointerPic
picture to draw pointer
Definition: TGTripleSlider.h:80
id
XFontStruct * id
Definition: TGX11.cxx:109
TGFrame::GetOptionString
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2480
TGDoubleSlider::fVmax
Double_t fVmax
logical upper limit of slider
Definition: TGDoubleSlider.h:48
TGWidget::fCommand
TString fCommand
command to be executed
Definition: TGWidget.h:49
TGTripleHSlider::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an horizontal slider as a C++ statement(s) on output stream out.
Definition: TGTripleSlider.cxx:658
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
kC_HSLIDER
@ kC_HSLIDER
Definition: WidgetMessageTypes.h:58
TGTripleHSlider::PointerPositionChanged
virtual void PointerPositionChanged()
Definition: TGTripleSlider.h:96
TGDoubleHSlider
Dragging the slider will generate the event:
Definition: TGDoubleSlider.h:196
TGTripleVSlider::GetPointerPosition
virtual Float_t GetPointerPosition() const
Definition: TGTripleSlider.h:45
TSystem.h
TGTripleVSlider
TripleSlider inherit from DoubleSlider widgets and allow easy selection of a min, max and pointer val...
Definition: TGTripleSlider.h:20
h
#define h(i)
Definition: RSha256.hxx:106
TGWidget::WidgetId
Int_t WidgetId() const
Definition: TGWidget.h:68
TGWidget::fMsgWindow
const TGWindow * fMsgWindow
window which handles widget events
Definition: TGWidget.h:48
TGWindow::GetName
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:336
TGObject::fId
Handle_t fId
X11/Win32 Window identifier.
Definition: TGObject.h:26
TGDoubleSlider::fMarkEnds
Bool_t fMarkEnds
lines marking where stretch zones begin
Definition: TGDoubleSlider.h:59
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
TGTripleVSlider::fCz
Int_t fCz
vertical pointer position in pixel coordinates
Definition: TGTripleSlider.h:23
TGTripleVSlider::~TGTripleVSlider
virtual ~TGTripleVSlider()
Delete vertical slider widget.
Definition: TGTripleSlider.cxx:132
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TGDoubleSlider::fPressSmax
Double_t fPressSmax
logical max position at button press event
Definition: TGDoubleSlider.h:53
kButtonPress
@ kButtonPress
Definition: GuiTypes.h:60
kButtonReleaseMask
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:162
TGTripleVSlider::DoRedraw
virtual void DoRedraw()
Redraw vertical slider widget.
Definition: TGTripleSlider.cxx:140
kButtonRelease
@ kButtonRelease
Definition: GuiTypes.h:60
TGTripleHSlider
TripleSlider inherit from DoubleSlider widgets and allow easy selection of a min, max and pointer val...
Definition: TGTripleSlider.h:73
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
TGClient::GetPicture
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:291
TSystem::Now
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
Definition: TSystem.cxx:465
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
TGDoubleSlider::Released
virtual void Released()
Definition: TGDoubleSlider.h:164
TGFrame::GetBckgndGC
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition: TGFrame.cxx:775
TGTripleHSlider::~TGTripleHSlider
virtual ~TGTripleHSlider()
Delete a horizontal slider widget.
Definition: TGTripleSlider.cxx:405
TGTripleHSlider::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in horizontal slider widget.
Definition: TGTripleSlider.cxx:431
kSL_POS
@ kSL_POS
Definition: WidgetMessageTypes.h:60
unsigned int
TGDoubleSlider::fPressPoint
Int_t fPressPoint
mouse position at button press event
Definition: TGDoubleSlider.h:51
TGDoubleVSlider
Dragging the slider will generate the event:
Definition: TGDoubleSlider.h:170
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TGTripleVSlider::fSCz
Double_t fSCz
vertical pointer position
Definition: TGTripleSlider.h:24
TGTripleHSlider::SetConstrained
virtual void SetConstrained(Bool_t on=kTRUE)
Set pointer position constrained in the slider range.
Definition: TGTripleSlider.cxx:569
TGWidget::fWidgetId
Int_t fWidgetId
the widget id (used for event processing)
Definition: TGWidget.h:46
TGTripleVSlider::fConstrained
Bool_t fConstrained
kTRUE if pointer is constrained to slider edges
Definition: TGTripleSlider.h:25
TGClient::NeedRedraw
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:374
Double_t
double Double_t
Definition: RtypesCore.h:59
TGDoubleVSlider::DoRedraw
virtual void DoRedraw()
Redraw vertical slider widget.
Definition: TGDoubleSlider.cxx:266
TGObject::fClient
TGClient * fClient
Connection to display server.
Definition: TGObject.h:27
kSL_PRESS
@ kSL_PRESS
Definition: WidgetMessageTypes.h:62
TGTripleVSlider::fPointerPic
const TGPicture * fPointerPic
picture to draw pointer
Definition: TGTripleSlider.h:27
TGTripleHSlider::fConstrained
Bool_t fConstrained
kTRUE if pointer is constrained to slider edges
Definition: TGTripleSlider.h:78
TGDoubleSlider::ChangeCursor
void ChangeCursor(Event_t *event)
Change the cursor shape depending on the slider area.
Definition: TGDoubleSlider.cxx:176
TGFrame::HandleConfigureNotify
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
Definition: TGFrame.cxx:443
TGTripleHSlider::DoRedraw
virtual void DoRedraw()
Redraw horizontal slider widget.
Definition: TGTripleSlider.cxx:413
Event_t
Event structure.
Definition: GuiTypes.h:174
TGDoubleSlider::fReversedScale
Bool_t fReversedScale
reverse which end is min and max
Definition: TGDoubleSlider.h:58
TGTripleVSlider::TGTripleVSlider
TGTripleVSlider(const TGWindow *p=0, UInt_t h=1, UInt_t type=1, Int_t id=-1, UInt_t options=kVerticalFrame, Pixel_t back=GetDefaultFrameBackground(), Bool_t reversed=kFALSE, Bool_t mark_ends=kFALSE, Bool_t constrained=kTRUE, Bool_t relative=kFALSE)
Create a vertical slider widget.
Definition: TGTripleSlider.cxx:112
TGTripleVSlider::HandleConfigureNotify
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handles resize events for this widget.
Definition: TGTripleSlider.cxx:208
kC_VSLIDER
@ kC_VSLIDER
Definition: WidgetMessageTypes.h:59
TGDoubleSlider::GetMinPosition
virtual Float_t GetMinPosition() const
Definition: TGDoubleSlider.h:100
TGTripleHSlider::DrawPointer
virtual void DrawPointer()
Draw slider pointer.
Definition: TGTripleSlider.cxx:423
TGDoubleSlider::fPressSmin
Double_t fPressSmin
logical min position at button press event
Definition: TGDoubleSlider.h:52
TGTripleHSlider::GetPointerPosition
virtual Float_t GetPointerPosition() const
Definition: TGTripleSlider.h:98
kStructureNotifyMask
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:166
TGFrame::fHeight
UInt_t fHeight
frame height
Definition: TGFrame.h:88
TGDoubleSlider::fScale
Int_t fScale
tick mark scale
Definition: TGDoubleSlider.h:49
type
int type
Definition: TGX11.cxx:121
TGTripleHSlider::SetPointerPos
virtual void SetPointerPos(Int_t z, Int_t opt=0)
Set slider pointer position in pixel value.
Definition: TGTripleSlider.cxx:584
TGTripleVSlider::SetConstrained
virtual void SetConstrained(Bool_t on=kTRUE)
Set pointer position constrained in the slider range.
Definition: TGTripleSlider.cxx:296
TGDoubleSlider::fSmin
Double_t fSmin
logical position of min value of Slider
Definition: TGDoubleSlider.h:44
TGTripleHSlider::fSCz
Double_t fSCz
vertical pointer position
Definition: TGTripleSlider.h:77
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
TGTripleVSlider::PointerPositionChanged
virtual void PointerPositionChanged()
Definition: TGTripleSlider.h:43
TGTripleHSlider::fCz
Int_t fCz
horizontal pointer position in pixel coordinates
Definition: TGTripleSlider.h:76
int
TGDoubleSlider::GetMaxPosition
virtual Float_t GetMaxPosition() const
Definition: TGDoubleSlider.h:103
TGTripleHSlider::TGTripleHSlider
TGTripleHSlider(const TGWindow *p=0, UInt_t w=1, UInt_t type=1, Int_t id=-1, UInt_t options=kHorizontalFrame, Pixel_t back=GetDefaultFrameBackground(), Bool_t reversed=kFALSE, Bool_t mark_ends=kFALSE, Bool_t constrained=kTRUE, Bool_t relative=kFALSE)
Create horizontal slider widget.
Definition: TGTripleSlider.cxx:385