[Gambas-user] Control.Proxy property (was Re: Gambas 3 advancement)

Benoît Minisini gambas at ...1...
Tue Dec 21 15:08:03 CET 2010


> 
> I'm currently implementing a Proxy class that allows to automatically
> delegate events from one object to another one. But the result is not
> beautiful. I must think about all that...

I finally dropped my "Proxy" class, finding no way to implement it correctly.

Instead, I created a "Proxy" property in the Control class. When a control has 
a proxy, it will raise all mouse and keyboard events of its proxy for itself 
(the proxy keeps its own events). Moreover, SetFocus() and HasFocus() on the 
control will actually act on the proxy.

For example, in the ValueBox user control, the inner TextBox is set as its 
proxy. That way, all keyboard events of the TextBox are catched as if the 
ValueBox has raised them.

-- 
Benoît Minisini




More information about the User mailing list