Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGImageMap.cxx
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Valeriy Onuchin & Fons Rademakers 18/10/2000
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/** \class TGImageMap
14 \ingroup guiwidgets
15
16(with TGRegion and TGRegionWithId help classes)
17
18A TGImageMap provides the functionality like a clickable image in
19a web browser with sensitive regions (MAP HTML tag).
20
21*/
22
23
24#include "TGImageMap.h"
25#include "TRefCnt.h"
26#include "TGMenu.h"
27#include "TGToolTip.h"
28#include "TList.h"
29#include "TArrayS.h"
30#include "TVirtualX.h"
31
32
36
37
38TGRegionWithId *gCurrentRegion; // current region
39
41static Int_t gPointerX; // current X mouse position
42static Int_t gPointerY; // current Y mouse position
43
44
45
46class TGRegionData : public TRefCnt {
47
48friend class TGRegion;
49
50private:
51 Region_t fRgn; // region handle
52 Bool_t fIsNull; // true if null region
53
54public:
56 ~TGRegionData() override { }
58};
59
60////////////////////////////////////////////////////////////////////////////////
61/// Assignment of region data object.
62
64{
65 if (this != &r) {
66 fRefs = r.fRefs;
67 fRgn = r.fRgn;
68 fIsNull = r.fIsNull;
69 }
70 return *this;
71}
72
73
74////////////////////////////////////////////////////////////////////////////////
75/// Create a region object.
76
78{
79 if (!gEmptyRegion) // avoid too many allocs
81
84}
85
86////////////////////////////////////////////////////////////////////////////////
87/// Create empty region.
88
90{
91 fData = new TGRegionData;
92 fData->fRgn = gVirtualX->CreateRegion();
93 fData->fIsNull = is_null;
94}
95
96////////////////////////////////////////////////////////////////////////////////
97/// Create and initialize a region with a rectangle.
98
100{
101 fData = new TGRegionData;
102 fData->fRgn = gVirtualX->CreateRegion();
104
105 Rectangle_t xr;
106 xr.fX = (Short_t) x;
107 xr.fY = (Short_t) y;
108 xr.fWidth = (UShort_t) w;
109 xr.fHeight = (UShort_t) h;
110 gVirtualX->UnionRectWithRegion(&xr, fData->fRgn, fData->fRgn);
111}
112
113////////////////////////////////////////////////////////////////////////////////
114/// Create and intialize a region with a polygon.
115
117{
118 fData = new TGRegionData;
120 Point_t *gpoints = new Point_t[n];
121
122 for (int i = 0; i < n; i++) {
123 gpoints[i].fX = (Short_t) points[i].GetX();
124 gpoints[i].fY = (Short_t) points[i].GetY();
125 }
126
127 fData->fRgn = gVirtualX->PolygonRegion(gpoints, n, winding);
128}
129
130////////////////////////////////////////////////////////////////////////////////
131/// Create and initialize a region with an X and a Y array of points.
132
133TGRegion::TGRegion(const TArrayS &x, const TArrayS &y, Bool_t winding)
134{
135 fData = new TGRegionData;
137
138 Int_t n = x.GetSize();
139 if (n != y.GetSize()) {
140 Error("TGRegion", "x and y arrays must have same length");
141 return;
142 }
143 Point_t *gpoints = new Point_t[n];
144
145 for (int i = 0; i < n; i++) {
146 gpoints[i].fX = x.GetArray()[i];
147 gpoints[i].fY = y.GetArray()[i];
148 }
149
150 fData->fRgn = gVirtualX->PolygonRegion(gpoints, n, winding);
151}
152
153////////////////////////////////////////////////////////////////////////////////
154/// Create and initialize a region with an X and Y array of points.
155
157{
158 fData = new TGRegionData;
160 Point_t *gpoints = new Point_t[n];
161
162 for (int i = 0; i < n; i++) {
163 gpoints[i].fX = x[i];
164 gpoints[i].fY = y[i];
165 }
166
167 fData->fRgn = gVirtualX->PolygonRegion(gpoints, n, winding);
168}
169
170////////////////////////////////////////////////////////////////////////////////
171/// Region copy constructor.
172
174{
175 fData = r.fData;
177}
178
179////////////////////////////////////////////////////////////////////////////////
180/// Delete a region.
181
183{
184 if (fData->RemoveReference() <= 0) {
185 gVirtualX->DestroyRegion(fData->fRgn);
186 delete fData;
187 }
188}
189
190////////////////////////////////////////////////////////////////////////////////
191/// Region assignment operator.
192
194{
195 if (this != &r) {
197 r.fData->AddReference();
198
199 if (fData->RemoveReference() <= 0) {
200 gVirtualX->DestroyRegion(fData->fRgn);
201 delete fData;
202 }
203 fData = r.fData;
204 }
205 return *this;
206}
207
208////////////////////////////////////////////////////////////////////////////////
209/// Copy a region.
210
212{
214 gVirtualX->UnionRegion(fData->fRgn, r.fData->fRgn, r.fData->fRgn);
215 return r;
216}
217
218////////////////////////////////////////////////////////////////////////////////
219/// Return true if region is not set.
220
222{
223 return fData->fIsNull;
224}
225
226////////////////////////////////////////////////////////////////////////////////
227/// Return true if region is empty.
228
230{
231 return fData->fIsNull || gVirtualX->EmptyRegion(fData->fRgn);
232}
233
234////////////////////////////////////////////////////////////////////////////////
235/// Return true if point p is contained in the region.
236
238{
239 return gVirtualX->PointInRegion((Int_t)p.GetX(), (Int_t)p.GetY(), fData->fRgn);
240}
241
242////////////////////////////////////////////////////////////////////////////////
243/// Return true if point (x,y) is contained in the region.
244
246{
247 return gVirtualX->PointInRegion(x, y, fData->fRgn);
248}
249
250////////////////////////////////////////////////////////////////////////////////
251/// Return the union of this region with r.
252
254{
256 gVirtualX->UnionRegion(fData->fRgn, r.fData->fRgn, result.fData->fRgn);
257 return result;
258}
259
260////////////////////////////////////////////////////////////////////////////////
261/// Returns a region which is the intersection of this region and r.
262
264{
266 gVirtualX->IntersectRegion(fData->fRgn, r.fData->fRgn, result.fData->fRgn);
267 return result;
268}
269
270////////////////////////////////////////////////////////////////////////////////
271/// Returns a region which is r subtracted from this region.
272
274{
276 gVirtualX->SubtractRegion(fData->fRgn, r.fData->fRgn, result.fData->fRgn);
277 return result;
278}
279
280////////////////////////////////////////////////////////////////////////////////
281/// Returns a region which is the difference between the union and
282/// intersection this region and r.
283
285{
287 gVirtualX->XorRegion(fData->fRgn, r.fData->fRgn, result.fData->fRgn);
288 return result;
289}
290
291////////////////////////////////////////////////////////////////////////////////
292/// Return dimension of region (width, height).
293
295{
296 Rectangle_t r = { 0, 0, 0, 0 };
297 gVirtualX->GetRegionBox(fData->fRgn, &r);
298 return TGDimension(r.fWidth, r.fHeight);
299}
300
301////////////////////////////////////////////////////////////////////////////////
302/// Return position of region (x, y).
303
305{
306 Rectangle_t r = { 0, 0, 0, 0 };
307 gVirtualX->GetRegionBox(fData->fRgn, &r);
308 return TGPosition(r.fX, r.fY);
309}
310
311////////////////////////////////////////////////////////////////////////////////
312/// Region == operator.
313
315{
316 return fData == r.fData ?
317 kTRUE : gVirtualX->EqualRegion(fData->fRgn, r.fData->fRgn);
318}
319
320
321////////////////////////////////////////////////////////////////////////////////
322/// Create GUI region (with id and possible tooltip).
323
325{
326 fId = 0;
327 fTip = 0;
328 fPopup = 0;
329}
330
331////////////////////////////////////////////////////////////////////////////////
332/// Create GUI region (with id and possible tooltip).
333
336 TGRegion(x, y, w, h, type)
337{
338 fId = id;
339 fTip = 0;
340 fPopup = 0;
341}
342
343////////////////////////////////////////////////////////////////////////////////
344/// Create GUI region (with id and possible tooltip).
345
347 Bool_t winding) :
348 TGRegion(n, points, winding)
349{
350 fId = id;
351 fTip = 0;
352 fPopup = 0;
353}
354
355////////////////////////////////////////////////////////////////////////////////
356/// Copy constructor.
357
359{
360 fId = reg.GetId();
361 fTip = 0;
362 fPopup = 0;
363}
364
365////////////////////////////////////////////////////////////////////////////////
366/// Copy ctor which allows setting of new id.
367
370{
371 fId = id;
372 fTip = 0;
373 fPopup = 0;
374}
375
376////////////////////////////////////////////////////////////////////////////////
377/// Cleanup.
378
380{
381 delete fTip;
382}
383
384////////////////////////////////////////////////////////////////////////////////
385/// Display popup menu associated with this region.
386
388{
390}
391
392////////////////////////////////////////////////////////////////////////////////
393/// Set tool tip text associated with this region. The delay is in
394/// milliseconds (minimum 250). To remove tool tip call method with
395/// text = 0.
396
398 const TGFrame *frame)
399{
400 if (fTip) {
401 delete fTip;
402 fTip = 0;
403 }
404
405 if (text && strlen(text))
406 fTip = new TGToolTip(gClient->GetDefaultRoot(), frame, text, delayms);
407}
408
409////////////////////////////////////////////////////////////////////////////////
410/// Create an image map widget.
411
413 TGPictureButton(p, pic)
414{
417 fListOfRegions = new TList;
418 fTrash = new TList;
419 fMainTip = 0;
420 fLastVisited = 0;
422
425
426 gVirtualX->GrabButton(fId, kAnyButton, kAnyModifier,
429
433}
434
435////////////////////////////////////////////////////////////////////////////////
436/// Create an image map widget.
437
439 TGPictureButton(p, pic.Data())
440{
443 fListOfRegions = new TList;
444 fTrash = new TList;
445 fMainTip = 0;
446 fLastVisited = 0;
448
451
452 gVirtualX->GrabButton(fId, kAnyButton, kAnyModifier,
455
459}
460
461////////////////////////////////////////////////////////////////////////////////
462/// Cleanup image map widget.
463
465{
466 delete fMainTip;
467 fTrash->Delete();
468 delete fTrash;
470 delete fListOfRegions;
471}
472
473////////////////////////////////////////////////////////////////////////////////
474/// Add a region to the image map.
475
476void TGImageMap::AddRegion(const TGRegion &region, Int_t id)
477{
478 fListOfRegions->Add(new TGRegionWithId(region, id));
479}
480
481////////////////////////////////////////////////////////////////////////////////
482/// Create popup menu or returns existing for regions with specified id.
483
485{
486 TIter next(fListOfRegions);
487 TGRegionWithId *region;
488 TGPopupMenu *popup = 0;
489 TGPopupMenu *newpopup = 0;
490
491 while ((region = (TGRegionWithId*)next())) {
492 if (id == region->GetId()) {
493 popup = region->GetPopup();
494 if (!popup && !newpopup) {
495 newpopup = new TGPopupMenu(this);
496 fTrash->Add(newpopup);
497 }
498 if (newpopup) region->SetPopup(newpopup);
499 }
500 }
501 return newpopup ? newpopup : popup;
502}
503
504////////////////////////////////////////////////////////////////////////////////
505/// Return popup for regions with specified id.
506
508{
509 TIter next(fListOfRegions);
510 TGRegionWithId *region;
511
512 while ((region = (TGRegionWithId*)next())) {
513 if (id == region->GetId()) return region->GetPopup();
514 }
515 return 0;
516}
517
518////////////////////////////////////////////////////////////////////////////////
519/// Handle mouse motion events.
520
522{
523 TIter next(fListOfRegions);
524 TGRegionWithId *region;
525
526 if (fNavMode != kNavRegions) return kTRUE;
527 gPointerX = event->fX;
528 gPointerY = event->fY;
529
530 while ((region = (TGRegionWithId*)next())) {
531 if (region->Contains(gPointerX, gPointerY)) {
532 if (fLastVisited == region->GetId()) return kTRUE;
534 fLastVisited = region->GetId();
535 fTip = region->GetToolTipText();
536 gCurrentRegion = region;
538 return kTRUE;
539 }
540 }
541
542 if (fLastVisited) {
544 fTip = fMainTip;
545 }
546 fLastVisited = 0; // main
547 return kTRUE;
548}
549
550////////////////////////////////////////////////////////////////////////////////
551/// Handle double click events.
552
554{
555 TIter next(fListOfRegions);
556 TGRegionWithId *region;
557
558 if (fTip) fTip->Hide();
559 if (event->fCode != kButton1 ) return kTRUE;
560 if (fNavMode != kNavRegions) return kTRUE;
561
562 gPointerX = event->fX;
563 gPointerY = event->fY;
564
565 while ((region = (TGRegionWithId*)next())) {
566 if (region->Contains(gPointerX, gPointerY)) {
567 DoubleClicked(region->GetId());
568 gCurrentRegion = region;
569 return kTRUE;
570 }
571 }
573 return kTRUE;
574}
575
576////////////////////////////////////////////////////////////////////////////////
577/// Handle button events.
578
580{
581 TIter next(fListOfRegions);
582 TGRegionWithId *region;
583 TGPopupMenu *pop;
584
585 if (fTip) fTip->Hide();
586 if (fNavMode != kNavRegions) return kTRUE;
587
588 gPointerX = event->fX;
589 gPointerY = event->fY;
590
591 while ((region = (TGRegionWithId*)next())) {
592 if (region->Contains(gPointerX, gPointerY)) {
593 gCurrentRegion = region;
594 if (event->fType == kButtonPress) {
595 if (event->fCode == kButton1 )
596 RegionClicked(region->GetId());
597 else if (event->fCode == kButton3 ) {
598 pop = region->GetPopup();
599 if (pop) pop->PlaceMenu(gPointerX, gPointerY, kTRUE, kTRUE);
600 }
601 }
602 return kTRUE;
603 }
604 }
605 if (event->fType == kButtonPress)
606 Clicked();
607 return kTRUE;
608}
609
610////////////////////////////////////////////////////////////////////////////////
611/// Set tooltip text for main region.
612
613void TGImageMap::SetToolTipText(const char *text, Long_t delayms)
614{
615 if (fMainTip) delete fMainTip;
616 fMainTip = 0;
617
618 if (text && strlen(text))
619 fMainTip = new TGToolTip(fClient->GetDefaultRoot(), this, text, delayms);
620}
621
622////////////////////////////////////////////////////////////////////////////////
623/// Set tooltip text for regions with specified id.
624
625void TGImageMap::SetToolTipText(Int_t id, const char *text, Long_t delayms)
626{
627 TIter next(fListOfRegions);
628 TGRegionWithId *region;
629
630 while ((region = (TGRegionWithId*)next())) {
631 if (id == region->GetId())
632 region->SetToolTipText(text, delayms, this);
633 }
634}
635
636////////////////////////////////////////////////////////////////////////////////
637/// Handle when mouse moves over region id. Emits signal
638/// OnMouseOver(Int_t).
639
641{
642 if (fTip) fTip->Reset();
643 if (fMainTip) fMainTip->Hide();
644 gVirtualX->SetCursor(fId, gVirtualX->CreateCursor(fCursorMouseOver));
645 Emit("OnMouseOver(Int_t)", id);
646}
647
648////////////////////////////////////////////////////////////////////////////////
649/// Handle when mouse moves from region id. Emits signal
650/// OnMouseOut(Int_t).
651
653{
654 if(fTip) fTip->Hide();
655 if(fMainTip) fMainTip->Reset();
656 gVirtualX->SetCursor(fId,gVirtualX->CreateCursor(fCursorMouseOut));
657 Emit("OnMouseOut(Int_t)",id);
658}
659
660////////////////////////////////////////////////////////////////////////////////
661/// Handle when mouse was clicked on region id. Emits signal
662/// RegionClicked(Int_t).
663
665{
666 Emit("RegionClicked(Int_t)",id);
667}
668
669////////////////////////////////////////////////////////////////////////////////
670/// Handle when mouse is double clicked on main map. Emits signal
671/// DoubleClicked().
672
674{
675 Emit("DoubleClicked()");
676}
677
678////////////////////////////////////////////////////////////////////////////////
679/// Handle when mouse is double clicked on region id. Emits signal
680/// DoubleClicked(Int_t).
681
683{
684 Emit("DoubleClicked(Int_t)",id);
685}
Handle_t Region_t
Region handle.
Definition GuiTypes.h:32
@ kButtonPress
Definition GuiTypes.h:60
@ kHand
Definition GuiTypes.h:374
@ kPointer
Definition GuiTypes.h:375
const Mask_t kButtonPressMask
Definition GuiTypes.h:161
const Mask_t kKeyReleaseMask
Definition GuiTypes.h:160
const Mask_t kAnyModifier
Definition GuiTypes.h:210
const Mask_t kKeyPressMask
Definition GuiTypes.h:159
const Mask_t kPointerMotionMask
Definition GuiTypes.h:163
const Handle_t kNone
Definition GuiTypes.h:88
const Mask_t kLeaveWindowMask
Definition GuiTypes.h:168
const Mask_t kStructureNotifyMask
Definition GuiTypes.h:166
const Mask_t kButtonReleaseMask
Definition GuiTypes.h:162
@ kButton3
Definition GuiTypes.h:214
@ kButton1
Definition GuiTypes.h:214
@ kAnyButton
Definition GuiTypes.h:214
#define h(i)
Definition RSha256.hxx:106
unsigned short UShort_t
Definition RtypesCore.h:40
int Int_t
Definition RtypesCore.h:45
long Long_t
Definition RtypesCore.h:54
short Short_t
Definition RtypesCore.h:39
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
#define ClassImp(name)
Definition Rtypes.h:382
@ kButtonDisabled
Definition TGButton.h:56
#define gClient
Definition TGClient.h:156
static TGRegion * gEmptyRegion
static Int_t gPointerY
static Int_t gPointerX
R__EXTERN TGRegionWithId * gCurrentRegion
Definition TGImageMap.h:154
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void reg
Option_t Option_t TPoint TPoint const char text
#define ClassImpQ(name)
Definition TQObject.h:283
#define gVirtualX
Definition TVirtualX.h:337
Array of shorts (16 bits per element).
Definition TArrayS.h:27
virtual void Clicked()
Definition TGButton.h:135
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition TGButton.cxx:235
TGToolTip * fTip
tool tip associated with button
Definition TGButton.h:79
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition TGClient.cxx:234
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
(with TGRegion and TGRegionWithId help classes)
Definition TGImageMap.h:107
ENavMode fNavMode
navigation mode
Definition TGImageMap.h:119
TGPopupMenu * GetPopup(Int_t id)
Return popup for regions with specified id.
Int_t fLastVisited
id of the last visited region
Definition TGImageMap.h:122
Bool_t HandleButton(Event_t *event) override
Handle button events.
virtual void OnMouseOut(Int_t id)
Handle when mouse moves from region id.
virtual void OnMouseOver(Int_t id)
Handle when mouse moves over region id.
TGToolTip * fMainTip
tooltip text for main region
Definition TGImageMap.h:123
TList * fTrash
collect all objects that need to be cleaned up
Definition TGImageMap.h:124
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion events.
virtual void DoubleClicked()
Handle when mouse is double clicked on main map.
void AddRegion(const TGRegion &region, Int_t id)
Add a region to the image map.
TGPopupMenu * CreatePopup(Int_t id)
Create popup menu or returns existing for regions with specified id.
TList * fListOfRegions
list of regions
Definition TGImageMap.h:118
Bool_t HandleDoubleClick(Event_t *event) override
Handle double click events.
TGImageMap(const TGImageMap &)=delete
void SetToolTipText(const char *text, Long_t delayms=300) override
Set tooltip text for main region.
ECursor fCursorMouseOver
cursor shape in regions
Definition TGImageMap.h:120
virtual void RegionClicked(Int_t id)
Handle when mouse was clicked on region id.
~TGImageMap() override
Cleanup image map widget.
ECursor fCursorMouseOut
cursor shape out of regions
Definition TGImageMap.h:121
TGClient * fClient
Connection to display server.
Definition TGObject.h:25
Handle_t fId
X11/Win32 Window identifier.
Definition TGObject.h:24
Yield an action as soon as it is clicked.
Definition TGButton.h:228
virtual void SetDisabledPicture(const TGPicture *pic)
Changes disabled picture.
const TGPicture * fPic
picture to be put in button
Definition TGButton.h:231
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Definition TGPicture.h:25
This class creates a popup menu object.
Definition TGMenu.h:110
virtual void PlaceMenu(Int_t x, Int_t y, Bool_t stick_mode, Bool_t grab_pointer)
Popup a popup menu.
Definition TGMenu.cxx:1241
~TGRegionData() override
TGRegionData & operator=(const TGRegionData &r)
Assignment of region data object.
Region_t fRgn
void SetPopup(TGPopupMenu *popup)
Definition TGImageMap.h:100
~TGRegionWithId() override
Cleanup.
TGPopupMenu * fPopup
popup menu
Definition TGImageMap.h:84
Int_t fId
region id
Definition TGImageMap.h:82
void SetToolTipText(const char *text, Long_t delayms, const TGFrame *frame)
Set tool tip text associated with this region.
Int_t GetId() const
Definition TGImageMap.h:95
TGToolTip * fTip
tooltip
Definition TGImageMap.h:83
void DisplayPopup()
Display popup menu associated with this region.
TGPopupMenu * GetPopup() const
Definition TGImageMap.h:99
TGRegionWithId()
Create GUI region (with id and possible tooltip).
TGToolTip * GetToolTipText() const
Definition TGImageMap.h:96
TGRegion CopyRegion() const
Copy a region.
Bool_t IsEmpty() const
Return true if region is empty.
TGDimension GetDimension() const
Return dimension of region (width, height).
TGRegion Unite(const TGRegion &r) const
Return the union of this region with r.
Bool_t Contains(const TPoint &p) const
Return true if point p is contained in the region.
Bool_t IsNull() const
Return true if region is not set.
TGPosition GetPosition() const
Return position of region (x, y).
TGRegion Eor(const TGRegion &r) const
Returns a region which is the difference between the union and intersection this region and r.
~TGRegion() override
Delete a region.
TGRegionData * fData
Definition TGImageMap.h:30
Bool_t operator==(const TGRegion &r) const
Region == operator.
TGRegion Subtract(const TGRegion &r) const
Returns a region which is r subtracted from this region.
TGRegion Intersect(const TGRegion &r) const
Returns a region which is the intersection of this region and r.
TGRegion()
Create a region object.
TGRegion & operator=(const TGRegion &r)
Region assignment operator.
A tooltip can be a one or multiple lines help text that is displayed in a window when the mouse curso...
Definition TGToolTip.h:24
void Hide()
Hide tool tip window.
void Reset()
Reset tool tip popup delay timer.
ROOT GUI Window base class.
Definition TGWindow.h:23
virtual void SetWindowName(const char *name=nullptr)
Set window name.
Definition TGWindow.cxx:129
A doubly linked list.
Definition TList.h:38
void Add(TObject *obj) override
Definition TList.h:81
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
Definition TList.cxx:468
Mother of all ROOT objects.
Definition TObject.h:41
TObject & operator=(const TObject &rhs)
TObject assignment operator.
Definition TObject.h:296
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:993
SCoord_t fY
Definition TPoint.h:36
SCoord_t fX
Definition TPoint.h:35
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition TQObject.h:164
Definitions for TRefCnt, base class for reference counted objects.
Definition TRefCnt.h:27
void AddReference()
Definition TRefCnt.h:40
UInt_t fRefs
Definition TRefCnt.h:30
UInt_t RemoveReference()
Definition TRefCnt.h:41
Basic string class.
Definition TString.h:139
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16
Event structure.
Definition GuiTypes.h:174
EGEventType fType
of event (see EGEventType)
Definition GuiTypes.h:175
UInt_t fCode
key or button code
Definition GuiTypes.h:180
Point structure (maps to the X11 XPoint structure)
Definition GuiTypes.h:356
Short_t fY
Definition GuiTypes.h:357
Short_t fX
Definition GuiTypes.h:357
Rectangle structure (maps to the X11 XRectangle structure)
Definition GuiTypes.h:361
Short_t fX
Definition GuiTypes.h:362
UShort_t fHeight
Definition GuiTypes.h:363
Short_t fY
Definition GuiTypes.h:362
UShort_t fWidth
Definition GuiTypes.h:363