03-20-2010 11:29 PM
In the code below can someone tell me what I have missed that is making the redline below "mainScreen"
public xxxxxxxxScreen(){
Manager bitmapScroller = new BitmapScroller();
mainScreen.add(bitmapScroller);
VerticalFieldManager manager = (VerticalFieldManager)getMainManager();
manager.setBackground(BackgroundFactory.createSoli dBackground(Color.ALICEBLUE));
add(new LabelField("XXXXXXXX",Field.FIELD_HCENTER));
03-21-2010 07:57 AM
What is mainScreen?
03-21-2010 08:08 AM
Peter,
Thanks for your reply
I want to use a large Bitmap and have the ability to scroll through the entire bitmap , as I have it now it skips the middle part of the bitmap
I have built what I think is a manager and I am trying to pull it to another screen
Here is the manager
mport net.rim.device.api.system.Bitmap; import net.rim.device.api.ui.component.BitmapField; import net.rim.device.api.ui.container.MainScreen; import net.rim.device.api.ui.container.VerticalFieldManager; public class BitmapScroller extends VerticalFieldManager{ private BitmapField bitmapField; public BitmapScroller(){ super(VERTICAL_SCROLL | HORIZONTAL_SCROLL); bitmapField = new BitmapField(Bitmap.getBitmapResource("File1-Test83 DL.png"), FOCUSABLE); add(bitmapField); } protected boolean navigationMovement(int dx, int dy, int status, int time) { if (dx > 0) setHorizontalScroll(getHorizontalScroll() + 5); if (dx < 0) setHorizontalScroll(getHorizontalScroll() - 5); if (dy > 0) setVerticalScroll(getVerticalScroll() + 5); if (dy < 0) setVerticalScroll(getVerticalScroll() - 5); return true; }
I want to have this on my "xxxxxxxxScreen"
Cheers!!
03-21-2010 08:36 AM
Does this help?
How To - Create a scrollable image field
Article Number: DB-00681
http://www.blackberry.com/knowledgecenterpublic/li
03-21-2010 04:33 PM
Thanks Peter,
That was exactly the help I needed
Now I will spend 3 or 4 days to try and get it to scroll with a button at the bottom of the screen,
Any documents you can point me at ?
Thanks again
Cheers!!!
03-21-2010 08:53 PM
MainScreen has a status area at the bottom (setStatus(..)). If you add your button in there, it will always be at the bottom of the screen.
Does that help?
03-24-2010 12:44 AM
I'm not quite sure where to add "(setStatus(..))." here is my code :
bitmapScroller = new BitmapScroller(logoBitmap);
add(bitmapScroller);
bitmapScroller.setChangeListener(this);{
}
storeButton = new ButtonField("FIND a STORE", ButtonField.CONSUME_CLICK);
storeButton.setChangeListener(this);
findButton = new ButtonField("FIND a BOTTLE", ButtonField.CONSUME_CLICK );
findButton.setChangeListener(this);
HorizontalFieldManager buttonManager = new HorizontalFieldManager(Field.FIELD_HCENTER);
buttonManager.add(storeButton);
buttonManager.add(findButton);
add(buttonManager);
}
Cheers!!!
03-24-2010 01:09 AM
instead of adding the manager (buttonManager) to the screen, set it in the status like in the following code below so that your buttons (store and find) will be displayed at the bottom of the screen always
bitmapScroller = new BitmapScroller(logoBitmap);
add(bitmapScroller);
bitmapScroller.setChangeListener(this);{
}
storeButton = new ButtonField("FIND a STORE", ButtonField.CONSUME_CLICK);
storeButton.setChangeListener(this);
findButton = new ButtonField("FIND a BOTTLE", ButtonField.CONSUME_CLICK );
findButton.setChangeListener(this);
HorizontalFieldManager buttonManager = new HorizontalFieldManager(Field.FIELD_HCENTER);
buttonManager.add(storeButton);
buttonManager.add(findButton);
add(buttonManager);
setStatus (buttonManager);
}
03-24-2010 01:34 AM
Thanks for the reply..
When I add the buttons the bitmap will not scroll completely like it will without the buttons
Thats the problem I am having
Cheers
03-24-2010 02:01 AM
"When I add the buttons the bitmap will not scroll completely like it will without the buttons"
are you not able to scroll down till to the end (ie., bottom/right) to see image?