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