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
21 class 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 */
28 class EXPCL_PANDA_PGUI PGMouseWatcherRegion : public MouseWatcherRegion {
29 public:
30 PGMouseWatcherRegion(PGItem *item);
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
43 private:
44 PGItem *_item;
45 static int _next_index;
46
47 public:
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
61 private:
62 static TypeHandle _type_handle;
63
64 friend class PGItem;
65};
66
67#include "pgMouseWatcherRegion.I"
68
69#endif
MouseWatcherParameter
This is sent along as a parameter to most events generated for a region to indicate the mouse and but...
Definition mouseWatcherParameter.h:28
MouseWatcherRegion::move
virtual void move(const MouseWatcherParameter &param)
This is a callback hook function, called whenever a mouse is moved within the region.
Definition mouseWatcherRegion.cxx:114
MouseWatcherRegion::release
virtual void release(const MouseWatcherParameter &param)
This is a callback hook function, called whenever a mouse or keyboard button previously depressed wit...
Definition mouseWatcherRegion.cxx:90
MouseWatcherRegion::keystroke
virtual void keystroke(const MouseWatcherParameter &param)
This is a callback hook function, called whenever a keystroke is generated by the user.
Definition mouseWatcherRegion.cxx:98
MouseWatcherRegion::exit_region
virtual void exit_region(const MouseWatcherParameter &param)
This is a callback hook function, called whenever the mouse exits the region.
Definition mouseWatcherRegion.cxx:56
MouseWatcherRegion::press
virtual void press(const MouseWatcherParameter &param)
This is a callback hook function, called whenever a mouse or keyboard button is depressed while the m...
Definition mouseWatcherRegion.cxx:82
MouseWatcherRegion::enter_region
virtual void enter_region(const MouseWatcherParameter &param)
This is a callback hook function, called whenever the mouse enters the region.
Definition mouseWatcherRegion.cxx:46
MouseWatcherRegion::candidate
virtual void candidate(const MouseWatcherParameter &param)
This is a callback hook function, called whenever an IME candidate is highlighted by the user.
Definition mouseWatcherRegion.cxx:106
MouseWatcherRegion::within_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...
Definition mouseWatcherRegion.cxx:66
MouseWatcherRegion::without_region
virtual void without_region(const MouseWatcherParameter &param)
This is a callback hook function, called whenever the mouse moves completely outside the boundaries o...
Definition mouseWatcherRegion.cxx:74
PGItem
This is the base class for all the various kinds of gui widget objects.
Definition pgItem.h:53
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
mouseWatcherRegion.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pgMouseWatcherRegion.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition register_type.I:22