NS Basic/Symbian OS Enhancements June 25, 2009 © NSB Corporation. All rights reserved. |
The new functions are: SerialOpen, SerialClose, SerialSet, SerialSend, SerialRecieve and SerialReceiveWithEvents. See the Language Reference for details.
The new properties are:
Gradient Color1: The top (or left) color.
Gradient Color2: The bottom (or right) color
Gradient Style: 1 for top to bottom, 0 for left to right.
You can use a bitmap instead of a label of the same size. Since Bitmap objects can have a script (just like a Button object), BitMap object buttons work the same way as Button Object buttons - but there are more options on appearance.
Sizing images on Bitmaps: You can now specify the image to appear on a bitmap as well as its size. The new properties are:
Picture: The pathname to the image. It can be bmp, gif, jpg and other format.
Stretch: If False, the image will be the size of the orginal image, aligned at the top left. If the image if larger than the bitmap object, it will be clipped. If Stretch is True, the image will be scaled to fit the current size of the bitmap object.
Keep in mind that the maximum size of a bitmap is 65,512 bytes. The formula for calculating the size of a bitmap is (width * height) * 8.
Projects with existing bitmap objects will continue to work as before.
SetTheme(themeName) function: This new function lets you change the Theme at any time in your program. The Theme file has to be included in the Resources of the project. themeName is the name of the file, without an extension.
To edit a theme or to create a new one, start the IDE and open a project. Select the Theme Editor under the Tools menu. It will automatically open the theme for the current form for editing, but allows you to also modify other themes or create new ones.
Projects are automatically given the "Symbian" theme. Projects that are imported from NS Basic/Palm can be given the "Classic" theme if you want to retain the original look. There is no restriction on changing the theme of an existing program.
The theme you specify in Project Properties will be automatically be added as a resource to your project. If you use additional themes, you have to add them as resources. Themes are kept in c:\NSBasic_Symbian\Themes. You can put additional themes you create in that folder or elsewhere.
Note on the "Symbian" Theme: This theme is intended to be a good standard theme. We haven't come up with a final version of this. Feel free to contribute an improved version!
The maximum size of a bitmap is 64k. If you specify more than one image in a bitmap, the total of all the images cannot exceed 64k. Note that the size used of the image is as a bitmap, which can be quite a bit larger than your original image if it is a gif or jpg.
If you need to display an image larger than 64k, you need to tile it into smaller images that are within the limit and display them as separate bitmaps.