Logo ROOT   6.12/07
Reference Guide
TGSlider.cxx
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 // Author: Fons Rademakers 14/01/98
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 /**************************************************************************
12 
13  This source is based on Xclass95, a Win95-looking GUI toolkit.
14  Copyright (C) 1996, 1997 David Barth, Ricky Ralston, Hector Peraza.
15 
16  Xclass95 is free software; you can redistribute it and/or
17  modify it under the terms of the GNU Library General Public
18  License as published by the Free Software Foundation; either
19  version 2 of the License, or (at your option) any later version.
20 
21 **************************************************************************/
22 
23 //////////////////////////////////////////////////////////////////////////
24 // //
25 // TGSlider, TGVSlider and TGHSlider //
26 // //
27 // Slider widgets allow easy selection of a range. //
28 // Sliders can be either horizontal or vertical oriented and there is //
29 // a choice of two different slider types and three different types //
30 // of tick marks. //
31 // //
32 // TGSlider is an abstract base class. Use the concrete TGVSlider and //
33 // TGHSlider. //
34 // //
35 // Dragging the slider will generate the event: //
36 // kC_VSLIDER, kSL_POS, slider id, position (for vertical slider) //
37 // kC_HSLIDER, kSL_POS, slider id, position (for horizontal slider) //
38 // //
39 // Pressing the mouse will generate the event: //
40 // kC_VSLIDER, kSL_PRESS, slider id, 0 (for vertical slider) //
41 // kC_HSLIDER, kSL_PRESS, slider id, 0 (for horizontal slider) //
42 // //
43 // Releasing the mouse will generate the event: //
44 // kC_VSLIDER, kSL_RELEASE, slider id, 0 (for vertical slider) //
45 // kC_HSLIDER, kSL_RELEASE, slider id, 0 (for horizontal slider) //
46 // //
47 //////////////////////////////////////////////////////////////////////////
48 
49 #include "TGSlider.h"
50 #include "TGPicture.h"
51 #include "TImage.h"
52 #include "TEnv.h"
53 #include "Riostream.h"
54 
58 
59 
60 ////////////////////////////////////////////////////////////////////////////////
61 /// Slider constructor.
62 
64  UInt_t options, ULong_t back)
65  : TGFrame(p, w, h, options, back)
66 {
67  fDisabledPic = 0;
68  fWidgetId = id;
70  fMsgWindow = p;
71 
72  fType = type;
73  fScale = 10;
74  fDragging = kFALSE;
75  fPos = fRelPos = 0;
76  fVmax = fVmin = 0;
77  fSliderPic = 0;
78 }
79 
80 ////////////////////////////////////////////////////////////////////////////////
81 /// Creates disabled picture.
82 
84 {
85  if (!fSliderPic) return;
86 
87  TImage *img = TImage::Create();
88  if (!img) return;
89  TImage *img2 = TImage::Create();
90  if (!img2) {
91  if (img) delete img;
92  return;
93  }
94  TString back = gEnv->GetValue("Gui.BackgroundColor", "#c0c0c0");
95  img2->FillRectangle(back.Data(), 0, 0, fSliderPic->GetWidth(),
98  Pixmap_t mask = img->GetMask();
99  img2->Merge(img, "overlay");
100 
101  TString name = "disbl_";
102  name += fSliderPic->GetName();
104  img2->GetPixmap(), mask);
105  delete img;
106  delete img2;
107 }
108 
109 ////////////////////////////////////////////////////////////////////////////////
110 /// Set state of widget. If kTRUE=enabled, kFALSE=disabled.
111 
113 {
114  if (state) {
116  } else {
118  }
119  fClient->NeedRedraw(this);
120 }
121 
122 ////////////////////////////////////////////////////////////////////////////////
123 /// Create a vertical slider widget.
124 
126  UInt_t options, ULong_t back) :
127  TGSlider(p, kSliderWidth, h, type, id, options, back)
128 {
129  if ((fType & kSlider1))
130  fSliderPic = fClient->GetPicture("slider1h.xpm");
131  else
132  fSliderPic = fClient->GetPicture("slider2h.xpm");
133 
134  if (!fSliderPic)
135  Error("TGVSlider", "slider?h.xpm not found");
136 
138 
139  gVirtualX->GrabButton(fId, kAnyButton, kAnyModifier,
142 
144  // set initial values
145  fPos = h/2; fVmin = 0; fVmax = h; fYp = 0;
147 
148  if (!p && fClient->IsEditable()) {
149  Resize(GetDefaultWidth(), 100);
150  }
151 }
152 
153 ////////////////////////////////////////////////////////////////////////////////
154 /// Delete vertical slider widget.
155 
157 {
160 }
161 
162 ////////////////////////////////////////////////////////////////////////////////
163 /// Redraw vertical slider widget.
164 
166 {
167  // cleanup the drawable
168  gVirtualX->ClearWindow(fId);
169 
170  GContext_t drawGC = IsEnabled() ? GetBlackGC()() : GetShadowGC()();
171 
172  gVirtualX->DrawLine(fId, GetShadowGC()(), fWidth/2, 8, fWidth/2-1, 8);
173  gVirtualX->DrawLine(fId, GetShadowGC()(), fWidth/2-1, 8, fWidth/2-1, fHeight-9);
174  gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth/2+1, 8, fWidth/2+1, fHeight-8);
175  gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth/2+1, fHeight-8, fWidth/2, fHeight-8);
176  gVirtualX->DrawLine(fId, drawGC, fWidth/2, 9, fWidth/2, fHeight-9);
177 
178  // check scale
179  if (fScale == 1) fScale++;
180  if (fScale * 2 > (int)fHeight) fScale = 0;
181  if (fScale > 0 && !(fType & kScaleNo)) {
182  int lines = ((int)fHeight-16) / fScale;
183  int remain = ((int)fHeight-16) % fScale;
184  if (lines < 1) lines = 1;
185  for (int i = 0; i <= lines; i++) {
186  int y = i * fScale + (i * remain) / lines;
187  gVirtualX->DrawLine(fId, drawGC, fWidth/2+8, y+7, fWidth/2+10, y+7);
188  if ((fType & kSlider2) && (fType & kScaleBoth))
189  gVirtualX->DrawLine(fId, drawGC, fWidth/2-9, y+7, fWidth/2-11, y+7);
190  }
191  }
192  if (fPos < fVmin) fPos = fVmin;
193  if (fPos > fVmax) fPos = fVmax;
194 
195  // calc slider-picture position
196  fRelPos = (((int)fHeight-16) * (fPos - fVmin)) / (fVmax - fVmin) + 8;
197  const TGPicture *pic = fSliderPic;
198  if (!IsEnabled()) {
201  }
202  if (pic) pic->Draw(fId, GetBckgndGC()(), fWidth/2-7, fRelPos-6);
203 }
204 
205 ////////////////////////////////////////////////////////////////////////////////
206 /// Handle mouse button event in vertical slider.
207 
209 {
210  if (!IsEnabled()) return kTRUE;
211  if (event->fCode == kButton4 || event->fCode == kButton5) {
212  Int_t oldPos = fPos;
213  int m = (fVmax - fVmin) / (fWidth-16);
214  if (event->fCode == kButton4)
215  fPos -= ((m) ? m : 1);
216  else if (event->fCode == kButton5)
217  fPos += ((m) ? m : 1);
218  if (fPos > fVmax) fPos = fVmax;
219  if (fPos < fVmin) fPos = fVmin;
221  fWidgetId, fPos);
223  fWidgetId, fPos);
224  if (fPos != oldPos) {
226  fClient->NeedRedraw(this);
227  }
228  return kTRUE;
229  }
230  if (event->fType == kButtonPress) {
231  // constrain to the slider width
232  if (event->fX < (Int_t)fWidth/2-7 || event->fX > (Int_t)fWidth/2+7) {
233  return kTRUE;
234  }
235  // last argument kFALSE forces all specified events to this window
238  kTRUE, kFALSE);
239 
240  if (event->fY >= fRelPos - 7 && event->fY <= fRelPos + 7) {
241  // slider selected
242  fDragging = kTRUE;
243  fYp = event->fY - (fRelPos-7);
246  Pressed();
247  } else {
248  if (event->fCode == kButton1) {
249  // scroll up or down
250  int m = (fVmax - fVmin) / (fHeight-16);
251  if (event->fY < fRelPos) {
252  fPos -= ((m) ? m : 1);
253  }
254  if (event->fY > fRelPos) {
255  fPos += ((m) ? m : 1);
256  }
257  } else if (event->fCode == kButton2) {
258  // set absolute position
259  fPos = ((fVmax - fVmin) * event->fY) / (fHeight-16) + fVmin;
260  }
261  if (fPos > fVmax) fPos = fVmax;
262  if (fPos < fVmin) fPos = fVmin;
264  fWidgetId, fPos);
266  fWidgetId, fPos);
268  }
269  fClient->NeedRedraw(this);
270 
271  } else {
272  // ButtonRelease
273  fDragging = kFALSE;
274  gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
275 
278  Released();
279  }
280  return kTRUE;
281 }
282 
283 ////////////////////////////////////////////////////////////////////////////////
284 /// Handle mouse motion event in vertical slider.
285 
287 {
288  if (fDragging) {
289  int old = fPos;
290  fPos = ((fVmax - fVmin) * (event->fY - fYp)) / ((int)fHeight-16) + fVmin;
291  if (fPos > fVmax) fPos = fVmax;
292  if (fPos < fVmin) fPos = fVmin;
293 
294  // check if position changed
295  if (old != fPos) {
296  fClient->NeedRedraw(this);
298  fWidgetId, fPos);
300  fWidgetId, fPos);
302  }
303  }
304  return kTRUE;
305 }
306 
307 ////////////////////////////////////////////////////////////////////////////////
308 /// Handles resize events for this widget.
309 
311 {
313  fClient->NeedRedraw(this);
314  return kTRUE;
315 }
316 
317 ////////////////////////////////////////////////////////////////////////////////
318 /// Create horizontal slider widget.
319 
321  UInt_t options, ULong_t back) :
322  TGSlider(p, w, kSliderHeight, type, id, options, back)
323 {
324  if ((fType & kSlider1))
325  fSliderPic = fClient->GetPicture("slider1v.xpm");
326  else
327  fSliderPic = fClient->GetPicture("slider2v.xpm");
328 
329  if (!fSliderPic)
330  Error("TGHSlider", "slider?v.xpm not found");
331 
333 
334  gVirtualX->GrabButton(fId, kAnyButton, kAnyModifier,
337 
339  // set initial values
340  fPos = w/2; fVmin = 0; fVmax = w; fXp = 0;
342 
343  if (!p && fClient->IsEditable()) {
344  Resize(100, GetDefaultHeight());
345  }
346 }
347 
348 ////////////////////////////////////////////////////////////////////////////////
349 /// Delete a horizontal slider widget.
350 
352 {
355 }
356 
357 ////////////////////////////////////////////////////////////////////////////////
358 /// Redraw horizontal slider widget.
359 
361 {
362  // cleanup drawable
363  gVirtualX->ClearWindow(fId);
364 
365  GContext_t drawGC = IsEnabled() ? GetBlackGC()() : GetShadowGC()();
366 
367  gVirtualX->DrawLine(fId, GetShadowGC()(), 8, fHeight/2, 8, fHeight/2-1);
368  gVirtualX->DrawLine(fId, GetShadowGC()(), 8, fHeight/2-1, fWidth-9, fHeight/2-1);
369  gVirtualX->DrawLine(fId, GetHilightGC()(), 8, fHeight/2+1, fWidth-8, fHeight/2+1);
370  gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth-8, fHeight/2+1, fWidth-8, fHeight/2);
371  gVirtualX->DrawLine(fId, drawGC, 9, fHeight/2, fWidth-9, fHeight/2);
372 
373  if (fScale == 1) fScale++;
374  if (fScale * 2 > (int)fWidth) fScale = 0;
375  if (fScale > 0 && !(fType & kScaleNo)) {
376  int lines = ((int)fWidth-16) / fScale;
377  int remain = ((int)fWidth-16) % fScale;
378  if (lines < 1) lines = 1;
379  for (int i = 0; i <= lines; i++) {
380  int x = i * fScale + (i * remain) / lines;
381  gVirtualX->DrawLine(fId, drawGC, x+7, fHeight/2+8, x+7, fHeight/2+10);
382  if ((fType & kSlider2) && (fType & kScaleBoth))
383  gVirtualX->DrawLine(fId, drawGC, x+7, fHeight/2-9, x+7, fHeight/2-11);
384  }
385  }
386  if (fPos < fVmin) fPos = fVmin;
387  if (fPos > fVmax) fPos = fVmax;
388 
389  // calc slider-picture position
390  fRelPos = (((int)fWidth-16) * (fPos - fVmin)) / (fVmax - fVmin) + 8;
391  const TGPicture *pic = fSliderPic;
392  if (!IsEnabled()) {
395  }
396  if (pic) pic->Draw(fId, GetBckgndGC()(), fRelPos-6, fHeight/2-7);
397 }
398 
399 ////////////////////////////////////////////////////////////////////////////////
400 /// Handle mouse button event in horizontal slider widget.
401 
403 {
404  if (!IsEnabled()) return kTRUE;
405  if (event->fCode == kButton4 || event->fCode == kButton5) {
406  Int_t oldPos = fPos;
407  int m = (fVmax - fVmin) / (fWidth-16);
408  if (event->fCode == kButton4)
409  fPos += ((m) ? m : 1);
410  else if (event->fCode == kButton5)
411  fPos -= ((m) ? m : 1);
412  if (fPos > fVmax) fPos = fVmax;
413  if (fPos < fVmin) fPos = fVmin;
415  fWidgetId, fPos);
417  fWidgetId, fPos);
418  if (fPos != oldPos) {
420  fClient->NeedRedraw(this);
421  }
422  return kTRUE;
423  }
424  if (event->fType == kButtonPress) {
425  // constrain to the slider height
426  if (event->fY < (Int_t)fHeight/2-7 || event->fY > (Int_t)fHeight/2+7) {
427  return kTRUE;
428  }
429  if (event->fX >= fRelPos - 7 && event->fX <= fRelPos + 7) {
430  // slider selected
431  fDragging = kTRUE;
432  fXp = event->fX - (fRelPos-7);
435  Pressed();
436  } else {
437  if (event->fCode == kButton1) {
438  int m = (fVmax - fVmin) / (fWidth-16);
439  if (event->fX < fRelPos) {
440  fPos -= ((m) ? m : 1);
441  }
442  if (event->fX > fRelPos) {
443  fPos += ((m) ? m : 1);
444  }
445  } else if (event->fCode == kButton2) {
446  fPos = ((fVmax - fVmin) * event->fX) / (fWidth-16) + fVmin;
447  }
448  if (fPos > fVmax) fPos = fVmax;
449  if (fPos < fVmin) fPos = fVmin;
451  fWidgetId, fPos);
453  fWidgetId, fPos);
455  }
456  fClient->NeedRedraw(this);
457 
458  // last argument kFALSE forces all specified events to this window
460  kNone, kNone, kTRUE, kFALSE);
461  } else {
462  // ButtonRelease
463  fDragging = kFALSE;
464  gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
465 
468  Released();
469  }
470  return kTRUE;
471 }
472 
473 ////////////////////////////////////////////////////////////////////////////////
474 /// Handle mouse motion event in horizontal slide widget.
475 
477 {
478  if (fDragging) {
479  int old = fPos;
480  fPos = ((fVmax - fVmin) * (event->fX - fXp)) / ((int)fWidth-16) + fVmin;
481  if (fPos > fVmax) fPos = fVmax;
482  if (fPos < fVmin) fPos = fVmin;
483 
484  // check if position changed
485  if (old != fPos) {
486  fClient->NeedRedraw(this);
488  fWidgetId, fPos);
490  fWidgetId, fPos);
492  }
493  }
494  return kTRUE;
495 }
496 
497 ////////////////////////////////////////////////////////////////////////////////
498 /// Handles resize events for this widget.
499 
501 {
503  fClient->NeedRedraw(this);
504  return kTRUE;
505 }
506 
507 ////////////////////////////////////////////////////////////////////////////////
508 /// Returns the slider type as a string - used in SavePrimitive().
509 
511 {
512  TString stype;
513 
514  if (fType) {
515  if (fType & kSlider1) {
516  if (stype.Length() == 0) stype = "kSlider1";
517  else stype += " | kSlider1";
518  }
519  if (fType & kSlider2) {
520  if (stype.Length() == 0) stype = "kSlider2";
521  else stype += " | kSlider2";
522  }
523  if (fType & kScaleNo) {
524  if (stype.Length() == 0) stype = "kScaleNo";
525  else stype += " | kScaleNo";
526  }
527  if (fType & kScaleDownRight) {
528  if (stype.Length() == 0) stype = "kScaleDownRight";
529  else stype += " | kScaleDownRight";
530  }
531  if (fType & kScaleBoth) {
532  if (stype.Length() == 0) stype = "kScaleBoth";
533  else stype += " | kScaleBoth";
534  }
535  }
536  return stype;
537 }
538 
539 ////////////////////////////////////////////////////////////////////////////////
540 /// Save an horizontal slider as a C++ statement(s) on output stream out.
541 
542 void TGHSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
543 {
544  if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
545 
546  out <<" TGHSlider *";
547  out << GetName() << " = new TGHSlider(" << fParent->GetName()
548  << "," << GetWidth() << ",";
549  out << GetTypeString() << "," << WidgetId();
550 
552  if (!GetOptions()) {
553  out <<");" << std::endl;
554  } else {
555  out << "," << GetOptionString() <<");" << std::endl;
556  }
557  } else {
558  out << "," << GetOptionString() << ",ucolor);" << std::endl;
559  }
560  if (option && strstr(option, "keep_names"))
561  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
562 
563  if (fVmin != 0 || fVmax != (Int_t)fWidth)
564  out << " " << GetName() <<"->SetRange(" << fVmin << "," << fVmax << ");" << std::endl;
565 
566  if (fPos != (Int_t)fWidth/2)
567  out << " " << GetName() <<"->SetPosition(" << GetPosition() << ");" << std::endl;
568 
569  if (fScale != 10)
570  out << " " << GetName() <<"->SetScale(" << fScale << ");" << std::endl;
571 
572  if (!IsEnabled())
573  out << " " << GetName() <<"->SetState(kFALSE);" << std::endl;
574 }
575 
576 ////////////////////////////////////////////////////////////////////////////////
577 /// Save an horizontal slider as a C++ statement(s) on output stream out.
578 
579 void TGVSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
580 {
581  if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
582 
583  out<<" TGVSlider *";
584  out << GetName() <<" = new TGVSlider("<< fParent->GetName()
585  << "," << GetHeight() << ",";
586  out << GetTypeString() << "," << WidgetId();
587 
589 
590  if (!GetOptions()) {
591  out <<");" << std::endl;
592  } else {
593  out << "," << GetOptionString() <<");" << std::endl;
594  }
595  } else {
596  out << "," << GetOptionString() << ",ucolor);" << std::endl;
597  }
598  if (option && strstr(option, "keep_names"))
599  out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
600 
601  if (fVmin != 0 || fVmax != (Int_t)fHeight)
602  out << " " << GetName() <<"->SetRange(" << fVmin << "," << fVmax << ");" << std::endl;
603 
604  if (fPos != (Int_t)fHeight/2)
605  out << " " << GetName() <<"->SetPosition(" << GetPosition() << ");" << std::endl;
606 
607  if (fScale != 10)
608  out << " " << GetName() <<"->SetScale(" << fScale << ");" << std::endl;
609 
610  if (!IsEnabled())
611  out << " " << GetName() <<"->SetState(kFALSE);" << std::endl;
612 }
const TGWindow * fParent
Definition: TGWindow.h:37
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an horizontal slider as a C++ statement(s) on output stream out.
Definition: TGSlider.cxx:579
virtual UInt_t GetOptions() const
Definition: TGFrame.h:244
auto * m
Definition: textangle.C:8
const char * GetName() const
Returns name of object.
Definition: TGPicture.h:62
TGHSlider(const TGWindow *p=0, UInt_t w=40, UInt_t type=kSlider1|kScaleBoth, Int_t id=-1, UInt_t options=kHorizontalFrame, Pixel_t back=GetDefaultFrameBackground())
Create horizontal slider widget.
Definition: TGSlider.cxx:320
virtual void Pressed()
Definition: TGSlider.h:120
virtual Int_t GetPosition() const
Definition: TGSlider.h:109
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:321
virtual void DoRedraw()
Redraw horizontal slider widget.
Definition: TGSlider.cxx:360
const char Option_t
Definition: RtypesCore.h:62
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition: TGFrame.cxx:737
UInt_t GetHeight() const
Definition: TGFrame.h:272
TH1 * h
Definition: legend2.C:5
Int_t WidgetId() const
Definition: TGWidget.h:80
Int_t SetFlags(Int_t flags)
Definition: TGWidget.h:70
Int_t fY
Definition: GuiTypes.h:177
virtual void SetState(Bool_t state)
Set state of widget. If kTRUE=enabled, kFALSE=disabled.
Definition: TGSlider.cxx:112
Handle_t GContext_t
Definition: GuiTypes.h:37
Basic string class.
Definition: TString.h:125
Pixel_t fBackground
Definition: TGFrame.h:142
int Int_t
Definition: RtypesCore.h:41
TGSlider(const TGSlider &)
bool Bool_t
Definition: RtypesCore.h:59
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
An abstract interface to image processing library.
Definition: TImage.h:29
virtual void Merge(const TImage *, const char *="alphablend", Int_t=0, Int_t=0)
Definition: TImage.h:172
UInt_t GetWidth() const
Definition: TGFrame.h:271
Int_t fWidgetId
Definition: TGWidget.h:58
UInt_t GetHeight() const
Definition: TGPicture.h:64
virtual void SetImage(const Double_t *, UInt_t, UInt_t, TImagePalette *=0)
Definition: TImage.h:116
virtual Pixmap_t GetPixmap()
Definition: TImage.h:235
void Draw(Option_t *="")
Default Draw method for all objects.
Definition: TGPicture.h:57
Int_t fYp
Definition: TGSlider.h:130
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:162
virtual void FillRectangle(const char *=0, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
Definition: TImage.h:192
const TGPicture * fDisabledPic
Definition: TGSlider.h:77
Double_t x[n]
Definition: legend1.C:17
TGPicturePool * GetPicturePool() const
Definition: TGClient.h:135
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:665
TString GetTypeString() const
Returns the slider type as a string - used in SavePrimitive().
Definition: TGSlider.cxx:510
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition: TGClient.cxx:306
void ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2)
Execute string "cmd" via the interpreter.
Definition: TGClient.cxx:911
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition: TGFrame.cxx:627
XFontStruct * id
Definition: TGX11.cxx:108
const TGWindow * fMsgWindow
Definition: TGWidget.h:60
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in horizontal slider widget.
Definition: TGSlider.cxx:402
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handles resize events for this widget.
Definition: TGSlider.cxx:500
virtual ~TGHSlider()
Delete a horizontal slider widget.
Definition: TGSlider.cxx:351
const Mask_t kButtonPressMask
Definition: GuiTypes.h:160
Pixmap_t GetPicture() const
Definition: TGPicture.h:65
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in vertical slider.
Definition: TGSlider.cxx:286
TString fCommand
Definition: TGWidget.h:61
Int_t fPos
Definition: TGSlider.h:69
Bool_t IsEditable() const
Definition: TGClient.h:98
Int_t ClearFlags(Int_t flags)
Definition: TGWidget.h:71
EGEventType fType
Definition: GuiTypes.h:174
Int_t fXp
Definition: TGSlider.h:157
virtual void Released()
Definition: TGSlider.h:121
TGVSlider(const TGWindow *p=0, UInt_t h=40, UInt_t type=kSlider1|kScaleBoth, Int_t id=-1, UInt_t options=kVerticalFrame, Pixel_t back=GetDefaultFrameBackground())
Create a vertical slider widget.
Definition: TGSlider.cxx:125
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition: TGWindow.cxx:221
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:880
const Handle_t kNone
Definition: GuiTypes.h:87
Ssiz_t Length() const
Definition: TString.h:386
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
Definition: TGPicture.cxx:80
Int_t fType
Definition: TGSlider.h:73
virtual UInt_t GetDefaultWidth() const
Definition: TGFrame.h:237
static const TGGC & GetBlackGC()
Get black graphics context.
Definition: TGFrame.cxx:717
#define gVirtualX
Definition: TVirtualX.h:350
UInt_t fWidth
Definition: TGFrame.h:134
const Bool_t kFALSE
Definition: RtypesCore.h:88
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
Definition: TGFrame.cxx:425
Int_t fRelPos
Definition: TGSlider.h:70
virtual UInt_t GetDefaultHeight() const
Definition: TGFrame.h:238
#define ClassImp(name)
Definition: Rtypes.h:359
virtual void Resize(UInt_t w, UInt_t h)
Resize the frame.
Definition: TGSlider.h:173
virtual void PositionChanged(Int_t pos)
Definition: TGSlider.h:119
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:165
virtual Pixmap_t GetMask()
Definition: TImage.h:236
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:161
UInt_t fCode
Definition: GuiTypes.h:179
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition: TGClient.cxx:287
int type
Definition: TGX11.cxx:120
R__EXTERN TEnv * gEnv
Definition: TEnv.h:171
unsigned long ULong_t
Definition: RtypesCore.h:51
Double_t y[n]
Definition: legend1.C:17
UInt_t GetWidth() const
Definition: TGPicture.h:63
UInt_t fHeight
Definition: TGFrame.h:135
Int_t fVmin
Definition: TGSlider.h:71
Bool_t IsEnabled() const
Definition: TGWidget.h:81
Handle_t fId
Definition: TGObject.h:36
Bool_t fDragging
Definition: TGSlider.h:75
virtual void Resize(UInt_t w, UInt_t h)
Resize the frame.
Definition: TGSlider.h:146
TGClient * fClient
Definition: TGObject.h:37
virtual void CreateDisabledPicture()
Creates disabled picture.
Definition: TGSlider.cxx:83
Handle_t Pixmap_t
Definition: GuiTypes.h:29
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in horizontal slide widget.
Definition: TGSlider.cxx:476
Pixmap_t GetMask() const
Definition: TGPicture.h:66
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition: TGClient.cxx:370
Int_t fWidgetFlags
Definition: TGWidget.h:59
UInt_t fEditDisabled
Definition: TGWindow.h:41
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition: TGFrame.cxx:2433
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition: TGFrame.cxx:2460
static TImage * Create()
Create an image.
Definition: TImage.cxx:36
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in vertical slider.
Definition: TGSlider.cxx:208
virtual void DoRedraw()
Redraw vertical slider widget.
Definition: TGSlider.cxx:165
const Mask_t kAnyModifier
Definition: GuiTypes.h:209
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition: TEnv.cxx:491
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handles resize events for this widget.
Definition: TGSlider.cxx:310
const Bool_t kTRUE
Definition: RtypesCore.h:87
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition: TGFrame.cxx:747
Int_t fVmax
Definition: TGSlider.h:72
Int_t fX
Definition: GuiTypes.h:177
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition: TGFrame.cxx:757
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an horizontal slider as a C++ statement(s) on output stream out.
Definition: TGSlider.cxx:542
char name[80]
Definition: TGX11.cxx:109
Int_t fScale
Definition: TGSlider.h:74
const TGPicture * fSliderPic
Definition: TGSlider.h:76
virtual ~TGVSlider()
Delete vertical slider widget.
Definition: TGSlider.cxx:156
const char * Data() const
Definition: TString.h:345