http://www.newton-inc.com/dev/techinfo/qa/qa.htm
protoPhoneExpando
under Newton 2.0 OS. Something is going wrong in the setup1
method. Is this a known bug?protoPhoneExpando
(and the entire expando user interface) have been deprecated in the Newton 2.0 OS, and are only supported for backward compatibility. If possible, you should redesign your application to avoid the expandos.setup1
and setup2
messages to the template in the lines
array. These methods in protoPhoneExpando
rely on information that isn't created until the view is actually opened.labelCommands
slot in the template which has an array of one element, that element being the label you want to appear in the phone line. For example: labelCommands: ["phone"]
.protoPhoneExpando
doesn't use the phoneIndex
feature. If it does, you'll have problems that are harder to work around.clEditView
, and clEditViews
can contain pictures (in addition to ink, polygons, and text) in the Newton 2.0 OS.'viewChildren
slot of a clEditView
to create editable items. 'para
templates are text and ink text, 'poly
templates are drawings and sketch ink, and 'pict
templates are images.clEditView
, you need to create an appropriate template and then add it to the viewChildren
array (and open the view or call RedoChildren
) or use the AddView
method to add it to an existing view (then Dirty
the view.) See the item "Adding Editable Text to a clEditView" elsewhere in the Q&As for details.'pict
items needs to contain these slots: viewStationery
: Must have the symbol 'pict
viewBounds
: A bounds frame, like RelBounds(0,0,40,40)
icon
: A bitmap frame, see clPictureView
docsclPictureView
view class.clParagraphView
that's inside a smaller view and be able to scroll back and forth. When I try this, it always wraps at the bounds of the parent. How can I create a horizontal scrolling text view?clEditView
, leaving the rest of it off screen and unselectable.viewBounds
of the clParagraphView
are modified during creation of the view so that the view's right edge is aligned with the parent's right edge. After that, wrapping is automatic.viewFlag
vReadOnly
is set, 2) making sure vCalculateBounds
and vGesturesAllowed
, are off, and 3) not using tabs
or styles
. Lightweight text views are not editable, but you can use SetValue
to change their text
slots dynamically.clParagraphView
or if tabs or styles are required, there is another workaround. The code to check for clipping only looks one or two levels up the parent chain, so you could nest the paragraph in a couple of otherwise useless views which were large enough to prevent clipping, and let the clipping happen several layers up the parent chain.clParagraphView
view class: viewKeyDownScript
message is sent when a key is pressed.viewKeyUpScript
message is sent when a key is released.ViewKeyUpScript
and ViewKeyDownScript
are currently called using parent inheritance. Do not rely on this behavior: it may change in future ROMs.nil
. The default action for ViewKeyDownScript
is usually to insert the character into the paragraph. (There may be other default actions in the future.) If you return a non-nil value, the default action will not occur.vSingleKeyStrokes
flag in the textFlags
slot of your view for the system to send the ViewKeyDownScript
or ViewKeyUpScript
message for every key stroke. If you do not specify vSingleKeyStrokes
, keyboard input may be dropped if a lot of key strokes are coming in. ViewKeyDownScript(char, flags)
This message is sent to the key view when the user presses down on a keyboard key. This applies to a hardware keyboard or an on-screen keyboard.char
The character that was entered on the keyboard. Note that if a modifier key is the only key pressed (for example, the Shift key), this value will be 0.flags
An integer that specifies which modifier keys were pressed, the unmodified key value, and the keycode. The modifier key constants are shown in the section "Keyboard Modifier Keys". ViewKeyUpScript(char, flags)
This message is sent to the key view whenever the user releases a keyboard key that was depressed. This applies to a hardware keyboard or an on-screen keyboard.char
The character that was entered on the keyboard. Note that if a modifier key is the only key pressed (for example, the Shift key), this value will be 0.flags
An integer that specifies which modifier keys were pressed, the unmodified key value, and the keycode. The modifier key constants are shown in the section "Keyboard Modifier Keys".kIsSoftKeyboard
(1 << 24) kCommandModifier
(1 << 25) kShiftModifier
(1 << 26) kCapsLockModifier
(1 << 27) kOptionsModifier
(1 << 28) kControlModifier
(1 << 29) protoKeyboard
-based keyboard to be open at the same time as other keyboards. When my keyboard opens, it seems like any other keyboard closes. How do I keep multiple keyboards open?protoKeyboard
-based view opens, it closes the last-opened protoKeyboard
-based view. However, you need not use protoKeyboard
. protoDragger
) and use the RegisterOpenKeyboard
view message to register the keyboard with the system. Using RegisterOpenKeyboard
will ensure that the caret is set up properly and allows you to track the caret changes with the viewCaretChangedScript
view message if desired.protoKeyboardButton
-based keyboard list. Is this possible?protoKeyboardButton
has a method called SetKeyboardList
that lets you do this. SetKeyboardList
takes two arguments. The first argument is an array of keyboard symbols to add to the list. The second argument is an array of keyboard symbols to remove from the list. Note that the keyboard symbols of the built-in keyboards are listed on pages pages 8-26 and 8-27 of the Newton Programmer's Guide.keyboardSymbol
.preallocatedContext
slot with the symbol of the keyboarduserName
slot with the name that will appear in the protoKeyboardButton
popupkeyboardSymbol
slot with your keyboard's symbol preallocatedContext
slot and the keyboardSymbol
slot must be the same symbol. Note that the keyboardSymbol
slot is required, but the preallocatedContext
slot is additionally necessary to avoid exceptions on devices prior to Newton 2.1 OS.viewSetupDoneScript
of the protoKeyboardButton
-based view, send the button a SetKeyboardList
message with your keyboard's symbol. For instance, you might have the following viewSetupDoneScript
:viewSetupDoneScript: func() begin :SetKeyboardList( [kMyKeyboardSymbol], nil ); // Be sure to call the inherited viewSetupDoneScript method! inherited:?viewSetupDoneScript();
end;
buttonClickScript
. You must first call SetKeyboardList
, then call the inherited buttonClickScript
.protoKeyboardButton
-based view is closed.ViewIntoBitmap
, or the global function GetPointsArray
, or a set of functions from the Recognition chapter, particularly GetStroke
and GetStrokePointsArray
.clKeyboardView
also finds the smallest key unit specified in the keyboard and uses this to constrain the final horizontal size. It calculates a minimal pixel size for the keyboard and makes sure that the final keyboard size is an integral multiple of this value. For example, if the smallest size is 10 pixels, then the final keyboard can be 10 pixels or 20 pixels, but not 15 pixels. If the view is 15 pixels, the keyboard will be 10 pixels. m = w * (1/s)
m - minimal sizew - width of the longest keyboard row in key unitss - numeric equivelent for smallest keyboard unit specified in the keyboard: (keyHUnit = 1, keyHHalf = 0.5, keyHQuarter = 0.25, keyHEighth = 0.125)
keyHQuarter
, so the minimal width for the ASCII keyboard is: m = 14 * (1 / 0.25) = 14 * 4 = 56 pixels.
_DoCloseButton
method to your application's base view. The _DoCloseButton
method is called when a keyboard equivalent is used to close a view. This method takes no arguments and must return true
if you handled the close, or return nil
to let the system continue to search for a close box in other applications.BuildContext
. This guarantees that it will be searched for a close box before your application is searched.keyCommand
if all I have is the keyMessage
symbol?MatchKeyMessage
that will do what you want. However, the documentation was inadvertently left out of the current version of the Newton Programmers Guide for Newton 2.1 OS. The documentation should be: MatchKeyMessage(startView, keyMessage)
keyCommand
frame for the specified message starting with the specified view.startView
- The view from which to start searching for the messagekeyMessage
- A symbol for the command message that will be searched for. This must be the same message that is specified in the keyMessage
slot of the keyCommand
framenil
or a keyCommand
frameMatchKeyMessage
function searches for the message using the same lookup rules that are used when the system handles a key command.