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
Developer
Posts: 264
Registered: ‎06-04-2009
My Device: Not Specified

Multi select highlighter color in List field

Hi

 

I am using a list field with multi select

I am changing the highlighter color in drawFocus.

But when i do multiple selection the color of the last selected item is highlighter color which i set other will be in default color blue. Any idea how to solve this

protected void drawFocus(Graphics g, boolean on) {
XYRect focusRect = new XYRect();
getFocusRect(focusRect);
int yOffset = 0;
if (isSelecting()) {
yOffset = focusRect.height >> 1;
focusRect.height = yOffset;
focusRect.y += yOffset;
}
g.pushRegion(focusRect.x, focusRect.y, focusRect.width,
focusRect.height, -focusRect.x, -focusRect.y);
g.setBackgroundColor(IAppConstant.HIGHLIGHTER_COLOR);
				g.setColor(0xFFFFFF);
				g.clear();
				this.paint(g);
				g.popContext();
			}

 

 

Developer
Posts: 264
Registered: ‎06-04-2009
My Device: Not Specified

Re: Multi select highlighter color in List field

any chane i need to do in the drawFocus part ??

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

Re: Multi select highlighter color in List field

[ Edited ]

For ListFields, I generally detect the currently selected row in the drawListRow method, and paint it differently in there. 

 

Just realised you are talking about multi-select, which I have not tried to do this with.  So perhaps this does not work. 

New Member
Posts: 1
Registered: ‎12-13-2010
My Device: Simulator 9550

Re: Multi select highlighter color in List field

Any update? I am also looking for solution to multi-select in the list field.