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

Controlling the width of a Manager

I find I am a little muddy on how some elements of the API work together.  For example, are the getPreferredWidth() & getPreferredHeight() merely "getters" which are primarly used to encapsulate any required calculations to make any setExtent() call in layout() cleaner???

 

Also, what exactly is the difference between layout() and sublayout() ?  Is it that the sublayout() is used to layout contained fields, where layout() is used to layout the container?

 

Now, I notice that layout() is final in Manager, and thus cannot be overriden.  So, if I want to fix the width of a HFM, I cannot override that method and setExtent( MAX_WIDTH, height).

 

Given that, can I fix the width of a HFM?  How?

 

I've tried just returning the MAX_WIDTH in getPreferredWidth(), but this does not have the desired effect.  So, I'm guessing that layout() does not call it and use the width I set.  When (if at all) does the framework call/use getPrefferedWidth()??

 

Patrick

 

BlackBerry Development Advisor
Posts: 15,062
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: Controlling the width of a Manager

Please see the following thread.

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=13866&view=by_date...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 143
Registered: ‎07-14-2008
My Device: Not Specified

Re: Controlling the width of a Manager

Unfortunately, that thread, nor any of the API docs answer my question, which is why I have posed it here.

 

I'd really like to have a clearer understanding of the framework, and so have asked the above.