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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
wpbbmg
Posts: 83
Registered: ‎02-19-2010
My Carrier: Vodafone
Accepted Solution

Fields behind the HFM above

[ Edited ]

Hello,

 

know I had managed that the 1st HFM is everytime on top of the screen I have another problem! When I add a Field to the 2nd HFM and I start this app I dont see this field, because it is behind the 1st HFM and I have to scroll above to see this. Can anyone help me?

 

Here is my code:

 

 

VerticalFieldManager fieldManagerAll = new VerticalFieldManager(USE_ALL_HEIGHT | USE_ALL_WIDTH | NO_VERTICAL_SCROLL){			
			protected void subpaint(Graphics graphics){
				int height = Display.getHeight();
				int width = Display.getWidth();
				
				super.sublayout(width, height);
			}
		};

//		VerticalFieldManager contains title
VerticalFieldManager fieldManagerTop = new VerticalFieldManager(Field.USE_ALL_WIDTH | NO_VERTICAL_SCROLL){
					
			protected void subpaint(Graphics graphics){
				int height = Display.getHeight() / 8;
				int width = Display.getWidth();
				
				super.sublayout(width, height);
			}
		};
		
VerticalFieldManager fieldManagerMiddle = new VerticalFieldManager(USE_ALL_WIDTH | VERTICAL_SCROLL){
			
			protected void subpaint(Graphics graphics){
				int height = (Display.getHeight() / 8) * 5;
				int width = Display.getWidth();
				
				super.sublayout(width, height);
			}
		};
		
//		all fields for title
		
//		all fields for the middle
HorizontalFieldManager middleTop = new HorizontalFieldManager(){
			
  protected void subpaint(Graphics graphics){
	int height = (Display.getHeight());//) / 12) * 5;
	int width = Display.getWidth();
				
	super.sublayout(width, height);
			}
};
		
HorizontalFieldManager middleTopLeft = new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER){			
	protected void subpaint(Graphics graphics){
		int height = (Display.getHeight() / 12) * 5;
		int width = Display.getWidth() / 2;
		super.sublayout(width, height);
		}
};
		
	
Bitmap symbol = Bitmap.getBitmapResource("ressources/100000.png");
BitmapField symbolField = new BitmapField(symbol, Field.FOCUSABLE);
middleTopLeft.add(symbolField);
		
VerticalFieldManager middleTopRight = new VerticalFieldManager(){
	protected void subpaint(Graphics graphics){
		int height = (Display.getHeight() / 12) * 5;
		int width = Display.getWidth() / 2;
				
		super.sublayout(width, height);
		}
};
		
		middleTop.add(middleTopLeft);
		middleTop.add(middleTopRight);
		
		fieldManagerMiddle.add(middleTop);

		fieldManagerAll.add(fieldManagerTop);
		fieldManagerAll.add(fieldManagerMiddle);
		
		add(fieldManagerAll);

 The added Bitmap isn't schown on the screen, I have to scroll!

 

Best regards

Maja

 

Please use plain text.
Developer
wpbbmg
Posts: 83
Registered: ‎02-19-2010
My Carrier: Vodafone

Re: Fields behind the HFM above

nobody understand what I mean?

Please use plain text.
Developer
hades_6
Posts: 178
Registered: ‎08-26-2009

Re: Fields behind the HFM above

wow ur code is very messy,

 

Refer this, it might help.

 

http://devsushi.com/2007/12/02/blackberry-jde-api-user-interface-field-reference/#separatorfield

 

If you can tell me what sort of layout you are trying to achieve, maybe I can help you out. Draw it out in photoshop or paint or something

Please use plain text.
Developer
wpbbmg
Posts: 83
Registered: ‎02-19-2010
My Carrier: Vodafone

Re: Fields behind the HFM above

ok I would try :smileyhappy:

 

    --------------------------------------------------------------------------

    |                                                                                                 |

    |                              title                                                             |

    |                                                                                                 |

    --------------------------------------------------------------------------

    |                                                                                                 |

    |                                                                                                 |

    |                                                                                                 |

    |                           main screen                                               |

    |                                                                                                 |

    |                                                                                                 |

    |                                                                                                 |

    |                                                                                                 |

    --------------------------------------------------------------------------

    |                                                                                                 |

    |                            status                                                         |

    |                                                                                                 |

    --------------------------------------------------------------------------

 

So this is what I have. The title is without setTitle(), see this thread

 

And know I have the following problem:

 

The first fields I want to add to the main screen will not be shown. I have to scroll up! Because the fields are behind the title! Know I want, that the fields are shown directly!

 

was this understandable?

 

Please use plain text.
Developer
wpbbmg
Posts: 83
Registered: ‎02-19-2010
My Carrier: Vodafone

Re: Fields behind the HFM above

ok I solved the problem! When I don't set width and height it work! :smileyhappy:

Please use plain text.