[lazarus] Win32 menu does not work

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


On Tue, 24 Jun 2003 17:49:15 +0200 (W. Europe Daylight Time)
Michael Van Canneyt <michael.vancanneyt at wisa.be> wrote:

> 
> 
> On Tue, 24 Jun 2003, Mattias Gaertner wrote:
> 
> > On Tue, 24 Jun 2003 17:16:40 +0200
> > "Micha Nelissen" <mdvpost at hotmail.com> 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.
> > > >
> > >
> > > Okay, the patch is ready and attached. Half of the first item of the
> > > TODO can be stripped now (implement menu item ids). It worked with a
> > > simple menu structure, but we need to test it with lots of menu items
> > > 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.
> > >
> > > It assumes the FCommand field of TMenuItem has been moved to the
> > > public section. (See my previous mail). Maybe there is a cleaner
> > > solution for this.
> >
> > Eh, I don't know why FCommand is still in the LCL. Probably as we
> > started, we didn't know, if it is needed for Delphi compatibility. But
> > this is not the case. The FCommand is a win32 specific thing to identify
> > handles. So, it should not be stored in the LCL, but in the win32
> > interface. A Handle must be enough to identify any interface component.
> > Maybe the win32 api identifies it otherwise. If this is the case, then
> > the win32 interface should map the handles.
> >
> > I will have a look ...
> 
> Win32 has a handle per menu item, but the *command* associated with the
> menu can be shared between menu items, so this needs to be stored with the
> menu item. 

Ah, I see. I will add the Command functions.


> The alternative is to create a separate mapping menu-item->command,
> and look up the the menu item from the command, but this requires an
> extra list handling, in addition to the TBits array.


Mattias






More information about the Lazarus mailing list