Panda3D
panda
src
pgui
pgItemNotify.cxx
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 pgItemNotify.cxx
10
* @author drose
11
* @date 2005-08-18
12
*/
13
14
#include "
pgItemNotify.h
"
15
#include "
pgItem.h
"
16
17
/**
18
*
19
*/
20
PGItemNotify::
21
~PGItemNotify() {
22
while
(!_items.empty()) {
23
// Disconnect all of the items that are connected to this object.
24
PGItem
*item = (*_items.begin());
25
nassertv(item->
get_notify
() ==
this
);
26
(*_items.begin())->set_notify(
nullptr
);
27
}
28
}
29
30
/**
31
* Called whenever a watched PGItem's local transform has been changed.
32
*/
33
void
PGItemNotify::
34
item_transform_changed(
PGItem
*) {
35
}
36
37
/**
38
* Called whenever a watched PGItem's frame has been changed.
39
*/
40
void
PGItemNotify::
41
item_frame_changed(
PGItem
*) {
42
}
43
44
/**
45
* Called whenever a watched PGItem's draw_mask has been changed.
46
*/
47
void
PGItemNotify::
48
item_draw_mask_changed(
PGItem
*) {
49
}
50
51
/**
52
* Called whenever the "enter" event is triggered on a watched PGItem. See
53
* PGItem::enter_region().
54
*/
55
void
PGItemNotify::
56
item_enter(
PGItem
*,
const
MouseWatcherParameter
&) {
57
}
58
59
/**
60
* Called whenever the "exit" event is triggered on a watched PGItem. See
61
* PGItem::exit_region().
62
*/
63
void
PGItemNotify::
64
item_exit(
PGItem
*,
const
MouseWatcherParameter
&) {
65
}
66
67
/**
68
* Called whenever the "within" event is triggered on a watched PGItem. See
69
* PGItem::within_region().
70
*/
71
void
PGItemNotify::
72
item_within(
PGItem
*,
const
MouseWatcherParameter
&) {
73
}
74
75
/**
76
* Called whenever the "without" event is triggered on a watched PGItem. See
77
* PGItem::without_region().
78
*/
79
void
PGItemNotify::
80
item_without(
PGItem
*,
const
MouseWatcherParameter
&) {
81
}
82
83
/**
84
* Called whenever the "focus_in" event is triggered on a watched PGItem. See
85
* PGItem::focus_in().
86
*/
87
void
PGItemNotify::
88
item_focus_in(
PGItem
*) {
89
}
90
91
/**
92
* Called whenever the "focus_out" event is triggered on a watched PGItem.
93
* See PGItem::focus_out().
94
*/
95
void
PGItemNotify::
96
item_focus_out(
PGItem
*) {
97
}
98
99
/**
100
* Called whenever the "press" event is triggered on a watched PGItem. See
101
* PGItem::press().
102
*/
103
void
PGItemNotify::
104
item_press(
PGItem
*,
const
MouseWatcherParameter
&) {
105
}
106
107
/**
108
* Called whenever the "release" event is triggered on a watched PGItem. See
109
* PGItem::release().
110
*/
111
void
PGItemNotify::
112
item_release(
PGItem
*,
const
MouseWatcherParameter
&) {
113
}
114
115
/**
116
* Called whenever the "keystroke" event is triggered on a watched PGItem.
117
* See PGItem::keystroke().
118
*/
119
void
PGItemNotify::
120
item_keystroke(
PGItem
*,
const
MouseWatcherParameter
&) {
121
}
122
123
/**
124
* Called whenever the "candidate" event is triggered on a watched PGItem.
125
* See PGItem::candidate().
126
*/
127
void
PGItemNotify::
128
item_candidate(
PGItem
*,
const
MouseWatcherParameter
&) {
129
}
130
131
/**
132
* Called whenever the "move" event is triggered on a watched PGItem. See
133
* PGItem::move().
134
*/
135
void
PGItemNotify::
136
item_move(
PGItem
*,
const
MouseWatcherParameter
&) {
137
}
138
139
/**
140
* Called by PGItem when a new item is set up to notify this object.
141
*/
142
void
PGItemNotify::
143
add_item(
PGItem
*item) {
144
bool
inserted = _items.insert(item).second;
145
nassertv(inserted);
146
}
147
148
/**
149
* Called by PGItem when an item is no longer set up to notify this object.
150
*/
151
void
PGItemNotify::
152
remove_item(
PGItem
*item) {
153
Items::iterator bi;
154
bi = _items.find(item);
155
nassertv(bi != _items.end());
156
_items.erase(bi);
157
}
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
PGItem
This is the base class for all the various kinds of gui widget objects.
Definition:
pgItem.h:53
PGItem::get_notify
PGItemNotify * get_notify() const
Returns the object which will be notified when the PGItem changes, if any.
Definition:
pgItem.I:69
pgItem.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pgItemNotify.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Generated on Mon Sep 14 2020 15:07:03 for Panda3D by
1.8.20