Another D7 and TMainMenu Problem

Hi all

I'm running D7 Ent with WinXP switched to classic theme !

I have encountered another problem when attaching a TMainMenu to a form in

The first issue was already mentioned because accidently Top-Level Menus are
as ownerdraw if there's an imagelist attached to the menu component .

Menus.pas Line 844:

      IsOwnerDraw := Assigned(ParentMenu) and
                     (ParentMenu.OwnerDraw or (GetImageList <> nil)) or
                     Assigned(FBitmap) and not FBitmap.Empty;

ParentMenu.OwnerDraw or (GetImageList <> nil) is always true if an imagelist
is assigned to the parent menu-component
so all items (even the top-level items) get marked as ownerdrawn !! I think
this is a VCL bug.

I solved this by manually setting the top-level menuitems not
to be ownerdrawn before the menuiten is drawn first time.

The second issue is driving me crazy ...

The problem is if an imagelist is assigned to a mainmenu's items (not top
level) the the background (the transparent area of the bitmap) of these
images is drawn with clMenuHighlight
while it should be drawn with clHighlight if the classic theme is enabled.
this looks very fancy.

Menus.pas Line 1082:

      if WinXP then
        if (odSelected in State) or (odHotLight in State) then
          Brush.Color := clMenuHighlight;  <<< should be clHighlight if
classic theme is enabled !!
          Font.Color := clHighlightText;      <<< should be if classic theme
is enabled !!
        else if TopLevel then
          Brush.Color := clMenuBar

(See the screenshot in attachments newsgroup as an example)