42 class TGRegionData : public
TRefCnt {
51 TGRegionData() { fRgn = 0; fIsNull =
kTRUE; AddReference(); }
53 TGRegionData &
operator=(
const TGRegionData &r);
80 fData->AddReference();
88 fData =
new TGRegionData;
90 fData->fIsNull = is_null;
98 fData =
new TGRegionData;
115 fData =
new TGRegionData;
119 for (
int i = 0; i <
n; i++) {
120 gpoints[i].
fX = (
Short_t) points[i].GetX();
121 gpoints[i].
fY = (
Short_t) points[i].GetY();
132 fData =
new TGRegionData;
137 Error(
"TGRegion",
"x and y arrays must have same length");
142 for (
int i = 0; i <
n; i++) {
155 fData =
new TGRegionData;
159 for (
int i = 0; i <
n; i++) {
160 gpoints[i].
fX = x[i];
161 gpoints[i].
fY = y[i];
173 fData->AddReference();
181 if (
fData->RemoveReference() <= 0) {
194 r.
fData->AddReference();
196 if (
fData->RemoveReference() <= 0) {
220 return fData->fIsNull;
403 if (text && strlen(text))
491 if (
id == region->
GetId()) {
493 if (!popup && !newpopup) {
497 if (newpopup) region->
SetPopup(newpopup);
500 return newpopup ? newpopup : popup;
617 if (text && strlen(text))
630 if (
id == region->
GetId())
644 Emit(
"OnMouseOver(Int_t)",
id);
656 Emit(
"OnMouseOut(Int_t)",
id);
665 Emit(
"RegionClicked(Int_t)",
id);
674 Emit(
"DoubleClicked()");
683 Emit(
"DoubleClicked(Int_t)",
id);
TGRegionWithId()
Create GUI region (with id and possible tooltip).
const Mask_t kKeyReleaseMask
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
TGDimension GetDimension() const
Return dimension of region (widht, height).
TGImageMap(const TGImageMap &)
void DisplayPopup()
Display popup menu associated with this region.
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
virtual void DoubleClicked()
Handle when mouse is double clicked on main map.
TGRegion Subtract(const TGRegion &r) const
Returns a region which is r subtracted from this region.
Definitions for TRefCnt, base class for reference counted objects.
const Mask_t kLeaveWindowMask
TGRegion Intersect(const TGRegion &r) const
Returns a region which is the intersection of this region and r.
TGToolTip * GetToolTipText() const
void SetToolTipText(const char *text, Long_t delayms=300)
Set tooltip text for main region.
TGPopupMenu * GetPopup(Int_t id)
Return popup for regions with specified id.
virtual ~TGRegion()
Delete a region.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion events.
R__EXTERN TGRegionWithId * gCurrentRegion
virtual Bool_t HandleDoubleClick(Event_t *event)
Handle double click events.
const Mask_t kPointerMotionMask
TGRegion Eor(const TGRegion &r) const
Returns a region which is the difference between the union and intersection this region and r...
void SetPopup(TGPopupMenu *popup)
std::vector< std::vector< double > > Data
TGRegion()
Create a region object.
TObject & operator=(const TObject &rhs)
TObject assignment operator.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
ClassImp(TGRegion) ClassImp(TGRegionWithId) ClassImpQ(TGImageMap) TGRegionWithId *gCurrentRegion
virtual ~TGRegionWithId()
Cleanup.
void Emit(const char *signal)
Acitvate signal without args.
TGRegion & operator=(const TGRegion &r)
Region assignment operator.
const Mask_t kButtonPressMask
const Mask_t kKeyPressMask
TGPopupMenu * GetPopup() const
Array of shorts (16 bits per element).
virtual Bool_t HandleButton(Event_t *event)
Handle button events.
Bool_t IsNull() const
Return true if region is not set.
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
TGPosition GetPosition() const
Return position of region (x, y).
const Mask_t kStructureNotifyMask
Bool_t operator==(const TGRegion &r) const
Region == operator.
const Mask_t kButtonReleaseMask
TGRegion Unite(const TGRegion &r) const
Return the union of this region with r.
virtual void OnMouseOver(Int_t id)
Handle when mouse moves over region id.
static TGRegion * gEmptyRegion
virtual ~TGImageMap()
Cleanup image map widget.
virtual void OnMouseOut(Int_t id)
Handle when mouse moves from region id.
Binding & operator=(OUT(*fun)(void))
Mother of all ROOT objects.
virtual void RegionClicked(Int_t id)
Handle when mouse was clicked on region id.
virtual void Add(TObject *obj)
void AddRegion(const TGRegion ®ion, Int_t id)
Add a region to the image map.
Bool_t Contains(const TPoint &p) const
Return true if point p is contained in the region.
Bool_t IsEmpty() const
Return true if region is empty.
TGPopupMenu * CreatePopup(Int_t id)
Create popoup menu or returns existing for regions with specified id.
const Short_t * GetArray() const
const Mask_t kAnyModifier
TGRegion CopyRegion() const
Copy a region.
void SetToolTipText(const char *text, Long_t delayms, const TGFrame *frame)
Set tool tip text associated with this region.
virtual void SetWindowName(const char *name=0)
Set window name.