Browse Source

further pgui enhancements

David Rose 24 years ago
parent
commit
0cba400ac0

+ 3 - 0
panda/src/pgui/Sources.pp

@@ -12,6 +12,7 @@
   #define SOURCES  \
   #define SOURCES  \
     config_pgui.h \
     config_pgui.h \
     pgButton.I pgButton.h \
     pgButton.I pgButton.h \
+    pgButtonEvent.I pgButtonEvent.h \
     pgFrameStyle.I pgFrameStyle.h \
     pgFrameStyle.I pgFrameStyle.h \
     pgItem.I pgItem.h \
     pgItem.I pgItem.h \
     pgMouseWatcherRegion.I pgMouseWatcherRegion.h \
     pgMouseWatcherRegion.I pgMouseWatcherRegion.h \
@@ -21,6 +22,7 @@
   #define SOURCES $[SOURCES] \
   #define SOURCES $[SOURCES] \
     config_pgui.cxx \
     config_pgui.cxx \
     pgButton.cxx \
     pgButton.cxx \
+    pgButtonEvent.cxx \
     pgFrameStyle.cxx \
     pgFrameStyle.cxx \
     pgItem.cxx \
     pgItem.cxx \
     pgMouseWatcherRegion.cxx \
     pgMouseWatcherRegion.cxx \
@@ -28,6 +30,7 @@
 
 
   #define INSTALL_HEADERS \
   #define INSTALL_HEADERS \
     pgButton.I pgButton.h \
     pgButton.I pgButton.h \
+    pgButtonEvent.I pgButtonEvent.h \
     pgFrameStyle.I pgFrameStyle.h \
     pgFrameStyle.I pgFrameStyle.h \
     pgItem.I pgItem.h \
     pgItem.I pgItem.h \
     pgMouseWatcherRegion.I pgMouseWatcherRegion.h \
     pgMouseWatcherRegion.I pgMouseWatcherRegion.h \

+ 2 - 0
panda/src/pgui/config_pgui.cxx

@@ -18,6 +18,7 @@
 
 
 #include "config_pgui.h"
 #include "config_pgui.h"
 #include "pgButton.h"
 #include "pgButton.h"
+#include "pgButtonEvent.h"
 #include "pgItem.h"
 #include "pgItem.h"
 #include "pgMouseWatcherRegion.h"
 #include "pgMouseWatcherRegion.h"
 #include "pgTop.h"
 #include "pgTop.h"
