You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the styles USE_ALL_HEIGHT and/or USE_ALL_WIDTH are set, getPreferredHeight and/or getPreferredWidth return Integer.MAX_VALUE. I believe this to be incorrect since the meaning of USE_ALL_HEIGHT and USE_ALL_WIDTH is that the field should use all the height/width given to it by its manager. Furthermore, the use of the styles should be taken into account by the ManagerDelegate.sublayout and FieldDelegate.layout methods.
The text was updated successfully, but these errors were encountered:
It appears that this behavior may have been introduced to workaround a bug in the buttonfield class. However, I believe a better workaround for this would be to override the buttonfield getPreferredWidth as follows:
public int getPreferredWidth() {
if (isStyle(USE_ALL_WIDTH)) { // workaround for buttonfield bug
return Integer.MAX_VALUE;
} else {
return FieldDelegate.getPreferredWidth(this);
}
}
My first thought here is that fields not added to a manager still have to return a preferred width/height which is Integer.MAX_VALUE in the case of USE_ALL_WIDTH / USE_ALL_HEIGHT in the default BlackBerry API. Still, i'll doublecheck this.
When the styles USE_ALL_HEIGHT and/or USE_ALL_WIDTH are set, getPreferredHeight and/or getPreferredWidth return Integer.MAX_VALUE. I believe this to be incorrect since the meaning of USE_ALL_HEIGHT and USE_ALL_WIDTH is that the field should use all the height/width given to it by its manager. Furthermore, the use of the styles should be taken into account by the ManagerDelegate.sublayout and FieldDelegate.layout methods.
The text was updated successfully, but these errors were encountered: