xsharp.eu • Bug in XIDE (event insert with delegate inside class)
Page 1 of 1

Bug in XIDE (event insert with delegate inside class)

Posted: Thu Mar 15, 2018 9:10 am
by SHirsch
Hi Chris,

Code: Select all

....
METHOD OKButtonClick(sender AS OBJECT , e AS System.EventArgs) AS VOID
	SELF:Close()
RETURN

DELEGATE PropertyChangedDelegate(o AS OBJECT, e AS System.ComponentModel.PropertyChangedEventArgs) AS VOID

METHOD btnTestClick(sender AS System.Object , e AS System.EventArgs) AS VOID
RETURN

END CLASS
When you now change something in the painter and save you get this code:

Code: Select all


METHOD OKButtonClick(sender AS OBJECT , e AS System.EventArgs) AS VOID
	SELF:Close()
RETURN

METHOD btnTestClick(sender AS System.Object , e AS System.EventArgs) AS VOID
RETURN

END CLASS
DELEGATE PropertyChangedDelegate(o AS OBJECT, e AS System.ComponentModel.PropertyChangedEventArgs) AS VOID

METHOD btnTestClick(sender AS System.Object , e AS System.EventArgs) AS VOID
RETURN

END CLASS
As you can see the event handler implemented after

Code: Select all

DELEGATE
is ignored and a new one is inserted. Also

Code: Select all

END CLASS
is inserted.
When I put the

Code: Select all

DELEGATE
outside the

Code: Select all

CLASS
everything is ok.

Attached a simple sample.

Regards,
Stefan

Bug in XIDE (event insert with delegate inside class)

Posted: Thu Mar 15, 2018 2:16 pm
by Chris
Hi Stefan,

Thanks, I see the problem. It's because the DELEGATE is considered a class and nested classes are not properly supported by the code generator yet (that was implemented in XIDE (VIDE back then) before nested classes were implemented in the vulcan compiler). I'll look into it, I think I should be able to add a small hack in there :)

Chris