Panda3D
Loading...
Searching...
No Matches
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 */
20PGItemNotify::
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 */
33void PGItemNotify::
34item_transform_changed(PGItem *) {
35}
36
37/**
38 * Called whenever a watched PGItem's frame has been changed.
39 */
40void PGItemNotify::
41item_frame_changed(PGItem *) {
42}
43
44/**
45 * Called whenever a watched PGItem's draw_mask has been changed.
46 */
47void PGItemNotify::
48item_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 */
55void PGItemNotify::
56item_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 */
63void PGItemNotify::
64item_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 */
71void PGItemNotify::
72item_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 */
79void PGItemNotify::
80item_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 */
87void PGItemNotify::
88item_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 */
95void PGItemNotify::
96item_focus_out(PGItem *) {
97}
98
99/**
100 * Called whenever the "press" event is triggered on a watched PGItem. See
101 * PGItem::press().
102 */
103void PGItemNotify::
104item_press(PGItem *, const MouseWatcherParameter &) {
105}
106
107/**
108 * Called whenever the "release" event is triggered on a watched PGItem. See
109 * PGItem::release().
110 */
111void PGItemNotify::
112item_release(PGItem *, const MouseWatcherParameter &) {
113}
114
115/**
116 * Called whenever the "keystroke" event is triggered on a watched PGItem.
117 * See PGItem::keystroke().
118 */
119void PGItemNotify::
120item_keystroke(PGItem *, const MouseWatcherParameter &) {
121}
122
123/**
124 * Called whenever the "candidate" event is triggered on a watched PGItem.
125 * See PGItem::candidate().
126 */
127void PGItemNotify::
128item_candidate(PGItem *, const MouseWatcherParameter &) {
129}
130
131/**
132 * Called whenever the "move" event is triggered on a watched PGItem. See
133 * PGItem::move().
134 */
135void PGItemNotify::
136item_move(PGItem *, const MouseWatcherParameter &) {
137}
138
139/**
140 * Called by PGItem when a new item is set up to notify this object.
141 */
142void PGItemNotify::
143add_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 */
151void PGItemNotify::
152remove_item(PGItem *item) {
153 Items::iterator bi;
154 bi = _items.find(item);
155 nassertv(bi != _items.end());
156 _items.erase(bi);
157}
This is sent along as a parameter to most events generated for a region to indicate the mouse and but...
This is the base class for all the various kinds of gui widget objects.
Definition pgItem.h:53
PGItemNotify * get_notify() const
Returns the object which will be notified when the PGItem changes, if any.
Definition pgItem.I:69
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.