I have some problems to understand how SetProxy() exactly works.
With SetProxy you can setup what is the 'main gadget' in your own-gadget.
But...
I have an user-gadget (like in the following example) that is composed by 2 (or more) sub-gadgets; I have problems to extends the standard gadget commands to work with my user-gadget.
In this case DISABLEGADGET what it really does? It disable the panel gadget? And the others?
I think I'm a little lost....
With SetProxy you can setup what is the 'main gadget' in your own-gadget.
But...
I have an user-gadget (like in the following example) that is composed by 2 (or more) sub-gadgets; I have problems to extends the standard gadget commands to work with my user-gadget.
In this case DISABLEGADGET what it really does? It disable the panel gadget? And the others?
I think I'm a little lost....
Import maxgui.drivers Import maxgui.proxygadgets Global wndMain:TGadget = CreateWindow( AppTitle, 100, 100, 300, 200, Null, WINDOW_TITLEBAR|WINDOW_CLIENTCOORDS|WINDOW_STATUS ) Global temp:tgadget = CreateMultiGadget("Hello" , 10 , 10 , 100 , 100 , wndMain) DisableGadget temp 'it disables the gadgets(panel) but all the rest is not greyed-out Repeat WaitEvent() SetStatusText wndMain, CurrentEvent.ToString() Select EventID() Case EVENT_WINDOWCLOSE, EVENT_APPTERMINATE;End EndSelect Forever Function CreateMultiGadget:TGadget( url$,x:Int,y:Int,w:Int,h:Int,group:TGadget,style=0,customtext$ = "" ) Return New Tmulti.Create(url,x,y,w,h,group,style,customtext) EndFunction Type tmulti Extends TProxyGadget Global multi_list:TList Field panel:tgadget Field button:tgadget Method New() If multi_list=Null Initialize() End Method Method Create:tmulti(tit$ , x:Int , y:Int , w:Int , h:Int , group:tgadget , style:Int = 0 , ct$ = "") panel:tgadget = CreatePanel(x , y , w , h , group , PANEL_ACTIVE) button:tgadget = CreateButton(tit , 4,1 , w , 18, panel , BUTTON_CHECKBOX) SetProxy(panel ) SetGadgetColor panel,188,188,188 multi_list.AddLast Self Return Self End Method Method EventHook:TEvent( pEvent:TEvent ) Select pEvent.id Case EVENT_MOUSEENTER button.settextcolor(255,0,0) SetPointer(POINTER_HAND) Case EVENT_MOUSELEAVE button.settextcolor(0,0,0) SetPointer(POINTER_DEFAULT) Case EVENT_MOUSEDOWN EndSelect Return Null EndMethod Method SetTextColor(r,g,b) Super.SetTextColor(r,g,b) EndMethod Method Free() multi_list.Remove(Self) Super.Free() EndMethod Function Initialize() multi_list = New TList AddHook EmitEventHook, eventHandler, Null, 1 EndFunction Function eventHandler:Object( pID%, pData:Object, pContext:Object ) Local pEvent:TEvent = TEvent(pData) If pEvent Then For Local tmp:Tmulti = EachIn multi_list If tmp.proxy = pEvent.source Return tmp.EventHook( pEvent ) End If Next EndIf Return pData EndFunction End Type