10-01-2008, 11:35 AM
|
#1 (permalink)
|
| New Member
Join Date: Oct 2007 Model: 8100 PIN: N/A Carrier: Orange
Posts: 2
Post Thanks: 0 Thanked 0 Times in 0 Posts
| Customised VerticalFieldManagers with padding Please Login to Remove! I’m trying to create a UI similar to the new 9000 style UI (example image at "img29.picoodle.com/data/img29/3/9/24/f_tasksm_efdfd59.png").
I am using a customised VerticalFieldManager for the outer grey area and a second customised VerticalFieldManager for the inner white boxes. I am using the new BorderFactory class to try and imitate the rounded corners. In order to create the padding between the edge of the screen and the inner boxes I am overriding the sublayout method on the outer VerticalFieldManager.
This code produces the result shown at "img37.picoodle.com/data/img37/3/9/24/f_bank1m_f206f89.png" with the bottom border visible
protected void sublayout(int iWidth, int iHeight)
{
super.sublayout(iWidth, iHeight);
setExtent(iWidth, iHeight);
}
However, in order to add the padding I need to position the inner VerticalFieldManagers myself. The code below shows what I think should be happening (without the extra padding), but it doesn’t give me the expected result – i.e. the bottom border is not visible (see image at "img26.picoodle.com/data/img26/3/9/24/f_bank2m_f4988d7.png").
protected void sublayout(int iWidth, int iHeight)
{
int iNumFields = getFieldCount();
int iYPos = 0;
for (int i = 0; i < iNumFields; i++)
{
Field fField = this.getField(i);
setPositionChild(fField, 0, iYPos);
layoutChild(fField, iWidth, iHeight);
iYPos = iYPos + fField.getHeight();
}
setExtent(iWidth, iHeight);
}
I have exhausted the forums and Googled this issue to death. Any ideas what I am doing wrong here? |
| Offline
| |