125 if (min > max) min = max;
128 if (max - min < eps) {
150 stype =
"kDoubleScaleNo";
152 stype +=
" | kDoubleScaleNo";
156 stype =
"kDoubleScaleDownRight";
158 stype +=
" | kDoubleScaleDownRight";
162 stype =
"kDoubleScaleBoth";
164 stype +=
" | kDoubleScaleBoth";
177 Int_t hw = 0, wh = 0, xy = 0, yx = 0;
182 if (leftCur ==
kNone)
186 if (rightCur ==
kNone)
209 if (xy > hw/2-7 && xy < hw/2+7 &&
fMove != 3) {
213 if ((yx <= (relMax - relMin) / 4 + relMin) &&
214 (yx >= relMin) && (
fMove != 2))
219 else if ((yx >= (relMax - relMin) / 4 * 3 + relMin) &&
220 (yx <= relMax) && (
fMove != 1))
245 Error(
"TGDoubleVSlider",
"sliderv.xpm not found");
289 if (relMax+1 < (
int)
fHeight-8) {
301 if (lines < 1) lines = 1;
302 for (
int i = 0; i <= lines; i++) {
303 int y = i *
fScale + (i * remain) / lines;
312 Int_t ypos = relMin + 2;
319 int y1 = (relMax - relMin) / 4 + relMin;
320 int y2 = (relMax - relMin) / 4 * 3 + relMin;
345 else if (
fPressPoint > (relMax - relMin) / 4 * 3 + relMin)
384 if ((now-was) < 50)
return kTRUE;
399 }
else if (
fMove == 2) {
404 }
else if (
fMove == 3) {
439 Error(
"TGDoubleHSlider",
"sliderh.xpm not found");
481 if (relMax+1 < (
int)
fWidth-8) {
492 if (lines < 1) lines = 1;
493 for (
int i = 0; i <= lines; i++) {
494 int x = i *
fScale + (i * remain) / lines;
503 Int_t xpos = relMin + 2;
510 int x1 = (relMax - relMin) / 4 + relMin;
511 int x2 = (relMax - relMin) / 4 * 3 + relMin;
536 else if (
fPressPoint > (relMax - relMin) / 4 * 3 + relMin)
575 if ((now-was) < 50)
return kTRUE;
590 }
else if (
fMove == 2) {
595 }
else if (
fMove == 3) {
624 out <<
" TGDoubleHSlider *" <<
GetName() <<
" = new TGDoubleHSlider(" <<
fParent->GetName() <<
"," <<
GetWidth()
628 out <<
", kTRUE, kTRUE);\n";
630 out <<
", kFALSE, kTRUE);\n";
632 out <<
", kTRUE);\n";
636 if (option && strstr(option,
"keep_names"))
637 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
646 out <<
" " <<
GetName() <<
"->SetScale(" <<
fScale <<
");\n";
656 out <<
" TGDoubleVSlider *" <<
GetName() <<
" = new TGDoubleVSlider(" <<
fParent->GetName() <<
"," <<
GetHeight()
660 out <<
",kTRUE,kTRUE);\n";
662 out <<
",kFALSE,kTRUE);\n";
668 if (option && strstr(option,
"keep_names"))
669 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
678 out <<
" " <<
GetName() <<
"->SetScale(" <<
fScale <<
");\n";
Handle_t Cursor_t
Cursor handle.
const Mask_t kButtonPressMask
const Mask_t kAnyModifier
const Mask_t kPointerMotionMask
const Mask_t kButtonReleaseMask
ULong_t Pixel_t
Pixel value.
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
void DoRedraw() override
Redraw horizontal slider widget.
TGDoubleHSlider(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)
Create horizontal slider widget.
Int_t fXp
horizontal slider x position in pixel coordinates
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion event in horizontal slide widget.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save an horizontal slider as a C++ statement(s) on output stream out.
~TGDoubleHSlider() override
Delete a horizontal slider widget.
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in 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
Int_t fScaleType
tick mark scale type (no, downright, both)
Double_t fPressSmax
logical max position at button press event
virtual void PositionChanged()
TGDoubleSlider(const TGDoubleSlider &)=delete
Double_t fSmax
logical position of max value of Slider
static void FixBounds(Double_t &min, Double_t &max)
Avoid boundaries to be equal.
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
Int_t fRelPos
slider position in pixel coordinates
Double_t fPos
logical position between fVmin and fVmax
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
Bool_t fMarkEnds
lines marking where stretch zones begin
Int_t fPressPoint
mouse position at button press event
const TGPicture * fSliderPic
picture to draw slider ends
TString GetSString() const
returns scaling type as string
Bool_t HandleButton(Event_t *event) override
Handle mouse button event in vertical slider.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save an horizontal slider as a C++ statement(s) on output stream out.
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion event in vertical slider.
TGDoubleVSlider(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)
Create a vertical slider widget.
~TGDoubleVSlider() override
Delete vertical slider widget.
Int_t fYp
vertical slider y position in pixel coordinates
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.
static const TGGC & GetBlackGC()
Get black graphics context.
TGFrame(const TGFrame &)=delete
UInt_t fHeight
frame height
static const TGGC & GetHilightGC()
Get highlight color graphics context.
virtual UInt_t GetOptions() const
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
static const TGGC & GetShadowGC()
Get shadow color graphics context.
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
static const TGGC & GetBckgndGC()
Get background color graphics context.
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
const TGWindow * fParent
Parent window.
virtual void SetWindowName(const char *name=nullptr)
Set window name.
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
EGEventType fType
of event (see EGEventType)
Int_t fY
pointer x, y coordinates in event window
UInt_t fCode
key or button code