@@ -29,6 +30,7 @@ NotifyCategoryDef(pgui, "");
 
 
 ConfigureFn(config_pgui) {
 ConfigureFn(config_pgui) {
   PGButton::init_type();
   PGButton::init_type();
+  PGButtonEvent::init_type();
   PGItem::init_type();
   PGItem::init_type();
   PGMouseWatcherRegion::init_type();
   PGMouseWatcherRegion::init_type();
   PGTop::init_type();
   PGTop::init_type();

+ 38 - 16
panda/src/pgui/pgButton.cxx

@@ -20,6 +20,8 @@
 #include "throw_event.h"
 #include "throw_event.h"
 #include "renderRelation.h"
 #include "renderRelation.h"
 #include "colorTransition.h"
 #include "colorTransition.h"
+#include "transformTransition.h"
+#include "mouseButton.h"
 
 
 TypeHandle PGButton::_type_handle;
 TypeHandle PGButton::_type_handle;
 
 
@@ -114,12 +116,16 @@ exit() {
 //               is within the region.
 //               is within the region.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void PGButton::
 void PGButton::
-button_down(ButtonHandle button) {
-  if (get_active()) {
-    _button_down = true;
-    set_state(S_depressed);
+button_down(ButtonHandle button, float x, float y) {
+  if (button == MouseButton::one() ||
+      button == MouseButton::two() ||
+      button == MouseButton::three()) {
+    if (get_active()) {
+      _button_down = true;
+      set_state(S_depressed);
+    }
   }
   }
-  PGItem::button_down(button);
+  PGItem::button_down(button, x, y);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -133,17 +139,21 @@ button_down(ButtonHandle button) {
 //               outside the region.
 //               outside the region.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void PGButton::
 void PGButton::
-button_up(ButtonHandle button, bool is_within) {
-  _button_down = false;
-  if (get_active()) {
-    if (is_within) {
-      set_state(S_rollover);
-      click();
-    } else {
-      set_state(S_ready);
+button_up(ButtonHandle button, float x, float y, bool is_within) {
+  if (button == MouseButton::one() ||
+      button == MouseButton::two() ||
+      button == MouseButton::three()) {
+    _button_down = false;
+    if (get_active()) {
+      if (is_within) {
+        set_state(S_rollover);
+        click();
+      } else {
+        set_state(S_ready);
+      }
     }
     }
   }
   }
-  PGItem::button_up(button, is_within);
+  PGItem::button_up(button, x, y, is_within);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -168,6 +178,11 @@ click() {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void PGButton::
 void PGButton::
 setup(const string &label) {
 setup(const string &label) {
+  clear_state_def(S_ready);
+  clear_state_def(S_depressed);
+  clear_state_def(S_rollover);
+  clear_state_def(S_inactive);
+
   TextNode *text_node = get_text_node();
   TextNode *text_node = get_text_node();
   text_node->set_text(label);
   text_node->set_text(label);
   PT_Node geom = text_node->generate();
   PT_Node geom = text_node->generate();
@@ -176,7 +191,7 @@ setup(const string &label) {
   set_frame(frame[0] - 0.4, frame[1] + 0.4, frame[2] - 0.15, frame[3] + 0.15);
   set_frame(frame[0] - 0.4, frame[1] + 0.4, frame[2] - 0.15, frame[3] + 0.15);
 
 
   new RenderRelation(get_state_def(S_ready), geom);
   new RenderRelation(get_state_def(S_ready), geom);
-  new RenderRelation(get_state_def(S_depressed), geom);
+  NodeRelation *down = new RenderRelation(get_state_def(S_depressed), geom);
   new RenderRelation(get_state_def(S_rollover), geom);
   new RenderRelation(get_state_def(S_rollover), geom);
   NodeRelation *inact = new RenderRelation(get_state_def(S_inactive), geom);
   NodeRelation *inact = new RenderRelation(get_state_def(S_inactive), geom);
 
 
@@ -197,8 +212,10 @@ setup(const string &label) {
 
 
   style.set_type(PGFrameStyle::T_bevel_in);
   style.set_type(PGFrameStyle::T_bevel_in);
   style.set_color(0.8, 0.8, 0.8, 1.0);
   style.set_color(0.8, 0.8, 0.8, 1.0);
-  style.set_width(0.05, 0.05);
   set_frame_style(S_depressed, style);
   set_frame_style(S_depressed, style);
+  LMatrix4f translate = LMatrix4f::translate_mat(0.05, 0.0, -0.05);
+  TransformTransition *ttrans = new TransformTransition(translate);
+  down->set_transition(ttrans);
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -210,6 +227,11 @@ setup(const string &label) {
 void PGButton::
 void PGButton::
 setup(const ArcChain &ready, const ArcChain &depressed, 
 setup(const ArcChain &ready, const ArcChain &depressed, 
       const ArcChain &rollover, const ArcChain &inactive) {
       const ArcChain &rollover, const ArcChain &inactive) {
+  clear_state_def(S_ready);
+  clear_state_def(S_depressed);
+  clear_state_def(S_rollover);
+  clear_state_def(S_inactive);
+
   instance_to_state_def(S_ready, ready);
   instance_to_state_def(S_ready, ready);
   instance_to_state_def(S_depressed, depressed);
   instance_to_state_def(S_depressed, depressed);
   instance_to_state_def(S_rollover, rollover);
   instance_to_state_def(S_rollover, rollover);

+ 2 - 2
panda/src/pgui/pgButton.h

@@ -44,8 +44,8 @@ public:
 
 
   virtual void enter();
   virtual void enter();
   virtual void exit();
   virtual void exit();
-  virtual void button_down(ButtonHandle button);
-  virtual void button_up(ButtonHandle button, bool is_within);
+  virtual void button_down(ButtonHandle button, float x, float y);
+  virtual void button_up(ButtonHandle button, float x, float y, bool is_within);
 
 
   virtual void click();
   virtual void click();
 
 

+ 94 - 0
panda/src/pgui/pgButtonEvent.I

@@ -0,0 +1,94 @@
+// Filename: pgButtonEvent.I
+// Created by:  drose (05Jul01)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
+//
+// All use of this software is subject to the terms of the Panda 3d
+// Software license.  You should have received a copy of this license
+// along with this source code; you will also find a current copy of
+// the license at http://www.panda3d.org/license.txt .
+//
+// To contact the maintainers of this program write to
+// [email protected] .
+//
+////////////////////////////////////////////////////////////////////
+
+
+////////////////////////////////////////////////////////////////////
+//     Function: PGButtonEvent::Constructor
+//       Access: Public
+//  Description: 
+////////////////////////////////////////////////////////////////////
+INLINE PGButtonEvent::
+PGButtonEvent() {
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: PGButtonEvent::Constructor
+//       Access: Public
+//  Description: 
+////////////////////////////////////////////////////////////////////
+INLINE PGButtonEvent::
+PGButtonEvent(ButtonHandle button, float mouse_x, float mouse_y) :
+  _button(button),
+  _mouse_x(mouse_x),
+  _mouse_y(mouse_y)
+{
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: PGButtonEvent::get_button
+//       Access: Published
+//  Description: Returns the ButtonHandle of the button involved with
+//               this event.
+////////////////////////////////////////////////////////////////////
+INLINE ButtonHandle PGButtonEvent::
+get_button() const {
+  return _button;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: PGButtonEvent::get_button_name
+//       Access: Published
+//  Description: Returns the name of the button involved with this
+//               event.  This is just a shorthand way to get to the
+//               name, since get_button().get_name() will return the
+//               same thing.
+////////////////////////////////////////////////////////////////////
+INLINE string PGButtonEvent::
+get_button_name() const {
+  return _button.get_name();
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: PGButtonEvent::get_mouse_x
+//       Access: Published
+//  Description: Returns the X position of the mouse within the window
+//               at the time the button event occurred.  This is in
+//               the normalized range [-1 .. 1].
+////////////////////////////////////////////////////////////////////
+INLINE float PGButtonEvent::
+get_mouse_x() const {
+  return _mouse_x;
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: PGButtonEvent::get_mouse_y
+//       Access: Published
+//  Description: Returns the Y position of the mouse within the window
+//               at the time the button event occurred.  This is in
+//               the normalized range [-1 .. 1].
+////////////////////////////////////////////////////////////////////
+INLINE float PGButtonEvent::
+get_mouse_y() const {
+  return _mouse_y;
+}
+
+INLINE ostream &
+operator << (ostream &out, const PGButtonEvent &event) {
+  event.output(out);
+  return out;
+}

+ 40 - 0
panda/src/pgui/pgButtonEvent.cxx

@@ -0,0 +1,40 @@
+// Filename: pgButtonEvent.cxx
+// Created by:  drose (05Jul01)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
+//
+// All use of this software is subject to the terms of the Panda 3d
+// Software license.  You should have received a copy of this license
+// along with this source code; you will also find a current copy of
+// the license at http://www.panda3d.org/license.txt .
+//
+// To contact the maintainers of this program write to
+// [email protected] .
+//
+////////////////////////////////////////////////////////////////////
+
+#include "pgButtonEvent.h"
+
+TypeHandle PGButtonEvent::_type_handle;
+
+////////////////////////////////////////////////////////////////////
+//     Function: PGButtonEvent::Destructor
+//       Access: Public, Virtual
+//  Description: 
+////////////////////////////////////////////////////////////////////
+PGButtonEvent::
+~PGButtonEvent() {
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: PGButtonEvent::output
+//       Access: Published
+//  Description: 
+////////////////////////////////////////////////////////////////////
+void PGButtonEvent::
+output(ostream &out) const {
+  out << _button << " at (" << _mouse_x << ", " << _mouse_y << ")";
+}

+ 76 - 0
panda/src/pgui/pgButtonEvent.h

@@ -0,0 +1,76 @@
+// Filename: pgButtonEvent.h
+// Created by:  drose (05Jul01)
+//
+////////////////////////////////////////////////////////////////////
+//
+// PANDA 3D SOFTWARE
+// Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
+//
+// All use of this software is subject to the terms of the Panda 3d
+// Software license.  You should have received a copy of this license
+// along with this source code; you will also find a current copy of
+// the license at http://www.panda3d.org/license.txt .
+//
+// To contact the maintainers of this program write to
+// [email protected] .
+//
+////////////////////////////////////////////////////////////////////
+
+#ifndef PGBUTTONEVENT_H
+#define PGBUTTONEVENT_H
+
+#include "pandabase.h"
+
+#include "typedReferenceCount.h"
+#include "buttonHandle.h"
+
+////////////////////////////////////////////////////////////////////
+//       Class : PGButtonEvent
+// Description : This is sent along as a parameter to a button_down or
+//               button_up event for an item to indicate which button
+//               was involved, and what the current mouse position
+//               was.
+////////////////////////////////////////////////////////////////////
+class EXPCL_PANDA PGButtonEvent : public TypedReferenceCount {
+public:
+  INLINE PGButtonEvent();
+  INLINE PGButtonEvent(ButtonHandle button, float mouse_x, float mouse_y);
+  virtual ~PGButtonEvent();
+
+PUBLISHED:
+  INLINE ButtonHandle get_button() const;
+  INLINE string get_button_name() const;
+
+  INLINE float get_mouse_x() const;
+  INLINE float get_mouse_y() const;
+
+  void output(ostream &out) const;
+
+public:
+  ButtonHandle _button;
+  float _mouse_x;
+  float _mouse_y;
+
+public:
+  static TypeHandle get_class_type() {
+    return _type_handle;
+  }
+  static void init_type() {
+    TypedReferenceCount::init_type();
+    register_type(_type_handle, "PGButtonEvent",
+                  TypedReferenceCount::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;
+};
+
+INLINE ostream &operator << (ostream &out, const PGButtonEvent &event);
+
+#include "pgButtonEvent.I"
+
+#endif

+ 7 - 6
panda/src/pgui/pgItem.I

@@ -193,8 +193,8 @@ get_exit_event() const {
 //               depressed while the mouse is within the frame.
 //               depressed while the mouse is within the frame.
 //
 //
 //               This event will be thrown with one parameter, which
 //               This event will be thrown with one parameter, which
-//               will be the name of the button that generated the
-//               event.
+//               will be the PGButtonEvent for the button that
+//               generated the event.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE string PGItem::
 INLINE string PGItem::
 get_button_down_event() const {
 get_button_down_event() const {
@@ -210,10 +210,11 @@ get_button_down_event() const {
 //               released.
 //               released.
 //
 //
 //               This event will be thrown with two parameters, the
 //               This event will be thrown with two parameters, the
-//               first of which will be the name of the button that
-//               generated the event, and the second of which will be
-//               a boolean flag indicating true if the mouse was
-//               within the frame while the button was released.
+//               first of which will be the PGButtonEvent for the
+//               button that generated the event, and the second of
+//               which will be a boolean flag indicating true if the
+//               mouse was within the frame while the button was
+//               released.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 INLINE string PGItem::
 INLINE string PGItem::
 get_button_up_event() const {
 get_button_up_event() const {

+ 8 - 4
panda/src/pgui/pgItem.cxx

@@ -17,6 +17,7 @@
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
 #include "pgItem.h"
 #include "pgItem.h"
+#include "pgButtonEvent.h"
 
 
 #include "namedNode.h"
 #include "namedNode.h"
 #include "throw_event.h"
 #include "throw_event.h"
@@ -142,8 +143,10 @@ exit() {
 //               is within the region.
 //               is within the region.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void PGItem::
 void PGItem::
-button_down(ButtonHandle button) {
-  throw_event(get_button_down_event(), button.get_name());
+button_down(ButtonHandle button, float x, float y) {
+  PGButtonEvent *be = new PGButtonEvent(button, x, y);
+  throw_event(get_button_down_event(), 
+              EventParameter(be));
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -157,9 +160,10 @@ button_down(ButtonHandle button) {
 //               outside the region.
 //               outside the region.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void PGItem::
 void PGItem::
-button_up(ButtonHandle button, bool is_within) {
+button_up(ButtonHandle button, float x, float y, bool is_within) {
+  PGButtonEvent *be = new PGButtonEvent(button, x, y);
   throw_event(get_button_up_event(), 
   throw_event(get_button_up_event(), 
-              EventParameter(button.get_name()), 
+              EventParameter(be),
               EventParameter(is_within));
               EventParameter(is_within));
 }
 }
 
 

+ 2 - 2
panda/src/pgui/pgItem.h

@@ -64,8 +64,8 @@ public:
 
 
   virtual void enter();
   virtual void enter();
   virtual void exit();
   virtual void exit();
-  virtual void button_down(ButtonHandle button);
-  virtual void button_up(ButtonHandle button, bool is_within);
+  virtual void button_down(ButtonHandle button, float x, float y);
+  virtual void button_up(ButtonHandle button, float x, float y, bool is_within);
 
 
 PUBLISHED:
 PUBLISHED:
   INLINE void set_frame(float left, float right, float bottom, float top);
   INLINE void set_frame(float left, float right, float bottom, float top);

+ 4 - 4
panda/src/pgui/pgMouseWatcherRegion.cxx

@@ -82,9 +82,9 @@ exit() {
 //               is within the region.
 //               is within the region.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void PGMouseWatcherRegion::
 void PGMouseWatcherRegion::
-button_down(ButtonHandle button) {
+button_down(ButtonHandle button, float x, float y) {
   if (_item != (PGItem *)NULL) {
   if (_item != (PGItem *)NULL) {
-    _item->button_down(button);
+    _item->button_down(button, x, y);
   }
   }
 }
 }
 
 
@@ -99,8 +99,8 @@ button_down(ButtonHandle button) {
 //               outside the region.
 //               outside the region.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void PGMouseWatcherRegion::
 void PGMouseWatcherRegion::
-button_up(ButtonHandle button, bool is_within) {
+button_up(ButtonHandle button, float x, float y, bool is_within) {
   if (_item != (PGItem *)NULL) {
   if (_item != (PGItem *)NULL) {
-    _item->button_up(button, is_within);
+    _item->button_up(button, x, y, is_within);
   }
   }
 }
 }

+ 2 - 2
panda/src/pgui/pgMouseWatcherRegion.h

@@ -39,8 +39,8 @@ public:
 
 
   virtual void enter();
   virtual void enter();
   virtual void exit();
   virtual void exit();
-  virtual void button_down(ButtonHandle button);
-  virtual void button_up(ButtonHandle button, bool is_within);
+  virtual void button_down(ButtonHandle button, float x, float y);
+  virtual void button_up(ButtonHandle button, float x, float y, bool is_within);
 
 
 private:
 private:
   PGItem *_item;
   PGItem *_item;

+ 16 - 0
panda/src/putil/buttonHandle.I

@@ -92,6 +92,22 @@ get_ascii_equivalent() const {
   return has_ascii_equivalent() ? (char)_index : '\0';
   return has_ascii_equivalent() ? (char)_index : '\0';
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: ButtonHandle::get_index
+//       Access: Public
+//  Description: Returns the integer index associated with this
+//               ButtonHandle. Each different ButtonHandle will have a
+//               different index.  However, you probably shouldn't be
+//               using this method; you should just treat the
+//               ButtonHandles as opaque classes.  This is provided
+//               for the convenience of non-C++ scripting languages to
+//               build a hashtable of ButtonHandles.
+////////////////////////////////////////////////////////////////////
+INLINE int ButtonHandle::
+get_index() const {
+  return _index;
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: ButtonHandle::none
 //     Function: ButtonHandle::none
 //       Access: Public, Static
 //       Access: Public, Static

+ 1 - 0
panda/src/putil/buttonHandle.h

@@ -43,6 +43,7 @@ PUBLISHED:
   INLINE bool has_ascii_equivalent() const;
   INLINE bool has_ascii_equivalent() const;
   INLINE char get_ascii_equivalent() const;
   INLINE char get_ascii_equivalent() const;
 
 
+  INLINE int get_index() const;
   INLINE static ButtonHandle none();
   INLINE static ButtonHandle none();
 
 
 private:
 private:

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

@@ -359,7 +359,7 @@ transmit_data(NodeAttributes &data) {
         // both of the button-up events properly.
         // both of the button-up events properly.
         if (_button_down_region != (MouseWatcherRegion *)NULL) {
         if (_button_down_region != (MouseWatcherRegion *)NULL) {
           bool is_within = (_current_region == _button_down_region);
           bool is_within = (_current_region == _button_down_region);
-          _button_down_region->button_up(be._button, is_within);
+          _button_down_region->button_up(be._button, get_mouse_x(), get_mouse_y(), is_within);
           throw_event_pattern(_button_up_pattern, _button_down_region,
           throw_event_pattern(_button_up_pattern, _button_down_region,
                               be._button.get_name());
                               be._button.get_name());
         }
         }
@@ -373,7 +373,7 @@ transmit_data(NodeAttributes &data) {
         }
         }
         _button_down = true;
         _button_down = true;
         if (_button_down_region != (MouseWatcherRegion *)NULL) {
         if (_button_down_region != (MouseWatcherRegion *)NULL) {
-          _button_down_region->button_down(be._button);
+          _button_down_region->button_down(be._button, get_mouse_x(), get_mouse_y());
           throw_event_pattern(_button_down_pattern, _button_down_region,
           throw_event_pattern(_button_down_pattern, _button_down_region,
                               be._button.get_name());
                               be._button.get_name());
         }
         }

+ 2 - 2
panda/src/tform/mouseWatcherRegion.cxx

@@ -71,7 +71,7 @@ exit() {
 //               is within the region.
 //               is within the region.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void MouseWatcherRegion::
 void MouseWatcherRegion::
-button_down(ButtonHandle) {
+button_down(ButtonHandle, float, float) {
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -85,5 +85,5 @@ button_down(ButtonHandle) {
 //               outside the region.
 //               outside the region.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void MouseWatcherRegion::
 void MouseWatcherRegion::
-button_up(ButtonHandle, bool) {
+button_up(ButtonHandle, float, float, bool) {
 }
 }

+ 2 - 2
panda/src/tform/mouseWatcherRegion.h

@@ -59,8 +59,8 @@ public:
 
 
   virtual void enter();
   virtual void enter();
   virtual void exit();
   virtual void exit();
-  virtual void button_down(ButtonHandle button);
-  virtual void button_up(ButtonHandle button, bool is_within);
+  virtual void button_down(ButtonHandle button, float x, float y);
+  virtual void button_up(ButtonHandle button, float x, float y, bool is_within);
 
 
 private:
 private:
   LVecBase4f _frame;
   LVecBase4f _frame;