This is the class that defines a rectangular region on the screen for the MouseWatcher. More...
Public Types | |
enum | SuppressFlags { SFMouseButton = 1, SFOtherButton = 2, SFAnyButton = 3, SFMousePosition = 4 } |
Public Member Functions | |
MouseWatcherRegion (string name, VBase4 const frame) | |
MouseWatcherRegion (string name, float left, float right, float bottom, float top) | |
bool | getActive () |
Returns whether the region is active or not. | |
float | getArea () |
Returns the area of the rectangular region. | |
VBase4 const | getFrame () |
bool | getKeyboard () |
Returns whether the region is interested in global keyboard events; see set_keyboard(). | |
int | getSort () |
Returns the current sorting order of this region. | |
int | getSuppressFlags () |
Returns the current suppress_flags. | |
output (ostream out) | |
Outputs the Namable. | |
setActive (bool active) | |
Sets whether the region is active or not. | |
setFrame (VBase4 const frame) | |
setFrame (float left, float right, float bottom, float top) | |
setKeyboard (bool keyboard) | |
Sets whether the region is interested in global keyboard events. | |
setSort (int sort) | |
Changes the sorting order of this particular region. | |
setSuppressFlags (int suppress_flags) | |
Sets which events are suppressed when the mouse is over the region. | |
write (ostream out, int indent_level) | |
write (ostream out) | |
Static Public Member Functions | |
static TypeHandle | getClassType () |
This is the class that defines a rectangular region on the screen for the MouseWatcher.
enum SuppressFlags |
MouseWatcherRegion | ( | string | name, |
VBase4 const | frame | ||
) |
MouseWatcherRegion | ( | string | name, |
float | left, | ||
float | right, | ||
float | bottom, | ||
float | top | ||
) |
bool getActive | ( | ) |
Returns whether the region is active or not.
See set_active().
float getArea | ( | ) |
Returns the area of the rectangular region.
static TypeHandle getClassType | ( | ) | [static] |
Reimplemented from Namable.
Reimplemented in PGMouseWatcherBackground.
bool getKeyboard | ( | ) |
Returns whether the region is interested in global keyboard events; see set_keyboard().
int getSuppressFlags | ( | ) |
Returns the current suppress_flags.
See set_suppress_flags().
setActive | ( | bool | active | ) |
Sets whether the region is active or not.
If it is not active, the MouseWatcher will never consider the mouse to be over the region. The region might still receive keypress events if its set_keyboard() flag is true.
setFrame | ( | float | left, |
float | right, | ||
float | bottom, | ||
float | top | ||
) |
setKeyboard | ( | bool | keyboard | ) |
Sets whether the region is interested in global keyboard events.
If this is true, then any keyboard button events will be passed to press() and release() regardless of the position of the mouse onscreen; otherwise, these events will only be passed if the mouse is over the region.
Changes the sorting order of this particular region.
The sorting order is used to resolve conflicts in the case of overlapping region; the region with the highest sort value will be preferred, and between regions of the same sort value, the smallest region will be preferred. The default sorting order, if none is explicitly specified, is 0.
setSuppressFlags | ( | int | suppress_flags | ) |
Sets which events are suppressed when the mouse is over the region.
This is the union of zero or more various SF_* values. Normally, this is 0, indicating that no events are suppressed.
If you set this to a non-zero value, for instance SF_mouse_position, then the mouse position will not be sent along the data graph when the mouse is over this particular region.