Note that there are some explanatory texts on larger screens.

plurals
  1. POSet height of a ButtonField
    primarykey
    data
    text
    <p>I need to change the size of a ButtonField. It is inside a VerticalFieldManager which is the only VFM in the MainPage.</p> <p>I have already changed its width successfully (overriding setPreferredWidth() was enough). However I'm having trouble with changing its height. </p> <p>Until now, I overrode setPreferredHeight() and it did not do anything. I've tried overriding layout like this (tried all permutations of commented rows):</p> <pre><code>protected void layout(int arg0, int arg1) { //super.layout(myDesiredWidth, myDesiredHeight); //setExtent(myDesiredWidth, myDesiredHeight); } </code></pre> <p>I have also tried overriding sublayout of its manager (the vfm) like this:</p> <pre><code>protected void sublayout(int arg0, int arg1) { super.sublayout(arg0, arg1); ButtonField myButton = (ButtonField)getField(1); layoutChild(myButton,myDesiredWidth,myDesiredHeight); } </code></pre> <p>It didn't work. I am still not sure how those layout and sublayout methods work in the background but I'm sure that someone needed to alter the size of a button before me.</p> <p>Edit: I'll be more specific. I was using BB JRE 6.0 and overriding getPreferredHeight() and layout() was buggy (changing height would alter width tremendously, other fields around my button would lose their text etc.). I tried BB JRE 5.0 and increasing the height worked but decreasing didn't work. Whatever, I googled a lot and I couldn't find a clear answer, I guess I have to create my own custom Field and implement paint method from scratch. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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