[lazarus] Win32 menu does not work

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Jun 24 12:43:59 EDT 2003


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
> > "Micha Nelissen" <mdvpost at hotmail.com> wrote:
> >
> >> Micha Nelissen wrote:
> >>> Mattias Gaertner wrote:
> >>>> On Tue, 24 Jun 2003 11:53:25 +0200
> >>>> "Micha Nelissen" <mdvpost at hotmail.com> wrote:
> >>>>
> >>>>>> TBits is implemented, so you can try it.
> >>>>
> >>>> Please do so.
> >>>>
> >>>
> >>> to see if the TBits are functioning well. We can also try checking
> >>> whether disabling/enabling checking/unchecking works as expected,
> >>> ie. not call the handler when disabled.
> >>
> >> And another patch to fix the check/enable issue. Like the other
> >> patch: apply in lcl/interfaces/win32.
> >
> > 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.


Mattias



> 
> @@ -537,6 +534,7 @@
>            Begin
>              DeleteMenu((Sender as TMenuItem).Parent.Handle, Handle,
> MF_BYCOMMAND);
>              { release menu item id }
> +            MenuItemIdPool.Bits[(Sender as TMenuItem).Command] := False;
>              DrawMenuBar(((Sender as TMenuItem).Owner as
> TWinControl).Handle);
>            End
>            Else
> @@ -2614,6 +2610,8 @@
>      fMask:=Mask;
>      fType:=Style;
>      {fState:=MFS_ENABLED;} {not needed}
> +    wID:=UniqueMenuItemId; {value may only be 16 bit wide!}
> +    (Sender as TMenuItem).Command := wID;
>      hSubmenu:=MenuHandle;
>      {hbmpChecked:=0;
>      hbmpUnchecked:=0;} {not needed}
> ---end patch---
> 
> Regards,
> 
> Micha.
> 
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>    archives at http://www.lazarus.freepascal.org/mailarchives


-- 






More information about the Lazarus mailing list