[Lazarus] copy declaration, with implementation [Re: Tweaking 'code completion' for event handlers]

Martin lazarus at mfriebe.de
Fri May 13 16:11:52 CEST 2011


On 13/05/2011 14:55, Mattias Gaertner wrote:
>
>
> Martin <lazarus at mfriebe.de> hat am 13. Mai 2011 um 15:36 geschrieben:
>
>> [...]
>> Maybe even synedit could be told to create this format => it has 
>> already some nice code to create clipboard stuff. 
>
> Can you explain this?
>
for example in line 1509
procedure TCustomSynEdit.DoCopyToClipboard(SText: string; FoldInfo: 
String = '');

SynEdit has TSynClipboardStream which accepts various parts of 
information (e.g the selection mode; and the fold state)
It then generates text content, and a custom clipboard format version 
with the extra info

This class could be extended in TSynSourceEditor (which is a subclass of 
TSynEdit, but in hte IDE). So odetools would not have to bother to much 
how to store stuff in the clibpoard or read it. It could use the 
existing code...
Of course SynSourceEditor would have to expose some methods that can be 
used, As codetools would decide what text, and what format info need to 
be copied....

You could also just take a copy of this class and use it directly in 
codetools.



>> Actually, there should be (at least) 2 paste methods. (But for 
>> starters one would do)
>>
>> 1) Paste, without any question.
>> Necessary/Optional actions such as units-dependencies, or replacing 
>> identifiers, can be globally configured
>> IMHO kept to a minimum by default (insert units into uses, but do not 
>> update identifiers 
>
> This could happen on normal Paste.
>

That's the idea.

>>
>> 2) Paste via feedback dialog (like "extract procedure " already has.
>> Could offer a growing amount of options. Such as an identifier, to 
>> use as prefix for calls to the originating-class. Or creation of 
>> missing fields.... 
>
> This can be a menu item under Refactor.
>
+1

Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110513/a61e57ca/attachment-0003.html>


More information about the Lazarus mailing list