75 :
TGFrame(p, w, h, options, back)
87 fPos = fSmin = fSmax = 0.0;
91 fPressSmin = fPressSmax = 0.0;
93 fReversedScale = reversed;
94 fMarkEnds = mark_ends;
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) {
282 int lines = ((int)fHeight-16) /
fScale;
283 int remain = ((int)fHeight-16) %
fScale;
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) {
395 fSmax = fPressSmax + logicalDiff;
396 fSmin = fPressSmin + logicalDiff;
422 Error(
"TGDoubleHSlider",
"sliderh.xpm not found");
464 if (relMax+1 < (
int)
fWidth-8) {
473 int lines = ((int)fWidth-16) /
fScale;
474 int remain = ((int)fWidth-16) %
fScale;
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) {
586 fSmax = fPressSmax + logicalDiff;
587 fSmin = fPressSmin + logicalDiff;
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;
629 if (
fSmin != fWidth/8*3 ||
fSmax != fWidth/8*5)
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;
668 if (
fSmin != fHeight/8*3 ||
fSmax != fHeight/8*5)
674 out <<
" " <<
GetName() <<
"->SetScale(" <<
fScale <<
");" << std::endl;
TString GetSString() const
Returns the slider type as a string - used in SavePrimitive()
virtual Float_t GetMinPosition() const
virtual ~TGDoubleHSlider()
Delete a horizontal slider widget.
virtual UInt_t GetOptions() const
virtual Float_t GetMaxPosition() const
virtual void DoRedraw()
Redraw horizontal slider widget.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in vertical slider.
static const TGGC & GetHilightGC()
Get highlight color graphics context.
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 void DoRedraw()
Redraw vertical slider widget.
void Draw(Option_t *="")
Default Draw method for all objects.
const Mask_t kPointerMotionMask
static const double x2[5]
void FreePicture(const TGPicture *pic)
Free picture resource.
void ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2)
Execute string "cmd" via the interpreter.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an horizontal slider as a C++ statement(s) on output stream out.
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
const TGPicture * fSliderPic
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.
const Mask_t kButtonPressMask
virtual TTime Now()
Get current time in milliseconds since 0:00 Jan 1 1995.
virtual ~TGDoubleVSlider()
Delete vertical slider widget.
R__EXTERN TSystem * gSystem
static void FixBounds(Float_t &min, Float_t &max)
Avoid boundaries to be equal.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in horizontal slide widget.
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 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.
void ChangeCursor(Event_t *event)
Change the cursor shape depending on the slider area.
static const TGGC & GetBlackGC()
Get black graphics context.
static const double x1[5]
const Mask_t kButtonReleaseMask
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in horizontal slider widget.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
virtual void PositionChanged()
const Mask_t kAnyModifier
static const TGGC & GetShadowGC()
Get shadow color graphics context.
static const TGGC & GetBckgndGC()
Get background color graphics context.
virtual void SetWindowName(const char *name=0)
Set window name.