/* ** Newton Developer Technical Support Sample Code ** ** WhoOwesWhom, NewtApp/Stationery Sample ** ** by Greg Christie & Bob Ebert for Newton Developer Technical Support ** ** Copyright © 1995-97 by Apple Computer, Inc. All rights reserved. ** ** You may incorporate this sample code into your applications without ** restriction. This sample code has been provided "AS IS" and the ** responsibility for its operation is 100% yours. You are not ** permitted to modify and redistribute the source as "DTS Sample Code." ** If you are going to re-distribute the source, we require that you ** make it clear in the source that the code was descended from ** Apple-provided sample code, but that you've made changes. */ The sample illustrates a single piece of stationery -- a data def with two viewDefs. All three flavors of NewtApp container are provided. The stationery pieces and resource files are the same in all three versions of the app. These files are: iouDataDef iouDefaultViewDef iouNotesViewDef Resources.rsrc Definitions.f Install&RemoveScript.f baseView Note: All three flavors may be loaded at once, however if one is removed, the shared viewDefs and dataDefs for all three are UnRegistered. Resetting the Newt reRegisters viewDefs. The Extend Notes App sample shows how the stationery created for the sample app could be installed into Notes, rather than its own application. Note: The Notes sample is not intended to co-exist on the same newton as the the other samples. Things to look for (differences): Card Flavor Routing button in status bar at all times. Filing button in status bar at all times. One entry visible at a time (except overview) Entries always the same size. Page Flavor Routing button in seperator bar in entry view, status bar in overview. Filing button in seperator bar in entry view, status bar in overview. One entry visible at a time (except overview) Entries can have differing heights. Last entry in "notes" is "endless" (scroll down.) Roll Flavor Routing button in seperator bar in entry view, status bar in overview. Filing button in seperator bar in entry view, status bar in overview. Several entry visible at a time Entries can have differing heights. Last entry in "notes" is "endless" (scroll down.) Note, Version 5 of WhoOwesWhom adds support for resizing the application correctly for different screen sizes and orientations. There is a pathological case which is not handled correctly by WhoOwesWhom. If the minWidth or minHeight happen to exactly match the current screen width or height, and the max height or width (the opposite one) is less than the current screen height or width, the message "screen to short/narrow" will appear. Because you view isn't full screen in one dimension, the border is required. Because the border takes away from the useable dimension in the other direction, the resulting view is too small to open. If you absolutely require a view that has borders on only 2 of the 4 sides for some screen size, this can be done, but it's beyond the scope of this function--write your own viewSetupFormScript!! There are also two new constants in the Definitions.f file which allow you to quickly test your app at minimum or maximum size (For max size, you may have to rely on "DV" to check the sizes of subviews, because they can be off-screen.) They are kTestMinAppSize and kTestMaxAppSize. There will be no borders when you are running your app this way. History: v5 - Updated application sizing in the baseView's viewSetupFormscript - Added bug fix regarding installing stationery. See the baseView's NewtInstallScript. v4 - Updated "Check All" button to match Newton OS 2.1 UI, Used StdAppSize to position views on multiple display sizes.