RRUZ / vcl-styles-utils

Extend and improve the Delphi VCL Styles
https://theroadtodelphi.wordpress.com/
329 stars 115 forks source link

Messed up menus, when there are too many items to fit the sceen and scrolling is enabled #284

Open Daniel-Tr opened 3 years ago

Daniel-Tr commented 3 years ago

With #217, the message to react on has been changed to MN_BUTTONDOWN_UP. This message seems not to be triggered at all, nor is it documented anywhere else other than with the VCL.Style.Utils. Please add according documentation and/or consider to use the buttondown event again, which seems to fix this problem.

In regard to #217, consider to simply call the inherited/default proc, just as the VCL would do, instead of simulating keyboard events. See lines 1660 to 1671: Vcl.Styles.Utils.Menus:

  Message2.Msg := MN_SELECTITEM;
  Message2.wParam := FKeyIndex;
  Message2.lParam := 0;
  Message2.Result := 0;
  CallDefaultProc(Message2);

  Message2.Msg := WM_KEYDOWN;
  Message2.wParam := VK_RETURN;
  CallDefaultProc(Message2);

  Message2.Msg := WM_KEYUP;
  CallDefaultProc(Message2);

Vcl.SysStyles:

  SetRedraw(False);
  Message.Result := CallDefaultProc(Message);
  SetRedraw(True);