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
Highlighted
Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer
Accepted Solution

HorizontalFieldManager focus/unfocus problem

I am doing this on a HorizontalFieldManager to get focus and unfocus color and its working fine.But my doubt is that even if i make my hfm style as NON_FOCUSABLE,it still shows the focus unfocus color which shudnt be the case.Kindly help

 

protected void paintBackground(Graphics g) {
		if (isFocus()) {
			int[] drawColors = { 0x1a66b4, 0x1a66b4, 0x1a66b4, 0x1a66b4, 0x1a66b4, 0x1a66b4, 0x4b80b7, 0x4b80b7, 0x4b80b7, 0x4b80b7, 0x4b80b7, 0x4b80b7 };
			g = Gradient.draw(g, mHeight, mWidth, drawColors);
		} else {
			int[] drawColors = { color, color, color,color,color,color,color,color,color,color,color,color};
			g = Gradient.draw(g, mHeight, mWidth, drawColors);
		}
	}
	
	protected void drawFocus(Graphics graphics, boolean on) {
	}

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

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: HorizontalFieldManager focus/unfocus problem

HFM like other Managers are not focusable themselves.  It is the contained Fields that are focusable.  Does your Manager contain focusable Fields?

Developer
Posts: 436
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Re: HorizontalFieldManager focus/unfocus problem

hey i solved it

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

Re: HorizontalFieldManager focus/unfocus problem

please mark the thread as solved, then
----------------------------------------------------------
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