Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGTripleSlider.h
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#ifndef ROOT_TGTripleSlider
13#define ROOT_TGTripleSlider
14
15
16#include "TGFrame.h"
17#include "TGWidget.h"
18#include "TGDoubleSlider.h"
19
21
22protected:
23 Int_t fCz; ///< vertical pointer position in pixel coordinates
24 Double_t fSCz; ///< vertical pointer position
25 Bool_t fConstrained; ///< kTRUE if pointer is constrained to slider edges
26 Bool_t fRelative; ///< kTRUE if pointer position is relative to slider
27 const TGPicture *fPointerPic; ///< picture to draw pointer
28
29 void DoRedraw() override;
30 virtual void SetPointerPos(Int_t z, Int_t opt = 0);
31
32public:
33 TGTripleVSlider(const TGWindow *p = nullptr, UInt_t h = 1, UInt_t type = 1, Int_t id = -1,
34 UInt_t options = kVerticalFrame,
36 Bool_t reversed = kFALSE,
37 Bool_t mark_ends = kFALSE,
38 Bool_t constrained = kTRUE,
39 Bool_t relative = kFALSE);
40
41 virtual ~TGTripleVSlider();
42
43 virtual void PointerPositionChanged() { Emit("PointerPositionChanged()"); } //*SIGNAL*
44 virtual void DrawPointer();
45 virtual Float_t GetPointerPosition() const {
47 }
48 virtual Long64_t GetPointerPositionL() const {
50 }
51 virtual Double_t GetPointerPositionD() const {
52 if (fReversedScale) return fVmin + fVmax - fSCz;
53 else return fSCz;
54 }
58 virtual void SetConstrained(Bool_t on = kTRUE);
59 virtual void SetPointerPosition(Double_t pos);
60 virtual void SetPointerPosition(Float_t pos) {
62 }
63 virtual void SetPointerPosition(Long64_t pos) {
65 }
66 virtual void SetRelative(Bool_t rel = kTRUE) { fRelative = rel; }
67 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
68
69 ClassDefOverride(TGTripleVSlider,0) // Vertical triple slider widget
70};
71
72
74
75protected:
76 Int_t fCz; ///< horizontal pointer position in pixel coordinates
77 Double_t fSCz; ///< vertical pointer position
78 Bool_t fConstrained; ///< kTRUE if pointer is constrained to slider edges
79 Bool_t fRelative; ///< kTRUE if pointer position is relative to slider
80 const TGPicture *fPointerPic; ///< picture to draw pointer
81
82 void DoRedraw() override;
83 virtual void SetPointerPos(Int_t z, Int_t opt = 0);
84
85public:
86 TGTripleHSlider(const TGWindow *p = nullptr, UInt_t w = 1, UInt_t type = 1, Int_t id = -1,
87 UInt_t options = kHorizontalFrame,
89 Bool_t reversed = kFALSE,
90 Bool_t mark_ends = kFALSE,
91 Bool_t constrained = kTRUE,
92 Bool_t relative = kFALSE);
93
94 virtual ~TGTripleHSlider();
95
96 virtual void PointerPositionChanged() { Emit("PointerPositionChanged()"); } //*SIGNAL*
97 virtual void DrawPointer();
98 virtual Float_t GetPointerPosition() const {
100 }
102 if (fReversedScale) return fVmin + fVmax - fSCz;
103 else return fSCz;
104 }
106 return (Long64_t) GetPointerPositionD();
107 }
108 Bool_t HandleButton(Event_t *event) override;
110 Bool_t HandleMotion(Event_t *event) override;
111 virtual void SetConstrained(Bool_t on = kTRUE);
112 virtual void SetPointerPosition(Double_t pos);
113 virtual void SetPointerPosition(Float_t pos) {
115 }
116 virtual void SetPointerPosition(Long64_t pos) {
118 }
119 virtual void SetRelative(Bool_t rel = kTRUE) { fRelative = rel; }
120 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
121
122 ClassDefOverride(TGTripleHSlider,0) // Horizontal triple slider widget
123};
124
125#endif
@ kVerticalFrame
Definition GuiTypes.h:381
@ kHorizontalFrame
Definition GuiTypes.h:382
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define h(i)
Definition RSha256.hxx:106
bool Bool_t
Definition RtypesCore.h:63
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:80
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
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
Dragging the slider will generate the event:
Double_t fVmax
logical upper limit of slider
Double_t fVmin
logical lower limit of slider
Bool_t fReversedScale
reverse which end is min and max
Dragging the slider will generate the event:
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:683
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
TripleSlider inherit from DoubleSlider widgets and allow easy selection of a min, max and pointer val...
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.
virtual Double_t GetPointerPositionD() const
Double_t fSCz
vertical pointer position
virtual void PointerPositionChanged()
virtual void SetRelative(Bool_t rel=kTRUE)
virtual ~TGTripleHSlider()
Delete a horizontal slider widget.
virtual void SetPointerPosition(Long64_t pos)
Bool_t fRelative
kTRUE if pointer position is relative to slider
virtual Float_t GetPointerPosition() const
void DoRedraw() override
Redraw horizontal slider widget.
virtual Long64_t GetPointerPositionL() const
virtual void DrawPointer()
Draw slider pointer.
virtual void SetPointerPosition(Float_t pos)
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.
TripleSlider inherit from DoubleSlider widgets and allow easy selection of a min, max and pointer val...
virtual void SetPointerPos(Int_t z, Int_t opt=0)
Set slider pointer position in pixel value.
virtual Double_t GetPointerPositionD() const
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.
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.
virtual ~TGTripleVSlider()
Delete vertical slider widget.
Bool_t fRelative
kTRUE if pointer position is relative to slider
virtual void SetRelative(Bool_t rel=kTRUE)
Bool_t HandleConfigureNotify(Event_t *event) override
Handles resize events for this widget.
void DoRedraw() override
Redraw vertical slider widget.
const TGPicture * fPointerPic
picture to draw pointer
virtual Long64_t GetPointerPositionL() const
virtual void SetPointerPosition(Long64_t pos)
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in vertical slider.
virtual Float_t GetPointerPosition() const
virtual void SetPointerPosition(Float_t pos)
Bool_t fConstrained
kTRUE if pointer is constrained to slider edges
ROOT GUI Window base class.
Definition TGWindow.h:23
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition TQObject.h:164
Event structure.
Definition GuiTypes.h:174