Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
28TripleSlider inherit from DoubleSlider widgets and allow easy
29selection of a min, max and pointer value out of a range.
30The pointer position can be constrained to edges of slider and / or
31can be relative to the slider position.
32
33To change the min value press the mouse near to the left / bottom
34edge of the slider.
35To change the max value press the mouse near to the right / top
36edge of the slider.
37To change both values simultaneously press the mouse near to the
38center of the slider.
39To change pointer value press the mouse on the pointer and drag it
40to the desired position
41
42Dragging the slider will generate the event:
43 - kC_VSLIDER, kSL_POS, slider id, 0
44
45Pressing the mouse will generate the event:
46 - kC_VSLIDER, kSL_PRESS, slider id, 0
47
48Releasing the mouse will generate the event:
49 - kC_VSLIDER, kSL_RELEASE, slider id, 0
50
51Moving the pointer will generate the event:
52 - kC_VSLIDER, kSL_POINTER, slider id, 0
53
54Use the functions GetMinPosition(), GetMaxPosition() and
55GetPosition() to retrieve the position of the slider.
56Use the function GetPointerPosition() to retrieve the position of
57the pointer
58
59*/
60
61
62/** \class TGTripleHSlider
63 \ingroup guiwidgets
64TripleSlider inherit from DoubleSlider widgets and allow easy
65selection of a min, max and pointer value out of a range.
66The pointer position can be constrained to edges of slider and / or
67can be relative to the slider position.
68
69To change the min value press the mouse near to the left / bottom
70edge of the slider.
71To change the max value press the mouse near to the right / top
72edge of the slider.
73To change both values simultaneously press the mouse near to the
74center of the slider.
75To change pointer value press the mouse on the pointer and drag it
76to the desired position
77
78Dragging the slider will generate the event:
79 - kC_HSLIDER, kSL_POS, slider id, 0
80
81Pressing the mouse will generate the event:
82 - kC_HSLIDER, kSL_PRESS, slider id, 0
83
84Releasing the mouse will generate the event:
85 - kC_HSLIDER, kSL_RELEASE, slider id, 0
86
87Moving the pointer will generate the event:
88 - kC_HSLIDER, kSL_POINTER, slider id, 0
89
90Use the functions GetMinPosition(), GetMaxPosition() and
91GetPosition() to retrieve the position of the slider.
92Use the function GetPointerPosition() to retrieve the position of
93the 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
106
107////////////////////////////////////////////////////////////////////////////////
108/// Create a vertical slider widget.
109
111 UInt_t options, ULong_t back,
114 : TGDoubleVSlider(p, h, type, id, options, back, reversed, mark_ends)
115{
116 fPointerPic = fClient->GetPicture("slider1h.xpm");
117 if (!fPointerPic)
118 Error("TGTripleVSlider", "slider1h.xpm not found");
121 fCz = 0;
122 fSCz = 0;
125}
126
127////////////////////////////////////////////////////////////////////////////////
128/// Delete vertical slider widget.
129
134
135////////////////////////////////////////////////////////////////////////////////
136/// Redraw vertical slider widget.
137
139{
141 // Draw Pointer
142 DrawPointer();
143}
144
145////////////////////////////////////////////////////////////////////////////////
146/// Draw slider pointer
147
149{
150 if (fPointerPic) fPointerPic->Draw(fId, GetBckgndGC()(), fWidth/2-7, fCz-5);
151}
152
153////////////////////////////////////////////////////////////////////////////////
154/// Handle mouse button event in vertical slider.
155
157{
158 if (event->fType == kButtonPress && event->fCode == kButton1) {
159 // constrain to the slider width
160 if (event->fX < (Int_t)fWidth/2-7 || event->fX > (Int_t)fWidth/2+7) {
161 return kTRUE;
162 }
163 fPressPoint = event->fY;
166
167 int relMin = (int)((fHeight-16) * (fSmin - fVmin) / (fVmax - fVmin)) + 1;
168 int relMax = (int)((fHeight-16) * (fSmax - fVmin) / (fVmax - fVmin) + 15);
169 if (fPressPoint > (fCz - 5) && fPressPoint < (fCz + 5) &&
170 event->fX > ((Int_t)fWidth / 2) - 7 && event->fX < ((Int_t)fWidth / 2) + 5)
171 // move pointer
172 fMove = 4;
173 else if (fPressPoint < (relMax - relMin) / 4 + relMin)
174 // move only min value
175 fMove = 1;
176 else if (fPressPoint > (relMax - relMin) / 4 * 3 + relMin)
177 // move only max value
178 fMove = 2;
179 else
180 // move min and max value
181 fMove = 3;
182
185 Pressed();
186
187 // last argument kFALSE forces all specified events to this window
190 kTRUE, kFALSE);
191 } else if (event->fType == kButtonRelease && event->fCode == kButton1) {
194 Released();
195 fMove = 0;
196 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
197 } else
198 fMove = 0;
199
200 return kTRUE;
201}
202
203////////////////////////////////////////////////////////////////////////////////
204/// Handles resize events for this widget.
205
212
213////////////////////////////////////////////////////////////////////////////////
214/// Handle mouse motion event in vertical slider.
215
217{
218 if (fMove < 3) {
219 // if the mouse pointer is on the cursor,
220 // and we are not moving anything,
221 // set the cursor shape as Pointer
222 if (event->fY > (fCz - 5) && event->fY < (fCz + 5) &&
223 event->fX > ((Int_t)fWidth / 2) - 7 &&
224 event->fX < ((Int_t)fWidth / 2) + 5 &&
225 fMove == 0)
226 gVirtualX->SetCursor(fId, kNone);
227 else
228 ChangeCursor(event);
229 }
230 static int oldDiff = 0;
231 static Long64_t was = gSystem->Now();
232 Long64_t now = gSystem->Now();
233
234 if (fMove == 0) return kTRUE;
235 if ((now-was) < 50) return kTRUE;
236 was = now;
237
238 int diff;
240
241 diff = event->fY - fPressPoint;
242 oldMin = fSmin;
243 oldMax = fSmax;
244
245 if (fMove == 1) {
246 // change of min value
247 oldDiff = 0;
248 fSmin = fPressSmin + diff * (fVmax - fVmin) / (fHeight-16);
249 if (fSmin < fVmin) fSmin = fVmin;
250 if (fSmin > fSmax) fSmin = fSmax;
251 } else if (fMove == 2) {
252 // change of max value
253 oldDiff = 0;
254 fSmax = fPressSmax + diff * (fVmax - fVmin) / (fHeight-16);
255 if (fSmax > fVmax) fSmax = fVmax;
256 if (fSmax < fSmin) fSmax = fSmin;
257 } else if (fMove == 3) {
258 // change of min and of max value
260 logicalDiff = diff * (fVmax - fVmin) / (fHeight-16);
267 if (fRelative) {
268 if (abs(diff) < 3) oldDiff = diff;
270 oldDiff = diff;
271 }
272 }
273 else if (fMove == 4) {
274 // change pointer position
275 oldDiff = 0;
276 SetPointerPos(event->fY, 1);
277 }
278 if (fMove != 4){
279 SetPointerPos(0, 2);
280 }
281 // check if position has changed
282 if (fMove != 0 && (fSmax != oldMax || fSmin != oldMin)) {
283 fClient->NeedRedraw(this);
287 }
288 return kTRUE;
289}
290
291////////////////////////////////////////////////////////////////////////////////
292/// Set pointer position constrained in the slider range.
293
305
306////////////////////////////////////////////////////////////////////////////////
307/// Set slider pointer position in pixel value.
308
310{
311 static Long64_t was = gSystem->Now();
312 Bool_t lcheck = (opt == 1);
313 Int_t oldPos = fCz;
314
315 if (opt < 2) {
316 fCz = z;
317
318 if (fCz < 7)
319 fCz = 7;
320 else if (fCz >= (Int_t)fHeight - 7)
321 fCz = (Int_t)fHeight - 7;
322 }
323 if (opt == 3) {
324 lcheck = kTRUE;
325 fCz += z;
326 if (fCz < 7)
327 fCz = 7;
328 else if (fCz >= (Int_t)fHeight-7)
329 fCz = (Int_t)fHeight - 7;
330 }
331 if (fConstrained) {
332 int relMin = (int)((fHeight-16) * (fSmin - fVmin) / (fVmax - fVmin)) + 1;
333 int relMax = (int)((fHeight-16) * (fSmax - fVmin) / (fVmax - fVmin) + 15);
334 if(fCz < relMin+7) {
335 fCz = relMin+7;
336 lcheck = kTRUE;
337 }
338 if(fCz > relMax-7) {
339 fCz = relMax-7;
340 lcheck = kTRUE;
341 }
342 }
343 if (lcheck)
344 fSCz = fVmin + ((Double_t)(fCz-8) * (fVmax - fVmin) / (Double_t)(fHeight-16));
345 if(fSCz < fVmin) fSCz = fVmin;
346 if(fSCz > fVmax) fSCz = fVmax;
347 if (fConstrained) {
348 if(fSCz < fSmin) fSCz = fSmin;
349 if(fSCz > fSmax) fSCz = fSmax;
350 }
351
352 DrawPointer();
353 fClient->NeedRedraw(this);
354 if (fCz != oldPos) {
355 Long64_t now = gSystem->Now();
356 if ((fMove != 4) && ((now-was) < 150)) return;
357 was = now;
361 fClient->NeedRedraw(this);
362 }
363}
364
365////////////////////////////////////////////////////////////////////////////////
366/// Set pointer position in scaled (real) value
367
369{
370 if (fReversedScale) {
371 fSCz = fVmin + fVmax - pos;
372 }
373 else {
374 fSCz = pos;
375 }
376 Double_t absPos = (fSCz - fVmin) * (fHeight-16) / (fVmax - fVmin);
377 SetPointerPos((int)(absPos+5.0), 0);
378}
379
380////////////////////////////////////////////////////////////////////////////////
381/// Create horizontal slider widget.
382
384 UInt_t options, ULong_t back,
387 : TGDoubleHSlider(p, w, type, id, options, back, reversed, mark_ends)
388{
389 fPointerPic = fClient->GetPicture("slider1v.xpm");
390 if (!fPointerPic)
391 Error("TGTripleVSlider", "slider1v.xpm not found");
394 fCz = 0;
395 fSCz = 0;
398}
399
400////////////////////////////////////////////////////////////////////////////////
401/// Delete a horizontal slider widget.
402
407
408////////////////////////////////////////////////////////////////////////////////
409/// Redraw horizontal slider widget.
410
412{
414 // Draw Pointer
415 DrawPointer();
416}
417
418////////////////////////////////////////////////////////////////////////////////
419/// Draw slider pointer
420
422{
423 if (fPointerPic) fPointerPic->Draw(fId, GetBckgndGC()(), fCz-5, fHeight/2-7);
424}
425
426////////////////////////////////////////////////////////////////////////////////
427/// Handle mouse button event in horizontal slider widget.
428
430{
431 if (event->fType == kButtonPress && event->fCode == kButton1) {
432 // constrain to the slider height
433 if (event->fY < (Int_t)fHeight/2-7 || event->fY > (Int_t)fHeight/2+7) {
434 return kTRUE;
435 }
436 fPressPoint = event->fX;
439
440 int relMin = (int)((fWidth-16) * (fSmin - fVmin) / (fVmax - fVmin)) + 1;
441 int relMax = (int)((fWidth-16) * (fSmax - fVmin) / (fVmax - fVmin) + 15);
442 if (fPressPoint > (fCz - 5) && fPressPoint < (fCz + 5) &&
443 event->fY > ((Int_t)fHeight / 2) - 7 && event->fY < ((Int_t)fHeight / 2) + 5)
444 // move pointer
445 fMove = 4;
446 else if (fPressPoint < (relMax - relMin) / 4 + relMin)
447 // move only min value
448 fMove = 1;
449 else if (fPressPoint > (relMax - relMin) / 4 * 3 + relMin)
450 // move only max value
451 fMove = 2;
452 else
453 // move min and max value
454 fMove = 3;
455
458 Pressed();
459
460 // last argument kFALSE forces all specified events to this window
463 kTRUE, kFALSE);
464 } else if (event->fType == kButtonRelease && event->fCode == kButton1) {
467 Released();
468 fMove = 0;
469 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
470 } else
471 fMove = 0;
472
473 return kTRUE;
474}
475
476////////////////////////////////////////////////////////////////////////////////
477/// Handles resize events for this widget.
478
485
486////////////////////////////////////////////////////////////////////////////////
487/// Handle mouse motion event in horizontal slide widget.
488
490{
491 if (fMove < 3) {
492 // if the mouse pointer is on the cursor,
493 // and we are not moving anything,
494 // set the cursor shape as Pointer
495 if (event->fX > (fCz - 5) && event->fX < (fCz + 5) &&
496 event->fY > ((Int_t)fHeight / 2) - 7 &&
497 event->fY < ((Int_t)fHeight / 2) + 5 &&
498 fMove == 0)
499 gVirtualX->SetCursor(fId, kNone);
500 else
501 ChangeCursor(event);
502 }
503 static int oldDiff = 0;
504 static Long64_t was = gSystem->Now();
505 Long64_t now = gSystem->Now();
506
507 if (fMove == 0) return kTRUE;
508 if ((now-was) < 50) return kTRUE;
509 was = now;
510
511 int diff;
513
514 diff = event->fX - fPressPoint;
515 oldMin = fSmin;
516 oldMax = fSmax;
517
518 if (fMove == 1) {
519 // change of min value
520 oldDiff = 0;
521 fSmin = fPressSmin + diff * (fVmax - fVmin) / (fWidth-16);
522 if (fSmin < fVmin) fSmin = fVmin;
523 if (fSmin > fSmax) fSmin = fSmax;
524 } else if (fMove == 2) {
525 // change of max value
526 oldDiff = 0;
527 fSmax = fPressSmax + diff * (fVmax - fVmin) / (fWidth-16);
528 if (fSmax > fVmax) fSmax = fVmax;
529 if (fSmax < fSmin) fSmax = fSmin;
530 } else if (fMove == 3) {
531 // change of min and of max value
533 logicalDiff = diff * (fVmax - fVmin) / (fWidth-16);
540 if (fRelative) {
541 if (abs(diff) < 3) oldDiff = diff;
543 oldDiff = diff;
544 }
545 }
546 else if (fMove == 4) {
547 // change pointer position
548 oldDiff = 0;
549 SetPointerPos(event->fX, 1);
550 }
551 if (fMove != 4) {
552 SetPointerPos(0, 2);
553 }
554 // check if position has changed
555 if (fMove != 0 && (fSmax != oldMax || fSmin != oldMin)) {
556 fClient->NeedRedraw(this);
560 }
561 return kTRUE;
562}
563
564////////////////////////////////////////////////////////////////////////////////
565/// Set pointer position constrained in the slider range.
566
578
579////////////////////////////////////////////////////////////////////////////////
580/// Set slider pointer position in pixel value.
581
583{
584 static Long64_t was = gSystem->Now();
585 Bool_t lcheck = (opt == 1);
586 Int_t oldPos = fCz;
587
588 if (opt < 2) {
589 fCz = z;
590
591 if (fCz < 7)
592 fCz = 7;
593 else if (fCz >= (Int_t)fWidth-7)
594 fCz = (Int_t)fWidth-7;
595 }
596 if (opt == 3) {
597 lcheck = kTRUE;
598 fCz += z;
599 if (fCz < 7)
600 fCz = 7;
601 else if (fCz >= (Int_t)fWidth-7)
602 fCz = (Int_t)fWidth-7;
603 }
604 if (fConstrained) {
605 int relMin = (int)((fWidth-16) * (fSmin - fVmin) / (fVmax - fVmin)) + 1;
606 int relMax = (int)((fWidth-16) * (fSmax - fVmin) / (fVmax - fVmin) + 15);
607 if(fCz < relMin+7) {
608 fCz = relMin+7;
609 lcheck = kTRUE;
610 }
611 if(fCz > relMax-7) {
612 fCz = relMax-7;
613 lcheck = kTRUE;
614 }
615 }
616 if (lcheck)
617 fSCz = fVmin + ((Double_t)(fCz-8) * (fVmax - fVmin) / (Double_t)(fWidth-16));
618 if(fSCz < fVmin) fSCz = fVmin;
619 if(fSCz > fVmax) fSCz = fVmax;
620 if (fConstrained) {
621 if(fSCz < fSmin) fSCz = fSmin;
622 if(fSCz > fSmax) fSCz = fSmax;
623 }
624
625 DrawPointer();
626 fClient->NeedRedraw(this);
627 if (fCz != oldPos) {
628 Long64_t now = gSystem->Now();
629 if ((fMove != 4) && ((now-was) < 150)) return;
630 was = now;
634 fClient->NeedRedraw(this);
635 }
636}
637
638////////////////////////////////////////////////////////////////////////////////
639/// Set pointer position in scaled (real) value
640
642{
643 if (fReversedScale) {
644 fSCz = fVmin + fVmax - pos;
645 }
646 else {
647 fSCz = pos;
648 }
649 Double_t absPos = (fSCz - fVmin) * (fWidth-16) / (fVmax - fVmin);
650 SetPointerPos((int)(absPos+5.0), 0);
651}
652
653////////////////////////////////////////////////////////////////////////////////
654/// Save an horizontal slider as a C++ statement(s) on output stream out.
655
656void TGTripleHSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
657{
658 SaveUserColor(out, option);
659
660 out << " TGTripleHSlider *" << GetName() << " = new TGTripleHSlider(" << fParent->GetName() << "," << GetWidth()
661 << "," << GetSString() << "," << WidgetId() << "," << GetOptionString() << ", ucolor";
662 if (fMarkEnds) {
663 if (fReversedScale)
664 out << ",kTRUE,kTRUE";
665 else
666 out << ",kFALSE,kTRUE";
667 } else if (fReversedScale) {
668 out << ",kTRUE,kFALSE";
669 } else {
670 out << ",kFALSE,kFALSE";
671 }
672 if (!fConstrained) {
673 if (fRelative)
674 out << ",kFALSE,kTRUE);\n";
675 else
676 out << ",kFALSE,kFALSE);\n";
677 } else if (fRelative) {
678 out << ",kTRUE);\n";
679 } else {
680 out << ");\n";
681 }
682 if (option && strstr(option, "keep_names"))
683 out << " " << GetName() << "->SetName(\"" << GetName() << "\");\n";
684
685 if (fVmin != 0 || fVmax != (Int_t)fWidth)
686 out << " " << GetName() << "->SetRange(" << fVmin << "," << fVmax << ");\n";
687
688 if (fSmin != fWidth / 8 * 3 || fSmax != fWidth / 8 * 5)
689 out << " " << GetName() << "->SetPosition(" << GetMinPosition() << "," << GetMaxPosition() << ");\n";
690
691 if (fScale != 10)
692 out << " " << GetName() << "->SetScale(" << fScale << ");\n";
693
694 out << " " << GetName() << "->SetPointerPosition(" << fSCz << ");\n";
695}
696
697////////////////////////////////////////////////////////////////////////////////
698/// Save an horizontal slider as a C++ statement(s) on output stream out.
699
700void TGTripleVSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
701{
702 SaveUserColor(out, option);
703
704 out << " TGTripleVSlider *" << GetName() << " = new TGTripleVSlider(" << fParent->GetName() << "," << GetHeight()
705 << "," << GetSString() << "," << WidgetId() << "," << GetOptionString() << ", ucolor";
706 if (fMarkEnds) {
707 if (fReversedScale)
708 out << ",kTRUE,kTRUE";
709 else
710 out << ",kFALSE,kTRUE";
711 } else if (fReversedScale) {
712 out << ",kTRUE,kFALSE";
713 } else {
714 out << ",kFALSE,kFALSE";
715 }
716 if (!fConstrained) {
717 if (fRelative)
718 out << ",kFALSE,kTRUE);\n";
719 else
720 out << ",kFALSE,kFALSE);\n";
721 } else if (fRelative) {
722 out << ",kTRUE);\n";
723 } else {
724 out << ");\n";
725 }
726 if (option && strstr(option, "keep_names"))
727 out << " " << GetName() << "->SetName(\"" << GetName() << "\");\n";
728
729 if (fVmin != 0 || fVmax != (Int_t)fHeight)
730 out << " " << GetName() << "->SetRange(" << fVmin << "," << fVmax << ");\n";
731
732 if (fSmin != fHeight / 8 * 3 || fSmax != fHeight / 8 * 5)
733 out << " " << GetName() << "->SetPosition(" << GetMinPosition() << "," << GetMaxPosition() << ");\n";
734
735 if (fScale != 10)
736 out << " " << GetName() << "->SetScale(" << fScale << ");\n";
737
738 out << " " << GetName() << "->SetPointerPosition(" << fSCz << ");\n";
739}
@ kButtonRelease
Definition GuiTypes.h:60
@ kButtonPress
Definition GuiTypes.h:60
const Mask_t kButtonPressMask
Definition GuiTypes.h:161
const Mask_t kPointerMotionMask
Definition GuiTypes.h:163
const Handle_t kNone
Definition GuiTypes.h:88
const Mask_t kStructureNotifyMask
Definition GuiTypes.h:166
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:162
@ kButton1
Definition GuiTypes.h:214
#define h(i)
Definition RSha256.hxx:106
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
Definition RtypesCore.h:69
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:208
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
R__EXTERN TSystem * gSystem
Definition TSystem.h:572
#define gVirtualX
Definition TVirtualX.h:337
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:922
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition TGClient.cxx:288
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:380
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition TGClient.cxx:316
Dragging the slider will generate the event:
void DoRedraw() override
Redraw horizontal slider widget.
void ChangeCursor(Event_t *event)
Change the cursor shape depending on the slider area.
virtual Float_t GetMaxPosition() const
Double_t fSmin
logical position of min value of Slider
Double_t fPressSmax
logical max position at button press event
virtual void PositionChanged()
Double_t fSmax
logical position of max value of Slider
Double_t fVmax
logical upper limit of slider
Int_t fScale
tick mark scale
Double_t fVmin
logical lower limit of slider
Int_t fMove
1: move min value 2: move max value 3: move min and max value 0: don't move any value
virtual Float_t GetMinPosition() const
Bool_t fReversedScale
reverse which end is min and max
Double_t fPressSmin
logical min position at button press event
virtual void Released()
Bool_t fMarkEnds
lines marking where stretch zones begin
virtual void Pressed()
Int_t fPressPoint
mouse position at button press event
TString GetSString() const
returns scaling type as string
Dragging the slider will generate the event:
void DoRedraw() override
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:331
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
Definition TGFrame.cxx:435
UInt_t fHeight
frame height
Definition TGFrame.h:88
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition TGFrame.cxx:2512
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
Definition TGFrame.cxx:637
UInt_t fWidth
frame width
Definition TGFrame.h:87
UInt_t GetHeight() const
Definition TGFrame.h:227
UInt_t GetWidth() const
Definition TGFrame.h:226
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition TGFrame.cxx:2471
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition TGFrame.cxx:767
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Handle_t fId
X11/Win32 Window identifier.
Definition TGObject.h:24
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save an horizontal slider as a C++ statement(s) on output stream out.
Bool_t fConstrained
kTRUE if pointer is constrained to slider edges
Int_t fCz
horizontal pointer position in pixel coordinates
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in horizontal slider widget.
const TGPicture * fPointerPic
picture to draw pointer
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion event in horizontal slide widget.
Double_t fSCz
vertical pointer position
virtual void PointerPositionChanged()
~TGTripleHSlider() override
Delete a horizontal slider widget.
Bool_t fRelative
kTRUE if pointer position is relative to slider
virtual Float_t GetPointerPosition() const
void DoRedraw() override
Redraw horizontal slider widget.
virtual void DrawPointer()
Draw slider pointer.
virtual void SetPointerPos(Int_t z, Int_t opt=0)
Set slider pointer position in pixel value.
virtual void SetPointerPosition(Double_t pos)
Set pointer position in scaled (real) value.
virtual void SetConstrained(Bool_t on=kTRUE)
Set pointer position constrained in the slider range.
Bool_t HandleConfigureNotify(Event_t *event) override
Handles resize events for this widget.
TGTripleHSlider(const TGWindow *p=nullptr, 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 void SetPointerPos(Int_t z, Int_t opt=0)
Set slider pointer position in pixel value.
virtual void SetPointerPosition(Double_t pos)
Set pointer position in scaled (real) value.
Double_t fSCz
vertical pointer position
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion event in vertical slider.
~TGTripleVSlider() override
Delete vertical slider widget.
Int_t fCz
vertical pointer position in pixel coordinates
virtual void DrawPointer()
Draw slider pointer.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save an horizontal slider as a C++ statement(s) on output stream out.
virtual void PointerPositionChanged()
virtual void SetConstrained(Bool_t on=kTRUE)
Set pointer position constrained in the slider range.
Bool_t fRelative
kTRUE if pointer position is relative to slider
Bool_t HandleConfigureNotify(Event_t *event) override
Handles resize events for this widget.
void DoRedraw() override
Redraw vertical slider widget.
TGTripleVSlider(const TGWindow *p=nullptr, 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.
const TGPicture * fPointerPic
picture to draw pointer
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in vertical slider.
virtual Float_t GetPointerPosition() const
Bool_t fConstrained
kTRUE if pointer is constrained to slider edges
Int_t fWidgetId
the widget id (used for event processing)
Definition TGWidget.h:46
TString fCommand
command to be executed
Definition TGWidget.h:49
const TGWindow * fMsgWindow
window which handles widget events
Definition TGWidget.h:48
Int_t WidgetId() const
Definition TGWidget.h:68
ROOT GUI Window base class.
Definition TGWindow.h:23
const TGWindow * fParent
Parent window.
Definition TGWindow.h:28
virtual void SetWindowName(const char *name=nullptr)
Set window name.
Definition TGWindow.cxx:127
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:334
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
Definition TSystem.cxx:461
Event structure.
Definition GuiTypes.h:174
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:175
Int_t fY
pointer x, y coordinates in event window
Definition GuiTypes.h:178
Int_t fX
Definition GuiTypes.h:178
UInt_t fCode
key or button code
Definition GuiTypes.h:180