Apple Newton Utilities Guide de l'utilisateur Page 196

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 942
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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;
Vue de la page 195
1 2 ... 191 192 193 194 195 196 197 198 199 200 201 ... 941 942

Commentaires sur ces manuels

Pas de commentaire