Panda3D
Loading...
Searching...
No Matches
pgMouseWatcherRegion.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file pgMouseWatcherRegion.h
10 * @author drose
11 * @date 2001-07-02
12 */
13
14#ifndef PGMOUSEWATCHERREGION_H
15#define PGMOUSEWATCHERREGION_H
16
17#include "pandabase.h"
18
19#include "mouseWatcherRegion.h"
20
21class PGItem;
22
23/**
24 * This is a specialization on MouseWatcherRegion, to add a bit more fields
25 * that are relevant to the PG system. Each PGItem corresponds to exactly one
26 * PGMouseWatcherRegion.
27 */
28class EXPCL_PANDA_PGUI PGMouseWatcherRegion : public MouseWatcherRegion {
29public:
31 virtual ~PGMouseWatcherRegion();
32
33 virtual void enter_region(const MouseWatcherParameter &param);
34 virtual void exit_region(const MouseWatcherParameter &param);
35 virtual void within_region(const MouseWatcherParameter &param);
36 virtual void without_region(const MouseWatcherParameter &param);
37 virtual void press(const MouseWatcherParameter &param);
38 virtual void release(const MouseWatcherParameter &param);
39 virtual void keystroke(const MouseWatcherParameter &param);
40 virtual void candidate(const MouseWatcherParameter &param);
41 virtual void move(const MouseWatcherParameter &param);
42
43private:
44 PGItem *_item;
45 static int _next_index;
46
47public:
48 static TypeHandle get_class_type() {
49 return _type_handle;
50 }
51 static void init_type() {
52 MouseWatcherRegion::init_type();
53 register_type(_type_handle, "PGMouseWatcherRegion",
54 MouseWatcherRegion::get_class_type());
55 }
56 virtual TypeHandle get_type() const {
57 return get_class_type();
58 }
59 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
60
61private:
62 static TypeHandle _type_handle;
63
64 friend class PGItem;
65};
66
68
69#endif
This is sent along as a parameter to most events generated for a region to indicate the mouse and but...
This is the class that defines a rectangular region on the screen for the MouseWatcher.
virtual void move(const MouseWatcherParameter &param)
This is a callback hook function, called whenever a mouse is moved within 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 keystroke(const MouseWatcherParameter &param)
This is a callback hook function, called whenever a keystroke is generated by the user.
virtual void exit_region(const MouseWatcherParameter &param)
This is a callback hook function, called whenever the mouse exits 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 enter_region(const MouseWatcherParameter &param)
This is a callback hook function, called whenever the mouse enters the region.
virtual void candidate(const MouseWatcherParameter &param)
This is a callback hook function, called whenever an IME candidate is highlighted by the user.
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 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:53
This is a specialization on MouseWatcherRegion, to add a bit more fields that are relevant to the PG ...
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...