02-05-2010 05:51 AM
I would like to develop a scrollable status bar. I have managed to do that by using HorizontalFieldManagar and adding it as setStatus.
What I need is that must be two buttons such as previous and next at the two corners at bottom. Those two buttons should be fixed and when I click on Next only then it should scroll, but the position of Next and previous should not change.
Can anyone let me know how to achieve this?
Hope to get a reply soon.
Thanks & Regards
Solved! Go to Solution.
02-05-2010 07:01 AM
Can anyone let me know how to actually do this task?
Have I to calculate it on my own or is there any API available which will allow me to do it?
Any help would be appreciated.
02-05-2010 08:23 AM
You could try adding these to a HFM as you do, and use Field.FIELD_LEFT and Field.FIELD_RIGHT Styles. Field_LEFT should certainly work for the first button, then you create a spacer Field to make sure the second Button is on the right. Or you could create a new Manager which positions these for you. But if you are looking for a control that does this for your with no effort on your behalf, sorry, I am not aware of one.
02-05-2010 08:46 AM
Thanks a lot Peter for replying.
Currently I am able to add the buttons in the horizontal field manager and they are getting displaced properly and the scroll comes automatically.
I need to add 13 buttons in the status bar and I am sure it will not fit into the screen width. So, what I want to do is to have a Next button on clicking it the button after next should come before next and so on. And reverse operation for the previous button which will be on the opposite side of the next button.
Can you help me in this?
Thanks again for replying.
02-05-2010 09:43 AM
As a suggestion, instead of using a HorizontalFieldManager, you could use TableLayoutManager. Search the KB for it, there are several forum entries about it and there is even a blog about it. Very useful I think.
To use this you would decide how many buttons fitted in your scroll bar, then use the TableLayoutManager to divide up the width. Then you add each button to the TableLayoutManager, reserving the first and last for your left and right. When left and right are pushed, you replace the buttons in the inside columns appropriately.
Does that work for you?
02-08-2010 07:43 AM
Thanks Peter, it did seem to work for me.
Do you know how can I fix the position of the two arrows i.e left and right one so that they are displayed at the bottom on the corner of the screen. It means the left arrow is placed at leftmost bottom corner and right arrow is placed at rightmost bottom corner. It should display uniformly in all the handsets.
I have tried by adjusting the width but it changes the look if tested on another simulator. Can you or someone else suggest me what to do?
02-08-2010 08:03 AM
I can't remember if TableLayoutManager actually takes any notice of these, but the official way of doing this is to use Styles in the buttons, Field.FIELD_BOTTOM | Field.FIELD_LEFT for the left button for example. But whether this works or not will depend on the TableLayoutManager. If this doesn't work, then perhaps you can alter the TableLayoutManager to force this?
02-08-2010 11:55 PM
Can you be more specific as how to force TableLayoutManager to have fieds Field.Field_bottom and such variables. I tried using
BitmapField image = new BitmapField(bitmap, Field.FOCUSABLE | Field.FIELD_LEFT | Field.FIELD_BOTTOM
but this doesn't seem to work.
Am I doing something wrong? Can you tell me the correct way to implement this?
02-09-2010 01:06 AM
Thanks a lot Peter for you support.
I have been able to do what I needed with the help of GridFieldManager.
The above URL describes the use of GridFieldManager and also its source. Please have a look at it if anyone needs.