Adding a bitmap to a button

Discuss topics that apply across the products, such as the PocketC language, or development in general

Postby johncraw on Fri Jan 12, 2007 9:45 pm

It seems every time I try to do something with bitmaps, I learn someting that I am not doing right.
I am trying to add some bitmaps to buttons on a form. The buttons are 40X20, and one of them is named btnG1.
The bitmaps are also 40X20, however I have tried various sizes.
The following code should (I think do what I need, however when I run it, nothing happens. No errors, it just does not show the bitmaps.
The code is in the mainform.oc
//**********************************************************
enum
{
G1nor = 7000,
G1sel,
};

Bitmap bitmap;

//Bitmaps for the button icons

@bitmap Bitmap bmppict1 {id = G1nor image16="G1nor.bmp"}
@bitmap Bitmap bmppict2 {id = G1sel image16="G1sel.bmp"}

handler mainForm.onopen()
{
alert("OS version = [" + osvers() + "]");
btnG1.bmpid = G1nor;

btnG1.sbmpid = G1sel;

}
//**********************************************************

The emulator version is 4.1 and the pda version is 5+. I read that for the bitmaps to work in this way the version must be 3.5 or graeter.
Any direction, help or un screwing me up would be appreciated.
Thanks in advance
John Crawford
johncraw
 
Posts: 64
Joined: Mon May 24, 2004 11:39 am
Location: Canada

Postby dewey on Sat Jan 13, 2007 12:19 am

The buttom must be declared with the graphic field set to true in order for this to work. If you are using OrbForms Designer, select the appropriate checkbox. If you are using PocketC Architect, make sure your declaration contains "graphic = true"
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Postby johncraw on Sat Jan 13, 2007 10:56 am

Dewey:
It's amazing how I looked and looked, and did not see the property. Now it works as needed. thanks.
John
johncraw
 
Posts: 64
Joined: Mon May 24, 2004 11:39 am
Location: Canada


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron