11-30-2008 02:18 PM
oops, sorry for mistake.
This method is available for Screen class.
Take your attention on paint() and drawFocus() methods.
Probably drawFocus() knows about one-line button. Tell to this method that button now is multi-lined.
Also I would recommend you to avoid use of fixed numbers in
public int getPreferredHeight()
It is better to calculate the height via Font class and getHeight() method of this class.
Otherwise if a user changes Font size via Options-Keyboard your application will show wrong picture.
11-30-2008 02:23 PM
Yeah your right...
I have to change many many things in my app depending on enviroment values. But for this "beta-Version" i think dealing with fixed values is okay....
Any idea, how to override the "onClick-draw-style" of a button... ?
have tried a little workarround using a boolean flag, paint and navigationClick-method, but it seems,
that the default "buttons-currently-clicked-style" is dominating....
dognose
11-30-2008 02:35 PM
Have you overridden the following method:
protected void drawFocus(Graphics graphics, boolean on)
it invokes when the the field gains focus, i.e you click on it.
11-30-2008 02:53 PM - last edited on 11-30-2008 02:55 PM
i override that one, thought is represents the "selected" style....
and in my case, the button changes style fine, if i "select" it.
but if i "click" on it, it falls back do the "default Button-Is-Currently-Clicked" Style...
here some pics of what i'm trying to say:
status downwards:
button default
button selected
button currently clicked

cheers,
dognose
11-30-2008 03:27 PM
I understand.
In this case try to avoid inheritance from ButtonField and extend Field class directly.
11-30-2008 04:12 PM
sounds logical.... okay, i change my code.
For thos who are interessted in this solution too:
if you want to use a field as a button, you have to implement the layout() method to your class
extending field.
navigationClick() method should notify your Changelistener and return true.
cheers,
dognose