[lazarus] Win32 menu does not work

Micha Nelissen mdvpost at hotmail.com
Tue Jun 24 15:26:16 EDT 2003


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 :) !

Regards,

Micha.






More information about the Lazarus mailing list