Page 1 of 1

Icon Sample Code

PostPosted: Thu Feb 21, 2008 5:16 am
by destroyers
I am new to this type of development. However, can someone please post a sample or tell me how to display an icon next to a label. I am currently using HS2_More_Icons.prc. How do I access icons in this file for use within my application? Also, how do I set the icon for the application that users can see on the palm?

Re: Icon Sample Code

PostPosted: Sat Mar 01, 2008 8:42 am
by dewey
It looks like the .prc file you mentioned is an Agendus icon database. I don't know what format they are storing the icons in, so I can't help you with that. However, drawing an image next to a text label is very simple.
1. Create a Bitmap resource (in OrbForms Designer, right-click "Bitmaps" in the project tree and select "Add ..."). In PocketC Architect, add a "bitmap" statement to your @app definition. See samples\ChessClock\ChessClockRes.ocp for a sample.
2. Add the Bitmap to a form. In OrbForms Designer, right-click in the form and select "Add Bitmap". In PocketC Architect, use the OrbC Resource language to add it to your form. Look for UIFBitmap in the "OrbC resource langauge" sections of the docs.

You set the app icon in OrbForms Designer by clicking on the "icon" node in the project tree and setting its properties. In PocketC Architect, you add an "icon" statement to you @app declaration. See any of the samples for an example.