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