Logo ROOT  
Reference Guide
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 
22 protected:
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 
32 public:
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 {
46  return (Float_t) GetPointerPositionD();
47  }
48  virtual Long64_t GetPointerPositionL() const {
49  return (Long64_t) GetPointerPositionD();
50  }
51  virtual Double_t GetPointerPositionD() const {
52  if (fReversedScale) return fVmin + fVmax - fSCz;
53  else return fSCz;
54  }
55  virtual Bool_t HandleButton(Event_t *event);
57  virtual Bool_t HandleMotion(Event_t *event);
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 
75 protected:
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 
85 public:
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 {
99  return (Float_t) GetPointerPositionD();
100  }
101  virtual Double_t GetPointerPositionD() const {
102  if (fReversedScale) return fVmin + fVmax - fSCz;
103  else return fSCz;
104  }
105  virtual Long64_t GetPointerPositionL() const {
106  return (Long64_t) GetPointerPositionD();
107  }
108  virtual Bool_t HandleButton(Event_t *event);
110  virtual Bool_t HandleMotion(Event_t *event);
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
TGTripleVSlider::SetPointerPosition
virtual void SetPointerPosition(Long64_t pos)
Definition: TGTripleSlider.h:63
TGTripleHSlider::GetPointerPositionD
virtual Double_t GetPointerPositionD() const
Definition: TGTripleSlider.h:101
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TGDoubleSlider.h
TGPicture
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition: TGPicture.h:25
Option_t
const char Option_t
Definition: RtypesCore.h:66
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
TGTripleVSlider::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in vertical slider.
Definition: TGTripleSlider.cxx:158
TGTripleHSlider::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in horizontal slide widget.
Definition: TGTripleSlider.cxx:491
kVerticalFrame
@ kVerticalFrame
Definition: GuiTypes.h:381
TGTripleVSlider::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an horizontal slider as a C++ statement(s) on output stream out.
Definition: TGTripleSlider.cxx:709
TGTripleVSlider::DrawPointer
virtual void DrawPointer()
Draw slider pointer.
Definition: TGTripleSlider.cxx:150
TGTripleVSlider::SetPointerPosition
virtual void SetPointerPosition(Double_t pos)
Set pointer position in scaled (real) value.
Definition: TGTripleSlider.cxx:370
Long64_t
long long Long64_t
Definition: RtypesCore.h:80
TGTripleHSlider::SetPointerPosition
virtual void SetPointerPosition(Double_t pos)
Set pointer position in scaled (real) value.
Definition: TGTripleSlider.cxx:643
TGDoubleSlider::fVmin
Double_t fVmin
logical lower limit of slider
Definition: TGDoubleSlider.h:47
Float_t
float Float_t
Definition: RtypesCore.h:57
TGTripleHSlider::GetPointerPositionL
virtual Long64_t GetPointerPositionL() const
Definition: TGTripleSlider.h:105
event
Definition: triangle.c:552
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:683
TGTripleVSlider::fRelative
Bool_t fRelative
kTRUE if pointer position is relative to slider
Definition: TGTripleSlider.h:26
TGTripleHSlider::fRelative
Bool_t fRelative
kTRUE if pointer position is relative to slider
Definition: TGTripleSlider.h:79
TGTripleHSlider::HandleConfigureNotify
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handles resize events for this widget.
Definition: TGTripleSlider.cxx:481
TGTripleVSlider::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in vertical slider.
Definition: TGTripleSlider.cxx:218
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TGTripleVSlider::SetPointerPos
virtual void SetPointerPos(Int_t z, Int_t opt=0)
Set slider pointer position in pixel value.
Definition: TGTripleSlider.cxx:311
bool
TGTripleHSlider::fPointerPic
const TGPicture * fPointerPic
picture to draw pointer
Definition: TGTripleSlider.h:80
TGDoubleSlider::fVmax
Double_t fVmax
logical upper limit of slider
Definition: TGDoubleSlider.h:48
TGTripleHSlider::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an horizontal slider as a C++ statement(s) on output stream out.
Definition: TGTripleSlider.cxx:658
TGTripleHSlider::PointerPositionChanged
virtual void PointerPositionChanged()
Definition: TGTripleSlider.h:96
TGTripleHSlider::SetPointerPosition
virtual void SetPointerPosition(Float_t pos)
Definition: TGTripleSlider.h:113
TGDoubleHSlider
Dragging the slider will generate the event:
Definition: TGDoubleSlider.h:196
TGTripleVSlider::GetPointerPosition
virtual Float_t GetPointerPosition() const
Definition: TGTripleSlider.h:45
TGTripleVSlider::SetPointerPosition
virtual void SetPointerPosition(Float_t pos)
Definition: TGTripleSlider.h:60
TGTripleVSlider
TripleSlider inherit from DoubleSlider widgets and allow easy selection of a min, max and pointer val...
Definition: TGTripleSlider.h:20
h
#define h(i)
Definition: RSha256.hxx:106
TGTripleHSlider::SetPointerPosition
virtual void SetPointerPosition(Long64_t pos)
Definition: TGTripleSlider.h:116
TGTripleVSlider::fCz
Int_t fCz
vertical pointer position in pixel coordinates
Definition: TGTripleSlider.h:23
TGTripleVSlider::~TGTripleVSlider
virtual ~TGTripleVSlider()
Delete vertical slider widget.
Definition: TGTripleSlider.cxx:132
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TGFrame.h
TGTripleVSlider::DoRedraw
virtual void DoRedraw()
Redraw vertical slider widget.
Definition: TGTripleSlider.cxx:140
TGTripleHSlider
TripleSlider inherit from DoubleSlider widgets and allow easy selection of a min, max and pointer val...
Definition: TGTripleSlider.h:73
TGTripleVSlider::SetRelative
virtual void SetRelative(Bool_t rel=kTRUE)
Definition: TGTripleSlider.h:66
TGTripleVSlider::GetPointerPositionD
virtual Double_t GetPointerPositionD() const
Definition: TGTripleSlider.h:51
TGTripleHSlider::~TGTripleHSlider
virtual ~TGTripleHSlider()
Delete a horizontal slider widget.
Definition: TGTripleSlider.cxx:405
TGTripleHSlider::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in horizontal slider widget.
Definition: TGTripleSlider.cxx:431
TGWidget.h
unsigned int
TGDoubleVSlider
Dragging the slider will generate the event:
Definition: TGDoubleSlider.h:170
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
TGTripleVSlider::fSCz
Double_t fSCz
vertical pointer position
Definition: TGTripleSlider.h:24
TGTripleHSlider::SetConstrained
virtual void SetConstrained(Bool_t on=kTRUE)
Set pointer position constrained in the slider range.
Definition: TGTripleSlider.cxx:569
TGTripleVSlider::fConstrained
Bool_t fConstrained
kTRUE if pointer is constrained to slider edges
Definition: TGTripleSlider.h:25
Double_t
double Double_t
Definition: RtypesCore.h:59
TGTripleVSlider::fPointerPic
const TGPicture * fPointerPic
picture to draw pointer
Definition: TGTripleSlider.h:27
TGTripleHSlider::fConstrained
Bool_t fConstrained
kTRUE if pointer is constrained to slider edges
Definition: TGTripleSlider.h:78
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGTripleHSlider::DoRedraw
virtual void DoRedraw()
Redraw horizontal slider widget.
Definition: TGTripleSlider.cxx:413
Event_t
Event structure.
Definition: GuiTypes.h:174
TGDoubleSlider::fReversedScale
Bool_t fReversedScale
reverse which end is min and max
Definition: TGDoubleSlider.h:58
TGTripleVSlider::TGTripleVSlider
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.
Definition: TGTripleSlider.cxx:112
TGTripleVSlider::HandleConfigureNotify
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handles resize events for this widget.
Definition: TGTripleSlider.cxx:208
TGTripleHSlider::DrawPointer
virtual void DrawPointer()
Draw slider pointer.
Definition: TGTripleSlider.cxx:423
TGTripleHSlider::GetPointerPosition
virtual Float_t GetPointerPosition() const
Definition: TGTripleSlider.h:98
type
int type
Definition: TGX11.cxx:121
TGTripleHSlider::SetPointerPos
virtual void SetPointerPos(Int_t z, Int_t opt=0)
Set slider pointer position in pixel value.
Definition: TGTripleSlider.cxx:584
TGTripleVSlider::SetConstrained
virtual void SetConstrained(Bool_t on=kTRUE)
Set pointer position constrained in the slider range.
Definition: TGTripleSlider.cxx:296
TGTripleHSlider::fSCz
Double_t fSCz
vertical pointer position
Definition: TGTripleSlider.h:77
TGTripleVSlider::GetPointerPositionL
virtual Long64_t GetPointerPositionL() const
Definition: TGTripleSlider.h:48
TGTripleVSlider::PointerPositionChanged
virtual void PointerPositionChanged()
Definition: TGTripleSlider.h:43
TQObject::Emit
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
TGTripleHSlider::fCz
Int_t fCz
horizontal pointer position in pixel coordinates
Definition: TGTripleSlider.h:76
TGTripleHSlider::SetRelative
virtual void SetRelative(Bool_t rel=kTRUE)
Definition: TGTripleSlider.h:119
int
TGTripleHSlider::TGTripleHSlider
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.
Definition: TGTripleSlider.cxx:385