I want to create a RichTextField at the bottom half of the screen, while I paint my own custom graphics at the top half of the screen. Is that possible in BlackBerry? It tried defining a LayoutManager and trying to position the RichTextField at the bottom of the screen but the RichTextField, scroll through the entire screen. This is the code for the LayoutManager(). Is it the right way or is there any other way to do what I have mentioned above.
class LayoutManager extends Manager
{
public LayoutManager()
{
//construct a manager with vertical scrolling
super(VERTICAL_SCROLL);
}
//overwrite the nextFocus method for custom navigation
protected int nextFocus(int direction, boolean alt)
{
return super.nextFocus(direction, alt);
}
protected void sublayout(int width, int height)
{
Field field;
//get total number of fields within this manager
int numberOfFields = getFieldCount();
int x = 0;
int y = 0;
System.out.println("******** Fields: " + numberOfFields + " W/H: " + width + " / " + height );
for(int i = 0;i < numberOfFields;i++) {
field = getField(i); //get the field
x = 20;
y = 80;
System.out.println("******** X/Y: " + x + " / " + y);
setPositionChild(field, x, y); //set the position for the field
layoutChild(field, width, y); //lay out the field
}
setPosition(0, 80);
setExtent(width, 80);
}
public int getPreferredWidth()
{
return 160;
}
public int getPreferredHeight()
{
int height= 0;
int numberOfFields= getFieldCount();
for(int i= 0; i < numberOfFields; i++)
{
height += getField(i).getPreferredHeight();
}
return 160;
}
}