110 if (min > max) min = max;
113 if (max - min < eps) {
135 stype =
"kDoubleScaleNo";
137 stype +=
" | kDoubleScaleNo";
141 stype =
"kDoubleScaleDownRight";
143 stype +=
" | kDoubleScaleDownRight";
147 stype =
"kDoubleScaleBoth";
149 stype +=
" | kDoubleScaleBoth";
162 Int_t hw = 0, wh = 0,
xy = 0, yx = 0;
167 if (leftCur ==
kNone)
171 if (rightCur ==
kNone)
194 if (
xy > hw/2-7 &&
xy < hw/2+7 &&
fMove != 3) {
198 if ((yx <= (relMax - relMin) / 4 + relMin) &&
199 (yx >= relMin) && (
fMove != 2))
204 else if ((yx >= (relMax - relMin) / 4 * 3 + relMin) &&
205 (yx <= relMax) && (
fMove != 1))
230 Error(
"TGDoubleVSlider",
"sliderv.xpm not found");
274 if (relMax+1 < (
int)
fHeight-8) {
286 if (lines < 1) lines = 1;
287 for (
int i = 0; i <= lines; i++) {
288 int y = i *
fScale + (i * remain) / lines;
297 Int_t ypos = relMin + 2;
304 int y1 = (relMax - relMin) / 4 + relMin;
305 int y2 = (relMax - relMin) / 4 * 3 + relMin;
330 else if (
fPressPoint > (relMax - relMin) / 4 * 3 + relMin)
369 if ((now-was) < 50)
return kTRUE;
384 }
else if (
fMove == 2) {
389 }
else if (
fMove == 3) {
424 Error(
"TGDoubleHSlider",
"sliderh.xpm not found");
466 if (relMax+1 < (
int)
fWidth-8) {
477 if (lines < 1) lines = 1;
478 for (
int i = 0; i <= lines; i++) {
479 int x = i *
fScale + (i * remain) / lines;
488 Int_t xpos = relMin + 2;
495 int x1 = (relMax - relMin) / 4 + relMin;
496 int x2 = (relMax - relMin) / 4 * 3 + relMin;
521 else if (
fPressPoint > (relMax - relMin) / 4 * 3 + relMin)
560 if ((now-was) < 50)
return kTRUE;
575 }
else if (
fMove == 2) {
580 }
else if (
fMove == 3) {
609 out <<
" TGDoubleHSlider *";
616 out <<
",kTRUE,kTRUE);" << std::endl;
618 out <<
",kFALSE,kTRUE);" << std::endl;
620 out <<
",kTRUE);" << std::endl;
622 out <<
");" << std::endl;
624 if (option && strstr(option,
"keep_names"))
625 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
629 <<
");" << std::endl;
636 out <<
" " <<
GetName() <<
"->SetScale(" <<
fScale <<
");" << std::endl;
647 out<<
" TGDoubleVSlider *";
654 out <<
",kTRUE,kTRUE);" << std::endl;
656 out <<
",kFALSE,kTRUE);" << std::endl;
658 out <<
",kTRUE);" << std::endl;
660 out <<
");" << std::endl;
662 if (option && strstr(option,
"keep_names"))
663 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
667 <<
");" << std::endl;
676 out <<
" " <<
GetName() <<
"->SetScale(" <<
fScale <<
");" << std::endl;
Handle_t Cursor_t
Cursor handle.
const Mask_t kButtonPressMask
const Mask_t kAnyModifier
const Mask_t kPointerMotionMask
const Mask_t kButtonReleaseMask
static const double x2[5]
static const double x1[5]
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
R__EXTERN TSystem * gSystem
void ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2)
Execute string "cmd" via the interpreter.
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
void FreePicture(const TGPicture *pic)
Free picture resource.
TGDoubleHSlider(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)
Create horizontal slider widget.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an horizontal slider as a C++ statement(s) on output stream out.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in horizontal slide widget.
virtual ~TGDoubleHSlider()
Delete a horizontal slider widget.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in horizontal slider widget.
virtual void DoRedraw()
Redraw horizontal slider widget.
void ChangeCursor(Event_t *event)
Change the cursor shape depending on the slider area.
virtual Float_t GetMaxPosition() const
virtual void PositionChanged()
TGDoubleSlider(const TGDoubleSlider &)=delete
static void FixBounds(Double_t &min, Double_t &max)
Avoid boundaries to be equal.
virtual Float_t GetMinPosition() const
const TGPicture * fSliderPic
TString GetSString() const
Returns the slider type as a string - used in SavePrimitive()
TGDoubleVSlider(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)
Create a vertical slider widget.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in vertical slider.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an horizontal slider as a C++ statement(s) on output stream out.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in vertical slider.
virtual ~TGDoubleVSlider()
Delete vertical slider widget.
virtual void DoRedraw()
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.
static const TGGC & GetHilightGC()
Get highlight color graphics context.
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
virtual UInt_t GetOptions() const
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
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.
void Draw(Option_t *="")
Default Draw method for all objects.
virtual void SetWindowName(const char *name=0)
Set window name.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
EGEventType fType
of event (see EGEventType)
Int_t fY
pointer x, y coordinates in event window
UInt_t fCode
key or button code