21 INLINE MouseWatcherRegion::
22 MouseWatcherRegion(
const string &name, PN_stdfloat left, PN_stdfloat right,
23 PN_stdfloat bottom, PN_stdfloat top) :
25 _frame(left, right, bottom, top)
36 INLINE MouseWatcherRegion::
37 MouseWatcherRegion(
const string &name,
const LVecBase4 &frame) :
50 INLINE
void MouseWatcherRegion::
51 set_frame(PN_stdfloat left, PN_stdfloat right, PN_stdfloat bottom, PN_stdfloat top) {
52 set_frame(
LVecBase4(left, right, bottom, top));
60 INLINE
void MouseWatcherRegion::
63 _area = (_frame[1] - _frame[0]) * (_frame[3] - _frame[2]);
71 INLINE
const LVecBase4 &MouseWatcherRegion::
139 return ((_flags & F_active) != 0);
155 _flags |= F_keyboard;
157 _flags &= ~F_keyboard;
169 return ((_flags & F_keyboard) != 0);
187 _flags = ((_flags & ~F_suppress_flags) | (suppress_flags & F_suppress_flags));
198 return (_flags & F_suppress_flags);
209 if (_sort != other._sort) {
210 return _sort > other._sort;
212 return _area < other._area;
void set_active(bool active)
Sets whether the region is active or not.
void set_suppress_flags(int suppress_flags)
Sets which events are suppressed when the mouse is over the region.
void set_keyboard(bool keyboard)
Sets whether the region is interested in global keyboard events.
void set_sort(int sort)
Changes the sorting order of this particular region.
A base class for all things which can have a name.
int get_sort() const
Returns the current sorting order of this region.
This is the class that defines a rectangular region on the screen for the MouseWatcher.
PN_stdfloat get_area() const
Returns the area of the rectangular region.
int get_suppress_flags() const
Returns the current suppress_flags.
bool get_keyboard() const
Returns whether the region is interested in global keyboard events; see set_keyboard().
This is the base class for all three-component vectors and points.
bool get_active() const
Returns whether the region is active or not.
bool operator<(const MouseWatcherRegion &other) const
Returns true if this region should be preferred over the other region when they overlap, false otherwise.