private void paintListItem( ListItem listItem, ListField listField, Graphics graphics, int index, int y, int width ) {
String text = listItem.toString().trim();
int type = listItem.getType();
Font font = graphics.getFont();
final int checkboxSize = font.getHeight() - 6;
final int textStart = PADDING + checkboxSize + 10;
Bitmap checkWhite = GPATools.ResizeTransparentBitmap( Bitmap.getBitmapResource( "chk-white.png" ), checkboxSize,
checkboxSize, Bitmap.FILTER_BOX, Bitmap.SCALE_TO_FILL );
Bitmap checkBlue = GPATools.ResizeTransparentBitmap( Bitmap.getBitmapResource( "chk-blue.png" ), checkboxSize,
checkboxSize, Bitmap.FILTER_BILINEAR, Bitmap.SCALE_TO_FILL );
Bitmap boxEmpty = GPATools.ResizeTransparentBitmap( Bitmap.getBitmapResource( "box-empty.png" ), checkboxSize,
checkboxSize, Bitmap.FILTER_BILINEAR, Bitmap.SCALE_TO_FILL );
switch( type ) {
case SelectAsyncFunction.POPUP_ITEM_TYPE_SEPARATOR:
graphics.setColor( Color.GRAY );
int lineY = y + listField.getRowHeight() / 3;
graphics.drawLine( PADDING, lineY, width - PADDING, lineY );
break;
case SelectAsyncFunction.POPUP_ITEM_TYPE_GROUP:
graphics.setColor( Color.GRAY );
font = font.derive( Font.BOLD );
graphics.setFont( font );
graphics.drawText( text, PADDING, y, DrawStyle.ELLIPSIS, width - PADDING ); // no fudge added to y coordinate
break;
case SelectAsyncFunction.POPUP_ITEM_TYPE_OPTION:
boolean enabled = listItem.isEnabled();