/usr/include/root/TGTripleSlider.h is in libroot-gui-dev 5.34.19+dfsg-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | // @(#)root/gui:$Id$
// Author: Bertrand Bellenot 20/01/06
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TGTripleSlider
#define ROOT_TGTripleSlider
//////////////////////////////////////////////////////////////////////////
// //
// TGTripleVSlider and TGTripleHSlider //
// //
// TripleSlider inherit from DoubleSlider widgets and allow easy //
// selection of a min, max and pointer value out of a range. //
// The pointer position can be constrained to edges of slider and / or //
// can be relative to the slider position. //
// //
// To change the min value press the mouse near to the left / bottom //
// edge of the slider. //
// To change the max value press the mouse near to the right / top //
// edge of the slider. //
// To change both values simultaneously press the mouse near to the //
// center of the slider. //
// To change pointer value press the mouse on the pointer and drag it //
// to the desired position //
// //
// Dragging the slider will generate the event: //
// kC_VSLIDER, kSL_POS, slider id, 0 (for vertical slider) //
// kC_HSLIDER, kSL_POS, slider id, 0 (for horizontal slider) //
// //
// Pressing the mouse will generate the event: //
// kC_VSLIDER, kSL_PRESS, slider id, 0 (for vertical slider) //
// kC_HSLIDER, kSL_PRESS, slider id, 0 (for horizontal slider) //
// //
// Releasing the mouse will generate the event: //
// kC_VSLIDER, kSL_RELEASE, slider id, 0 (for vertical slider) //
// kC_HSLIDER, kSL_RELEASE, slider id, 0 (for horizontal slider) //
// //
// Moving the pointer will generate the event: //
// kC_VSLIDER, kSL_POINTER, slider id, 0 (for vertical slider) //
// kC_HSLIDER, kSL_POINTER, slider id, 0 (for horizontal slider) //
// //
// Use the functions GetMinPosition(), GetMaxPosition() and //
// GetPosition() to retrieve the position of the slider. //
// Use the function GetPointerPosition() to retrieve the position of //
// the pointer //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif
#ifndef ROOT_TGWidget
#include "TGWidget.h"
#endif
#ifndef ROOT_TGDoubleSlider
#include "TGDoubleSlider.h"
#endif
class TGTripleVSlider : public TGDoubleVSlider {
protected:
Int_t fCz; // vertical pointer position in pixel coordinates
Float_t fSCz; // vertical pointer position
Bool_t fConstrained; // kTRUE if pointer is constrained to slider edges
Bool_t fRelative; // kTRUE if pointer position is relative to slider
const TGPicture *fPointerPic; // picture to draw pointer
virtual void DoRedraw();
virtual void SetPointerPos(Int_t z, Int_t opt = 0);
public:
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);
virtual ~TGTripleVSlider();
virtual void PointerPositionChanged() { Emit("PointerPositionChanged()"); } //*SIGNAL*
virtual void DrawPointer();
virtual Float_t GetPointerPosition() const {
if (fReversedScale) return fVmin + fVmax - fSCz;
else return fSCz;
}
virtual Bool_t HandleButton(Event_t *event);
virtual Bool_t HandleConfigureNotify(Event_t* event);
virtual Bool_t HandleMotion(Event_t *event);
virtual void SetConstrained(Bool_t on = kTRUE);
virtual void SetPointerPosition(Float_t pos);
virtual void SetRelative(Bool_t rel = kTRUE) { fRelative = rel; }
virtual void SavePrimitive(ostream &out, Option_t *option = "");
ClassDef(TGTripleVSlider,0) // Vertical triple slider widget
};
class TGTripleHSlider : public TGDoubleHSlider {
protected:
Int_t fCz; // horizontal pointer position in pixel coordinates
Float_t fSCz; // vertical pointer position
Bool_t fConstrained; // kTRUE if pointer is constrained to slider edges
Bool_t fRelative; // kTRUE if pointer position is relative to slider
const TGPicture *fPointerPic; // picture to draw pointer
virtual void DoRedraw();
virtual void SetPointerPos(Int_t z, Int_t opt = 0);
public:
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);
virtual ~TGTripleHSlider();
virtual void PointerPositionChanged() { Emit("PointerPositionChanged()"); } //*SIGNAL*
virtual void DrawPointer();
virtual Float_t GetPointerPosition() const {
if (fReversedScale) return fVmin + fVmax - fSCz;
else return fSCz;
}
virtual Bool_t HandleButton(Event_t *event);
virtual Bool_t HandleConfigureNotify(Event_t* event);
virtual Bool_t HandleMotion(Event_t *event);
virtual void SetConstrained(Bool_t on = kTRUE);
virtual void SetPointerPosition(Float_t pos);
virtual void SetRelative(Bool_t rel = kTRUE) { fRelative = rel; }
virtual void SavePrimitive(ostream &out, Option_t *option = "");
ClassDef(TGTripleHSlider,0) // Horizontal triple slider widget
};
#endif
|