Apple Newton Utilities Podręcznik Użytkownika Strona 196

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 942
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 195
CHAPTER 5
Stationery
5-14 Using Stationery
Using the MinimalBounds ViewDef Method 5
The MinimalBounds method must be used in a viewDef when the size of the
entry is dynamic, as it is in a paper-roll-style or page-style application. It’s not
necessary for a card-style application, which has a xed height; in that case you
should set a static height for your viewDef in the
viewDefHeight slot.
The
MinimalBounds method is used to compute the minimal size for the
enclosing bounding box for the viewDef at run time. The following is an
example of a
MinimalBounds implementation where the viewDef contains
a
newtEditView whose path slot is set to
[pathExpr:kDataSymbol,'notes]:
MinimalBounds: func(entry)
begin
local result := {left: 0, top: 0, right: 0,
bottom: viewDefHeight};
// For an editView, make the bounds big enough to
// contain all the child views.
if entry.(kDataSymbol).notes then
foreach item in entry.(kDataSymbol).notes do
result := UnionRect( result, item.viewBounds );
result;
end;
Przeglądanie stron 195
1 2 ... 191 192 193 194 195 196 197 198 199 200 201 ... 941 942

Komentarze do niniejszej Instrukcji

Brak uwag