17 INLINE MouseWatcherRegion::
18 MouseWatcherRegion(
const std::string &name, PN_stdfloat left, PN_stdfloat right,
19 PN_stdfloat bottom, PN_stdfloat top) :
24 set_frame(left, right, bottom, top);
30 INLINE MouseWatcherRegion::
31 MouseWatcherRegion(
const std::string &name,
const LVecBase4 &frame) :
42 INLINE
void MouseWatcherRegion::
43 set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top) {
44 set_frame(LVecBase4(left, right, bottom, top));
50 INLINE
void MouseWatcherRegion::
51 set_frame(
const LVecBase4 &frame) {
53 _area = (_frame[1] - _frame[0]) * (_frame[3] - _frame[2]);
59 INLINE
const LVecBase4 &MouseWatcherRegion::
112 return ((_flags & F_active) != 0);
124 _flags |= F_keyboard;
126 _flags &= ~F_keyboard;
136 return ((_flags & F_keyboard) != 0);
150 _flags = ((_flags & ~F_suppress_flags) | (suppress_flags & F_suppress_flags));
158 return (_flags & F_suppress_flags);
167 if (_sort != other._sort) {
168 return _sort > other._sort;
170 return _area < other._area;
This is the class that defines a rectangular region on the screen for the MouseWatcher.
get_area
Returns the area of the rectangular region.
set_suppress_flags
Sets which events are suppressed when the mouse is over the region.
get_sort
Returns the current sorting order of this region.
get_active
Returns whether the region is active or not.
set_keyboard
Sets whether the region is interested in global keyboard events.
bool operator<(const MouseWatcherRegion &other) const
Returns true if this region should be preferred over the other region when they overlap,...
get_suppress_flags
Returns the current suppress_flags.
set_active
Sets whether the region is active or not.
get_keyboard
Returns whether the region is interested in global keyboard events; see set_keyboard().
set_sort
Changes the sorting order of this particular region.
A base class for all things which can have a name.