int checkMarkWidth = itemHeight;
gr.setFont(f);
for (int index=0; index < s.getItemCount(); index++) {
MenuItemState is = s.getItem(index);
String label = is.getText();
if (!label.equals("-")) { //$NON-NLS-1$
int dy = verticalPadding * 2 + itemHeight;
y += dy;
if (!is.isEnabled()) {
gr.setColor(SystemColor.textInactiveText);
} else if (index == s.getSelectedItemIndex()) {
gr.setColor(SystemColor.textHighlight);
gr.fillRect(spacing, y - dy, w - 2*spacing, dy);
gr.setColor(SystemColor.textHighlightText);
} else {
gr.setColor(SystemColor.menuText);
}
gr.drawString(label, leftMargin + spacing + checkMarkWidth,
y - verticalPadding - fm.getDescent() );
if (is.isMenu()) {
int sz = dy/4;
int base = y - dy/2 - 1;
int dx = w - spacing - rightMargin - sz - 2;
int px[] = new int[] { dx, dx + sz, dx };
int py[] = new int[] { base - sz, base, base + sz };
gr.fillPolygon(px, py, px.length);
}
if (is.isChecked()) {
int sz = dy/6;
int dx = spacing + sz + leftMargin;
int base = y - verticalPadding - fm.getDescent();
int px[] = new int[] { dx, dx - sz, dx - sz, dx,