On Wed, Dec 19, 2001 at 07:13:36PM -0500, Laurie Davis wrote:
> The usual way to provide graphical buttons that work on OS versions
> prior to 3.5 is to overlay a bitmap with a button (without a label).
> This works fine on black and white devices, but the button does not
> highlight in the right colors on color devices.
It's not a coincidence that all colour devices run 3.5 or later. You
might almost think that graphical buttons were introduced so that it
would be possible to do good highlighting on colour devices. :-)
> The solution I have come up with is as follows. Start with the bitmap
> and a regular button overlay. On top of this overlay a graphical
> button with the bitmap set to the same bitmap. Set the usable bit for
> the graphical bitmap to false. In the frmOpenEvent of the form do a
> simple check of the OS version, and if it is version 3.5 or later,
> show the graphical button. This solution works on OS versions prior to
> 3.5 (the graphical button is hidden) and supports full graphical
> buttons on OS version 3.5 and later (the graphic button is shown).
So what you're saying is:
- when graphical buttons exist, use them
- otherwise fall back to the bitmap/text button overlay trick
and therefore colour devices will be happy because they're always using
graphical buttons. Yeah, fair enough. :-)
> case frmOpenEvent:
> if (RomVersion >= rom35Version)
> FrmShowObject(frmPtr, FrmGetObjectIndex(frmPtr, GraphicButton));
You might also want to FrmHideObject the bitmap and ordinary button.
The order of "on topness" changed between 3.5 and 4.0, and I would be
concerned that on a 4.0 device a tap might get the wrong button if
they're both enabled in the same place.
Personally, I can never remember which way "on topness" is supposed to
be on Palm OS and just think of it as unpredicable and ensure that if
my form objects overlap only one of them is active (i.e. responds to
tapping).
John
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/