Answer: Cross Platform Forms design with HanDBase Forms
As you probably know, cross-platform development is always a challenge,
even sometimes when using something like HTML or Java, designed just
for this very purpose. With the HanDBase forms, this is no exception,
though we tried to make the cross-platform experience as smooth as possible.
There are several differences that are covered in this article,
Screen Resolution and Features and attributes differences between platforms.
Screen Resolution
As you may already know, the resolution of a screen varies with the target platform you are working with. So designing a form that works on different resolution displays can be challenging.
For this reason the Forms installed on a Pocket PC and the desktop are actually scaled to what we felt best matched the per-pixel size of the Palm. The Palm's screen is 160x160, as most know, and thus one would think that 160x160 on a Palm is equal to a 160x160 window on the desktop or Pocket PC. The truth is that it is not even close. On the Palm, the fonts and controls are such that you can fit far more text and controls in a 160x160 screen than you ever could on the desktop or Pocket PC. In fact, when we designed the Pocket PC version of HanDBase, we had trouble making the same setup screens that we had in HanDBase for Palm OS fit in the 320x240 screen. The text and controls are just a bit
bigger and the extra resolution generally means better quality text, rather than
the ability to fit more on the screen.
In any case, we did some calculations and test forms on all three platforms to come up with what we call a size-factor for each platform. Palm is the base size factor as it has the lowest resolution, and it has a factor of 1. Thus a control that is 10x10 is truly 10 pixels by 10 pixels. On the desktop, a size-factor of 2 is used- that is a 160x160 form is actually using 320 pixels by 320
pixels of space on the desktop. You'll notice that the form looks generally just like the Palm, as we are scaling by a factor of two, and for the most
part the same amounts of data can be seen on both Palm and Desktop.
The Pocket PC uses a size-factor of 1.5. This means that a 160x160 form takes up 240x240 on the Pocket PC. Now that would imply that we are leaving 320 - 240 = 80 pixels of unused space when scaling this way, but in fact that's not the case. The reason for this is that the Pocket PC has a fixed 'Start bar' at the top that uses about 20 pixels, and the command/menu bar at the bottom that uses about the same. So roughly, the usable space on a Pocket PC's screen is
280x240, and so there is 40 pixels of height unused in HanDBase when showing a
form that is 160x160.
With the Forms Desktop component you can create a form to be nearly any resolution, but please note that currently whatever you enter there is actually going to be scaled by the size-factor of the device it's running on. On the desktop PC, for example, if your PC supports 800x600, and you'd like to design a full screen form, you would want to create it at 400x300.
On the Pocket PC, in order to create a full screen form that does not waste space, you'd want to create the form as 160 wide by 186 height, and you should be able to make the best use of your screen.
Remember that you can easily create a different set of forms for each platform if there is some benefit to doing so for your application. To do so you just choose the main start form that you want for whichever platform and check the 'Start Form' for that platform. So it's quite easy to have a full screen desktop form, and have the handheld forms broken up into several different forms that link to one another to show the complete set of data on the large desktop form.
Features and attributes differences between platforms
Each platform has its own attributes that can be assigned to a control as well. For example, all platforms all have a way to set the size of a button, or the width of a text entry box. But as with everything there is no standard in this regard. When designing the HanDBase Forms we tried to capture the attributes that were most common between different platforms and let those be set. However, there were a few that seemed extremely important to have that were not supported on one platform. This section discusses those attributes that are not supported across all platforms:
Control Type: Text Entry
Color
On the Palm OS, there is no way to set a text field's color individually using current existing APIs. For this reason, the Color attribute for a text field is ignored when running a Form on the Palm OS, and a black on white text field is always shown.
Auto-Shift
On the Palm OS there is built in support to automatically shift the first character of a blank field. This option is unique to the Palm OS platform, and thus this setting has no effect on the desktop or Pocket PC.
Control Type: Button
Frame
At this time, the frame option currently only effects forms on the Palm OS. The other operating systems do not offer this option.
Type
At this time, the Type option currently only effects forms on the Palm OS. The other operating systems do not offer this option currently.
As with all of these options, we may be able to override the default controls add try to emulate the consistent behavior on all platforms. This is something we're investigating for future versions.
As you can see, we've taken great pains to try to make developing cross-platform forms as consistent as possible, but there are some key differences. We hope this document makes these clear for HanDBase Forms developers! |