EControl Ltd. Forum Index EControl Ltd.
VCL libraries and software support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to use the paramcompletion component

 
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor
View previous topic :: View next topic  
Author Message
MikeHart



Joined: 16 Jul 2006
Posts: 8

PostPosted: Sun Jul 23, 2006 7:07 am    Post subject: How to use the paramcompletion component Reply with quote

Hello,

how does someone use the paramcompletion component?

Michael
Back to top
View user's profile Send private message
itsatomic



Joined: 12 Jun 2006
Posts: 38

PostPosted: Sun Jul 23, 2006 9:52 am    Post subject: Reply with quote

Hi Mike

I have not used it, yet, but there is an example application that you can look at in \demos\gutter objects\go_test.dpr

It would probably pay to go through the examples and have a look at what they do and how, it is not as efficient as a helpfile, but could be far easier to do now.

Aaron
Back to top
View user's profile Send private message
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Sun Jul 23, 2006 7:50 pm    Post subject: Reply with quote

Hello,

Brief description of TParamCompletion properties:

OpenChar: ecChar - character that opens function parameters, default - '('
CloseChar: ecChar - character that closes function, default - ')'
Separator: ecChar - character that is used as parameters delimiter in the text, default - ','
TerminateChar: ecChar - character that terminates search (operator delimiter), default - ';'
DeclSeparator: Char - character that is used as parameters delimiter in the hint items, default - ';'
Items: TStrings - list of hints for the current function, single item contains parameters declaration that are separated with the DeclSeparator.
ParamNumber: integer - currently edited parameter.
Automatic: Boolean - in automatic mode all text processing provided by the component, that is you should only write OnGetParams event handler to fill Items for the specified function. If Automatic is False you should manually show hint (using procedure ShowAt(pos: integer)), control caret position to set ParamNumber and hide hint (procedure CloseUp).

Code:
OnGetParams: TGetParamsEvent
  TGetParamsEvent = procedure(Sender: TObject; const FuncName: ecString; Pos: integer) of object;


OnGetParams is executed before showing hint window in Automatic mode. In this handler you should fill TParamCompletion.Items.
FuncName is the word before opening bracket. Pos - zero-based index of the opening bracket in the text buffer.
When function name may be complex (for example, composed of several words) you should analyze text before opening bracket programaically.

Michael.
Back to top
View user's profile Send private message Send e-mail
MikeHart



Joined: 16 Jul 2006
Posts: 8

PostPosted: Sun Jul 30, 2006 9:02 am    Post subject: Reply with quote

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor 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, 2005 phpBB Group