Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 115
Registered: ‎10-04-2008
My Device: Not Specified
Accepted Solution

Scrollable Status Bar?

Hi,

 

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

Sunil

Regards
Sunil
Developer
Posts: 115
Registered: ‎10-04-2008
My Device: Not Specified

Re: Scrollable Status Bar?

Hi Everybody,

 

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.

 

 

Regards
Sunil
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Scrollable Status Bar?

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. 

Developer
Posts: 115
Registered: ‎10-04-2008
My Device: Not Specified

Re: Scrollable Status Bar?

Hi,

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.

Regards
Sunil
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Scrollable Status Bar?

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?

Developer
Posts: 115
Registered: ‎10-04-2008
My Device: Not Specified

Re: Scrollable Status Bar?

Hi,

 

Thanks for your suggestion.

 

Will definitely try that out and get back to you.

 

 

 

Regards
Sunil
Developer
Posts: 115
Registered: ‎10-04-2008
My Device: Not Specified

Re: Scrollable Status Bar?

Hi,

 

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?

 

 

 

Regards
Sunil
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Scrollable Status Bar?

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?

Developer
Posts: 115
Registered: ‎10-04-2008
My Device: Not Specified

Re: Scrollable Status Bar?

Hi,

 

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?

 

 

Regards
Sunil
Developer
Posts: 115
Registered: ‎10-04-2008
My Device: Not Specified

Re: Scrollable Status Bar?

Hi,

 

Thanks a lot Peter for you support.

 

I have been able to do what I needed with the help of GridFieldManager.

 

http://www.thinkingblackberry.com/archives/116

 

The above URL describes the use of GridFieldManager and also its source. Please have a look at it if anyone needs.

 

Thanks anyways.

 

 

 

Regards
Sunil