background image
C H A P T E R 1 0
Recognition: Advanced Topics
10-2
About Advanced Topics in Recognition
applications to change these system-wide settings. Instead, individual views can
customize their own recognition behavior by using a
recConfig
frame or
recToggle
view to override these inherited values locally.
In practice, most views' recognition behavior is defined by a combination of
inherited and overridden values. For example, because most users tend not to
change the speed at which they write, it's common for views to use inherited values
for the
timeoutCursiveOption
slot, which specifies the relative delay required
to consider a group of input strokes complete. At the same time, individual views
may customize certain recognition settings by overriding values that would
otherwise be inherited from the system's user configuration data. For example, a
view can use a
recConfig
frame to disable the automatic addition of new words
to the user dictionary.
A view based on the
protoRecToggle
system prototype provides another way to
override inherited recognition settings. This view provides a picker that allows the
user to change recognition settings easily. Each view controlled by this picker must
provide a
_recogSettings
slot that the picker sets according to the user's
current choice of recognition settings. The value in the
_recogSettings
slot
overrides values inherited from the system's user configuration data.
Your application supplies only one
_recogSettings
slot for each
recToggle
view it provides. Because views use parent inheritance to find a
_recogSettings
slot, a single
recToggle
view and a single
_recogSettings
slot can control
the recognition behavior of one view or multiple views, depending on the
_recogSettings
slot's position in the view hierarchy. For more information, see
"Creating the _recogSettings Slot" beginning on page 10-20.
You can also provide an optional
RecogSettingsChanged
method in the
_parent
chain of any view controlled by the
recToggle
view. If a
RecogSettingsChanged
method is provided, the
recToggle
view sends this
message to
self
when the user chooses an item in the
recToggle
picker.Your
RecogSettingsChanged
method can perform any application-specific task that
is appropriate; typically, this method reconfigures recognition settings in response
to the change in the
recToggle
view's state.
Finally, any view can provide an optional
recConfig
frame that specifies the
view's recognition behavior at the local level.
Although
recConfig
frames have thus far been presented as simply an alternate
interface to the recognition system, they are actually used internally by the system
to represent the recognition behavior of each view. When the user writes, draws, or
gestures in a view, the system builds a
recConfig
frame that specifies the precise
settings of all the recognizers needed for the view. If you supply a
recConfig
frame for the view, the
recConfig
frame that the system builds is based on the
recConfig
frame you have supplied and any recognition-related user preferences
that may apply.
© 2007-2017, o7 studio » при воспроизведении материала сайта ссылка обязательна