No word from PalmSource yet on CollapseUtils, though one person has told me
that the license text has been removed from the relevant source files on the
PalmSource website--without a new license being put in.

I have, however, been thinking about a generalized way of doing DIA that
might even be better than using CollapseUtils.  For each object on each
form, we set a bunch of possible attributes.  These include sensible
combinations of:
   FIX_HEIGHT
   FIX_WIDTH
   FIX_TOP
   FIX_BOTTOM
   FIX_LEFT
   FIX_RIGHT
   WIDTH_BY_RATIO
   HEIGHT_BY_RATIO

In the init method for each form, on first load we call things like:
  SetObjectAttributes( objId, flags );
or, for a bulk approach,
  SetObjectAttributesByType( objType, flags );
  SetObjectAttributesByRange( firstId, lastId, flags );

The routine then stores the flags as well as the original bounds of the
object in a global list or array.  Then, we write a simple ResizeObjects()
function that goes through all of the objects and sets their bounds
intelligently based on the attributes and based on WinGetDisplayExtent().
For instance, if the object has attributes HEIGHT_BY_RATIO | FIX_BOTTOM |
FIX_LEFT | FIX_RIGHT, we then calculate its new bounds as follows:

   newBounds.topLeft.x = savedBounds.topLeft.x;
      // fix distance from left to object (FIX_LEFT)
   newBounds.extent.x =displayExtentX - ( 160 - savedBounds.extent.x );
      // fix distance from right to object (FIX_RIGHT)
   newBounds.extent.y = displayExtentY / 160. * oldBounds.extent.y;
      // HEIGHT_BY_RATIO.  Of course we need to do this in int arithmetic
   newBounds.topLeft.y = displayExtentY - ( 160 - savedBounds.extent.y ) -
newBounds.extent.y
      // FIX_BOTTOM

I assume most of the attributes are pretty self-explanatory.  By default,
objects default to FIX_HEIGHT | FIX_WIDTH | FIX_LEFT | FIX_TOP.  We don't
allow the combinations FIX_WIDTH | FIX_LEFT | FIX_RIGHT and FIX_HEIGHT |
FIX_TOP | FIX_BOTTOM.

After this, it's a pretty easy matter to figure out which objects on each
form should resize and how, and also to set whether we want the form to try
to keep current DIA status, minimize DIA, or maximize DIA.  The code can
work for Sony/Handera/Palm.  And if we do it right, I can also plug it into
PalmBible+, too.  (This email is actually a modified version of something I
posted to the PB+ core team forum.)

Or, perhaps better, rather than setting these attributes through calls in
the source code, we create a new resource that contains a list of the form:
struct {
    UInt16 reserved0;
    UInt16 objID;
    UInt32 flags;
    UInt32 reserved1;
} objectInfoList[];

Then at program init, the code can check the initial bounds of every object
referenced in the objectInfoList and store these in an array.

Alex

--
Dr. Alexander R. Pruss
Department of Philosophy
Georgetown University
Washington, DC 20057-1133  U.S.A.
e-mail: [EMAIL PROTECTED]
online papers and home page: www.georgetown.edu/faculty/ap85
--------------------------------------------------------------------------
   "Philosophiam discimus non ut tantum sciamus, sed ut boni efficiamur."
       - Paul of Worczyn (1424)

_______________________________________________
plucker-dev mailing list
[EMAIL PROTECTED]
http://lists.rubberchicken.org/mailman/listinfo/plucker-dev

Reply via email to