Panda3D
 All Classes Functions Variables Enumerations
pgItem.I
1 // Filename: pgItem.I
2 // Created by: drose (13Mar02)
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 
16 ////////////////////////////////////////////////////////////////////
17 // Function: PGItem::set_name
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE void PGItem::
22 set_name(const string &name) {
23  Namable::set_name(name);
24  _lock.set_name(name);
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: PGItem::get_region
29 // Access: Public
30 // Description: Returns the MouseWatcherRegion associated with this
31 // item. Every PGItem has a MouseWatcherRegion
32 // associated with it, that is created when the PGItem
33 // is created; it does not change during the lifetime of
34 // the PGItem. Even items that do not have a frame have
35 // an associated MouseWatcherRegion, although it will
36 // not be used in this case.
37 ////////////////////////////////////////////////////////////////////
39 get_region() const {
40  LightReMutexHolder holder(_lock);
41  return _region;
42 }
43 
44 ////////////////////////////////////////////////////////////////////
45 // Function: PGItem::set_notify
46 // Access: Published
47 // Description: Sets the object which will be notified when the
48 // PGItem changes. Set this to NULL to disable
49 // this effect. The PGItem does not retain
50 // ownership of the pointer; it is your responsibility
51 // to ensure that the notify object does not destruct.
52 ////////////////////////////////////////////////////////////////////
53 INLINE void PGItem::
55  LightReMutexHolder holder(_lock);
56  if (_notify != (PGItemNotify *)NULL) {
57  _notify->remove_item(this);
58  }
59  _notify = notify;
60  if (_notify != (PGItemNotify *)NULL) {
61  _notify->add_item(this);
62  }
63 }
64 
65 ////////////////////////////////////////////////////////////////////
66 // Function: PGItem::has_notify
67 // Access: Published
68 // Description: Returns true if there is an object configured to be
69 // notified when the PGItem changes, false otherwise.
70 ////////////////////////////////////////////////////////////////////
71 INLINE bool PGItem::
72 has_notify() const {
73  LightReMutexHolder holder(_lock);
74  return (_notify != (PGItemNotify *)NULL);
75 }
76 
77 ////////////////////////////////////////////////////////////////////
78 // Function: PGItem::get_notify
79 // Access: Published
80 // Description: Returns the object which will be notified when the
81 // PGItem changes, if any. Returns NULL if there
82 // is no such object configured.
83 ////////////////////////////////////////////////////////////////////
84 INLINE PGItemNotify *PGItem::
85 get_notify() const {
86  LightReMutexHolder holder(_lock);
87  return _notify;
88 }
89 
90 ////////////////////////////////////////////////////////////////////
91 // Function: PGItem::set_frame
92 // Access: Published
93 // Description: Sets the bounding rectangle of the item, in local
94 // coordinates. This is the region on screen within
95 // which the mouse will be considered to be within the
96 // item. Normally, it should correspond to the bounding
97 // rectangle of the visible geometry of the item.
98 ////////////////////////////////////////////////////////////////////
99 INLINE void PGItem::
100 set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top) {
101  set_frame(LVecBase4(left, right, bottom, top));
102 }
103 
104 ////////////////////////////////////////////////////////////////////
105 // Function: PGItem::set_frame
106 // Access: Published
107 // Description: Sets the bounding rectangle of the item, in local
108 // coordinates. This is the region on screen within
109 // which the mouse will be considered to be within the
110 // item. Normally, it should correspond to the bounding
111 // rectangle of the visible geometry of the item.
112 ////////////////////////////////////////////////////////////////////
113 INLINE void PGItem::
114 set_frame(const LVecBase4 &frame) {
115  LightReMutexHolder holder(_lock);
116  if (!_has_frame || _frame != frame) {
117  _has_frame = true;
118  _frame = frame;
119  frame_changed();
120  }
121 }
122 
123 ////////////////////////////////////////////////////////////////////
124 // Function: PGItem::get_frame
125 // Access: Published
126 // Description: Returns the bounding rectangle of the item. See
127 // set_frame(). It is an error to call this if
128 // has_frame() returns false.
129 ////////////////////////////////////////////////////////////////////
130 INLINE const LVecBase4 &PGItem::
131 get_frame() const {
132  LightReMutexHolder holder(_lock);
133  nassertr(has_frame(), _frame);
134  return _frame;
135 }
136 
137 ////////////////////////////////////////////////////////////////////
138 // Function: PGItem::has_frame
139 // Access: Published
140 // Description: Returns true if the item has a bounding rectangle;
141 // see set_frame().
142 ////////////////////////////////////////////////////////////////////
143 INLINE bool PGItem::
144 has_frame() const {
145  LightReMutexHolder holder(_lock);
146  return _has_frame;
147 }
148 
149 ////////////////////////////////////////////////////////////////////
150 // Function: PGItem::clear_frame
151 // Access: Published
152 // Description: Removes the bounding rectangle from the item. It
153 // will no longer be possible to position the mouse
154 // within the item; see set_frame().
155 ////////////////////////////////////////////////////////////////////
156 INLINE void PGItem::
158  LightReMutexHolder holder(_lock);
159  if (_has_frame) {
160  _has_frame = false;
161  frame_changed();
162  }
163 }
164 
165 ////////////////////////////////////////////////////////////////////
166 // Function: PGItem::set_state
167 // Access: Published
168 // Description: Sets the "state" of this particular PGItem.
169 //
170 // The PGItem node will render as if it were the
171 // subgraph assigned to the corresponding index via
172 // set_state_def().
173 ////////////////////////////////////////////////////////////////////
174 INLINE void PGItem::
175 set_state(int state) {
176  LightReMutexHolder holder(_lock);
177  _state = state;
178 }
179 
180 ////////////////////////////////////////////////////////////////////
181 // Function: PGItem::get_state
182 // Access: Published
183 // Description: Returns the "state" of this particular PGItem. See
184 // set_state().
185 ////////////////////////////////////////////////////////////////////
186 INLINE int PGItem::
187 get_state() const {
188  LightReMutexHolder holder(_lock);
189  return _state;
190 }
191 
192 ////////////////////////////////////////////////////////////////////
193 // Function: PGItem::get_active
194 // Access: Published
195 // Description: Returns whether the PGItem is currently active for
196 // mouse events. See set_active().
197 ////////////////////////////////////////////////////////////////////
198 INLINE bool PGItem::
199 get_active() const {
200  LightReMutexHolder holder(_lock);
201  return (_flags & F_active) != 0;
202 }
203 
204 ////////////////////////////////////////////////////////////////////
205 // Function: PGItem::get_focus
206 // Access: Published
207 // Description: Returns whether the PGItem currently has focus for
208 // keyboard events. See set_focus().
209 ////////////////////////////////////////////////////////////////////
210 INLINE bool PGItem::
211 get_focus() const {
212  LightReMutexHolder holder(_lock);
213  return (_flags & F_focus) != 0;
214 }
215 
216 ////////////////////////////////////////////////////////////////////
217 // Function: PGItem::get_background_focus
218 // Access: Published
219 // Description: Returns whether background_focus is currently
220 // enabled. See set_background_focus().
221 ////////////////////////////////////////////////////////////////////
222 INLINE bool PGItem::
224  LightReMutexHolder holder(_lock);
225  return (_flags & F_background_focus) != 0;
226 }
227 
228 ////////////////////////////////////////////////////////////////////
229 // Function: PGItem::set_suppress_flags
230 // Access: Published
231 // Description: This is just an interface to set the suppress flags
232 // on the underlying MouseWatcherRegion. See
233 // MouseWatcherRegion::set_suppress_flags().
234 ////////////////////////////////////////////////////////////////////
235 INLINE void PGItem::
236 set_suppress_flags(int suppress_flags) {
237  LightReMutexHolder holder(_lock);
238  _region->set_suppress_flags(suppress_flags);
239 }
240 
241 ////////////////////////////////////////////////////////////////////
242 // Function: PGItem::get_suppress_flags
243 // Access: Published
244 // Description: This is just an interface to get the suppress flags
245 // on the underlying MouseWatcherRegion. See
246 // MouseWatcherRegion::get_suppress_flags().
247 ////////////////////////////////////////////////////////////////////
248 INLINE int PGItem::
250  LightReMutexHolder holder(_lock);
251  return _region->get_suppress_flags();
252 }
253 
254 ////////////////////////////////////////////////////////////////////
255 // Function: PGItem::get_id
256 // Access: Published
257 // Description: Returns the unique ID assigned to this PGItem. This
258 // will be assigned to the region created with the
259 // MouseWatcher, and will thus be used to generate event
260 // names.
261 ////////////////////////////////////////////////////////////////////
262 INLINE const string &PGItem::
263 get_id() const {
264  LightReMutexHolder holder(_lock);
265  return _region->get_name();
266 }
267 
268 ////////////////////////////////////////////////////////////////////
269 // Function: PGItem::set_id
270 // Access: Published
271 // Description: Set the unique ID assigned to this PGItem. It is the
272 // user's responsibility to ensure that this ID is
273 // unique.
274 //
275 // Normally, this should not need to be called, as the
276 // PGItem will assign itself an ID when it is created,
277 // but this function allows the user to decide to
278 // redefine the ID to be something possibly more
279 // meaningful.
280 ////////////////////////////////////////////////////////////////////
281 INLINE void PGItem::
282 set_id(const string &id) {
283  LightReMutexHolder holder(_lock);
284  _region->set_name(id);
285 }
286 
287 ////////////////////////////////////////////////////////////////////
288 // Function: PGItem::get_enter_prefix
289 // Access: Published, Static
290 // Description: Returns the prefix that is used to define the enter
291 // event for all PGItems. The enter event is the
292 // concatenation of this string followed by get_id().
293 ////////////////////////////////////////////////////////////////////
294 INLINE string PGItem::
296  return "enter-";
297 }
298 
299 ////////////////////////////////////////////////////////////////////
300 // Function: PGItem::get_exit_prefix
301 // Access: Published, Static
302 // Description: Returns the prefix that is used to define the exit
303 // event for all PGItems. The exit event is the
304 // concatenation of this string followed by get_id().
305 ////////////////////////////////////////////////////////////////////
306 INLINE string PGItem::
308  return "exit-";
309 }
310 
311 ////////////////////////////////////////////////////////////////////
312 // Function: PGItem::get_within_prefix
313 // Access: Published, Static
314 // Description: Returns the prefix that is used to define the within
315 // event for all PGItems. The within event is the
316 // concatenation of this string followed by get_id().
317 ////////////////////////////////////////////////////////////////////
318 INLINE string PGItem::
320  return "within-";
321 }
322 
323 ////////////////////////////////////////////////////////////////////
324 // Function: PGItem::get_without_prefix
325 // Access: Published, Static
326 // Description: Returns the prefix that is used to define the without
327 // event for all PGItems. The without event is the
328 // concatenation of this string followed by get_id().
329 ////////////////////////////////////////////////////////////////////
330 INLINE string PGItem::
332  return "without-";
333 }
334 
335 ////////////////////////////////////////////////////////////////////
336 // Function: PGItem::get_focus_in_prefix
337 // Access: Published, Static
338 // Description: Returns the prefix that is used to define the focus_in
339 // event for all PGItems. The focus_in event is the
340 // concatenation of this string followed by get_id().
341 //
342 // Unlike most item events, this event is thrown with no
343 // parameters.
344 ////////////////////////////////////////////////////////////////////
345 INLINE string PGItem::
347  return "fin-";
348 }
349 
350 ////////////////////////////////////////////////////////////////////
351 // Function: PGItem::get_focus_out_prefix
352 // Access: Published, Static
353 // Description: Returns the prefix that is used to define the focus_out
354 // event for all PGItems. The focus_out event is the
355 // concatenation of this string followed by get_id().
356 //
357 // Unlike most item events, this event is thrown with no
358 // parameters.
359 ////////////////////////////////////////////////////////////////////
360 INLINE string PGItem::
362  return "fout-";
363 }
364 
365 ////////////////////////////////////////////////////////////////////
366 // Function: PGItem::get_press_prefix
367 // Access: Published, Static
368 // Description: Returns the prefix that is used to define the press
369 // event for all PGItems. The press event is the
370 // concatenation of this string followed by a button
371 // name, followed by a hyphen and get_id().
372 ////////////////////////////////////////////////////////////////////
373 INLINE string PGItem::
375  return "press-";
376 }
377 
378 ////////////////////////////////////////////////////////////////////
379 // Function: PGItem::get_repeat_prefix
380 // Access: Published, Static
381 // Description: Returns the prefix that is used to define the repeat
382 // event for all PGItems. The repeat event is the
383 // concatenation of this string followed by a button
384 // name, followed by a hyphen and get_id().
385 ////////////////////////////////////////////////////////////////////
386 INLINE string PGItem::
388  return "repeat-";
389 }
390 
391 ////////////////////////////////////////////////////////////////////
392 // Function: PGItem::get_release_prefix
393 // Access: Published, Static
394 // Description: Returns the prefix that is used to define the release
395 // event for all PGItems. The release event is the
396 // concatenation of this string followed by a button
397 // name, followed by a hyphen and get_id().
398 ////////////////////////////////////////////////////////////////////
399 INLINE string PGItem::
401  return "release-";
402 }
403 
404 ////////////////////////////////////////////////////////////////////
405 // Function: PGItem::get_keystroke_prefix
406 // Access: Published, Static
407 // Description: Returns the prefix that is used to define the
408 // keystroke event for all PGItems. The keystroke event
409 // is the concatenation of this string followed by a
410 // hyphen and get_id().
411 ////////////////////////////////////////////////////////////////////
412 INLINE string PGItem::
414  return "keystroke-";
415 }
416 
417 ////////////////////////////////////////////////////////////////////
418 // Function: PGItem::get_enter_event
419 // Access: Published
420 // Description: Returns the event name that will be thrown when the
421 // item is active and the mouse enters its frame, but
422 // not any nested frames.
423 ////////////////////////////////////////////////////////////////////
424 INLINE string PGItem::
426  LightReMutexHolder holder(_lock);
427  return get_enter_prefix() + get_id();
428 }
429 
430 ////////////////////////////////////////////////////////////////////
431 // Function: PGItem::get_exit_event
432 // Access: Published
433 // Description: Returns the event name that will be thrown when the
434 // item is active and the mouse exits its frame, or
435 // enters a nested frame.
436 ////////////////////////////////////////////////////////////////////
437 INLINE string PGItem::
438 get_exit_event() const {
439  LightReMutexHolder holder(_lock);
440  return get_exit_prefix() + get_id();
441 }
442 
443 ////////////////////////////////////////////////////////////////////
444 // Function: PGItem::get_within_event
445 // Access: Published
446 // Description: Returns the event name that will be thrown when the
447 // item is active and the mouse moves within the
448 // boundaries of the frame. This is different from the
449 // enter_event in that the mouse is considered within
450 // the frame even if it is also within a nested frame.
451 ////////////////////////////////////////////////////////////////////
452 INLINE string PGItem::
454  LightReMutexHolder holder(_lock);
455  return get_within_prefix() + get_id();
456 }
457 
458 ////////////////////////////////////////////////////////////////////
459 // Function: PGItem::get_without_event
460 // Access: Published
461 // Description: Returns the event name that will be thrown when the
462 // item is active and the mouse moves completely outside
463 // the boundaries of the frame. This is different from
464 // the exit_event in that the mouse is considered
465 // within the frame even if it is also within a nested
466 // frame.
467 ////////////////////////////////////////////////////////////////////
468 INLINE string PGItem::
470  LightReMutexHolder holder(_lock);
471  return get_without_prefix() + get_id();
472 }
473 
474 ////////////////////////////////////////////////////////////////////
475 // Function: PGItem::get_focus_in_event
476 // Access: Published
477 // Description: Returns the event name that will be thrown when the
478 // item gets the keyboard focus.
479 ////////////////////////////////////////////////////////////////////
480 INLINE string PGItem::
482  LightReMutexHolder holder(_lock);
483  return get_focus_in_prefix() + get_id();
484 }
485 
486 ////////////////////////////////////////////////////////////////////
487 // Function: PGItem::get_focus_out_event
488 // Access: Published
489 // Description: Returns the event name that will be thrown when the
490 // item loses the keyboard focus.
491 ////////////////////////////////////////////////////////////////////
492 INLINE string PGItem::
494  LightReMutexHolder holder(_lock);
495  return get_focus_out_prefix() + get_id();
496 }
497 
498 ////////////////////////////////////////////////////////////////////
499 // Function: PGItem::get_press_event
500 // Access: Published
501 // Description: Returns the event name that will be thrown when the
502 // item is active and the indicated mouse or keyboard
503 // button is depressed while the mouse is within the
504 // frame.
505 ////////////////////////////////////////////////////////////////////
506 INLINE string PGItem::
507 get_press_event(const ButtonHandle &button) const {
508  LightReMutexHolder holder(_lock);
509  return get_press_prefix() + button.get_name() + "-" + get_id();
510 }
511 
512 ////////////////////////////////////////////////////////////////////
513 // Function: PGItem::get_repeat_event
514 // Access: Published
515 // Description: Returns the event name that will be thrown when the
516 // item is active and the indicated mouse or keyboard
517 // button is continuously held down while the mouse is
518 // within the frame.
519 ////////////////////////////////////////////////////////////////////
520 INLINE string PGItem::
521 get_repeat_event(const ButtonHandle &button) const {
522  LightReMutexHolder holder(_lock);
523  return get_repeat_prefix() + button.get_name() + "-" + get_id();
524 }
525 
526 ////////////////////////////////////////////////////////////////////
527 // Function: PGItem::get_release_event
528 // Access: Published
529 // Description: Returns the event name that will be thrown when the
530 // item is active and the indicated mouse or keyboard
531 // button, formerly clicked down is within the frame, is
532 // released.
533 ////////////////////////////////////////////////////////////////////
534 INLINE string PGItem::
535 get_release_event(const ButtonHandle &button) const {
536  LightReMutexHolder holder(_lock);
537  return get_release_prefix() + button.get_name() + "-" + get_id();
538 }
539 
540 ////////////////////////////////////////////////////////////////////
541 // Function: PGItem::get_keystroke_event
542 // Access: Published
543 // Description: Returns the event name that will be thrown when the
544 // item is active and any key is pressed by the user.
545 ////////////////////////////////////////////////////////////////////
546 INLINE string PGItem::
548  LightReMutexHolder holder(_lock);
549  return get_keystroke_prefix() + get_id();
550 }
551 
552 ////////////////////////////////////////////////////////////////////
553 // Function: PGItem::set_text_node
554 // Access: Published, Static
555 // Description: Changes the TextNode object that will be used by all
556 // PGItems to generate default labels given a string.
557 // This can be loaded with the default font, etc.
558 ////////////////////////////////////////////////////////////////////
559 INLINE void PGItem::
561  _text_node = node;
562 }
563 
564 ////////////////////////////////////////////////////////////////////
565 // Function: PGItem::get_focus_item
566 // Access: Published, Static
567 // Description: Returns the one PGItem in the world that currently
568 // has keyboard focus, if any, or NULL if no item has
569 // keyboard focus. Use PGItem::set_focus() to activate
570 // or deactivate keyboard focus on a particular item.
571 ////////////////////////////////////////////////////////////////////
572 INLINE PGItem *PGItem::
574  return _focus_item;
575 }
576 
577 ////////////////////////////////////////////////////////////////////
578 // Function: PGItem::get_frame_inv_xform
579 // Access: Published, Static
580 // Description: Returns the inverse of the frame transform matrix
581 ////////////////////////////////////////////////////////////////////
582 INLINE LMatrix4 PGItem::
584  LightReMutexHolder holder(_lock);
585  return _frame_inv_xform;
586 }
587 
588 ////////////////////////////////////////////////////////////////////
589 // Function: PGItem::compute_area
590 // Access: Private, Static
591 // Description: Computes the area of the indicated frame.
592 ////////////////////////////////////////////////////////////////////
593 INLINE PN_stdfloat PGItem::
594 compute_area(const LVecBase4 &frame) {
595  return (frame[1] - frame[0]) * (frame[3] - frame[2]);
596 }
597 
598 ////////////////////////////////////////////////////////////////////
599 // Function: PGItem::compare_largest
600 // Access: Private, Static
601 // Description: Given that largest is the pointer to the largest
602 // frame so far, and largest_area is its area, compare
603 // that to the area of the new frame; if the new frame
604 // is larger, adjust largest and largest_area
605 // appropriately.
606 ////////////////////////////////////////////////////////////////////
607 INLINE void PGItem::
608 compare_largest(const LVecBase4 *&largest, PN_stdfloat &largest_area,
609  const LVecBase4 *new_frame) {
610  PN_stdfloat new_area = compute_area(*new_frame);
611  if (new_area > largest_area) {
612  largest = new_frame;
613  largest_area = new_area;
614  }
615 }
616 
617 ////////////////////////////////////////////////////////////////////
618 // Function: PGItem::StateDef::Constructor
619 // Access: Public
620 // Description:
621 ////////////////////////////////////////////////////////////////////
622 INLINE PGItem::StateDef::
623 StateDef() :
624  _frame_stale(true)
625 {
626 }
const LVecBase4 & get_frame() const
Returns the bounding rectangle of the item.
Definition: pgItem.I:131
void set_name(const string &name)
The mutex name is only defined when compiling in DEBUG_THREADS mode.
string get_within_event() const
Returns the event name that will be thrown when the item is active and the mouse moves within the bou...
Definition: pgItem.I:453
static string get_press_prefix()
Returns the prefix that is used to define the press event for all PGItems.
Definition: pgItem.I:374
bool get_background_focus() const
Returns whether background_focus is currently enabled.
Definition: pgItem.I:223
void set_id(const string &id)
Set the unique ID assigned to this PGItem.
Definition: pgItem.I:282
This is the base class for all the various kinds of gui widget objects.
Definition: pgItem.h:58
string get_release_event(const ButtonHandle &button) const
Returns the event name that will be thrown when the item is active and the indicated mouse or keyboar...
Definition: pgItem.I:535
void clear_frame()
Removes the bounding rectangle from the item.
Definition: pgItem.I:157
static string get_focus_out_prefix()
Returns the prefix that is used to define the focus_out event for all PGItems.
Definition: pgItem.I:361
int get_suppress_flags() const
This is just an interface to get the suppress flags on the underlying MouseWatcherRegion.
Definition: pgItem.I:249
LMatrix4 get_frame_inv_xform() const
Returns the inverse of the frame transform matrix.
Definition: pgItem.I:583
void set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top)
Sets the bounding rectangle of the item, in local coordinates.
Definition: pgItem.I:100
static string get_release_prefix()
Returns the prefix that is used to define the release event for all PGItems.
Definition: pgItem.I:400
const string & get_id() const
Returns the unique ID assigned to this PGItem.
Definition: pgItem.I:263
string get_repeat_event(const ButtonHandle &button) const
Returns the event name that will be thrown when the item is active and the indicated mouse or keyboar...
Definition: pgItem.I:521
static PGItem * get_focus_item()
Returns the one PGItem in the world that currently has keyboard focus, if any, or NULL if no item has...
Definition: pgItem.I:573
static string get_keystroke_prefix()
Returns the prefix that is used to define the keystroke event for all PGItems.
Definition: pgItem.I:413
static string get_focus_in_prefix()
Returns the prefix that is used to define the focus_in event for all PGItems.
Definition: pgItem.I:346
A ButtonHandle represents a single button from any device, including keyboard buttons and mouse butto...
Definition: buttonHandle.h:28
bool has_frame() const
Returns true if the item has a bounding rectangle; see set_frame().
Definition: pgItem.I:144
PGItemNotify * get_notify() const
Returns the object which will be notified when the PGItem changes, if any.
Definition: pgItem.I:85
static void set_text_node(TextNode *node)
Changes the TextNode object that will be used by all PGItems to generate default labels given a strin...
Definition: pgItem.I:560
string get_exit_event() const
Returns the event name that will be thrown when the item is active and the mouse exits its frame...
Definition: pgItem.I:438
int get_state() const
Returns the "state" of this particular PGItem.
Definition: pgItem.I:187
string get_name() const
Returns the name of the button.
bool has_notify() const
Returns true if there is an object configured to be notified when the PGItem changes, false otherwise.
Definition: pgItem.I:72
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:451
string get_press_event(const ButtonHandle &button) const
Returns the event name that will be thrown when the item is active and the indicated mouse or keyboar...
Definition: pgItem.I:507
bool get_active() const
Returns whether the PGItem is currently active for mouse events.
Definition: pgItem.I:199
This is a specialization on MouseWatcherRegion, to add a bit more fields that are relevant to the PG ...
string get_enter_event() const
Returns the event name that will be thrown when the item is active and the mouse enters its frame...
Definition: pgItem.I:425
static string get_exit_prefix()
Returns the prefix that is used to define the exit event for all PGItems.
Definition: pgItem.I:307
Similar to MutexHolder, but for a light reentrant mutex.
static string get_without_prefix()
Returns the prefix that is used to define the without event for all PGItems.
Definition: pgItem.I:331
string get_focus_out_event() const
Returns the event name that will be thrown when the item loses the keyboard focus.
Definition: pgItem.I:493
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111
void set_state(int state)
Sets the "state" of this particular PGItem.
Definition: pgItem.I:175
static string get_within_prefix()
Returns the prefix that is used to define the within event for all PGItems.
Definition: pgItem.I:319
string get_focus_in_event() const
Returns the event name that will be thrown when the item gets the keyboard focus. ...
Definition: pgItem.I:481
The primary interface to this module.
Definition: textNode.h:52
PGMouseWatcherRegion * get_region() const
Returns the MouseWatcherRegion associated with this item.
Definition: pgItem.I:39
Objects that inherit from this class can receive specialized messages when PGItems change in certain ...
Definition: pgItemNotify.h:30
string get_keystroke_event() const
Returns the event name that will be thrown when the item is active and any key is pressed by the user...
Definition: pgItem.I:547
void set_suppress_flags(int suppress_flags)
This is just an interface to set the suppress flags on the underlying MouseWatcherRegion.
Definition: pgItem.I:236
static string get_repeat_prefix()
Returns the prefix that is used to define the repeat event for all PGItems.
Definition: pgItem.I:387
bool get_focus() const
Returns whether the PGItem currently has focus for keyboard events.
Definition: pgItem.I:211
static string get_enter_prefix()
Returns the prefix that is used to define the enter event for all PGItems.
Definition: pgItem.I:295
string get_without_event() const
Returns the event name that will be thrown when the item is active and the mouse moves completely out...
Definition: pgItem.I:469
void set_notify(PGItemNotify *notify)
Sets the object which will be notified when the PGItem changes.
Definition: pgItem.I:54