BlackBerry Bitmap listener -
i have code similar 1 below, painting on mapfields micon several times. how can add click listener bitmap ? using bb 5.0
public bitmap micon; micon = bitmap.getbitmapresource("pcture1.png"); protected void paint(graphics g) { super.paint(g); mdest = new xyrect(....); g.drawbitmap(mdest, micon, 0, 0); }
override bitmapfield , modify isfocusable(), navigationclick(), keychar(), , trackwheelclick() methods.
public class imagebuttonfield extends bitmapfield { public imagebuttonfield(bitmap image) { super(image); } public boolean isfocusable() { return true; } protected boolean navigationclick(int status, int time) { fieldchangenotify(0); return true; } protected boolean trackwheelclick(int status, int time) { fieldchangenotify(0); return true; } protected boolean keychar(char character, int status, int time) { if(characters.enter == character || characters.space == character) { fieldchangenotify(0); return true; } return super.keychar(character, status, time); } }
Comments
Post a Comment