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 virtual void DoRedraw();
30 virtual void SetPointerPos(Int_t z, Int_t opt = 0);
31
32public:
33 TGTripleVSlider(const TGWindow *p = 0, 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 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
68
69 ClassDef(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 virtual void DoRedraw();
83 virtual void SetPointerPos(Int_t z, Int_t opt = 0);
84
85public:
86 TGTripleHSlider(const TGWindow *p = 0, 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 }
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 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
121
122 ClassDef(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
const Bool_t kFALSE
Definition RtypesCore.h:101
bool Bool_t
Definition RtypesCore.h:63
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:80
float Float_t
Definition RtypesCore.h:57
const Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:325
int type
Definition TGX11.cxx:121
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...
Bool_t fConstrained
kTRUE if pointer is constrained to slider edges
Int_t fCz
horizontal pointer position in pixel coordinates
virtual void DoRedraw()
Redraw horizontal slider widget.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in horizontal slider widget.
const TGPicture * fPointerPic
picture to draw pointer
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)
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handles resize events for this widget.
Bool_t fRelative
kTRUE if pointer position is relative to slider
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 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 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.
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
virtual void DoRedraw()
Redraw vertical slider widget.
Int_t fCz
vertical pointer position in pixel coordinates
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.
Bool_t fRelative
kTRUE if pointer position is relative to slider
virtual void SetRelative(Bool_t rel=kTRUE)
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
picture to draw pointer
virtual Long64_t GetPointerPositionL() const
virtual void SetPointerPosition(Long64_t pos)
virtual Float_t GetPointerPosition() const
virtual void SetPointerPosition(Float_t pos)
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in vertical slider.
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