beautypg.com

Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 695

background image

C H A P T E R 1 9

Built-in Applications and System Data

Dates

19-21

OpenMeetingSlip

opens the meeting slip for a specific meeting or event.

RegInfoItem

adds and

UnRegInfoItem

or deletes an item in the Info picker

in the base view of the Dates application. This example shows how to add a
command that displays the next day’s To Do List to the Info button:

GetRoot().calendar:RegInfoItem('|NextDayToDo:MyApp|,

{

item: "Next Day's To Do",

doAction: func()

begin

local cal := GetRoot().calendar;

cal:DisplayDate

(cal:GetSelectedDates() [0]

+(24*60),'ToDoList);

end;

});

Controlling the Dates Display

19

There are two system variables you can set to control specific features of the Dates
display:

firstDayOfWeek

and

useWeekNumber

.

The Dates variable

firstDayOfWeek

specifies what the first day of the week

should be, for display purposes. It holds an integer value from 0 to 6, where 0
means Sunday, 1 means Monday, and so on. The default value is 0, which means
that by default all months show Sunday as the first day of the week.

Once this value has been set, all new views of the class

clMonthView

and views

that display meeting frequency reflect the new value, but existing views must be
closed and reopened to reflect the new value. This variable is part of the
system-stored user configuration data (the Dates application checks there first), or
in the locale bundle frame (Dates checks there next).

The Dates variable

useWeekNumber

controls display of a week number in the

upper-left corner of the Dates view. If this slot is non-

nil

, the Dates application

displays the week number there. The first week of the year is number 1 and the last
week is number 52. This variable is a slot in the locale bundle frame.

To get and set the value of user configuration variables, use the functions

GetUserConfig

and

SetUserConfig

; this frame and the two functions are

described in “System Data” (page 19-44). To return the current locale bundle
frame, use the global function

GetLocale

.