43class TGRegionData : public
TRefCnt {
52 TGRegionData() { fRgn = 0; fIsNull =
kTRUE; AddReference(); }
54 TGRegionData &
operator=(
const TGRegionData &
r);
81 fData->AddReference();
89 fData =
new TGRegionData;
91 fData->fIsNull = is_null;
99 fData =
new TGRegionData;
116 fData =
new TGRegionData;
120 for (
int i = 0; i <
n; i++) {
133 fData =
new TGRegionData;
137 if (
n !=
y.GetSize()) {
138 Error(
"TGRegion",
"x and y arrays must have same length");
143 for (
int i = 0; i <
n; i++) {
144 gpoints[i].
fX =
x.GetArray()[i];
145 gpoints[i].
fY =
y.GetArray()[i];
156 fData =
new TGRegionData;
160 for (
int i = 0; i <
n; i++) {
161 gpoints[i].
fX =
x[i];
162 gpoints[i].
fY =
y[i];
174 fData->AddReference();
182 if (
fData->RemoveReference() <= 0) {
195 r.fData->AddReference();
197 if (
fData->RemoveReference() <= 0) {
221 return fData->fIsNull;
492 if (
id == region->
GetId()) {
494 if (!popup && !newpopup) {
498 if (newpopup) region->
SetPopup(newpopup);
501 return newpopup ? newpopup : popup;
631 if (
id == region->
GetId())
645 Emit(
"OnMouseOver(Int_t)",
id);
657 Emit(
"OnMouseOut(Int_t)",
id);
666 Emit(
"RegionClicked(Int_t)",
id);
675 Emit(
"DoubleClicked()");
684 Emit(
"DoubleClicked(Int_t)",
id);
const Mask_t kButtonPressMask
const Mask_t kKeyReleaseMask
const Mask_t kAnyModifier
const Mask_t kKeyPressMask
const Mask_t kPointerMotionMask
const Mask_t kLeaveWindowMask
const Mask_t kStructureNotifyMask
const Mask_t kButtonReleaseMask
static TGRegion * gEmptyRegion
TGRegionWithId * gCurrentRegion
Binding & operator=(OUT(*fun)(void))
Array of shorts (16 bits per element).
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
void SetToolTipText(const char *text, Long_t delayms=300)
Set tooltip text for main region.
virtual ~TGImageMap()
Cleanup image map widget.
TGPopupMenu * GetPopup(Int_t id)
Return popup for regions with specified id.
virtual void OnMouseOut(Int_t id)
Handle when mouse moves from region id.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion events.
virtual void OnMouseOver(Int_t id)
Handle when mouse moves over region id.
virtual void DoubleClicked()
Handle when mouse is double clicked on main map.
virtual Bool_t HandleButton(Event_t *event)
Handle button events.
void AddRegion(const TGRegion ®ion, Int_t id)
Add a region to the image map.
TGImageMap(const TGImageMap &)
TGPopupMenu * CreatePopup(Int_t id)
Create popoup menu or returns existing for regions with specified id.
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click events.
virtual void RegionClicked(Int_t id)
Handle when mouse was clicked on region id.
void SetPopup(TGPopupMenu *popup)
void SetToolTipText(const char *text, Long_t delayms, const TGFrame *frame)
Set tool tip text associated with this region.
void DisplayPopup()
Display popup menu associated with this region.
TGPopupMenu * GetPopup() const
virtual ~TGRegionWithId()
Cleanup.
TGRegionWithId()
Create GUI region (with id and possible tooltip).
TGToolTip * GetToolTipText() const
TGRegion CopyRegion() const
Copy a region.
Bool_t IsEmpty() const
Return true if region is empty.
virtual ~TGRegion()
Delete a region.
TGDimension GetDimension() const
Return dimension of region (widht, 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.
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.
virtual void SetWindowName(const char *name=0)
Set window name.
virtual void Add(TObject *obj)
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
Mother of all ROOT objects.
TObject & operator=(const TObject &rhs)
TObject assignment operator.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definitions for TRefCnt, base class for reference counted objects.