Logo ROOT  
Reference Guide
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 // //
14 // TGImageMap (with TGRegion and TGRegionWithId help classes) //
15 // //
16 // A TGImageMap provides the functionality like a clickable image in //
17 // a web browser with sensitive regions (MAP HTML tag). //
18 // //
19 //////////////////////////////////////////////////////////////////////////
20 
21 #include "TGImageMap.h"
22 #include "TRefCnt.h"
23 #include "TGMenu.h"
24 #include "TGToolTip.h"
25 #include "TList.h"
26 #include "TArrayS.h"
27 #include "TVirtualX.h"
28 
29 
33 
34 
35 TGRegionWithId *gCurrentRegion; // current region
36 
37 static TGRegion *gEmptyRegion = 0;
38 static Int_t gPointerX; // current X mouse position
39 static Int_t gPointerY; // current Y mouse position
40 
41 
42 
43 class TGRegionData : public TRefCnt {
44 
45 friend class TGRegion;
46 
47 private:
48  Region_t fRgn; // region handle
49  Bool_t fIsNull; // true if null region
50 
51 public:
52  TGRegionData() { fRgn = 0; fIsNull = kTRUE; AddReference(); }
53  ~TGRegionData() { }
54  TGRegionData &operator=(const TGRegionData &r);
55 };
56 
57 ////////////////////////////////////////////////////////////////////////////////
58 /// Assignemnt of region data object.
59 
60 TGRegionData &TGRegionData::operator=(const TGRegionData &r)
61 {
62  if (this != &r) {
63  fRefs = r.fRefs;
64  fRgn = r.fRgn;
65  fIsNull = r.fIsNull;
66  }
67  return *this;
68 }
69 
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 ////////////////////////////////////////////////////////////////////////////////
73 /// Create a region object.
74 
76 {
77  if (!gEmptyRegion) // avoid too many allocs
79 
81  fData->AddReference();
82 }
83 
84 ////////////////////////////////////////////////////////////////////////////////
85 /// Create empty region.
86 
88 {
89  fData = new TGRegionData;
90  fData->fRgn = gVirtualX->CreateRegion();
91  fData->fIsNull = is_null;
92 }
93 
94 ////////////////////////////////////////////////////////////////////////////////
95 /// Create and initialize a region with a rectangle.
96 
98 {
99  fData = new TGRegionData;
100  fData->fRgn = gVirtualX->CreateRegion();
101  fData->fIsNull = kFALSE;
102 
103  Rectangle_t xr;
104  xr.fX = (Short_t) x;
105  xr.fY = (Short_t) y;
106  xr.fWidth = (UShort_t) w;
107  xr.fHeight = (UShort_t) h;
108  gVirtualX->UnionRectWithRegion(&xr, fData->fRgn, fData->fRgn);
109 }
110 
111 ////////////////////////////////////////////////////////////////////////////////
112 /// Create and intialize a region with a polygon.
113 
115 {
116  fData = new TGRegionData;
117  fData->fIsNull = kFALSE;
118  Point_t *gpoints = new Point_t[n];
119 
120  for (int i = 0; i < n; i++) {
121  gpoints[i].fX = (Short_t) points[i].GetX();
122  gpoints[i].fY = (Short_t) points[i].GetY();
123  }
124 
125  fData->fRgn = gVirtualX->PolygonRegion(gpoints, n, winding);
126 }
127 
128 ////////////////////////////////////////////////////////////////////////////////
129 /// Create and initialize a region with an X and a Y array of points.
130 
131 TGRegion::TGRegion(const TArrayS &x, const TArrayS &y, Bool_t winding)
132 {
133  fData = new TGRegionData;
134  fData->fIsNull = kFALSE;
135 
136  Int_t n = x.GetSize();
137  if (n != y.GetSize()) {
138  Error("TGRegion", "x and y arrays must have same length");
139  return;
140  }
141  Point_t *gpoints = new Point_t[n];
142 
143  for (int i = 0; i < n; i++) {
144  gpoints[i].fX = x.GetArray()[i];
145  gpoints[i].fY = y.GetArray()[i];
146  }
147 
148  fData->fRgn = gVirtualX->PolygonRegion(gpoints, n, winding);
149 }
150 
151 ////////////////////////////////////////////////////////////////////////////////
152 /// Create and initialize a region with an X and Y array of points.
153 
155 {
156  fData = new TGRegionData;
157  fData->fIsNull = kFALSE;
158  Point_t *gpoints = new Point_t[n];
159 
160  for (int i = 0; i < n; i++) {
161  gpoints[i].fX = x[i];
162  gpoints[i].fY = y[i];
163  }
164 
165  fData->fRgn = gVirtualX->PolygonRegion(gpoints, n, winding);
166 }
167 
168 ////////////////////////////////////////////////////////////////////////////////
169 /// Region copy constructor.
170 
172 {
173  fData = r.fData;
174  fData->AddReference();
175 }
176 
177 ////////////////////////////////////////////////////////////////////////////////
178 /// Delete a region.
179 
181 {
182  if (fData->RemoveReference() <= 0) {
183  gVirtualX->DestroyRegion(fData->fRgn);
184  delete fData;
185  }
186 }
187 
188 ////////////////////////////////////////////////////////////////////////////////
189 /// Region assignment operator.
190 
192 {
193  if (this != &r) {
195  r.fData->AddReference();
196 
197  if (fData->RemoveReference() <= 0) {
198  gVirtualX->DestroyRegion(fData->fRgn);
199  delete fData;
200  }
201  fData = r.fData;
202  }
203  return *this;
204 }
205 
206 ////////////////////////////////////////////////////////////////////////////////
207 /// Copy a region.
208 
210 {
211  TGRegion r(fData->fIsNull);
212  gVirtualX->UnionRegion(fData->fRgn, r.fData->fRgn, r.fData->fRgn);
213  return r;
214 }
215 
216 ////////////////////////////////////////////////////////////////////////////////
217 /// Return true if region is not set.
218 
220 {
221  return fData->fIsNull;
222 }
223 
224 ////////////////////////////////////////////////////////////////////////////////
225 /// Return true if region is empty.
226 
228 {
229  return fData->fIsNull || gVirtualX->EmptyRegion(fData->fRgn);
230 }
231 
232 ////////////////////////////////////////////////////////////////////////////////
233 /// Return true if point p is contained in the region.
234 
236 {
237  return gVirtualX->PointInRegion((Int_t)p.GetX(), (Int_t)p.GetY(), fData->fRgn);
238 }
239 
240 ////////////////////////////////////////////////////////////////////////////////
241 /// Return true if point (x,y) is contained in the region.
242 
244 {
245  return gVirtualX->PointInRegion(x, y, fData->fRgn);
246 }
247 
248 ////////////////////////////////////////////////////////////////////////////////
249 /// Return the union of this region with r.
250 
252 {
253  TGRegion result(kFALSE);
254  gVirtualX->UnionRegion(fData->fRgn, r.fData->fRgn, result.fData->fRgn);
255  return result;
256 }
257 
258 ////////////////////////////////////////////////////////////////////////////////
259 /// Returns a region which is the intersection of this region and r.
260 
262 {
263  TGRegion result(kFALSE);
264  gVirtualX->IntersectRegion(fData->fRgn, r.fData->fRgn, result.fData->fRgn);
265  return result;
266 }
267 
268 ////////////////////////////////////////////////////////////////////////////////
269 /// Returns a region which is r subtracted from this region.
270 
272 {
273  TGRegion result(kFALSE);
274  gVirtualX->SubtractRegion(fData->fRgn, r.fData->fRgn, result.fData->fRgn);
275  return result;
276 }
277 
278 ////////////////////////////////////////////////////////////////////////////////
279 /// Returns a region which is the difference between the union and
280 /// intersection this region and r.
281 
283 {
284  TGRegion result(kFALSE);
285  gVirtualX->XorRegion(fData->fRgn, r.fData->fRgn, result.fData->fRgn);
286  return result;
287 }
288 
289 ////////////////////////////////////////////////////////////////////////////////
290 /// Return dimension of region (widht, height).
291 
293 {
294  Rectangle_t r = { 0, 0, 0, 0 };
295  gVirtualX->GetRegionBox(fData->fRgn, &r);
296  return TGDimension(r.fWidth, r.fHeight);
297 }
298 
299 ////////////////////////////////////////////////////////////////////////////////
300 /// Return position of region (x, y).
301 
303 {
304  Rectangle_t r = { 0, 0, 0, 0 };
305  gVirtualX->GetRegionBox(fData->fRgn, &r);
306  return TGPosition(r.fX, r.fY);
307 }
308 
309 ////////////////////////////////////////////////////////////////////////////////
310 /// Region == operator.
311 
313 {
314  return fData == r.fData ?
315  kTRUE : gVirtualX->EqualRegion(fData->fRgn, r.fData->fRgn);
316 }
317 
318 
319 ////////////////////////////////////////////////////////////////////////////////
320 ////////////////////////////////////////////////////////////////////////////////
321 /// Create GUI region (with id and possible tooltip).
322 
324 {
325  fId = 0;
326  fTip = 0;
327  fPopup = 0;
328 }
329 
330 ////////////////////////////////////////////////////////////////////////////////
331 /// Create GUI region (with id and possible tooltip).
332 
335  TGRegion(x, y, w, h, type)
336 {
337  fId = id;
338  fTip = 0;
339  fPopup = 0;
340 }
341 
342 ////////////////////////////////////////////////////////////////////////////////
343 /// Create GUI region (with id and possible tooltip).
344 
346  Bool_t winding) :
347  TGRegion(n, points, winding)
348 {
349  fId = id;
350  fTip = 0;
351  fPopup = 0;
352 }
353 
354 ////////////////////////////////////////////////////////////////////////////////
355 /// Copy constructor.
356 
358 {
359  fId = reg.GetId();
360  fTip = 0;
361  fPopup = 0;
362 }
363 
364 ////////////////////////////////////////////////////////////////////////////////
365 /// Copy ctor which allows setting of new id.
366 
368  TGRegion(reg)
369 {
370  fId = id;
371  fTip = 0;
372  fPopup = 0;
373 }
374 
375 ////////////////////////////////////////////////////////////////////////////////
376 /// Cleanup.
377 
379 {
380  delete fTip;
381 }
382 
383 ////////////////////////////////////////////////////////////////////////////////
384 /// Display popup menu associated with this region.
385 
387 {
389 }
390 
391 ////////////////////////////////////////////////////////////////////////////////
392 /// Set tool tip text associated with this region. The delay is in
393 /// milliseconds (minimum 250). To remove tool tip call method with
394 /// text = 0.
395 
396 void TGRegionWithId::SetToolTipText(const char *text, Long_t delayms,
397  const TGFrame *frame)
398 {
399  if (fTip) {
400  delete fTip;
401  fTip = 0;
402  }
403 
404  if (text && strlen(text))
405  fTip = new TGToolTip(gClient->GetDefaultRoot(), frame, text, delayms);
406 }
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 
432  SetWindowName();
433 }
434 
435 ////////////////////////////////////////////////////////////////////////////////
436 /// Create an image map widget.
437 
438 TGImageMap::TGImageMap(const TGWindow *p, const TString &pic) :
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 
458  SetWindowName();
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 
476 void TGImageMap::AddRegion(const TGRegion &region, Int_t id)
477 {
478  fListOfRegions->Add(new TGRegionWithId(region, id));
479 }
480 
481 ////////////////////////////////////////////////////////////////////////////////
482 /// Create popoup 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  }
572  DoubleClicked();
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 
613 void 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 
625 void 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 }
TGWindow::SetWindowName
virtual void SetWindowName(const char *name=0)
Set window name.
Definition: TGWindow.cxx:128
TGImageMap.h
Event_t::fType
EGEventType fType
of event (see EGEventType)
Definition: GuiTypes.h:175
TGClient::GetDefaultRoot
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
Definition: TGClient.cxx:235
TGPopupMenu::PlaceMenu
virtual void PlaceMenu(Int_t x, Int_t y, Bool_t stick_mode, Bool_t grab_pointer)
Popup a popup menu.
Definition: TGMenu.cxx:1240
TGRegion::GetPosition
TGPosition GetPosition() const
Return position of region (x, y).
Definition: TGImageMap.cxx:302
n
const Int_t n
Definition: legend1.C:16
TGButton::Clicked
virtual void Clicked()
Definition: TGButton.h:135
TArrayS
Array of shorts (16 bits per element).
Definition: TArrayS.h:27
TGImageMap::HandleDoubleClick
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click events.
Definition: TGImageMap.cxx:553
Point_t::fX
Short_t fX
Definition: GuiTypes.h:357
TGRegion::fData
TGRegionData * fData
Definition: TGImageMap.h:38
TGWindow
Definition: TGWindow.h:31
TGImageMap::kNavRegions
@ kNavRegions
Definition: TGImageMap.h:123
Region_t
Handle_t Region_t
Region handle.
Definition: GuiTypes.h:32
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TGImageMap::fListOfRegions
TList * fListOfRegions
Definition: TGImageMap.h:126
TGPicture
Definition: TGPicture.h:36
kAnyModifier
const Mask_t kAnyModifier
Definition: GuiTypes.h:210
TGImageMap::AddRegion
void AddRegion(const TGRegion &region, Int_t id)
Add a region to the image map.
Definition: TGImageMap.cxx:476
TGDimension
Definition: TGDimension.h:27
gPointerX
static Int_t gPointerX
Definition: TGImageMap.cxx:38
kPointerMotionMask
const Mask_t kPointerMotionMask
Definition: GuiTypes.h:163
TGImageMap::fMainTip
TGToolTip * fMainTip
Definition: TGImageMap.h:131
UShort_t
unsigned short UShort_t
Definition: RtypesCore.h:40
TPoint::GetX
SCoord_t GetX() const
Definition: TPoint.h:46
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
Rectangle_t
Rectangle structure (maps to the X11 XRectangle structure)
Definition: GuiTypes.h:361
TGRegion::CopyRegion
TGRegion CopyRegion() const
Copy a region.
Definition: TGImageMap.cxx:209
kAnyButton
@ kAnyButton
Definition: GuiTypes.h:214
TList::Delete
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Definition: TList.cxx:470
Point_t
Point structure (maps to the X11 XPoint structure)
Definition: GuiTypes.h:356
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TPoint::GetY
SCoord_t GetY() const
Definition: TPoint.h:47
r
ROOT::R::TRInterface & r
Definition: Object.C:4
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
TGRegionWithId::fTip
TGToolTip * fTip
Definition: TGImageMap.h:91
TGRegion::~TGRegion
virtual ~TGRegion()
Delete a region.
Definition: TGImageMap.cxx:180
TRefCnt.h
TGRegion::GetDimension
TGDimension GetDimension() const
Return dimension of region (widht, height).
Definition: TGImageMap.cxx:292
operator=
Binding & operator=(OUT(*fun)(void))
Definition: TRInterface_Binding.h:15
TGRegionWithId::GetId
Int_t GetId() const
Definition: TGImageMap.h:103
Int_t
int Int_t
Definition: RtypesCore.h:45
TGRegion
Definition: TGImageMap.h:35
x
Double_t x[n]
Definition: legend1.C:17
TGRegion::operator=
TGRegion & operator=(const TGRegion &r)
Region assignment operator.
Definition: TGImageMap.cxx:191
TGRegionWithId::fPopup
TGPopupMenu * fPopup
Definition: TGImageMap.h:92
TGToolTip
Definition: TGToolTip.h:35
TList.h
kButton1
@ kButton1
Definition: GuiTypes.h:214
TGRegion::operator==
Bool_t operator==(const TGRegion &r) const
Region == operator.
Definition: TGImageMap.cxx:312
TVirtualX.h
TGImageMap::fCursorMouseOut
ECursor fCursorMouseOut
Definition: TGImageMap.h:129
TString
Basic string class.
Definition: TString.h:136
TGImageMap::fCursorMouseOver
ECursor fCursorMouseOver
Definition: TGImageMap.h:128
TGFrame
Definition: TGFrame.h:104
Point_t::fY
Short_t fY
Definition: GuiTypes.h:357
kButtonPressMask
const Mask_t kButtonPressMask
Definition: GuiTypes.h:161
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
text
TText * text
Definition: entrylist_figure1.C:10
TGRegionWithId::TGRegionWithId
TGRegionWithId()
Create GUI region (with id and possible tooltip).
Definition: TGImageMap.cxx:323
Rectangle_t::fY
Short_t fY
Definition: GuiTypes.h:362
bool
TGRegion::Eor
TGRegion Eor(const TGRegion &r) const
Returns a region which is the difference between the union and intersection this region and r.
Definition: TGImageMap.cxx:282
kLeaveWindowMask
const Mask_t kLeaveWindowMask
Definition: GuiTypes.h:168
TGRegionWithId::fId
Int_t fId
Definition: TGImageMap.h:90
id
XFontStruct * id
Definition: TGX11.cxx:109
gClient
#define gClient
Definition: TGClient.h:166
Rectangle_t::fX
Short_t fX
Definition: GuiTypes.h:362
TGFrame::AddInput
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
Definition: TGFrame.cxx:324
kNone
const Handle_t kNone
Definition: GuiTypes.h:88
TGToolTip::Reset
void Reset()
Reset tool tip popup delay timer.
Definition: TGToolTip.cxx:260
TGRegion::Subtract
TGRegion Subtract(const TGRegion &r) const
Returns a region which is r subtracted from this region.
Definition: TGImageMap.cxx:271
TGImageMap::RegionClicked
virtual void RegionClicked(Int_t id)
Handle when mouse was clicked on region id.
Definition: TGImageMap.cxx:664
TGRegionWithId::~TGRegionWithId
virtual ~TGRegionWithId()
Cleanup.
Definition: TGImageMap.cxx:378
gCurrentRegion
TGRegionWithId * gCurrentRegion
Definition: TGImageMap.cxx:35
h
#define h(i)
Definition: RSha256.hxx:106
kButton3
@ kButton3
Definition: GuiTypes.h:214
TGImageMap::fLastVisited
Int_t fLastVisited
Definition: TGImageMap.h:130
TGRegion::Intersect
TGRegion Intersect(const TGRegion &r) const
Returns a region which is the intersection of this region and r.
Definition: TGImageMap.cxx:261
TGObject::fId
Handle_t fId
Definition: TGObject.h:36
Event_t::fCode
UInt_t fCode
key or button code
Definition: GuiTypes.h:180
TGRegion::Contains
Bool_t Contains(const TPoint &p) const
Return true if point p is contained in the region.
Definition: TGImageMap.cxx:235
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGRegionWithId::SetPopup
void SetPopup(TGPopupMenu *popup)
Definition: TGImageMap.h:108
gPointerY
static Int_t gPointerY
Definition: TGImageMap.cxx:39
kButtonPress
@ kButtonPress
Definition: GuiTypes.h:60
Long_t
long Long_t
Definition: RtypesCore.h:54
TGButton::fTip
TGToolTip * fTip
Definition: TGButton.h:79
kButtonReleaseMask
const Mask_t kButtonReleaseMask
Definition: GuiTypes.h:162
TGImageMap::GetPopup
TGPopupMenu * GetPopup(Int_t id)
Return popup for regions with specified id.
Definition: TGImageMap.cxx:507
TGImageMap::SetToolTipText
void SetToolTipText(const char *text, Long_t delayms=300)
Set tooltip text for main region.
Definition: TGImageMap.cxx:613
ClassImpQ
#define ClassImpQ(name)
Definition: TQObject.h:282
TGRegion::TGRegion
TGRegion()
Create a region object.
Definition: TGImageMap.cxx:75
TGRegionWithId::SetToolTipText
void SetToolTipText(const char *text, Long_t delayms, const TGFrame *frame)
Set tool tip text associated with this region.
Definition: TGImageMap.cxx:396
TGImageMap::fNavMode
ENavMode fNavMode
Definition: TGImageMap.h:127
y
Double_t y[n]
Definition: legend1.C:17
Short_t
short Short_t
Definition: RtypesCore.h:39
TGRegionWithId::DisplayPopup
void DisplayPopup()
Display popup menu associated with this region.
Definition: TGImageMap.cxx:386
kPointer
@ kPointer
Definition: GuiTypes.h:375
kKeyPressMask
const Mask_t kKeyPressMask
Definition: GuiTypes.h:159
TGRegionWithId
Definition: TGImageMap.h:83
TGImageMap::TGImageMap
TGImageMap(const TGImageMap &)=delete
kHand
@ kHand
Definition: GuiTypes.h:374
unsigned int
TGRegionWithId::GetToolTipText
TGToolTip * GetToolTipText() const
Definition: TGImageMap.h:104
TGButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set button state.
Definition: TGButton.cxx:188
TGPictureButton::SetDisabledPicture
virtual void SetDisabledPicture(const TGPicture *pic)
Changes disabled picture.
Definition: TGButton.cxx:1088
TGRegion::IsEmpty
Bool_t IsEmpty() const
Return true if region is empty.
Definition: TGImageMap.cxx:227
TGImageMap
Definition: TGImageMap.h:115
TGImageMap::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle button events.
Definition: TGImageMap.cxx:579
TGRegionWithId::GetPopup
TGPopupMenu * GetPopup() const
Definition: TGImageMap.h:107
TPoint
Definition: TPoint.h:31
TObject::operator=
TObject & operator=(const TObject &rhs)
TObject assignment operator.
Definition: TObject.h:268
Rectangle_t::fHeight
UShort_t fHeight
Definition: GuiTypes.h:363
TGPictureButton
Definition: TGButton.h:228
TGImageMap::OnMouseOut
virtual void OnMouseOut(Int_t id)
Handle when mouse moves from region id.
Definition: TGImageMap.cxx:652
TGObject::fClient
TGClient * fClient
Definition: TGObject.h:37
TArrayS.h
points
point * points
Definition: X3DBuffer.c:22
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
Rectangle_t::fWidth
UShort_t fWidth
Definition: GuiTypes.h:363
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
gEmptyRegion
static TGRegion * gEmptyRegion
Definition: TGImageMap.cxx:37
TGImageMap::fTrash
TList * fTrash
Definition: TGImageMap.h:132
TGToolTip.h
kKeyReleaseMask
const Mask_t kKeyReleaseMask
Definition: GuiTypes.h:160
TGPopupMenu
Definition: TGMenu.h:123
Event_t
Event structure.
Definition: GuiTypes.h:174
TGRegion::Unite
TGRegion Unite(const TGRegion &r) const
Return the union of this region with r.
Definition: TGImageMap.cxx:251
TRefCnt
Definitions for TRefCnt, base class for reference counted objects.
Definition: TRefCnt.h:27
TIter
Definition: TCollection.h:233
kStructureNotifyMask
const Mask_t kStructureNotifyMask
Definition: GuiTypes.h:166
TGImageMap::OnMouseOver
virtual void OnMouseOver(Int_t id)
Handle when mouse moves over region id.
Definition: TGImageMap.cxx:640
type
int type
Definition: TGX11.cxx:121
TGImageMap::~TGImageMap
virtual ~TGImageMap()
Cleanup image map widget.
Definition: TGImageMap.cxx:464
TGPosition
Definition: TGDimension.h:45
TGToolTip::Hide
void Hide()
Hide tool tip window.
Definition: TGToolTip.cxx:247
TGPictureButton::fPic
const TGPicture * fPic
Definition: TGButton.h:231
TGMenu.h
TGImageMap::CreatePopup
TGPopupMenu * CreatePopup(Int_t id)
Create popoup menu or returns existing for regions with specified id.
Definition: TGImageMap.cxx:484
kButtonDisabled
@ kButtonDisabled
Definition: TGButton.h:56
TList
A doubly linked list.
Definition: TList.h:44
TQObject::Emit
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
TGImageMap::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion events.
Definition: TGImageMap.cxx:521
TGRegion::IsNull
Bool_t IsNull() const
Return true if region is not set.
Definition: TGImageMap.cxx:219
TGRegion::ERegionType
ERegionType
Definition: TGImageMap.h:44
TGImageMap::DoubleClicked
virtual void DoubleClicked()
Handle when mouse is double clicked on main map.
Definition: TGImageMap.cxx:673
int