background image
C H A P T E R 1 0
Recognition: Advanced Topics
Using Advanced Topics in Recognition
10-19
Using protoRecToggle Views
10
A
protoRecToggle
view changes the recognition behavior of views by overriding
values inherited from the system's user configuration data. Note that values in the
view's
recConfig
frame override settings specified by the
protoRecToggle
view.
The
protoRecToggle
view is usually used with
clEditView
views that set the
vAnythingAllowed
mask or
clParagraphView
views that support ink text.
Take the following steps to use a
protoRecToggle
view.
Create the
recToggle
view in NTK. If your application has a status bar, you
need to provide the
recToggle
view as a child of the status bar.
Configure input views appropriately to support the choices your
recToggle
view provides. To do so, you need to provide an appropriate
recConfig
frame
or set the
vAnythingAllowed
mask for each view that is to be controlled by
the
recToggle
view.
Provide a
_recogSettings
slot at a place in the
_parent
chain that allows
each view controlled by the
recToggle
view to inherit this slot.
You can take the following optional steps to customize your
recToggle
view's
appearance or behavior:
Provide a
_recogPopup
slot specifying the items to be included in the
protoRecToggle
picker.
Implement a
RecogSettingsChanged
method in the
_parent
chain of any
view controlled by the
recToggle
view.
The next several sections describes these steps in detail.
Creating the recToggle View
10
To create a
recToggle
view, you'll first need to sketch it out in the NTK layout
editor. When you do so, you'll notice that regardless of where you draw it, the view
will appear in the upper-left corner of the layout. This is because the
recToggle
view is intended to be displayed as a child of the status bar in applications that
have one.
When a recToggle view is a child of your application's status bar, the view system
positions the
recToggle
view on the status bar automatically, ignoring the value
of the
recToggle
view template's
viewBounds
slot in the process. When the
recToggle
view is not a child of the status bar, you must create a
viewBounds
slot for it and set appropriate values for this slot.
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна