library: libGui #include "TGImageMap.h"

# TGImageMap

class description - source file - inheritance tree (.ps)

## class TGImageMap : public TGPictureButton

| Inheritance Chart:

`TObject`

<-

`TGObject`

<-

`TGWindow`

`TQObject`

<-

`TGFrame`

`TGWidget`

<-

`TGButton`

<-

`TGPictureButton`

<-

`TGImageMap`

        public:

                               TGImageMap(const TGWindow* p, const TGPicture* pic)
                               TGImageMap(const TGWindow* p, const TString& pic)
                               TGImageMap(const TGImageMap&)
                       virtual ~TGImageMap()
                          void AddRegion(const TGRegion& region, Int_t id)
                static TClass* Class()
                  TGPopupMenu* CreatePopup(Int_t id)
                  virtual void DoubleClicked(Int_t id)
                  virtual void DoubleClicked()
          TGImageMap::ENavMode GetNavMode()
                  TGPopupMenu* GetPopup(Int_t id)
                virtual Bool_t HandleButton(Event_t* event)
                virtual Bool_t HandleDoubleClick(Event_t* event)
                virtual Bool_t HandleMotion(Event_t* event)
               virtual TClass* IsA() const
                  virtual void OnMouseOut(Int_t id)
                  virtual void OnMouseOver(Int_t id)
                  virtual void RegionClicked(Int_t id)
                          void SetCursor(ECursor cursor = kHand)
                          void SetPicture(const TGPicture*)
                  virtual void SetToolTipText(const char* text, Long_t delayms = 300)
                          void SetToolTipText(Int_t id, const char* text, Long_t delayms = 300)
                  virtual void ShowMembers(TMemberInspector& insp, char* parent)
                  virtual void Streamer(TBuffer& b)
                          void StreamerNVirtual(TBuffer& b)

### Data Members

        protected:

                        TList* fListOfRegions    list of regions
          TGImageMap::ENavMode fNavMode          navigation mode
                       ECursor fCursorMouseOver  cursor shape in regions
                       ECursor fCursorMouseOut   cursor shape out of regions
                         Int_t fLastVisited      id of the last visited region
                    TGToolTip* fMainTip          tooltip text for main region
                        TList* fTrash            collect all objects that need to be cleaned up

        public:

          static const TGImageMap::ENavMode kNavRegions
          static const TGImageMap::ENavMode kNavGrid

## Class Description

     TGImageMap (with TGRegion and TGRegionWithId help classes)

     A TGImageMap provides the functionality like a clickable image in
     a web browser with sensitive regions (MAP HTML tag).

TGImageMap(const TGWindow *p, const TGPicture *pic) : TGPictureButton(p, pic)

     Create an image map widget.

TGImageMap(const TGWindow *p, const TString &pic) : TGPictureButton(p, pic.Data())

     Create an image map widget.

~TGImageMap()

     Cleanup image map widget.

void AddRegion(const TGRegion &region, Int_t id)

     Add a region to the image map.

TGPopupMenu* CreatePopup(Int_t id)

     Create popoup menu or returns existing for regions with specified id.

TGPopupMenu* GetPopup(Int_t id)

     Return popup for regions with specified id.

Bool_t HandleMotion(Event_t *event)

     Handle mouse motion events.

Bool_t HandleDoubleClick(Event_t *event)

     Handle double click events.

Bool_t HandleButton(Event_t *event)

     Handle button events.

void SetToolTipText(const char *text, Long_t delayms)

     Set tooltip text for main region.

void SetToolTipText(Int_t id, const char *text, Long_t delayms)

     Set tooltip text for regions with specified id.

void OnMouseOver(Int_t id)

     Handle when mouse moves over region id. Emits signal
     OnMouseOver(Int_t).

void OnMouseOut(Int_t id)

     Handle when mouse moves from region id. Emits signal
     OnMouseOut(Int_t).

void RegionClicked(Int_t id)

     Handle when mouse was clicked on region id. Emits signal
     RegionClicked(Int_t).

void DoubleClicked()

     Handle when mouse is double clicked on main map. Emits signal
     DoubleClicked().

void DoubleClicked(Int_t id)

     Handle when mouse is double clicked on region id. Emits signal
     DoubleClicked(Int_t).

### Inline Functions

            TGImageMap::ENavMode GetNavMode()
                            void SetCursor(ECursor cursor = kHand)
                            void SetPicture(const TGPicture*)
                         TClass* Class()
                         TClass* IsA() const
                            void ShowMembers(TMemberInspector& insp, char* parent)
                            void Streamer(TBuffer& b)
                            void StreamerNVirtual(TBuffer& b)
                      TGImageMap TGImageMap(const TGImageMap&)

Author: Valeriy Onuchin & Fons Rademakers 18/10/2000
Last update: root/gui:$Name: $:$Id: TGImageMap.cxx,v 1.6 2004/07/08 10:02:31 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *