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
kiran_b
Posts: 260
Registered: ‎10-27-2010

How to get focus on only Cheboxfield icon

 

Hi,

 

    In the attached image checkbox field focus appears for both icon and data but i need focus only on icon ...

 

is it possible ?? if yes tell me how??

Please use plain text.
Developer
shahumang8
Posts: 474
Registered: ‎08-09-2010

Re: How to get focus on only Cheboxfield icon

Hi,kiran_b

 

           You create on CustomeCheckBox Class and extends those class to HorizontalField and add the BitampField and LabelField.In there BitmapField given Focusable and LabelField given unFocusable so your problem Slove.

 

 

Thanks,

 

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

 

feel free to press the kudos button  on the left side to thank the user that helped you.
please mark posts as solved if you found a solution

Please use plain text.
Developer
kiran_b
Posts: 260
Registered: ‎10-27-2010

Re: How to get focus on only Cheboxfield icon

any sample link

Please use plain text.
Developer
shahumang8
Posts: 474
Registered: ‎08-09-2010

Re: How to get focus on only Cheboxfield icon

 

	public CustomeLikesDeselectedCheckBox(String text,long l) {
		super(unfocusedBitmap, l |FOCUSABLE);
		this._text=text;
	}
	protected void paint(Graphics graphics) {
		super.paint(graphics);
		graphics.setColor(Color.WHITE);
		graphics.setFont(Const.likeFont);
		graphics.drawText(_text,40,unfocusedBitmap.getHeight()/2-(Const.likeFont.getHeight()/2));
		
	}
	protected void drawFocus(Graphics graphics, boolean on) {

	}
	protected void onFocus(int direction) {
		setBitmap(selectedfocusedBitmap);
		this.invalidate();
	}

	protected void onUnfocus() {
		setBitmap(unfocusedBitmap);
		this.invalidate();
	}
	
	public void setId(int number) {
		this.number = number;
	}

	public int getId() {
		return number;
	}
	protected boolean keyChar(char character, int status, int time) {
		if (character == Keypad.KEY_ENTER) {
			fieldChangeNotify(0);
			return true;
		}
		return super.keyChar(character, status, time);
	}

	protected boolean navigationClick(int status, int time) {
		fieldChangeNotify(0);
		return true;
	}

 Hi,kiran_b,

 

               Here i perovide some small code so u check those code and then put your program here .

 

Thanks,

 

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

 

feel free to press the kudos button  on the left side to thank the user that helped you.
please mark posts as solved if you found a solution

 

Please use plain text.