122 for (
int i = 0; i <
n; i++) {
139 if (
n !=
y.GetSize()) {
140 Error(
"TGRegion",
"x and y arrays must have same length");
145 for (
int i = 0; i <
n; i++) {
146 gpoints[i].
fX =
x.GetArray()[i];
147 gpoints[i].
fY =
y.GetArray()[i];
162 for (
int i = 0; i <
n; i++) {
163 gpoints[i].
fX =
x[i];
164 gpoints[i].
fY =
y[i];
197 r.fData->AddReference();
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);
Handle_t Region_t
Region handle.
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
R__EXTERN TGRegionWithId * gCurrentRegion
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
Array of shorts (16 bits per element).
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
(with TGRegion and TGRegionWithId help classes)
virtual ~TGImageMap()
Cleanup image map widget.
ENavMode fNavMode
navigation mode
TGPopupMenu * GetPopup(Int_t id)
Return popup for regions with specified id.
Int_t fLastVisited
id of the last visited region
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
TList * fTrash
collect all objects that need to be cleaned up
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 ®ion, 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
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
virtual void RegionClicked(Int_t id)
Handle when mouse was clicked on region id.
ECursor fCursorMouseOut
cursor shape out of regions
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
TGRegionData & operator=(const TGRegionData &r)
Assignment of region data object.
void SetPopup(TGPopupMenu *popup)
TGPopupMenu * fPopup
popup menu
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 (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.
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.
ROOT GUI Window base class.
virtual void SetWindowName(const char *name=nullptr)
Set window name.
void Add(TObject *obj) override
void Delete(Option_t *option="") override
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.
Point structure (maps to the X11 XPoint structure)
Rectangle structure (maps to the X11 XRectangle structure)