- // we need to render selected and current items differently
- if ( GetVListBoxComboPopup()->IsCurrent((size_t)item) ||
- (flags & wxODCB_PAINTING_CONTROL) )
+ // We need only to explicitly draw background for items
+ // that should have selected background. Also, call PrepareBackground
+ // always when painting the control so that clipping is done properly.
+
+ if ( (flags & wxODCB_PAINTING_SELECTED) ||
+ ((flags & wxODCB_PAINTING_CONTROL) && HasFlag(wxCB_READONLY)) )