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: 104
Registered: ‎07-08-2010
My Device: blackberry bold

how can i create equal space toolbar in blackberry?

hi all,

 i want create gui like  equal sapce for all buttons 

so how can i create equal space toolbar.

Regards
Vishal Patel
Developer
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE

Re: how can i create equal space toolbar in blackberry?

what do u mean by equal space ??? do u want to say equal size ? width? height??


available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.

Developer
Posts: 104
Registered: ‎07-08-2010
My Device: blackberry bold

Re: how can i create equal space toolbar in blackberry?

thanks for reply,

 

yes equal size   .

i mean if there is a three buttons in toolbar all are same size , same width. its text  may differen latters.

like toolbar.

Regards
Vishal Patel
Developer
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE

Re: how can i create equal space toolbar in blackberry?

u can use getpreferredwidth & height to return a constant width height, and use setextent(fixed_width, fixed_height) in layout() method of buttonfield


available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.

Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: how can i create equal space toolbar in blackberry?

The last North American Devcon provided a Equal Space Tool Bar Manager sample code.  You can find the soruce by downloading the material for Dev 19, which was on Day 2.  You can find the DevCon sessions by logging on to the Developer Zone and looking for the DevCon button.  This link might get you there too. 

 

https://www.blackberry.com/bdsc/?lang=na#devcon

Developer
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE

Re: how can i create equal space toolbar in blackberry?

like...............

 

ButtonField LogonButton = new ButtonField(mLoginButtonText,
            ButtonField.CONSUME_CLICK) {

        protected void layout(int width, int height) {
            super.layout(width, height);
            setExtent(XXX, YYY);
        };
        public int getPreferredHeight() {
            return YYY;
        };
        public int getPreferredWidth() {
            return XXX;
        };


available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.

Developer
Posts: 104
Registered: ‎07-08-2010
My Device: blackberry bold

Re: how can i create equal space toolbar in blackberry?

[ Edited ]

thanks peter for reply and give me a  nice link

Regards
Vishal Patel
Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: how can i create equal space toolbar in blackberry?

The code is well worth studying, the guy(s) that created understand the Ui and how to get the best from it. 

 

Same guy as helped with this, did these:

http://supportforums.blackberry.com/t5/Java-Development/Implement-advanced-buttons-fields-and-manage...

 

Personally I have found the code form the DevCon better.

 

If this works for you, can you mark this as solved?