108 if (min > max) min = max;
111 if (max - min < eps) {
133 stype =
"kDoubleScaleNo";
135 stype +=
" | kDoubleScaleNo";
139 stype =
"kDoubleScaleDownRight";
141 stype +=
" | kDoubleScaleDownRight";
145 stype =
"kDoubleScaleBoth";
147 stype +=
" | kDoubleScaleBoth";
160 Int_t hw = 0, wh = 0,
xy = 0, yx = 0;
165 if (leftCur ==
kNone)
169 if (rightCur ==
kNone)
175 yx = (
Int_t)
event->fY;
183 yx = (
Int_t)
event->fX;
192 if (
xy > hw/2-7 &&
xy < hw/2+7 &&
fMove != 3) {
196 if ((yx <= (relMax - relMin) / 4 + relMin) &&
197 (yx >= relMin) && (
fMove != 2))
202 else if ((yx >= (relMax - relMin) / 4 * 3 + relMin) &&
203 (yx <= relMax) && (
fMove != 1))
228 Error(
"TGDoubleVSlider",
"sliderv.xpm not found");
272 if (relMax+1 < (
int)
fHeight-8) {
284 if (lines < 1) lines = 1;
285 for (
int i = 0; i <= lines; i++) {
286 int y = i *
fScale + (i * remain) / lines;
295 Int_t ypos = relMin + 2;
302 int y1 = (relMax - relMin) / 4 + relMin;
303 int y2 = (relMax - relMin) / 4 * 3 + relMin;
328 else if (
fPressPoint > (relMax - relMin) / 4 * 3 + relMin)
367 if ((now-was) < 50)
return kTRUE;
382 }
else if (
fMove == 2) {
387 }
else if (
fMove == 3) {
422 Error(
"TGDoubleHSlider",
"sliderh.xpm not found");
464 if (relMax+1 < (
int)
fWidth-8) {
475 if (lines < 1) lines = 1;
476 for (
int i = 0; i <= lines; i++) {
477 int x = i *
fScale + (i * remain) / lines;
486 Int_t xpos = relMin + 2;
493 int x1 = (relMax - relMin) / 4 + relMin;
494 int x2 = (relMax - relMin) / 4 * 3 + relMin;
519 else if (
fPressPoint > (relMax - relMin) / 4 * 3 + relMin)
558 if ((now-was) < 50)
return kTRUE;
573 }
else if (
fMove == 2) {
578 }
else if (
fMove == 3) {
607 out <<
" TGDoubleHSlider *";
614 out <<
",kTRUE,kTRUE);" << std::endl;
616 out <<
",kFALSE,kTRUE);" << std::endl;
618 out <<
",kTRUE);" << std::endl;
620 out <<
");" << std::endl;
622 if (option && strstr(option,
"keep_names"))
623 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
627 <<
");" << std::endl;
634 out <<
" " <<
GetName() <<
"->SetScale(" <<
fScale <<
");" << std::endl;
645 out<<
" TGDoubleVSlider *";
652 out <<
",kTRUE,kTRUE);" << std::endl;
654 out <<
",kFALSE,kTRUE);" << std::endl;
656 out <<
",kTRUE);" << std::endl;
658 out <<
");" << std::endl;
660 if (option && strstr(option,
"keep_names"))
661 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
665 <<
");" << std::endl;
674 out <<
" " <<
GetName() <<
"->SetScale(" <<
fScale <<
");" << std::endl;
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]
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()
static void FixBounds(Float_t &min, Float_t &max)
Avoid boundaries to be equal.
virtual Float_t GetMinPosition() const
TGDoubleSlider(const TGDoubleSlider &)
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 void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.