background image
C H A P T E R 1 0
Recognition: Advanced Topics
10-16
Using Advanced Topics in Recognition
// indent from left of view to first letter
constant kBoxIndent := 4;
// width of a single box in the grid
constant kCellWidth := 24;
// create editable recConfig frame and set initial values
myView.ViewSetupDoneScript := func()
begin
// prebuild RAM copy that we can change
recConfig := PrepRecConfig(recConfig);
// set these same flags in myView.viewFlags
recConfig.inputMask :=
vClickable+vGesturesAllowed+vCustomDictionaries;
// get global bounds of enclosing view
local box := :GlobalBox();
// calc left edge of boxes in grid
local leftX := box.left + kBoxIndent;
// specify baseline and expected letter height
recConfig.rcBaseInfo :=
{
// baseline for writing
base: box.top + viewLineSpacing,
// height of a small letter
smallHeight: kSmallHeight,
};
// specify horizontal info for an array of boxes
recConfig.rcGridInfo :=
{
// left edge of first box
boxLeft: leftX,
// right edge of first box
boxRight: leftX + kCellWidth,
// width to left edge of next box
xSpace: kCellWidth,
};
// use new settings
PurgeAreaCache();
end;
© 2007-2017, o7 studio » при воспроизведении материала сайта ссылка обязательна