109 if (min > max) min = max;
112 if (max - min < eps) {
134 stype =
"kDoubleScaleNo";
136 stype +=
" | kDoubleScaleNo";
140 stype =
"kDoubleScaleDownRight";
142 stype +=
" | kDoubleScaleDownRight";
146 stype =
"kDoubleScaleBoth";
148 stype +=
" | kDoubleScaleBoth";
161 Int_t hw = 0, wh = 0,
xy = 0, yx = 0;
166 if (leftCur ==
kNone)
170 if (rightCur ==
kNone)
176 yx = (
Int_t)
event->fY;
184 yx = (
Int_t)
event->fX;
193 if (
xy > hw/2-7 &&
xy < hw/2+7 &&
fMove != 3) {
197 if ((yx <= (relMax - relMin) / 4 + relMin) &&
198 (yx >= relMin) && (
fMove != 2))
203 else if ((yx >= (relMax - relMin) / 4 * 3 + relMin) &&
204 (yx <= relMax) && (
fMove != 1))
229 Error(
"TGDoubleVSlider",
"sliderv.xpm not found");
273 if (relMax+1 < (
int)
fHeight-8) {
285 if (lines < 1) lines = 1;
286 for (
int i = 0; i <= lines; i++) {
287 int y = i *
fScale + (i * remain) / lines;
296 Int_t ypos = relMin + 2;
303 int y1 = (relMax - relMin) / 4 + relMin;
304 int y2 = (relMax - relMin) / 4 * 3 + relMin;
329 else if (
fPressPoint > (relMax - relMin) / 4 * 3 + relMin)
368 if ((now-was) < 50)
return kTRUE;
383 }
else if (
fMove == 2) {
388 }
else if (
fMove == 3) {
423 Error(
"TGDoubleHSlider",
"sliderh.xpm not found");
465 if (relMax+1 < (
int)
fWidth-8) {
476 if (lines < 1) lines = 1;
477 for (
int i = 0; i <= lines; i++) {
478 int x = i *
fScale + (i * remain) / lines;
487 Int_t xpos = relMin + 2;
494 int x1 = (relMax - relMin) / 4 + relMin;
495 int x2 = (relMax - relMin) / 4 * 3 + relMin;
520 else if (
fPressPoint > (relMax - relMin) / 4 * 3 + relMin)
559 if ((now-was) < 50)
return kTRUE;
574 }
else if (
fMove == 2) {
579 }
else if (
fMove == 3) {
608 out <<
" TGDoubleHSlider *";
615 out <<
",kTRUE,kTRUE);" << std::endl;
617 out <<
",kFALSE,kTRUE);" << std::endl;
619 out <<
",kTRUE);" << std::endl;
621 out <<
");" << std::endl;
623 if (option && strstr(option,
"keep_names"))
624 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
628 <<
");" << std::endl;
635 out <<
" " <<
GetName() <<
"->SetScale(" <<
fScale <<
");" << std::endl;
646 out<<
" TGDoubleVSlider *";
653 out <<
",kTRUE,kTRUE);" << std::endl;
655 out <<
",kFALSE,kTRUE);" << std::endl;
657 out <<
",kTRUE);" << std::endl;
659 out <<
");" << std::endl;
661 if (option && strstr(option,
"keep_names"))
662 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
666 <<
");" << std::endl;
675 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.