background image
C H A P T E R 6
Pickers, Pop-up Views, and Overviews
6-8
Map Pickers
The protoGeneralPopup
sends a
pickCancelledScript
to the
callbackContext
specified in the
New
method. However, it does not send a
pickActionScript
back; instead, it sends an
Affirmative
message to itself.
You supply the method and decide what call to make to the context and what
information to send back.
To put other objects in the
protoGeneralPopup
, just drag them out in NTK. For
example, if you want a checkbox in your pop-up view, drag out a
protoCheckbox
. You can put anything in the pop-up view, including your
own protos.
Since you have to assemble the information to send on an affirmative, you will
likely end up declaring your content to the general pop-up.
The only slots you really need to set are
Affirmative
and
viewBounds
.
Affirmative
is a function. Here's an example:
func()
begin
// Notify the context that the user has accepted the
// changes made in the popup
if context then
context:?pickActionScript(changeData) ;
end
Map Pickers
6
You can use the pickers described in this section to display maps and allow the user
to select countries, U.S. states, Canadian provinces, and cities. The Newton system
software provides the following map picker protos:
The
protoCountryPicker
displays a map of the world. When the user taps a
country, the
PickWorld
message is sent to your view. For information about
the slots and methods for this picker, see "protoCountryPicker" (page 5-30) in
Newton Programmer's Reference. Figure 6-8 shows an example of a
protoCountryPicker
.
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна