*** empty log message ***

This commit is contained in:
David Rose 2001-03-14 00:13:47 +00:00
parent 73245f4743
commit d01dec2965
2 changed files with 21 additions and 21 deletions

View File

@ -32,7 +32,7 @@ MouseWatcher::
MouseWatcher(const string &name) : DataNode(name) {
_has_mouse = false;
_current_region = (MouseWatcherRegion *)NULL;
_button_down_region = (MouseWatcherRegion *)NULL;
_button_down = false;
}
////////////////////////////////////////////////////////////////////
@ -80,9 +80,6 @@ remove_region(MouseWatcherRegion *region) {
if (region == _current_region) {
_current_region = (MouseWatcherRegion *)NULL;
}
if (region == _button_down_region) {
_button_down_region = (MouseWatcherRegion *)NULL;
}
return _regions.erase(region) != 0;
}
@ -249,7 +246,11 @@ transmit_data(NodeAttributes &data) {
_has_mouse = true;
set_current_region(get_over_region(_mouse));
if (!_button_down) {
// We don't change regions while we are holding down a
// button--only when all buttons are up.
set_current_region(get_over_region(_mouse));
}
// Look for button events.
const ButtonEventDataAttribute *b;
@ -264,19 +265,25 @@ transmit_data(NodeAttributes &data) {
// There is some danger of losing button-up events here. If
// more than one button goes down together, we won't detect
// both the of the button-up events properly.
// both of the button-up events properly.
if (_button_down_region != (MouseWatcherRegion *)NULL) {
throw_event_pattern(_button_up_pattern, _button_down_region,
if (_current_region != (MouseWatcherRegion *)NULL) {
throw_event_pattern(_button_up_pattern, _current_region,
be._button.get_name());
}
_button_down_region = (MouseWatcherRegion *)NULL;
_button_down = false;
} else {
// Button down.
_button_down_region = _current_region;
if (_button_down) {
// Clicking down a second button while still holding the
// first button down does cause a change in regions.
set_current_region(get_over_region(_mouse));
}
_button_down = true;
if (_current_region != (MouseWatcherRegion *)NULL) {
throw_event_pattern(_button_down_pattern, _button_down_region,
throw_event_pattern(_button_down_pattern, _current_region,
be._button.get_name());
}
}
@ -284,15 +291,7 @@ transmit_data(NodeAttributes &data) {
}
bool suppress_below = false;
if (_button_down_region != (MouseWatcherRegion *)NULL) {
// We're currently holding down a button. This is the effective
// region that determines whether we suppress below.
suppress_below = _button_down_region->get_suppress_below();
} else if (_current_region != (MouseWatcherRegion *)NULL) {
// We're not holding down a button, but we are within a region.
// Use this region to determine whether we suppress below.
if (_current_region != (MouseWatcherRegion *)NULL) {
suppress_below = _current_region->get_suppress_below();
}

View File

@ -93,7 +93,8 @@ private:
LPoint2f _mouse;
MouseWatcherRegion *_current_region;
MouseWatcherRegion *_button_down_region;
bool _button_down;
string _button_down_pattern;
string _button_up_pattern;
string _enter_pattern;