From 3c77f79fb3a8189b95999cc12179a869dbb56fef Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 8 Feb 2001 19:01:22 +0000 Subject: [PATCH] *** empty log message *** --- panda/src/tform/mouseWatcher.I | 2 +- panda/src/tform/mouseWatcher.cxx | 3 ++- panda/src/tform/mouseWatcher.h | 2 +- panda/src/tform/mouseWatcherRegion.h | 12 ++++++++---- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/panda/src/tform/mouseWatcher.I b/panda/src/tform/mouseWatcher.I index 05c7248618..bfc6c76709 100644 --- a/panda/src/tform/mouseWatcher.I +++ b/panda/src/tform/mouseWatcher.I @@ -119,7 +119,7 @@ get_over_region(float x, float y) const { // names are generated when a button is depressed. This // is a string that may contain any of the following: // -// %n - the name of the region the mouse is over +// %r - the name of the region the mouse is over // %b - the name of the button pressed. // // The event name will be based on the in_pattern diff --git a/panda/src/tform/mouseWatcher.cxx b/panda/src/tform/mouseWatcher.cxx index ebc23a594f..35138b21e4 100644 --- a/panda/src/tform/mouseWatcher.cxx +++ b/panda/src/tform/mouseWatcher.cxx @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -204,7 +205,7 @@ throw_event_pattern(const string &pattern, const MouseWatcherRegion *region, } if (!event.empty()) { - throw_event(event); + throw_event(event, EventParameter(region), EventParameter(button_name)); } } diff --git a/panda/src/tform/mouseWatcher.h b/panda/src/tform/mouseWatcher.h index d2b0f86581..4f46afaeb3 100644 --- a/panda/src/tform/mouseWatcher.h +++ b/panda/src/tform/mouseWatcher.h @@ -64,7 +64,7 @@ PUBLISHED: INLINE void set_button_up_pattern(const string &pattern); INLINE const string &get_button_up_pattern() const; - + INLINE void set_enter_pattern(const string &pattern); INLINE const string &get_enter_pattern() const; diff --git a/panda/src/tform/mouseWatcherRegion.h b/panda/src/tform/mouseWatcherRegion.h index 7d57d8bd06..abbab74644 100644 --- a/panda/src/tform/mouseWatcherRegion.h +++ b/panda/src/tform/mouseWatcherRegion.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include //////////////////////////////////////////////////////////////////// @@ -17,7 +17,7 @@ // Description : This is the class that defines a rectangular region // on the screen for the MouseWatcher. //////////////////////////////////////////////////////////////////// -class EXPCL_PANDA MouseWatcherRegion : public ReferenceCount, public Namable { +class EXPCL_PANDA MouseWatcherRegion : public TypedReferenceCount, public Namable { PUBLISHED: INLINE MouseWatcherRegion(const string &name, float left, float right, float bottom, float top); @@ -49,12 +49,16 @@ public: return _type_handle; } static void init_type() { - ReferenceCount::init_type(); + TypedReferenceCount::init_type(); Namable::init_type(); register_type(_type_handle, "MouseWatcherRegion", - ReferenceCount::get_class_type(), + TypedReferenceCount::get_class_type(), Namable::get_class_type()); } + virtual TypeHandle get_type() const { + return get_class_type(); + } + virtual TypeHandle force_init_type() {init_type(); return get_class_type();} private: static TypeHandle _type_handle;