View previous topic :: View next topic |
Author |
Message |
MikeHart
Joined: 16 Jul 2006 Posts: 8
|
Posted: Sun Jul 23, 2006 7:07 am Post subject: How to use the paramcompletion component |
|
|
Hello,
how does someone use the paramcompletion component?
Michael |
|
Back to top |
|
|
itsatomic
Joined: 12 Jun 2006 Posts: 38
|
Posted: Sun Jul 23, 2006 9:52 am Post subject: |
|
|
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 |
|
|
econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Sun Jul 23, 2006 7:50 pm Post subject: |
|
|
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 |
|
|
MikeHart
Joined: 16 Jul 2006 Posts: 8
|
Posted: Sun Jul 30, 2006 9:02 am Post subject: |
|
|
Thanks |
|
Back to top |
|
|
|