I had created a HorizontalFieldManager & added BitmapFields in that.
In Blackberry Storm, Display.getWidth() is 480. In that I want to use first 450 to add some BitmapFields at LHS of screen which I m creating at runtime & add 2 BitmapFields at start at RHS of Screen.
2 BimapFields which I want to show at start r added in Constructor & other BitmapFields which I m creating at run time r added afterwords like..
class MyCanvas extends MainScreen
{
MyCanvas()
{
hfm_BitmapField = new HorizontalFieldManager(){
protected void sublayout(int maxWidth, int maxHeight) {
super.sublayout(maxWidth, maxHeight);
setExtent(Display.getWidth()-30, 60);
}
};
startBitmap = Bitmap.getBitmapResource("start.png");
startBitmapField = new BitmapField(startBitmap, BitmapField.ACTION_INVOKE | BitmapField.FIELD_HCENTER | BitmapField.FIELD_RIGHT);
hfm_BitmapField.add(startBitmapField);
endBitmap = Bitmap.getBitmapResource("end.png");
endBitmapField = new BitmapField(endBitmap, BitmapField.ACTION_INVOKE | BitmapField.FIELD_HCENTER | BitmapField.FIELD_RIGHT);
hfm_BitmapField.add(endBitmapField);
drawBitmap();
}
public void drawBitmap()
{
bitmap[i] = new Bitmap(50, 50);
Graphics g = new Graphics(bitmap[i]);
g.drawLine(5,5,25,25);
bitmapField[i] = new BitmapField(bitmap[i]);
synchronized(UiApplication.getEventLock()) { hfm.add(bitmapField[i]); }
}
I want startBitmapField & endBitmapField at RHS & bitmapField[i] which I m creating at runtime at LHS of HorizontalFieldManagers.
I m thinking to add 2 HorizontalFieldManagers. 1 for bitmapField[i] & 1 for startBitmapField & endBitmapField. But how to add 2 HorizontalFieldManagers or any other FieldManagers in a row?
Any solution? How to do it?