#include <imgmap.h>
Inheritance diagram for ImageMap:


Public Methods | |
| void | seek_over () |
| Finds the region that the mouse is currently over and sets the appropriate member. | |
| void | set_watcher (Watcher< ImageMap > &my_watch) |
| Sets the watcher that will watch this TreeView. | |
| void | me_modified () |
| gint | motion_notify_event_impl (GdkEventMotion *event) |
| Updates the information about which region the pointer is over. | |
| gint | button_press_event_impl (GdkEventButton *event) |
| Updates the display when a mouse button is clicked. | |
| gint | enter_notify_event_impl (GdkEventCrossing *event) |
| Updates the display when the mouse enters the map area. | |
| gint | leave_notify_event_impl (GdkEventCrossing *event) |
| Updates the display when the mouse leaves the map area. | |
| virtual bool | clicked (EntryRect const *, int button)=0 |
| virtual void | hover (EntryRect const *) |
| virtual void | left () |
| virtual void | entered () |
Protected Attributes | |
| EntryRect * | over_rect |
| bool | mouse_in |
| std::vector< EntryRect > | rectangles |
|
|
Finds the region that the mouse is currently over and sets the appropriate member.
00066 {
00067 int x=mouse_x;
00068 int y=mouse_y;
00069 if (over_rect!=NULL && over_rect->contains(x, y)) return;
00070 for (size_t i=0; i<rectangles.size(); ++i)
00071 {
00072 if (rectangles[i].contains(x, y))
00073 {
00074 over_rect=&rectangles[i];
00075 me_modified();
00076 return;
00077 }
00078 }
00079 over_rect=NULL;
00080 }
|
|
|
Sets the watcher that will watch this TreeView.
00169 {
00170 this->my_watch=&my_watch;
00171 }
|
|
|
|
|
|
Updates the information about which region the pointer is over.
00089 {
00090 int x, y;
00091 GdkModifierType state;
00092 Gdk_Window window(event->window);
00093 if (event->window);
00094 if (event->is_hint)
00095 window.get_pointer (x,y,state);
00096 else
00097 {
00098 x=(int)event->x;
00099 y=(int)event->y;
00100 state=(GdkModifierType) event->state;
00101 }
00102 mouse_x=x;
00103 mouse_y=y;
00104 EntryRect *old_over=over_rect;
00105 seek_over();
00106 //if (over_rect!=old_over) hover(over_rect);
00107 if (over_rect!=old_over && over_rect!=NULL) over_rect->hover();
00108 DrawingArea::motion_notify_event_impl(event);
00109 return true;
00110 }
|
|
|
Updates the display when a mouse button is clicked.
|
|
|
Updates the display when the mouse enters the map area.
|
|
|
Updates the display when the mouse leaves the map area.
00141 {
00142 if (event==NULL) return false;
00143 if (!DrawingArea::leave_notify_event_impl(event))
00144 mouse_in=false;
00145 me_modified();
00146 return false;
00147 }
|
|
||||||||||||
|
Implemented in TreeView. |
|
|
00150 {
00151 me_modified();
00152 }
|
|
|
00160 {
00161 me_modified();
00162 }
|
|
|
00155 {
00156 me_modified();
00157 }
|
|
|
|
|
|
|
|
|
|
1.2.18