BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Double click on Collection ...

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing
View previous topic :: View next topic  
Author Message
Rafael Colucci
Guest





PostPosted: Fri Oct 24, 2003 7:25 pm    Post subject: Double click on Collection ... Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.