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: 74
Registered: ‎07-17-2008
My Device: Not Specified

How to create separate rectangle areas, like in Blackberry 4.5

In the new blackberry 4.5 simulators, when creating a new task or calendar appointment, there are areas that are separated in rectangles

how do I create that kind of manager, is it something built in?

 

Here is an example. 

 Seperation example

Developer
Posts: 74
Registered: ‎07-17-2008
My Device: Not Specified

Re: How to create separate rectangle areas, like in Blackberry 4.5

Guys, any comments?

Please :-D

Highlighted
Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: How to create separate rectangle areas, like in Blackberry 4.5

[ Edited ]

 I'm not sure if there is anything specific in 4.5.0/4.6.0, so there might be a better solution then what I am about to give. I heard mention of a border factory in 4.6.0, but I do not know anything about it. In lower versions you can use:

 

a) Parent manager with colored/image backgound w/ each section being a child manager with a different background (like white). You would have to override sublayout to shift the child managers around so there is padding to display the color/image of the parent.

 

b) No parent manager, just section managers. Override paint and draw a border using drawRect or use png cutouts to draw the top/right/bottom/left borders. You would probably want to add padding again so you don't draw other fields/text over/behind the border.

 

 This thread talks about padding:

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&view=by_date_ascending&messa...

Message Edited by mreed on 08-03-2008 01:39 PM
Developer
Posts: 74
Registered: ‎07-17-2008
My Device: Not Specified

Re: How to create separate rectangle areas, like in Blackberry 4.5

Thanks mreed, I guess Ill implement it my self, as i want older devices to support this too, so i cant use decor.

 

Thanks alot! 

Developer
Posts: 74
Registered: ‎07-17-2008
My Device: Not Specified

Re: How to create separate rectangle areas, like in Blackberry 4.5

[ Edited ]

OK, Implemented my own custom manager,

But i seem to have a problem.

When i put a EditField in the manager, and the user enteres a long input, The line wraps around, but the rest of the fields arnt pushed down.

 

How do i do it so that if a fields height changes, the layout will be recalculated and the fields will be reapainted?

 

I debuged the application, and i see that when an extra line is added, sublayout is called,

but getPreferredHeight on the edit field returns the same as it did when it was one line.

Message Edited by omri on 08-15-2008 05:40 AM
Developer
Posts: 74
Registered: ‎07-17-2008
My Device: Not Specified

Re: How to create separate rectangle areas, like in Blackberry 4.5

Never mind that,

I found the solution!

 

for anyone wanting to do this in the future, the solution is to use getHight, and not getPreferredHeight