Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "TVirtualX.h"
54
55#include <iostream>
56
60
61
62////////////////////////////////////////////////////////////////////////////////
63/// Slider constructor.
64
66 UInt_t options, ULong_t back)
67 : TGFrame(p, w, h, options, back)
68{
69 fDisabledPic = 0;
70 fWidgetId = id;
72 fMsgWindow = p;
73
74 fType = type;
75 fScale = 10;
77 fPos = fRelPos = 0;
78 fVmax = fVmin = 0;
79 fSliderPic = 0;
80}
81
82////////////////////////////////////////////////////////////////////////////////
83/// Creates disabled picture.
84
86{
87 if (!fSliderPic) return;
88
89 TImage *img = TImage::Create();
90 if (!img) return;
91 TImage *img2 = TImage::Create();
92 if (!img2) {
93 if (img) delete img;
94 return;
95 }
96 TString back = gEnv->GetValue("Gui.BackgroundColor", "#c0c0c0");
97 img2->FillRectangle(back.Data(), 0, 0, fSliderPic->GetWidth(),
100 Pixmap_t mask = img->GetMask();
101 img2->Merge(img, "overlay");
102
103 TString name = "disbl_";
104 name += fSliderPic->GetName();
106 img2->GetPixmap(), mask);
107 delete img;
108 delete img2;
109}
110
111////////////////////////////////////////////////////////////////////////////////
112/// Set state of widget. If kTRUE=enabled, kFALSE=disabled.
113
115{
116 if (state) {
118 } else {
120 }
121 fClient->NeedRedraw(this);
122}
123
124////////////////////////////////////////////////////////////////////////////////
125/// Create a vertical slider widget.
126
128 UInt_t options, ULong_t back) :
129 TGSlider(p, kSliderWidth, h, type, id, options, back)
130{
131 if ((fType & kSlider1))
132 fSliderPic = fClient->GetPicture("slider1h.xpm");
133 else
134 fSliderPic = fClient->GetPicture("slider2h.xpm");
135
136 if (!fSliderPic)
137 Error("TGVSlider", "slider?h.xpm not found");
138
140
141 gVirtualX->GrabButton(fId, kAnyButton, kAnyModifier,
144
146 // set initial values
147 fPos = h/2; fVmin = 0; fVmax = h; fYp = 0;
149
150 if (!p && fClient->IsEditable()) {
151 Resize(GetDefaultWidth(), 100);
152 }
153}
154
155////////////////////////////////////////////////////////////////////////////////
156/// Delete vertical slider widget.
157
159{
162}
163
164////////////////////////////////////////////////////////////////////////////////
165/// Redraw vertical slider widget.
166
168{
169 // cleanup the drawable
170 gVirtualX->ClearWindow(fId);
171
172 GContext_t drawGC = IsEnabled() ? GetBlackGC()() : GetShadowGC()();
173
174 gVirtualX->DrawLine(fId, GetShadowGC()(), fWidth/2, 8, fWidth/2-1, 8);
175 gVirtualX->DrawLine(fId, GetShadowGC()(), fWidth/2-1, 8, fWidth/2-1, fHeight-9);
176 gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth/2+1, 8, fWidth/2+1, fHeight-8);
177 gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth/2+1, fHeight-8, fWidth/2, fHeight-8);
178 gVirtualX->DrawLine(fId, drawGC, fWidth/2, 9, fWidth/2, fHeight-9);
179
180 // check scale
181 if (fScale == 1) fScale++;
182 if (fScale * 2 > (int)fHeight) fScale = 0;
183 if (fScale > 0 && !(fType & kScaleNo)) {
184 int lines = ((int)fHeight-16) / fScale;
185 int remain = ((int)fHeight-16) % fScale;
186 if (lines < 1) lines = 1;
187 for (int i = 0; i <= lines; i++) {
188 int y = i * fScale + (i * remain) / lines;
189 gVirtualX->DrawLine(fId, drawGC, fWidth/2+8, y+7, fWidth/2+10, y+7);
190 if ((fType & kSlider2) && (fType & kScaleBoth))
191 gVirtualX->DrawLine(fId, drawGC, fWidth/2-9, y+7, fWidth/2-11, y+7);
192 }
193 }
194 if (fPos < fVmin) fPos = fVmin;
195 if (fPos > fVmax) fPos = fVmax;
196
197 // calc slider-picture position
198 fRelPos = (((int)fHeight-16) * (fPos - fVmin)) / (fVmax - fVmin) + 8;
199 const TGPicture *pic = fSliderPic;
200 if (!IsEnabled()) {
203 }
204 if (pic) pic->Draw(fId, GetBckgndGC()(), fWidth/2-7, fRelPos-6);
205}
206
207////////////////////////////////////////////////////////////////////////////////
208/// Handle mouse button event in vertical slider.
209
211{
212 if (!IsEnabled()) return kTRUE;
213 if (event->fCode == kButton4 || event->fCode == kButton5) {
214 Int_t oldPos = fPos;
215 int m = (fVmax - fVmin) / (fWidth-16);
216 if (event->fCode == kButton4)
217 fPos -= ((m) ? m : 1);
218 else if (event->fCode == kButton5)
219 fPos += ((m) ? m : 1);
220 if (fPos > fVmax) fPos = fVmax;
221 if (fPos < fVmin) fPos = fVmin;
223 fWidgetId, fPos);
225 fWidgetId, fPos);
226 if (fPos != oldPos) {
228 fClient->NeedRedraw(this);
229 }
230 return kTRUE;
231 }
232 if (event->fType == kButtonPress) {
233 // constrain to the slider width
234 if (event->fX < (Int_t)fWidth/2-7 || event->fX > (Int_t)fWidth/2+7) {
235 return kTRUE;
236 }
237 // last argument kFALSE forces all specified events to this window
240 kTRUE, kFALSE);
241
242 if (event->fY >= fRelPos - 7 && event->fY <= fRelPos + 7) {
243 // slider selected
245 fYp = event->fY - (fRelPos-7);
248 Pressed();
249 } else {
250 if (event->fCode == kButton1) {
251 // scroll up or down
252 int m = (fVmax - fVmin) / (fHeight-16);
253 if (event->fY < fRelPos) {
254 fPos -= ((m) ? m : 1);
255 }
256 if (event->fY > fRelPos) {
257 fPos += ((m) ? m : 1);
258 }
259 } else if (event->fCode == kButton2) {
260 // set absolute position
261 fPos = ((fVmax - fVmin) * event->fY) / (fHeight-16) + fVmin;
262 }
263 if (fPos > fVmax) fPos = fVmax;
264 if (fPos < fVmin) fPos = fVmin;
266 fWidgetId, fPos);
268 fWidgetId, fPos);
270 }
271 fClient->NeedRedraw(this);
272
273 } else {
274 // ButtonRelease
276 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
277
280 Released();
281 }
282 return kTRUE;
283}
284
285////////////////////////////////////////////////////////////////////////////////
286/// Handle mouse motion event in vertical slider.
287
289{
290 if (fDragging) {
291 int old = fPos;
292 fPos = ((fVmax - fVmin) * (event->fY - fYp)) / ((int)fHeight-16) + fVmin;
293 if (fPos > fVmax) fPos = fVmax;
294 if (fPos < fVmin) fPos = fVmin;
295
296 // check if position changed
297 if (old != fPos) {
298 fClient->NeedRedraw(this);
300 fWidgetId, fPos);
302 fWidgetId, fPos);
304 }
305 }
306 return kTRUE;
307}
308
309////////////////////////////////////////////////////////////////////////////////
310/// Handles resize events for this widget.
311
313{
315 fClient->NeedRedraw(this);
316 return kTRUE;
317}
318
319////////////////////////////////////////////////////////////////////////////////
320/// Create horizontal slider widget.
321
323 UInt_t options, ULong_t back) :
324 TGSlider(p, w, kSliderHeight, type, id, options, back)
325{
326 if ((fType & kSlider1))
327 fSliderPic = fClient->GetPicture("slider1v.xpm");
328 else
329 fSliderPic = fClient->GetPicture("slider2v.xpm");
330
331 if (!fSliderPic)
332 Error("TGHSlider", "slider?v.xpm not found");
333
335
336 gVirtualX->GrabButton(fId, kAnyButton, kAnyModifier,
339
341 // set initial values
342 fPos = w/2; fVmin = 0; fVmax = w; fXp = 0;
344
345 if (!p && fClient->IsEditable()) {
346 Resize(100, GetDefaultHeight());
347 }
348}
349
350////////////////////////////////////////////////////////////////////////////////
351/// Delete a horizontal slider widget.
352
354{
357}
358
359////////////////////////////////////////////////////////////////////////////////
360/// Redraw horizontal slider widget.
361
363{
364 // cleanup drawable
365 gVirtualX->ClearWindow(fId);
366
367 GContext_t drawGC = IsEnabled() ? GetBlackGC()() : GetShadowGC()();
368
369 gVirtualX->DrawLine(fId, GetShadowGC()(), 8, fHeight/2, 8, fHeight/2-1);
370 gVirtualX->DrawLine(fId, GetShadowGC()(), 8, fHeight/2-1, fWidth-9, fHeight/2-1);
371 gVirtualX->DrawLine(fId, GetHilightGC()(), 8, fHeight/2+1, fWidth-8, fHeight/2+1);
372 gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth-8, fHeight/2+1, fWidth-8, fHeight/2);
373 gVirtualX->DrawLine(fId, drawGC, 9, fHeight/2, fWidth-9, fHeight/2);
374
375 if (fScale == 1) fScale++;
376 if (fScale * 2 > (int)fWidth) fScale = 0;
377 if (fScale > 0 && !(fType & kScaleNo)) {
378 int lines = ((int)fWidth-16) / fScale;
379 int remain = ((int)fWidth-16) % fScale;
380 if (lines < 1) lines = 1;
381 for (int i = 0; i <= lines; i++) {
382 int x = i * fScale + (i * remain) / lines;
383 gVirtualX->DrawLine(fId, drawGC, x+7, fHeight/2+8, x+7, fHeight/2+10);
384 if ((fType & kSlider2) && (fType & kScaleBoth))
385 gVirtualX->DrawLine(fId, drawGC, x+7, fHeight/2-9, x+7, fHeight/2-11);
386 }
387 }
388 if (fPos < fVmin) fPos = fVmin;
389 if (fPos > fVmax) fPos = fVmax;
390
391 // calc slider-picture position
392 fRelPos = (((int)fWidth-16) * (fPos - fVmin)) / (fVmax - fVmin) + 8;
393 const TGPicture *pic = fSliderPic;
394 if (!IsEnabled()) {
397 }
398 if (pic) pic->Draw(fId, GetBckgndGC()(), fRelPos-6, fHeight/2-7);
399}
400
401////////////////////////////////////////////////////////////////////////////////
402/// Handle mouse button event in horizontal slider widget.
403
405{
406 if (!IsEnabled()) return kTRUE;
407 if (event->fCode == kButton4 || event->fCode == kButton5) {
408 Int_t oldPos = fPos;
409 int m = (fVmax - fVmin) / (fWidth-16);
410 if (event->fCode == kButton4)
411 fPos += ((m) ? m : 1);
412 else if (event->fCode == kButton5)
413 fPos -= ((m) ? m : 1);
414 if (fPos > fVmax) fPos = fVmax;
415 if (fPos < fVmin) fPos = fVmin;
417 fWidgetId, fPos);
419 fWidgetId, fPos);
420 if (fPos != oldPos) {
422 fClient->NeedRedraw(this);
423 }
424 return kTRUE;
425 }
426 if (event->fType == kButtonPress) {
427 // constrain to the slider height
428 if (event->fY < (Int_t)fHeight/2-7 || event->fY > (Int_t)fHeight/2+7) {
429 return kTRUE;
430 }
431 if (event->fX >= fRelPos - 7 && event->fX <= fRelPos + 7) {
432 // slider selected
434 fXp = event->fX - (fRelPos-7);
437 Pressed();
438 } else {
439 if (event->fCode == kButton1) {
440 int m = (fVmax - fVmin) / (fWidth-16);
441 if (event->fX < fRelPos) {
442 fPos -= ((m) ? m : 1);
443 }
444 if (event->fX > fRelPos) {
445 fPos += ((m) ? m : 1);
446 }
447 } else if (event->fCode == kButton2) {
448 fPos = ((fVmax - fVmin) * event->fX) / (fWidth-16) + fVmin;
449 }
450 if (fPos > fVmax) fPos = fVmax;
451 if (fPos < fVmin) fPos = fVmin;
453 fWidgetId, fPos);
455 fWidgetId, fPos);
457 }
458 fClient->NeedRedraw(this);
459
460 // last argument kFALSE forces all specified events to this window
463 } else {
464 // ButtonRelease
466 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
467
470 Released();
471 }
472 return kTRUE;
473}
474
475////////////////////////////////////////////////////////////////////////////////
476/// Handle mouse motion event in horizontal slide widget.
477
479{
480 if (fDragging) {
481 int old = fPos;
482 fPos = ((fVmax - fVmin) * (event->fX - fXp)) / ((int)fWidth-16) + fVmin;
483 if (fPos > fVmax) fPos = fVmax;
484 if (fPos < fVmin) fPos = fVmin;
485
486 // check if position changed
487 if (old != fPos) {
488 fClient->NeedRedraw(this);
490 fWidgetId, fPos);
492 fWidgetId, fPos);
494 }
495 }
496 return kTRUE;
497}
498
499////////////////////////////////////////////////////////////////////////////////
500/// Handles resize events for this widget.
501
503{
505 fClient->NeedRedraw(this);
506 return kTRUE;
507}
508
509////////////////////////////////////////////////////////////////////////////////
510/// Returns the slider type as a string - used in SavePrimitive().
511
513{
514 TString stype;
515
516 if (fType) {
517 if (fType & kSlider1) {
518 if (stype.Length() == 0) stype = "kSlider1";
519 else stype += " | kSlider1";
520 }
521 if (fType & kSlider2) {
522 if (stype.Length() == 0) stype = "kSlider2";
523 else stype += " | kSlider2";
524 }
525 if (fType & kScaleNo) {
526 if (stype.Length() == 0) stype = "kScaleNo";
527 else stype += " | kScaleNo";
528 }
529 if (fType & kScaleDownRight) {
530 if (stype.Length() == 0) stype = "kScaleDownRight";
531 else stype += " | kScaleDownRight";
532 }
533 if (fType & kScaleBoth) {
534 if (stype.Length() == 0) stype = "kScaleBoth";
535 else stype += " | kScaleBoth";
536 }
537 }
538 return stype;
539}
540
541////////////////////////////////////////////////////////////////////////////////
542/// Save an horizontal slider as a C++ statement(s) on output stream out.
543
544void TGHSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
545{
547
548 out <<" TGHSlider *";
549 out << GetName() << " = new TGHSlider(" << fParent->GetName()
550 << "," << GetWidth() << ",";
551 out << GetTypeString() << "," << WidgetId();
552
554 if (!GetOptions()) {
555 out <<");" << std::endl;
556 } else {
557 out << "," << GetOptionString() <<");" << std::endl;
558 }
559 } else {
560 out << "," << GetOptionString() << ",ucolor);" << std::endl;
561 }
562 if (option && strstr(option, "keep_names"))
563 out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
564
565 if (fVmin != 0 || fVmax != (Int_t)fWidth)
566 out << " " << GetName() <<"->SetRange(" << fVmin << "," << fVmax << ");" << std::endl;
567
568 if (fPos != (Int_t)fWidth/2)
569 out << " " << GetName() <<"->SetPosition(" << GetPosition() << ");" << std::endl;
570
571 if (fScale != 10)
572 out << " " << GetName() <<"->SetScale(" << fScale << ");" << std::endl;
573
574 if (!IsEnabled())
575 out << " " << GetName() <<"->SetState(kFALSE);" << std::endl;
576}
577
578////////////////////////////////////////////////////////////////////////////////
579/// Save an horizontal slider as a C++ statement(s) on output stream out.
580
581void TGVSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
582{
584
585 out<<" TGVSlider *";
586 out << GetName() <<" = new TGVSlider("<< fParent->GetName()
587 << "," << GetHeight() << ",";
588 out << GetTypeString() << "," << WidgetId();
589
591
592 if (!GetOptions()) {
593 out <<");" << std::endl;
594 } else {
595 out << "," << GetOptionString() <<");" << std::endl;
596 }
597 } else {
598 out << "," << GetOptionString() << ",ucolor);" << std::endl;
599 }
600 if (option && strstr(option, "keep_names"))
601 out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
602
603 if (fVmin != 0 || fVmax != (Int_t)fHeight)
604 out << " " << GetName() <<"->SetRange(" << fVmin << "," << fVmax << ");" << std::endl;
605
606 if (fPos != (Int_t)fHeight/2)
607 out << " " << GetName() <<"->SetPosition(" << GetPosition() << ");" << std::endl;
608
609 if (fScale != 10)
610 out << " " << GetName() <<"->SetScale(" << fScale << ");" << std::endl;
611
612 if (!IsEnabled())
613 out << " " << GetName() <<"->SetState(kFALSE);" << std::endl;
614}
@ kButtonPress
Definition GuiTypes.h:60
const Mask_t kButtonPressMask
Definition GuiTypes.h:161
const Mask_t kAnyModifier
Definition GuiTypes.h:210
Handle_t Pixmap_t
Pixmap handle.
Definition GuiTypes.h:30
const Mask_t kPointerMotionMask
Definition GuiTypes.h:163
const Handle_t kNone
Definition GuiTypes.h:88
const Mask_t kStructureNotifyMask
Definition GuiTypes.h:166
Handle_t GContext_t
Graphics context handle.
Definition GuiTypes.h:38
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:162
@ kButton4
Definition GuiTypes.h:215
@ kButton2
Definition GuiTypes.h:214
@ kButton5
Definition GuiTypes.h:215
@ kButton1
Definition GuiTypes.h:214
@ kAnyButton
Definition GuiTypes.h:214
#define h(i)
Definition RSha256.hxx:106
const Bool_t kFALSE
Definition RtypesCore.h:92
unsigned long ULong_t
Definition RtypesCore.h:55
const Bool_t kTRUE
Definition RtypesCore.h:91
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:364
R__EXTERN TEnv * gEnv
Definition TEnv.h:171
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:187
@ kSliderWidth
Definition TGSlider.h:49
@ kSliderHeight
Definition TGSlider.h:50
@ kScaleNo
Definition TGSlider.h:60
@ kScaleBoth
Definition TGSlider.h:62
@ kSlider2
Definition TGSlider.h:57
@ kSlider1
Definition TGSlider.h:56
@ kScaleDownRight
Definition TGSlider.h:61
@ kWidgetIsEnabled
Definition TGWidget.h:47
@ kWidgetWantFocus
Definition TGWidget.h:45
XFontStruct * id
Definition TGX11.cxx:109
char name[80]
Definition TGX11.cxx:110
int type
Definition TGX11.cxx:121
#define gVirtualX
Definition TVirtualX.h:338
Int_t MK_MSG(EWidgetMessageTypes msg, EWidgetMessageTypes submsg)
@ kSL_RELEASE
@ kSL_POS
@ kC_HSLIDER
@ kSL_PRESS
@ kC_VSLIDER
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Definition TEnv.cxx:491
Bool_t IsEditable() const
Definition TGClient.h:98
void ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2)
Execute string "cmd" via the interpreter.
Definition TGClient.cxx:913
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition TGClient.cxx:288
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:371
TGPicturePool * GetPicturePool() const
Definition TGClient.h:135
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition TGClient.cxx:307
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition TGFrame.cxx:324
static const TGGC & GetBlackGC()
Get black graphics context.
Definition TGFrame.cxx:720
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
Definition TGFrame.cxx:428
UInt_t fHeight
Definition TGFrame.h:112
virtual UInt_t GetDefaultWidth() const
Definition TGFrame.h:214
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:215
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition TGFrame.cxx:740
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
Definition TGFrame.cxx:630
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:668
virtual UInt_t GetOptions() const
Definition TGFrame.h:221
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition TGFrame.cxx:2465
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition TGFrame.cxx:750
UInt_t fWidth
Definition TGFrame.h:111
UInt_t GetHeight() const
Definition TGFrame.h:249
UInt_t GetWidth() const
Definition TGFrame.h:248
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition TGFrame.cxx:2438
Pixel_t fBackground
Definition TGFrame.h:119
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition TGFrame.cxx:760
virtual void Resize(UInt_t w, UInt_t h)
Resize the frame.
Definition TGSlider.h:173
virtual void DoRedraw()
Redraw horizontal slider widget.
Definition TGSlider.cxx:362
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:322
virtual ~TGHSlider()
Delete a horizontal slider widget.
Definition TGSlider.cxx:353
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:544
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in horizontal slide widget.
Definition TGSlider.cxx:478
Int_t fXp
Definition TGSlider.h:157
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in horizontal slider widget.
Definition TGSlider.cxx:404
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handles resize events for this widget.
Definition TGSlider.cxx:502
TGClient * fClient
Definition TGObject.h:37
Handle_t fId
Definition TGObject.h:36
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
Definition TGPicture.cxx:80
Pixmap_t GetMask() const
Definition TGPicture.h:66
const char * GetName() const
Returns name of object.
Definition TGPicture.h:62
UInt_t GetHeight() const
Definition TGPicture.h:64
void Draw(Option_t *="")
Default Draw method for all objects.
Definition TGPicture.h:57
Pixmap_t GetPicture() const
Definition TGPicture.h:65
UInt_t GetWidth() const
Definition TGPicture.h:63
Int_t fPos
Definition TGSlider.h:69
Int_t fRelPos
Definition TGSlider.h:70
virtual void CreateDisabledPicture()
Creates disabled picture.
Definition TGSlider.cxx:85
virtual void Released()
Definition TGSlider.h:121
virtual void Pressed()
Definition TGSlider.h:120
virtual Int_t GetPosition() const
Definition TGSlider.h:109
const TGPicture * fSliderPic
Definition TGSlider.h:76
Int_t fVmin
Definition TGSlider.h:71
Int_t fType
Definition TGSlider.h:73
TString GetTypeString() const
Returns the slider type as a string - used in SavePrimitive().
Definition TGSlider.cxx:512
TGSlider(const TGSlider &)=delete
Bool_t fDragging
Definition TGSlider.h:75
Int_t fScale
Definition TGSlider.h:74
const TGPicture * fDisabledPic
Definition TGSlider.h:77
virtual void PositionChanged(Int_t pos)
Definition TGSlider.h:119
Int_t fVmax
Definition TGSlider.h:72
virtual void SetState(Bool_t state)
Set state of widget. If kTRUE=enabled, kFALSE=disabled.
Definition TGSlider.cxx:114
virtual void Resize(UInt_t w, UInt_t h)
Resize the frame.
Definition TGSlider.h:146
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handles resize events for this widget.
Definition TGSlider.cxx:312
virtual ~TGVSlider()
Delete vertical slider widget.
Definition TGSlider.cxx:158
virtual void DoRedraw()
Redraw vertical slider widget.
Definition TGSlider.cxx:167
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:581
Int_t fYp
Definition TGSlider.h:130
TGVSlider(const TGWindow *p=nullptr, 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:127
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in vertical slider.
Definition TGSlider.cxx:288
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in vertical slider.
Definition TGSlider.cxx:210
Int_t fWidgetId
Definition TGWidget.h:56
TString fCommand
Definition TGWidget.h:59
Int_t ClearFlags(Int_t flags)
Definition TGWidget.h:69
Int_t fWidgetFlags
Definition TGWidget.h:57
Int_t SetFlags(Int_t flags)
Definition TGWidget.h:68
const TGWindow * fMsgWindow
Definition TGWidget.h:58
Bool_t IsEnabled() const
Definition TGWidget.h:79
Int_t WidgetId() const
Definition TGWidget.h:78
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:335
const TGWindow * fParent
Definition TGWindow.h:36
@ kEditDisableHeight
Definition TGWindow.h:63
@ kEditDisableWidth
Definition TGWindow.h:64
UInt_t fEditDisabled
Definition TGWindow.h:40
An abstract interface to image processing library.
Definition TImage.h:29
virtual void SetImage(const Double_t *, UInt_t, UInt_t, TImagePalette *=0)
Definition TImage.h:116
static TImage * Create()
Create an image.
Definition TImage.cxx:35
virtual void Merge(const TImage *, const char *="alphablend", Int_t=0, Int_t=0)
Definition TImage.h:172
virtual Pixmap_t GetPixmap()
Definition TImage.h:235
virtual void FillRectangle(const char *=0, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
Definition TImage.h:192
virtual Pixmap_t GetMask()
Definition TImage.h:236
Basic string class.
Definition TString.h:136
Ssiz_t Length() const
Definition TString.h:410
const char * Data() const
Definition TString.h:369
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
Event structure.
Definition GuiTypes.h:174
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:175
Int_t fY
pointer x, y coordinates in event window
Definition GuiTypes.h:178
Int_t fX
Definition GuiTypes.h:178
UInt_t fCode
key or button code
Definition GuiTypes.h:180
auto * m
Definition textangle.C:8