Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Regular Contributor
Posts: 88
Registered: ‎04-09-2010
My Device: 9530
My Carrier: Software Developer

How to increase the space between the fields in VerticalFieldManager

hi all

 

i am having problem in increasing the space between the fields  in VerticalFieldManager. i am placing three custom button field in a verticalfieldManager, but when i am running the application there is no space between the fields.

if i am increasing the preferredHeight() of the Custom button Fields its working fine but the problem is, the focus area also increases. i don't want that blue colored focus area.

help me out pleaseSmiley Sad

 

Here is my code for customButtonField:-

 

 public CustomSmallButton(Bitmap onFocous,Bitmap offFocous,long style )
{
super(style);
onPicture=onFocous;
offPicture=offFocous;
}



public int getPreferredHeight()
{
return onPicture.getHeight();
}
public int getPreferredWidth()
{
return onPicture.getWidth();
}
protected void layout(int width , int height)
{

setExtent(Math.min(width, getPreferredWidth()), Math.min(height,getPreferredHeight()));

}
protected void paint(Graphics graphics)
{

if (isFocus())
{
graphics.setColor(Color.BLACK);
graphics.drawBitmap(0, 0, getWidth(), getHeight(),onPicture , 0, 0);

}
else
{
graphics.drawBitmap(0, 0, getWidth(), getHeight(),offPicture , 0, 0);
}
}

public boolean isFocusable()
{
return true;
}
protected void drawFocous(Graphics graphics, boolean on)
{

}
protected void onFocus(int direction)
{
super.onFocus(direction);
invalidate();
}

protected void onUnfocus()
{
super.onUnfocus();
invalidate();
}
protected boolean navigationClick(int status, int time)
{
fieldChangeNotify(0);
return true;
}
protected boolean keyChar(char character, int status, int time)
{
if (character == Keypad.KEY_ENTER)
{
fieldChangeNotify(0);
return true;
}
return super.keyChar(character, status, time);
}
}

Developer
Posts: 16,838
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to increase the space between the fields in VerticalFieldManager

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800508/...

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 723
Registered: ‎03-12-2009
My Device: Playbook

Re: How to increase the space between the fields in VerticalFieldManager

[ Edited ]

Outside of creating a custom manager... set the top margins of the fields to the desired distance between fields.

 

i.e. setMargin(5,0,0,0)

 

These "used" to be hidden, but they are actually present on all devices, component packs (not all JDE's have em shown though) and they do work.

Highlighted
Regular Contributor
Posts: 88
Registered: ‎04-09-2010
My Device: 9530
My Carrier: Software Developer

Re: How to increase the space between the fields in VerticalFieldManager

I dint get you , can i have a sample code please