scope=(WDS_Scope *)FindWidgetType(WDS_Typecode scope_code,long first);where first specifies whether you are looking for the nearest ancestral scope (first = TRUE) or the scope nearest to the root window (first = FALSE). The scope_code is a long pointer unique to WDS_Scope and can be determined by calling WDS_Widget::GetTypeCode() on any WDS_Scope or directly to the static function WDS_Scope::GetTypeCodeStatic().
For any incoming event, the scope will search its list of bypasses
for all entries that have the same source
and any common event items and event states.
For each match,
the corresponding destination widgets are directly sent the incoming event
(not necessarily with all the items and states as set in the bypass),
but with the OR'ed event widget flag WDS_BYPASS_EVENT set.
The event widget flags can be read using
EW_Event::GetWidgetFlags().
If a widget registers for exclusive access using the
WDS_Bypass flag WDS_BYPASS_FLAG_TAKE,
any previous intersecting exclusive bypasses are removed from
the scope's bypass list and sent a psuedo-event matching their bypass and
with the OR'ed event widget flags
WDS_BYPASS_EVENT and WDS_BYPASS_TAKE_LOST both set.
Widgets, who have not otherwise excluded such through their event mask,
can expected events resembling their bypass with the widget flag
WDS_BYPASS_IN_FOCUS set.
This happens when the scope determines that if the event occured,
it would be sent to this widget.
It generally occurs during the descension processing of an idlemouse event
after the idlemouse event itself is sent to the widget.
Other unfocused widgets will recieve the idlemouse event,
but no following WDS_BYPASS_IN_FOCUS event.
From such, they know they are not focused.
WDS_GetString uses this as evident when in shallow focus mode.
When non-idlemouse events are sent to exclusive bypasses,
they are first propagated normally through the hierarchy but with
WDS_BYPASS_EVENT set and as EW_EVENT_USED_ALL.
After that, the bypass recieves the event as unused and
WDS_BYPASS_EVENT still set.
The following lists the sequence of event processing in a scope.
The process is specifically different for idlemouse events.
For idlemouse event on all bypasses,
| Phase 1 |
non-exclusive bypasses sent event with WDS_BYPASS_EVENT set
|
| Phase 2 |
normal event propagation through hierarchy
|
| Phase 3 |
exclusive bypasses whose widget is in focus sent event
with WDS_BYPASS_IN_FOCUS set
|
For other events,
| Phase 1 |
non-exclusive bypasses sent event with WDS_BYPASS_EVENT set
|
| Phase 2 |
normal event propagation through hierarchy;
if there is an intersecting exclusive bypass,
events sent as EW_EVENT_USED_ALL and with WDS_BYPASS_EVENT set
|
| Phase 3 |
exclusive bypasses of intersecting content sent event
with WDS_BYPASS_EVENT set
|
void RegisterBypass(WDS_Bypass *bypass)
void DeRegisterBypass(WDS_Bypass *bypass)
Register/DeRegister the given bypass with this scope.
There is no specified limit on the number of destination widgets or
bypasses per destination widget.
void ExcludeAncestors(WDS_Bypass *bypass)
Find widgets whose bypass in ancestral scopes conficts
with the one specified, and remove their exclusive access.
Intended for internal use.