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::
67 INLINE PN_stdfloat MouseWatcherRegion::
87 INLINE
int MouseWatcherRegion::
110 INLINE
bool MouseWatcherRegion::
112 return ((_flags & F_active) != 0);
124 _flags |= F_keyboard;
126 _flags &= ~F_keyboard;
134 INLINE
bool MouseWatcherRegion::
135 get_keyboard()
const {
136 return ((_flags & F_keyboard) != 0);
150 _flags = ((_flags & ~F_suppress_flags) | (suppress_flags & F_suppress_flags));
156 INLINE
int MouseWatcherRegion::
157 get_suppress_flags()
const {
158 return (_flags & F_suppress_flags);
167 if (_sort != other._sort) {
168 return _sort > other._sort;
170 return _area < other._area;
set_suppress_flags
Sets which events are suppressed when the mouse is over the region.
bool operator<(const MouseWatcherRegion &other) const
Returns true if this region should be preferred over the other region when they overlap,...
set_active
Sets whether the region is active or not.
set_sort
Changes the sorting order of this particular region.
set_keyboard
Sets whether the region is interested in global keyboard events.
A base class for all things which can have a name.
This is the class that defines a rectangular region on the screen for the MouseWatcher.