[Gambas-user] Menu events in 1.9.34 (attachment)

Benoit Minisini gambas at ...1...
Tue Jul 25 02:48:01 CEST 2006


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,

-- 
Benoit Minisini




More information about the User mailing list