http://www.newton-inc.com/dev/techinfo/qa/qa.htm
GetNamedResource(..., 'picture)
routine, you can use PICT resources to be drawn in clPictureViews. MacOS PICT resources often contain multiple opcodes (instructions). For single-opcode PICTs, compression is done for the whole picture. You can check Inside Macintosh documentation for specifications of the PICT format. If you are using very large bitmaps which you will print, you should use PICT resources composed of many smaller 'bitmap copy' opcodes because they will print much faster and more reliably on PostScript printers. This is because very large PICT opcodes printed to LaserWriters must be decompressed on the printer. The printer's decompression buffer is sometimes too small if the opcodes represent large bitmaps. Check your MacOS graphics application documentation for more information on segmenting your large PICTs into smaller pieces. For some applications, you might have two versions of the PICTs, one for displaying (using GetPictAsBits
for faster screen drawing), and a large tiled PICT for printing.MonacoTest
". That includes a font which will print as the monospaced Courier font.target
variable (it will contain the "body" of the data sent; don't use fields
.body). Note that if mulitiple items are sent, the value of target
will change as the print format iterates over the list. Try to put the real "data" for the routing in the target using the view method GetTargetInfo
.GetRoot().(yourAppSymbol).theSlot
.OpenRoutingSlip
. Create a new item with the transport's NewItem
method and add routing information such as the recipient information in the toRef
slot. For the call slip, the transport symbol will be '|phoneHome:Newton|
, but this approach will work for other transports. (For transports other than the call transports, you will also provide the data to route in the item.body
slot.)toRef
slot in the item frame should contain an array of recipients in the form of nameRefs, which are the objects returned from protoPeoplePicker
and other protoListPicker
-based choosers. Each nameRef can be created from one of two forms: a cardfile soup entry, or just a frame of data with minimal slots. (The required slots vary depending on the transport. For instance, the current call transport requires only phone, name, and country.) entry := myCursor:Entry();
entry := { phone:"408 555 1234", name: {first: "Glagly", last: "Wigout"}, country: "UK", };
transport.addressingClass
slot. (Examples are '|nameRef.phone|
and '|nameRef.email|
).local class := '|nameRef.phone|;local nameRef := GetDataDefs(class):MakeNameRef(myData, class);
GetTargetInfo
view method should return a targetInfo
frame, consisting of target
and targetView
slots. Alternatively, you can create a frame consisting of these slots and pass it to OpenRoutingSlip
. As a workaround to a ROM bug, you must also supply an appSymbol
slot in the targetInfo
frame containing your appSymbol. Note that targetInfo.target
could be a multiple item target (see the CreateTargetCursor
documentation for more info.)OpenRoutingSlip
to open the slip after setting up slots such as toRef
and cc
within the item. You can use code such as the following:/* example using Call Transport */local item, entry, class, nameRef;// just for testing, get an Name...entry := GetUnionSoup("Names"):Query(nil):Entry();item := TransportNotify('|phoneHome:Newton|, 'NewItem, [nil]);if item = 'noTransport or not item then return 'noTransport; class := '|nameRef.phone|;nameRef := GetDataDefs(class):MakeNameRef(entry, class);item.toRef := [nameRef];targetInfo := { targetView: getroot(), target: {}/* for non-CALL transports, add your data here! */, appsymbol: kAppSymbol };// returns view (succeeded), or fails: nil or 'skipErrorMessageOpenRoutingSlip(item, targetInfo);
CreateTargetCursor
function.GetTargetInfo
method like: func(reason) begin local t := CreateTargetCursor(kDataClassSymbol, myItemArray); local tv := base; // the targetView return {target: t, targetView: tv}; end;
CreateTargetCursor
is used as the class of the target, which is used to determine what formats and transports are available. You must register formats on that data class symbol in your part's InstallScript
function. CreateTargetCursor
can contain any items, including soup entries or soup entry aliases. If you include soup entry aliases, they will automatically be resolved when accessing items using the GetTargetCursor
function.usesCursors
slot set to nil
will automatically print items on separate pages -- print formats must use the target variable to image the current item. To print multiple items, set the format usesCursors
slot to true
and use GetTargetCursor(target, nil)
to navigate through the items. usesCursors
slot) or the transport (the allowsBodyCursors
slot) does not support cursors, the system will automatically split the items into separate Out Box items.protoPrintFormat:viewSetupFormScript()
?viewSetupFormScript
. self:LocalBox()
and get the correct page size. Note that you cannot rely on the protoPrintFormat.viewBounds
slot value. To position subviews within the print format centered or "full" width or height, use view justifications like centered, right, and full, or use theEnclosingView:LocalBox()
to determine the exact size of the enclosing view.CreateTargetCursor('newtOverview, myItemArray)
in my application to simplify my code which handles overviews. Why would my print format throw an exception when I use this method?'newtOverview
symbol as your data class with CreateTargetCursor
. The biggest limitation is that it requires you to support exactly the set of of datatypes: ['frame, 'text, 'view].
In other words, you must register a protoFrameFormat
(by default, it handles 'frame
and 'text
dataTypes) and a protoPrintFormat
. However, there are two other limitations not mentioned in the final documentation: the system does not guarantee that it will call your print format's formatInitScript
method or a format's SetupItem
method.viewSetupFormScript
(or other code in the print format) assumed that the formatInitScript
has been called, it could cause errors and/or exceptions. The workaround to this would be to set a flag in the formatInitScript
; if it was not set at the beginning of viewSetupFormScript
, send your format the formatInitScript
message. Other problems could occur with SetupItem
, but you'd probably not see any errors or exceptions until you tried to beam/mail a frame to another device and then tried to Put Away the item.CreateTargetCursor
to prepare a "multiple item target", you may be able to use this special 'newtOverview
symbol as your data class. If your application prints every item on separate pages (in other words, not multiple items on one page) and you want to split beam and mail items into separate items in the Out Box, this might be useful to you. For more information, see the Newton Programmers Guide (not reference) in the Routing chapter "Using the Built-in Overview Data Class" section and the "Move It!" article in the Newton Technology Journal 2.02. Also, check out the MultiRoute DTS sample.'frame
dataTypes. Why is Beam available in my Action picker in Newton 2.1 OS? 'text
dataType. If any routing formats for your data supports text export (a format.dataTypes
array includes 'text
), Beam will be available. Unfortunately, there is a bug in current Newton 2.1 OS devices such that Beam does not convert the target to text before sending it. Transports that support sending text should use the kItemToTextFunc
function (in the Newton 2.x platform files), and that function calls the format's TextScript
to convert the item to text. Since Beam does not do this, this gives the appearance that the item is being sent as 'frame
, a dataType that may not be supported by your application's routing formats. 'frame
datatype. In your routing format, add 'frame
to the dataTypes
slot. This will allow all 'frame
transports, including mail transports that can send attachments, to send mail with your application. This will allow your application to avoid text-specific bugs in Beam. For the best user interface, we recommend that you write stationery for your data so that users can view the item in the In Box or Out Box. See the Newton Programmers Guide and Reference for more information about writing and registering stationery. Note that you can test your application with Put Away, using the built-in Beam transport as well as the DTS sample "Archive Transport".format:SetupItem(...)
method. If you don't support overviews or other mechanisms that use multiple item targets, change item.body
to be a new frame of the form {text: "the converted item to text", class: 'text}
. Note that this format should not also support the 'frame
dataType because you are destructively modifying the item.SetupItem
method is called. You can use the code like the following in your SetupItem
format after calling the inherited method:// get a 'cursor' to iterate over the items.// Note: this still returns a 'cursor' even if item.body wasn't reallocal cursor := GetTargetCursor(item.body, nil);local newArray := [];local entry := cursor:entry();while (entry) do begin // convert item to text in whatever way you normally do it... // For instance, you might call your format's textscript... entry := { text: "blah blah" && entry.a && entry.b, class: 'text }; AddArraySlot(newArray, entry); entry := cursor:Next(); end; item.body := CreateTargetCursor(classof(item.body), newArray);// remember to return 'item' from SetupItemitem
You might be wondering if you could route the 'frame
data by hiding the data in extra slots in item.body
. If you did that, the item would be much larger than necessary to route 'frame
data, and will not be Put Away properly because the 'class
slot is set to 'text
, not your original data class). If you actually want to support 'text
and 'frame
dataTypes, use a single protoFrameFormat
with dataTypes ['frame, 'text]
and do not convert the item.body
as illustrated above. (This is actually recommendation #1 above).'text
stationery must be registered in order to view the item in the In Box and Out Box. Such stationery is not necessarily installed on the receiving device. Some mail transport packages may have installed 'text
stationery, but you may choose not to rely on this. If you are interested in writing text stationery, see the DTS sample "MinMail" and the Newton Programmers Guide and Reference for more information about writing and registering stationery.:LocalBox()
in its viewSetupFormScript
, viewSetupChildrenScript
, or viewSetupDoneScript
. This is only accurate during the current print job to the printer or fax driver. You cannot determine this size during Print/Fax preview, nor during the print format's formatInitScript
, nor in your application's on-screen views.formatInitScript
can accurately determine the page height. This special format method was designed to allow time-intensive code to execute before the print job begins. For instance, fax timeouts might be less likely if some data were processed before fax connection. However, there is no supported API to find the actual final printable area that you will have when the system opens the print format view and sends the viewSetupFormScript
message. Although you may be tempted to access undocumented slots which contain information about printer and page settings, this is both unsupported and results in unreliable bounds. (For instance, the undocumented fax cover page information affects the printable area but it's not stored in the printer nor page size structures.)paperSize
and paperSizes
. You cannot use these to reliably determine the printable area, nor can you create new paperSizes
. See the Newton Programmer's Reference for more details. :LocalBox()
in the print format viewSetupFormScript
, viewSetupChildrenScript
, or viewSetupDoneScript
. (Or, use the print format pageHeight
and pageWidth
slots in viewSetupChildrenScript
or later.) Also, add new child views with appropriate center/full/right/relative justification to take advantage of varying page sizes. This will allow your application to work with any paper size, in any printer, and in any locale.modeXOR
and modeNot
will not work.modeBic
) for drawing the text.