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/** \class TGSlider
25 \ingroup guiwidgets
26
27Slider widgets allow easy selection of a range.
28Sliders can be either horizontal or vertical oriented and there is
29a choice of two different slider types and three different types
30of tick marks.
31
32TGSlider is an abstract base class. Use the concrete TGVSlider and
33TGHSlider.
34
35\class TGVSlider
36\ingroup guiwidgets
37Concrete class for vertical slider.
38
39Dragging the slider will generate the event:
40 - kC_VSLIDER, kSL_POS, slider id, position (for vertical slider)
41
42Pressing the mouse will generate the event:
43 - kC_VSLIDER, kSL_PRESS, slider id, 0 (for vertical slider)
44
45Releasing the mouse will generate the event:
46 - kC_VSLIDER, kSL_RELEASE, slider id, 0 (for vertical slider)
47
48\class TGHSlider
49\ingroup guiwidgets
50Concrete class for horizontal slider.
51
52Dragging the slider will generate the event:
53 - kC_HSLIDER, kSL_POS, slider id, position (for horizontal slider)
54
55Pressing the mouse will generate the event:
56 - kC_HSLIDER, kSL_PRESS, slider id, 0 (for horizontal slider)
57
58Releasing the mouse will generate the event:
59 - kC_HSLIDER, kSL_RELEASE, slider id, 0 (for horizontal slider)
60
61*/
62
63
64#include "TGSlider.h"
65#include "TGPicture.h"
66#include "TImage.h"
67#include "TEnv.h"
68#include "TVirtualX.h"
69
70#include <iostream>
71
75
76
77////////////////////////////////////////////////////////////////////////////////
78/// Slider constructor.
79
81 UInt_t options, ULong_t back)
82 : TGFrame(p, w, h, options, back)
83{
84 fDisabledPic = 0;
85 fWidgetId = id;
87 fMsgWindow = p;
88
89 fType = type;
90 fScale = 10;
92 fPos = fRelPos = 0;
93 fVmax = fVmin = 0;
94 fSliderPic = 0;
95}
96
97////////////////////////////////////////////////////////////////////////////////
98/// Creates disabled picture.
99
101{
102 if (!fSliderPic) return;
103
104 TImage *img = TImage::Create();
105 if (!img) return;
106 TImage *img2 = TImage::Create();
107 if (!img2) {
108 if (img) delete img;
109 return;
110 }
111 TString back = gEnv->GetValue("Gui.BackgroundColor", "#c0c0c0");
112 img2->FillRectangle(back.Data(), 0, 0, fSliderPic->GetWidth(),
115 Pixmap_t mask = img->GetMask();
116 img2->Merge(img, "overlay");
117
118 TString name = "disbl_";
119 name += fSliderPic->GetName();
121 img2->GetPixmap(), mask);
122 delete img;
123 delete img2;
124}
125
126////////////////////////////////////////////////////////////////////////////////
127/// Set state of widget. If kTRUE=enabled, kFALSE=disabled.
128
130{
131 if (state) {
133 } else {
135 }
136 fClient->NeedRedraw(this);
137}
138
139////////////////////////////////////////////////////////////////////////////////
140/// Create a vertical slider widget.
141
143 UInt_t options, ULong_t back) :
144 TGSlider(p, kSliderWidth, h, type, id, options, back)
145{
146 if ((fType & kSlider1))
147 fSliderPic = fClient->GetPicture("slider1h.xpm");
148 else
149 fSliderPic = fClient->GetPicture("slider2h.xpm");
150
151 if (!fSliderPic)
152 Error("TGVSlider", "slider?h.xpm not found");
153
155
156 gVirtualX->GrabButton(fId, kAnyButton, kAnyModifier,
159
161 // set initial values
162 fPos = h/2; fVmin = 0; fVmax = h; fYp = 0;
164
165 if (!p && fClient->IsEditable()) {
166 Resize(GetDefaultWidth(), 100);
167 }
168}
169
170////////////////////////////////////////////////////////////////////////////////
171/// Delete vertical slider widget.
172
174{
177}
178
179////////////////////////////////////////////////////////////////////////////////
180/// Redraw vertical slider widget.
181
183{
184 // cleanup the drawable
185 gVirtualX->ClearWindow(fId);
186
187 GContext_t drawGC = IsEnabled() ? GetBlackGC()() : GetShadowGC()();
188
189 gVirtualX->DrawLine(fId, GetShadowGC()(), fWidth/2, 8, fWidth/2-1, 8);
190 gVirtualX->DrawLine(fId, GetShadowGC()(), fWidth/2-1, 8, fWidth/2-1, fHeight-9);
191 gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth/2+1, 8, fWidth/2+1, fHeight-8);
192 gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth/2+1, fHeight-8, fWidth/2, fHeight-8);
193 gVirtualX->DrawLine(fId, drawGC, fWidth/2, 9, fWidth/2, fHeight-9);
194
195 // check scale
196 if (fScale == 1) fScale++;
197 if (fScale * 2 > (int)fHeight) fScale = 0;
198 if (fScale > 0 && !(fType & kScaleNo)) {
199 int lines = ((int)fHeight-16) / fScale;
200 int remain = ((int)fHeight-16) % fScale;
201 if (lines < 1) lines = 1;
202 for (int i = 0; i <= lines; i++) {
203 int y = i * fScale + (i * remain) / lines;
204 gVirtualX->DrawLine(fId, drawGC, fWidth/2+8, y+7, fWidth/2+10, y+7);
205 if ((fType & kSlider2) && (fType & kScaleBoth))
206 gVirtualX->DrawLine(fId, drawGC, fWidth/2-9, y+7, fWidth/2-11, y+7);
207 }
208 }
209 if (fPos < fVmin) fPos = fVmin;
210 if (fPos > fVmax) fPos = fVmax;
211
212 // calc slider-picture position
213 fRelPos = (((int)fHeight-16) * (fPos - fVmin)) / (fVmax - fVmin) + 8;
214 const TGPicture *pic = fSliderPic;
215 if (!IsEnabled()) {
218 }
219 if (pic) pic->Draw(fId, GetBckgndGC()(), fWidth/2-7, fRelPos-6);
220}
221
222////////////////////////////////////////////////////////////////////////////////
223/// Handle mouse button event in vertical slider.
224
226{
227 if (!IsEnabled()) return kTRUE;
228 if (event->fCode == kButton4 || event->fCode == kButton5) {
229 Int_t oldPos = fPos;
230 int m = (fVmax - fVmin) / (fWidth-16);
231 if (event->fCode == kButton4)
232 fPos -= ((m) ? m : 1);
233 else if (event->fCode == kButton5)
234 fPos += ((m) ? m : 1);
235 if (fPos > fVmax) fPos = fVmax;
236 if (fPos < fVmin) fPos = fVmin;
238 fWidgetId, fPos);
240 fWidgetId, fPos);
241 if (fPos != oldPos) {
243 fClient->NeedRedraw(this);
244 }
245 return kTRUE;
246 }
247 if (event->fType == kButtonPress) {
248 // constrain to the slider width
249 if (event->fX < (Int_t)fWidth/2-7 || event->fX > (Int_t)fWidth/2+7) {
250 return kTRUE;
251 }
252 // last argument kFALSE forces all specified events to this window
255 kTRUE, kFALSE);
256
257 if (event->fY >= fRelPos - 7 && event->fY <= fRelPos + 7) {
258 // slider selected
260 fYp = event->fY - (fRelPos-7);
263 Pressed();
264 } else {
265 if (event->fCode == kButton1) {
266 // scroll up or down
267 int m = (fVmax - fVmin) / (fHeight-16);
268 if (event->fY < fRelPos) {
269 fPos -= ((m) ? m : 1);
270 }
271 if (event->fY > fRelPos) {
272 fPos += ((m) ? m : 1);
273 }
274 } else if (event->fCode == kButton2) {
275 // set absolute position
276 fPos = ((fVmax - fVmin) * event->fY) / (fHeight-16) + fVmin;
277 }
278 if (fPos > fVmax) fPos = fVmax;
279 if (fPos < fVmin) fPos = fVmin;
281 fWidgetId, fPos);
283 fWidgetId, fPos);
285 }
286 fClient->NeedRedraw(this);
287
288 } else {
289 // ButtonRelease
291 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
292
295 Released();
296 }
297 return kTRUE;
298}
299
300////////////////////////////////////////////////////////////////////////////////
301/// Handle mouse motion event in vertical slider.
302
304{
305 if (fDragging) {
306 int old = fPos;
307 fPos = ((fVmax - fVmin) * (event->fY - fYp)) / ((int)fHeight-16) + fVmin;
308 if (fPos > fVmax) fPos = fVmax;
309 if (fPos < fVmin) fPos = fVmin;
310
311 // check if position changed
312 if (old != fPos) {
313 fClient->NeedRedraw(this);
315 fWidgetId, fPos);
317 fWidgetId, fPos);
319 }
320 }
321 return kTRUE;
322}
323
324////////////////////////////////////////////////////////////////////////////////
325/// Handles resize events for this widget.
326
328{
330 fClient->NeedRedraw(this);
331 return kTRUE;
332}
333
334////////////////////////////////////////////////////////////////////////////////
335/// Create horizontal slider widget.
336
338 UInt_t options, ULong_t back) :
339 TGSlider(p, w, kSliderHeight, type, id, options, back)
340{
341 if ((fType & kSlider1))
342 fSliderPic = fClient->GetPicture("slider1v.xpm");
343 else
344 fSliderPic = fClient->GetPicture("slider2v.xpm");
345
346 if (!fSliderPic)
347 Error("TGHSlider", "slider?v.xpm not found");
348
350
351 gVirtualX->GrabButton(fId, kAnyButton, kAnyModifier,
354
356 // set initial values
357 fPos = w/2; fVmin = 0; fVmax = w; fXp = 0;
359
360 if (!p && fClient->IsEditable()) {
361 Resize(100, GetDefaultHeight());
362 }
363}
364
365////////////////////////////////////////////////////////////////////////////////
366/// Delete a horizontal slider widget.
367
369{
372}
373
374////////////////////////////////////////////////////////////////////////////////
375/// Redraw horizontal slider widget.
376
378{
379 // cleanup drawable
380 gVirtualX->ClearWindow(fId);
381
382 GContext_t drawGC = IsEnabled() ? GetBlackGC()() : GetShadowGC()();
383
384 gVirtualX->DrawLine(fId, GetShadowGC()(), 8, fHeight/2, 8, fHeight/2-1);
385 gVirtualX->DrawLine(fId, GetShadowGC()(), 8, fHeight/2-1, fWidth-9, fHeight/2-1);
386 gVirtualX->DrawLine(fId, GetHilightGC()(), 8, fHeight/2+1, fWidth-8, fHeight/2+1);
387 gVirtualX->DrawLine(fId, GetHilightGC()(), fWidth-8, fHeight/2+1, fWidth-8, fHeight/2);
388 gVirtualX->DrawLine(fId, drawGC, 9, fHeight/2, fWidth-9, fHeight/2);
389
390 if (fScale == 1) fScale++;
391 if (fScale * 2 > (int)fWidth) fScale = 0;
392 if (fScale > 0 && !(fType & kScaleNo)) {
393 int lines = ((int)fWidth-16) / fScale;
394 int remain = ((int)fWidth-16) % fScale;
395 if (lines < 1) lines = 1;
396 for (int i = 0; i <= lines; i++) {
397 int x = i * fScale + (i * remain) / lines;
398 gVirtualX->DrawLine(fId, drawGC, x+7, fHeight/2+8, x+7, fHeight/2+10);
399 if ((fType & kSlider2) && (fType & kScaleBoth))
400 gVirtualX->DrawLine(fId, drawGC, x+7, fHeight/2-9, x+7, fHeight/2-11);
401 }
402 }
403 if (fPos < fVmin) fPos = fVmin;
404 if (fPos > fVmax) fPos = fVmax;
405
406 // calc slider-picture position
407 fRelPos = (((int)fWidth-16) * (fPos - fVmin)) / (fVmax - fVmin) + 8;
408 const TGPicture *pic = fSliderPic;
409 if (!IsEnabled()) {
412 }
413 if (pic) pic->Draw(fId, GetBckgndGC()(), fRelPos-6, fHeight/2-7);
414}
415
416////////////////////////////////////////////////////////////////////////////////
417/// Handle mouse button event in horizontal slider widget.
418
420{
421 if (!IsEnabled()) return kTRUE;
422 if (event->fCode == kButton4 || event->fCode == kButton5) {
423 Int_t oldPos = fPos;
424 int m = (fVmax - fVmin) / (fWidth-16);
425 if (event->fCode == kButton4)
426 fPos += ((m) ? m : 1);
427 else if (event->fCode == kButton5)
428 fPos -= ((m) ? m : 1);
429 if (fPos > fVmax) fPos = fVmax;
430 if (fPos < fVmin) fPos = fVmin;
432 fWidgetId, fPos);
434 fWidgetId, fPos);
435 if (fPos != oldPos) {
437 fClient->NeedRedraw(this);
438 }
439 return kTRUE;
440 }
441 if (event->fType == kButtonPress) {
442 // constrain to the slider height
443 if (event->fY < (Int_t)fHeight/2-7 || event->fY > (Int_t)fHeight/2+7) {
444 return kTRUE;
445 }
446 if (event->fX >= fRelPos - 7 && event->fX <= fRelPos + 7) {
447 // slider selected
449 fXp = event->fX - (fRelPos-7);
452 Pressed();
453 } else {
454 if (event->fCode == kButton1) {
455 int m = (fVmax - fVmin) / (fWidth-16);
456 if (event->fX < fRelPos) {
457 fPos -= ((m) ? m : 1);
458 }
459 if (event->fX > fRelPos) {
460 fPos += ((m) ? m : 1);
461 }
462 } else if (event->fCode == kButton2) {
463 fPos = ((fVmax - fVmin) * event->fX) / (fWidth-16) + fVmin;
464 }
465 if (fPos > fVmax) fPos = fVmax;
466 if (fPos < fVmin) fPos = fVmin;
468 fWidgetId, fPos);
470 fWidgetId, fPos);
472 }
473 fClient->NeedRedraw(this);
474
475 // last argument kFALSE forces all specified events to this window
478 } else {
479 // ButtonRelease
481 gVirtualX->GrabPointer(0, 0, 0, 0, kFALSE); // ungrab pointer
482
485 Released();
486 }
487 return kTRUE;
488}
489
490////////////////////////////////////////////////////////////////////////////////
491/// Handle mouse motion event in horizontal slide widget.
492
494{
495 if (fDragging) {
496 int old = fPos;
497 fPos = ((fVmax - fVmin) * (event->fX - fXp)) / ((int)fWidth-16) + fVmin;
498 if (fPos > fVmax) fPos = fVmax;
499 if (fPos < fVmin) fPos = fVmin;
500
501 // check if position changed
502 if (old != fPos) {
503 fClient->NeedRedraw(this);
505 fWidgetId, fPos);
507 fWidgetId, fPos);
509 }
510 }
511 return kTRUE;
512}
513
514////////////////////////////////////////////////////////////////////////////////
515/// Handles resize events for this widget.
516
518{
520 fClient->NeedRedraw(this);
521 return kTRUE;
522}
523
524////////////////////////////////////////////////////////////////////////////////
525/// Returns the slider type as a string - used in SavePrimitive().
526
528{
529 TString stype;
530
531 if (fType) {
532 if (fType & kSlider1) {
533 if (stype.Length() == 0) stype = "kSlider1";
534 else stype += " | kSlider1";
535 }
536 if (fType & kSlider2) {
537 if (stype.Length() == 0) stype = "kSlider2";
538 else stype += " | kSlider2";
539 }
540 if (fType & kScaleNo) {
541 if (stype.Length() == 0) stype = "kScaleNo";
542 else stype += " | kScaleNo";
543 }
544 if (fType & kScaleDownRight) {
545 if (stype.Length() == 0) stype = "kScaleDownRight";
546 else stype += " | kScaleDownRight";
547 }
548 if (fType & kScaleBoth) {
549 if (stype.Length() == 0) stype = "kScaleBoth";
550 else stype += " | kScaleBoth";
551 }
552 }
553 return stype;
554}
555
556////////////////////////////////////////////////////////////////////////////////
557/// Save an horizontal slider as a C++ statement(s) on output stream out.
558
559void TGHSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
560{
562
563 out <<" TGHSlider *";
564 out << GetName() << " = new TGHSlider(" << fParent->GetName()
565 << "," << GetWidth() << ",";
566 out << GetTypeString() << "," << WidgetId();
567
569 if (!GetOptions()) {
570 out <<");" << std::endl;
571 } else {
572 out << "," << GetOptionString() <<");" << std::endl;
573 }
574 } else {
575 out << "," << GetOptionString() << ",ucolor);" << std::endl;
576 }
577 if (option && strstr(option, "keep_names"))
578 out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
579
580 if (fVmin != 0 || fVmax != (Int_t)fWidth)
581 out << " " << GetName() <<"->SetRange(" << fVmin << "," << fVmax << ");" << std::endl;
582
583 if (fPos != (Int_t)fWidth/2)
584 out << " " << GetName() <<"->SetPosition(" << GetPosition() << ");" << std::endl;
585
586 if (fScale != 10)
587 out << " " << GetName() <<"->SetScale(" << fScale << ");" << std::endl;
588
589 if (!IsEnabled())
590 out << " " << GetName() <<"->SetState(kFALSE);" << std::endl;
591}
592
593////////////////////////////////////////////////////////////////////////////////
594/// Save an horizontal slider as a C++ statement(s) on output stream out.
595
596void TGVSlider::SavePrimitive(std::ostream &out, Option_t *option /*= ""*/)
597{
599
600 out<<" TGVSlider *";
601 out << GetName() <<" = new TGVSlider("<< fParent->GetName()
602 << "," << GetHeight() << ",";
603 out << GetTypeString() << "," << WidgetId();
604
606
607 if (!GetOptions()) {
608 out <<");" << std::endl;
609 } else {
610 out << "," << GetOptionString() <<");" << std::endl;
611 }
612 } else {
613 out << "," << GetOptionString() << ",ucolor);" << std::endl;
614 }
615 if (option && strstr(option, "keep_names"))
616 out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << std::endl;
617
618 if (fVmin != 0 || fVmax != (Int_t)fHeight)
619 out << " " << GetName() <<"->SetRange(" << fVmin << "," << fVmax << ");" << std::endl;
620
621 if (fPos != (Int_t)fHeight/2)
622 out << " " << GetName() <<"->SetPosition(" << GetPosition() << ");" << std::endl;
623
624 if (fScale != 10)
625 out << " " << GetName() <<"->SetScale(" << fScale << ");" << std::endl;
626
627 if (!IsEnabled())
628 out << " " << GetName() <<"->SetState(kFALSE);" << std::endl;
629}
@ 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:101
unsigned long ULong_t
Definition RtypesCore.h:55
const Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:364
R__EXTERN TEnv * gEnv
Definition TEnv.h:170
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:187
@ kSliderWidth
Definition TGSlider.h:23
@ kSliderHeight
Definition TGSlider.h:24
@ kScaleNo
Definition TGSlider.h:34
@ kScaleBoth
Definition TGSlider.h:36
@ kSlider2
Definition TGSlider.h:31
@ kSlider1
Definition TGSlider.h:30
@ kScaleDownRight
Definition TGSlider.h:35
@ kWidgetIsEnabled
Definition TGWidget.h:37
@ kWidgetWantFocus
Definition TGWidget.h:35
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:89
void ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2)
Execute string "cmd" via the interpreter.
Definition TGClient.cxx:914
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
Definition TGClient.cxx:289
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
Definition TGClient.cxx:372
TGPicturePool * GetPicturePool() const
Definition TGClient.h:126
void FreePicture(const TGPicture *pic)
Free picture resource.
Definition TGClient.cxx:308
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
Definition TGFrame.h:80
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition TGFrame.cxx:339
static const TGGC & GetBlackGC()
Get black graphics context.
Definition TGFrame.cxx:735
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
Definition TGFrame.cxx:443
UInt_t fHeight
frame height
Definition TGFrame.h:88
virtual UInt_t GetDefaultWidth() const
Definition TGFrame.h:190
virtual UInt_t GetDefaultHeight() const
Definition TGFrame.h:191
static const TGGC & GetHilightGC()
Get highlight color graphics context.
Definition TGFrame.cxx:755
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:683
virtual UInt_t GetOptions() const
Definition TGFrame.h:197
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
Definition TGFrame.cxx:2504
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
Definition TGFrame.cxx:645
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Definition TGFrame.cxx:765
UInt_t fWidth
frame width
Definition TGFrame.h:87
UInt_t GetHeight() const
Definition TGFrame.h:225
UInt_t GetWidth() const
Definition TGFrame.h:224
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Definition TGFrame.cxx:2477
Pixel_t fBackground
frame background color
Definition TGFrame.h:95
static const TGGC & GetBckgndGC()
Get background color graphics context.
Definition TGFrame.cxx:775
Concrete class for horizontal slider.
Definition TGSlider.h:128
virtual void Resize(UInt_t w, UInt_t h)
Resize the frame.
Definition TGSlider.h:147
virtual void DoRedraw()
Redraw horizontal slider widget.
Definition TGSlider.cxx:377
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:337
virtual ~TGHSlider()
Delete a horizontal slider widget.
Definition TGSlider.cxx:368
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:559
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in horizontal slide widget.
Definition TGSlider.cxx:493
Int_t fXp
horizontal slider x position in pixel coordinates
Definition TGSlider.h:131
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in horizontal slider widget.
Definition TGSlider.cxx:419
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handles resize events for this widget.
Definition TGSlider.cxx:517
TGClient * fClient
Connection to display server.
Definition TGObject.h:27
Handle_t fId
X11/Win32 Window identifier.
Definition TGObject.h:26
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
Definition TGPicture.cxx:82
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
Pixmap_t GetMask() const
Definition TGPicture.h:55
const char * GetName() const
Returns name of object.
Definition TGPicture.h:51
UInt_t GetHeight() const
Definition TGPicture.h:53
void Draw(Option_t *="")
Default Draw method for all objects.
Definition TGPicture.h:46
Pixmap_t GetPicture() const
Definition TGPicture.h:54
UInt_t GetWidth() const
Definition TGPicture.h:52
Slider widgets allow easy selection of a range.
Definition TGSlider.h:40
Int_t fPos
logical position between fVmin and fVmax
Definition TGSlider.h:43
Int_t fRelPos
slider position in pixel coordinates
Definition TGSlider.h:44
virtual void CreateDisabledPicture()
Creates disabled picture.
Definition TGSlider.cxx:100
virtual void Released()
Definition TGSlider.h:95
virtual void Pressed()
Definition TGSlider.h:94
virtual Int_t GetPosition() const
Definition TGSlider.h:83
const TGPicture * fSliderPic
picture to draw slider
Definition TGSlider.h:50
Int_t fVmin
logical lower limit of slider
Definition TGSlider.h:45
Int_t fType
slider type bits
Definition TGSlider.h:47
TString GetTypeString() const
used in SavePrimitive
Definition TGSlider.cxx:527
TGSlider(const TGSlider &)=delete
Bool_t fDragging
true if in dragging mode
Definition TGSlider.h:49
Int_t fScale
tick mark scale
Definition TGSlider.h:48
const TGPicture * fDisabledPic
picture to draw disabled slider
Definition TGSlider.h:51
virtual void PositionChanged(Int_t pos)
Definition TGSlider.h:93
Int_t fVmax
logical upper limit of slider
Definition TGSlider.h:46
virtual void SetState(Bool_t state)
Set state of widget. If kTRUE=enabled, kFALSE=disabled.
Definition TGSlider.cxx:129
Concrete class for vertical slider.
Definition TGSlider.h:101
virtual void Resize(UInt_t w, UInt_t h)
Resize the frame.
Definition TGSlider.h:120
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handles resize events for this widget.
Definition TGSlider.cxx:327
virtual ~TGVSlider()
Delete vertical slider widget.
Definition TGSlider.cxx:173
virtual void DoRedraw()
Redraw vertical slider widget.
Definition TGSlider.cxx:182
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:596
Int_t fYp
vertical slider y position in pixel coordinates
Definition TGSlider.h:104
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:142
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion event in vertical slider.
Definition TGSlider.cxx:303
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event in vertical slider.
Definition TGSlider.cxx:225
Int_t fWidgetId
the widget id (used for event processing)
Definition TGWidget.h:46
TString fCommand
command to be executed
Definition TGWidget.h:49
Int_t ClearFlags(Int_t flags)
Definition TGWidget.h:59
Int_t fWidgetFlags
widget status flags (OR of EWidgetStatus)
Definition TGWidget.h:47
Int_t SetFlags(Int_t flags)
Definition TGWidget.h:58
const TGWindow * fMsgWindow
window which handles widget events
Definition TGWidget.h:48
Bool_t IsEnabled() const
Definition TGWidget.h:69
Int_t WidgetId() const
Definition TGWidget.h:68
ROOT GUI Window base class.
Definition TGWindow.h:23
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
Definition TGWindow.cxx:336
const TGWindow * fParent
Parent window.
Definition TGWindow.h:28
@ kEditDisableHeight
window height cannot be edited
Definition TGWindow.h:55
@ kEditDisableWidth
window width cannot be edited
Definition TGWindow.h:56
UInt_t fEditDisabled
flags used for "guibuilding"
Definition TGWindow.h:32
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
auto * m
Definition textangle.C:8