[Gambas-user] Menu events in 1.9.34 (attachment)
Allen Murphy
msumurph at ...626...
Tue Jul 25 03:05:11 CEST 2006
Thanks for the correction, Benoit. I applied the changes that you
recommended (in CControl.class I changed lines 285 and 311 to read
'Object.Attach(..., "MenuControl")') and fixed the sub in FForm.class
(line 1464 'PUBLIC SUB MenuControl_Click()'). This seems to be working.
Take care,
Allen
On Tue, 2006-07-25 at 02:48 +0200, Benoit Minisini wrote:
> On Tuesday 25 July 2006 02:33, Allen Murphy wrote:
> > Sorry, forgot to attach the patch.
> >
> > On Mon, 2006-07-24 at 20:29 -0400, Allen Murphy wrote:
> > > I did some snooping around and found the offending commented code.
> > >
> > > In file FForm.class located in ../gambas2-1.9.34/app/src/gambas2, I
> > > un-commented lines 1464 to 1468:
> > >
> > > PUBLIC SUB Menu_Click()
> > >
> > > Control_DblClick
> > >
> > > END
> > >
> > > This seems to have fixed the problem. I have attached the patched file.
> > > Benoit can verify if I found the right section of problem code.
> > >
> > > Take care,
> > > Allen
> > >
>
> Actually this is more complex than that.
>
> If you just uncomment the "Menu_Click" sub, then this event handler can be
> raised because a true menu is clicked (not one you design in the form editor,
> but one of the contextual menu). This is because now the contextual menus
> don't have their own event handler anymore, they use Actions, and so an event
> handler with the class name is searched. And as the class name is "Menu", the
> Menu_Click function is called, and you get an error. Try to remove a control
> in the form editor with the DELETE key.
>
> The solution is to replace in CControl.class the code 'Object.Attach(...,
> "Menu")' by 'Object.Attach(..., "MenuControl")' and to rename Menu_Click as
> MenuControl_Click.
>
> Regards,
>
More information about the User
mailing list