Prechádzať zdrojové kódy

*** empty log message ***

David Rose 25 rokov pred
rodič
commit
3c77f79fb3

+ 1 - 1
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
 //               names are generated when a button is depressed.  This
 //               is a string that may contain any of the following:
 //               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.
 //                  %b  - the name of the button pressed.
 //
 //
 //               The event name will be based on the in_pattern
 //               The event name will be based on the in_pattern

+ 2 - 1
panda/src/tform/mouseWatcher.cxx

@@ -13,6 +13,7 @@
 #include <keyboardButton.h>
 #include <keyboardButton.h>
 #include <mouseButton.h>
 #include <mouseButton.h>
 #include <throw_event.h>
 #include <throw_event.h>
+#include <eventParameter.h>
 #include <pruneTransition.h>
 #include <pruneTransition.h>
 #include <transformTransition.h>
 #include <transformTransition.h>
 
 
@@ -204,7 +205,7 @@ throw_event_pattern(const string &pattern, const MouseWatcherRegion *region,
   }
   }
 
 
   if (!event.empty()) {
   if (!event.empty()) {
-    throw_event(event);
+    throw_event(event, EventParameter(region), EventParameter(button_name));
   }
   }
 }
 }
 
 

+ 1 - 1
panda/src/tform/mouseWatcher.h

@@ -64,7 +64,7 @@ PUBLISHED:
 
 
   INLINE void set_button_up_pattern(const string &pattern);
   INLINE void set_button_up_pattern(const string &pattern);
   INLINE const string &get_button_up_pattern() const;
   INLINE const string &get_button_up_pattern() const;
-
+  
   INLINE void set_enter_pattern(const string &pattern);
   INLINE void set_enter_pattern(const string &pattern);
   INLINE const string &get_enter_pattern() const;
   INLINE const string &get_enter_pattern() const;
 
 

+ 8 - 4
panda/src/tform/mouseWatcherRegion.h

@@ -9,7 +9,7 @@
 #include <pandabase.h>
 #include <pandabase.h>
 
 
 #include <namable.h>
 #include <namable.h>
-#include <referenceCount.h>
+#include <typedReferenceCount.h>
 #include <luse.h>
 #include <luse.h>
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -17,7 +17,7 @@
 // Description : This is the class that defines a rectangular region
 // Description : This is the class that defines a rectangular region
 //               on the screen for the MouseWatcher.
 //               on the screen for the MouseWatcher.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-class EXPCL_PANDA MouseWatcherRegion : public ReferenceCount, public Namable {
+class EXPCL_PANDA MouseWatcherRegion : public TypedReferenceCount, public Namable {
 PUBLISHED:
 PUBLISHED:
   INLINE MouseWatcherRegion(const string &name, float left, float right,
   INLINE MouseWatcherRegion(const string &name, float left, float right,
 			    float bottom, float top);
 			    float bottom, float top);
@@ -49,12 +49,16 @@ public:
     return _type_handle;
     return _type_handle;
   }
   }
   static void init_type() {
   static void init_type() {
-    ReferenceCount::init_type();
+    TypedReferenceCount::init_type();
     Namable::init_type();
     Namable::init_type();
     register_type(_type_handle, "MouseWatcherRegion",
     register_type(_type_handle, "MouseWatcherRegion",
-		  ReferenceCount::get_class_type(),
+		  TypedReferenceCount::get_class_type(),
 		  Namable::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:
 private:
   static TypeHandle _type_handle;
   static TypeHandle _type_handle;