 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Rafael Colucci Guest
|
Posted: Fri Oct 24, 2003 7:25 pm Post subject: Double click on Collection ... |
|
|
Hi
I created a custom component editor. It conteins a collection. When the user
adds a item of collection and double clicks on the item I would like to
associate a function with the property of this item of collection.
I know what I do to associate a function with a form property, but I don't
know what I do to associate with a item of collection ... I have this code:
function TPLKEventCreator.DoCreateEvent(aFormDesigner :
FormDesignerInterface; aPersistent : TPersistent;
aMethodName, aEventNameToAssociate : string) : Boolean;
var
vMethod : TMethod;
vPropInfo : PPropInfo;
vTypeInfo : PTypeInfo;
begin
try
New(vTypeInfo);
New(vPropInfo);
try
vTypeInfo := PTypeInfo(aPersistent.ClassInfo);
vPropInfo := GetPropInfo(vTypeInfo, aMethodName); // Ex: MethodName :=
"Click"
vMethod := aFormDesigner.CreateMethod(aEventNameToAssociate,
GetTypeData(vPropInfo^.PropType^));
SetMethodProp(aPersistent, vPropInfo, vMethod);
Result := True;
finally
Dispose(vTypeInfo);
Dispose(vPropInfo);
end;
except
Result := False;
end;
end;
Rafael Colucci
Equipe de Tecnologia Prolink Publicações Ltda Fone:
(0xx32) 3217-2627, ramal 215
[email]tecnologia1 (AT) prolink (DOT) inf.br[/email]
http://www.universojuridico.com.br
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|