On Wed, 1 Mar 2006 12:09:42 +0200
"A.J. Venter" <[EMAIL PROTECTED]> wrote:

> 
> > > - Move all (all "non-basic" at least) editor commands to a separate
> > > unit and implement each command on a separate method or class. I'm
> > > inclined to make them TAction descendants to unify shortcut handling,
> > > but I'm not set yet...
> >
> > What would we gain?
> >
> Reuse ?
> In theory (depending on how that unit is implemented).
> It should be designed to work on any stringlist (which is what I believe
> the  underlying data-set in synedit is), 

Yes, it is a TStrings descendant and some functions don't use the advanced
features.

> so it can update a synedit, or a
> memo or  whatever and can be used for other components or heck if called
> from code  directly to do easy advanced stringset parsing. 
> Imagine if we could tell a programmer that the stringset he is trying to 
> modify in a certain way before displaying - well he can access the search|
> replace menu's own command from his code with all it's features|power.

I agree in case of the search/replace/block indent/unindent commands and
maybe a few more. 
It is a matter of speed. If speed does not matter, just create a synedit,
assign your list and execute the command. If speed does matter, read
further:
Normally at least the biggest part of a synedit command handles synedit
specific things like cursor, invalidating, gutter, marks, selection,
highlighter and undo/redo stuff.
To get good reusable stringlist functions, we would have to rewrite all the
functions.


> Right now most string parsing seems to be handled by pos, copy and delete
> -  which works but why should people need to write the same code over and
> over   when lazarus already contains it ? 

The same reason, why there are so many databases.

 
> A.J.
> Some might notice I am highly in favour of lazarus having MORE than delphi
> 
> ever did - to make delphi users SWOON over it :)


Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to