09-02-2010 09:41 AM
Is there a way to change the color of the TextSpinBoxField from the default blue? I have tried setBackground, but it seems to have no effect.
I have also tried overriding the paint method in a custom class based on the TextSpinBoxField, but oddly, the graphics object provided only gives access to the spinning portion of the field. The left and right margins are not included.
09-02-2010 12:22 PM
setBackground is final in Field, so it cannot be overridden.
Here is what I tried earlier, just as a test - it seemed to have no effect:
09-02-2010 12:23 PM
The margins are never included in the Graphics object (nor Field's extent). A Field can never paint anything on its margins - they are there for the parent manager to decide how to position the Field properly. Don't forget that margins of different Fields may (and, in native BlackBerry gadgets, do) actually overlap.
It is the same way on the Web - your background color or image stretches all the way to the outer border boundary but not to the margins.
09-02-2010 12:35 PM
"Margins" was a poor choice of words. The TextSpinBoxField displays what looks like a button with the selected text displayed on it. The other visible rows are displayed in a rectangle that extends above and below the button. Normally this rectangle appears to be behind the button, and the button is wider than the rectangle. When I override paint, it only gives access to the rectangle - the wider parts of the button are unaffected, and the button then appears to be behind the rectangle.
02-05-2011 02:23 AM
try this in spinboxfield drawfocus method
protected void drawFocus(Graphics g, boolean on)
XYRect rect = new XYRect();
drawHighlightRegion(g, HIGHLIGHT_FOCUS, false, rect.x, rect.y, rect.width, rect.height);
01-30-2012 02:20 AM