Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Blackberry screen works in the following way.</p> <ol> <li>The delegate manager of a screen lays out itself.</li> <li>The delegate manager asks the other fields and managers to lay out.</li> <li>The managers added to the delegate manager lays out itself and asks its child fields or managers to layout.</li> <li>This process continues until all the fields are laid out.</li> </ol> <p>You want to layout a button field which is part of a manager. Based on the rules above, you have to override the layout method of the button field only. As alishaik786 said, you dont have to layout the manager or anything else other than the <code>buttonField</code>.</p> <p>A simple example of a custom button field is given here at <a href="http://www.coderholic.com/blackberry-custom-button-field/" rel="nofollow">http://www.coderholic.com/blackberry-custom-button-field/</a></p> <p>If you look at the code you can see the following overrided methods which are necessary for laying out the field itself</p> <pre><code>public int getPreferredWidth() { return fieldWidth; } public int getPreferredHeight() { return fieldHeight; } protected void layout(int arg0, int arg1) { setExtent(getPreferredWidth(), getPreferredHeight()); } </code></pre> <p>Once you have set the <code>fieldWidth</code> and <code>fieldHeight</code> in the constructor, you can return those values for <code>getPreferredWidth()</code> and <code>getPreferredHeight()</code> respectively.</p> <p>the <code>layout()</code> of the field is called, when the field is being laid out which will set the extent of the field to <code>fieldWidth</code> and <code>fieldHeight</code></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload