Problem with extending TGadget

BlitzMax Forums/BlitzMax Programming/Problem with extending TGadget

Dreamora(Posted 2006) [#1]
I'm not sure if it is only me or if there is some problem, so I'm asking for help.
I'm trying to extend TGadget for own combined gadgets. But for some reason it does not work ...

Strict

Import brl.maxgui 

Type IF_NODE Extends TGadget 'tried with TWin32Gadget as well
	Field in:TGadget
	Field out_true:TGadget
	Field out_false:TGadget
	
	Function CreateNode:IF_NODE(main_panel:TGadget, x:Int, y:Int)
		Local pan:TGadget		= CreatePanel(x,y, 150,200, main_panel, PANEL_ACTIVE) 
		Local result:IF_NODE	= IF_NODE(pan)  '<-- Convert fails always!
		DebugStop
		SetPanelColor(result,0,200,0)
		result.in				= CreatePanel(10,65, 20,20, result, PANEL_ACTIVE)
		result.out_true			= CreatePanel(140,56, 20,20, result, PANEL_ACTIVE)
		result.out_false		= CreatePanel(140,133, 20,20, result, PANEL_ACTIVE)
		Return result
	End Function
End Type


I marked the line above that is the problem. Although IF_NODE is an extended TGadget (tried with TWin32Gadget as well), it fails.

Any ideas? Is it a bug, I better should post in the bug board? Or is it simply my stupidity? ;-)


Jay Kyburz(Posted 2006) [#2]
have you tried tproxygadget. Also, why do you want your if_node to extend tGadget?


Dreamora(Posted 2006) [#3]
Because I wanted to create a new type of gadget that builds up on a panel but with more substuff as you see above. Especially with its own functionality like drag and drop and other stuff.

For the moment I have a workaround which forces me to use TMaps to get the Type when I get the panel back from a GUI event which is not really desirable ... but no other way for the moment.


bregors(Posted 2006) [#4]
.


Jay Kyburz(Posted 2006) [#5]
I said tproxygadget. :)