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) {
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) {
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;
virtual ~TGDoubleHSlider()
Delete a horizontal slider widget.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
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.
ClassImp(TGDoubleSlider) ClassImp(TGDoubleVSlider) ClassImp(TGDoubleHSlider) TGDoubleSlider
Slider constructor.
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]
const char Int_t const char TProof Int_t stype
virtual UInt_t GetOptions() const
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.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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.
TString GetSString() const
Returns the slider type as a string - used in SavePrimitive()
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.
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
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.
virtual Float_t GetMinPosition() const
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
virtual Float_t GetMaxPosition() const
virtual void PositionChanged()
const Mask_t kAnyModifier
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
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.