Panda3D
 All Classes Functions Variables Enumerations
pgMouseWatcherRegion.h
1 // Filename: pgMouseWatcherRegion.h
2 // Created by: drose (02Jul01)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PGMOUSEWATCHERREGION_H
16 #define PGMOUSEWATCHERREGION_H
17 
18 #include "pandabase.h"
19 
20 #include "mouseWatcherRegion.h"
21 
22 class PGItem;
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : PGMouseWatcherRegion
26 // Description : This is a specialization on MouseWatcherRegion, to
27 // add a bit more fields that are relevant to the PG
28 // system. Each PGItem corresponds to exactly one
29 // PGMouseWatcherRegion.
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDA_PGUI PGMouseWatcherRegion : public MouseWatcherRegion {
32 public:
34  virtual ~PGMouseWatcherRegion();
35 
36  virtual void enter_region(const MouseWatcherParameter &param);
37  virtual void exit_region(const MouseWatcherParameter &param);
38  virtual void within_region(const MouseWatcherParameter &param);
39  virtual void without_region(const MouseWatcherParameter &param);
40  virtual void press(const MouseWatcherParameter &param);
41  virtual void release(const MouseWatcherParameter &param);
42  virtual void keystroke(const MouseWatcherParameter &param);
43  virtual void candidate(const MouseWatcherParameter &param);
44  virtual void move(const MouseWatcherParameter &param);
45 
46 private:
47  PGItem *_item;
48  static int _next_index;
49 
50 public:
51  static TypeHandle get_class_type() {
52  return _type_handle;
53  }
54  static void init_type() {
55  MouseWatcherRegion::init_type();
56  register_type(_type_handle, "PGMouseWatcherRegion",
57  MouseWatcherRegion::get_class_type());
58  }
59  virtual TypeHandle get_type() const {
60  return get_class_type();
61  }
62  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
63 
64 private:
65  static TypeHandle _type_handle;
66 
67  friend class PGItem;
68 };
69 
70 #include "pgMouseWatcherRegion.I"
71 
72 #endif
virtual void without_region(const MouseWatcherParameter &param)
This is a callback hook function, called whenever the mouse moves completely outside the boundaries o...
This is the base class for all the various kinds of gui widget objects.
Definition: pgItem.h:58
virtual void exit_region(const MouseWatcherParameter &param)
This is a callback hook function, called whenever the mouse exits the region.
virtual void release(const MouseWatcherParameter &param)
This is a callback hook function, called whenever a mouse or keyboard button previously depressed wit...
virtual void enter_region(const MouseWatcherParameter &param)
This is a callback hook function, called whenever the mouse enters the region.
virtual void within_region(const MouseWatcherParameter &param)
This is a callback hook function, called whenever the mouse moves within the boundaries of the region...
virtual void press(const MouseWatcherParameter &param)
This is a callback hook function, called whenever a mouse or keyboard button is depressed while the m...
virtual void candidate(const MouseWatcherParameter &param)
This is a callback hook function, called whenever an IME candidate is highlighted by the user...
This is the class that defines a rectangular region on the screen for the MouseWatcher.
This is a specialization on MouseWatcherRegion, to add a bit more fields that are relevant to the PG ...
virtual void keystroke(const MouseWatcherParameter &param)
This is a callback hook function, called whenever a keystroke is generated by the user...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
This is sent along as a parameter to most events generated for a region to indicate the mouse and but...
virtual void move(const MouseWatcherParameter &param)
This is a callback hook function, called whenever a mouse is moved within the region.