[lazarus] Win32 menu does not work

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Jun 24 17:14:45 EDT 2003


On Tue, 24 Jun 2003 21:52:12 +0200
"Micha Nelissen" <mdvpost at hotmail.com> wrote:

> Mattias Gaertner wrote:
> > On Tue, 24 Jun 2003 19:01:02 +0200
> > "Micha Nelissen" <mdvpost at hotmail.com> wrote:
> >
> >> Mattias Gaertner wrote:
> >>> On Tue, 24 Jun 2003 17:40:07 +0200
> >>>
> >>>
> >>> Applied.
> >>>
> >>> I have added the public property Command: integer; to TMenuItem. The
> >>> FCommand ist set just like Delphi on creation and destruction.
> >>> I replaced the FCommand in the win32 intf by Command. Please check
> >>> if this is correct. (I have to find out, how this cross compiling
> >>> works ...)
> >>
> >> I think you have deleted some by accident; you still need to apply:
> >
> > The MenuItemIdPool is unneeded, since the LCL does it like the VCL in
> > menus.pp. Every TMenuItem creates its own unique Command.
> 
> Ah ok. But then still, in win32object.inc you need something like:
> 
> @@ -2614,6 +2610,8 @@
>      fMask:=Mask;
>      fType:=Style;
>      {fState:=MFS_ENABLED;} {not needed}
> +    wID:=(Sender as TMenuItem).Command; {value may only be 16 bit wide!}
>      hSubmenu:=MenuHandle;
>      {hbmpChecked:=0;
>      hbmpUnchecked:=0;} {not needed}
> ---end patch---
> 
> If you don't assign the ID, then windows doesn't know about it and it was
> all for nothing :) !

Right you are.

Mattias






More information about the Lazarus mailing list