[Lazarus] Elastic Tabstops: benefits or not

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Nov 6 18:20:05 CET 2009


2009/11/6 Hans-Peter Diettrich <DrDiettrich1 at aol.com>:
>
> What restrictions must be observed in order to make the desired output
> format occur? What about lengthy (multi line) descriptions?

I cannot see any restrictions at all, but I'll try and put together an
example showing all the variations you mention. Or maybe even a small
animated gif will help.


> Such EOL-block comments as in ex1 are ugly and a waste of space. More useful
> were a comment block describing the interface, that can be inserted into

I agree, and I don't code in that style myself. :-) I was simply
trying to demonstrate that Tab characters can be using inside the
context of code. Below is another possible use, but without the
comments. Maybe you have a produce with a huge amount of parameters,
and wrapping them at 80 chars and condensed in two or three lines
might make it hard to easily see the parameters and types, though with
syntax highlighting this is not anymore such a problem.

----------------------------
Procedure TRichTextLayout.PerformStyleTag( Const Tag: TTag;
                                           Var Style: TTextDrawStyle;
                                           const X: longint );
begin
  ApplyStyleTag( Tag,
                 Style,
                 FFontManager,
                 FRichTextSettings,
                 X );
end;
----------------------------


> ex2 seems to be more useful, but have a severe limiation: when a record has
> more fields, either the lines will become overly long, disappearing to the
> right of the screen, or they must be wrapped, breaking any table formatting.

Well that is not really an issue regarding Elastic Tabstops, that is a
general problem defining a large record and populating it with values
in one go.


> Can you provide examples with the above modifications (longer comments and
> records, and a block description of the procedure interface)?

Sure, but I think you will get a better feel for elastic tabstops if
you have access to Linux. Simply install and enable the gEdit ET
plugin, set you preferred widths, then open a .pas file and experiment
away.

  http://nickgravgaard.com/elastictabstops/

Alternatively you can try the Java "ETDemo.jar" application and run it
locally. Also available for download from the above URL. It's a
mock-up mini editor where you can try ET. Only thing is, I don't think
you can adjust the default indentation widths which I think is a bit
large (but typical of C programmers), and it's a bit slow compared to
the gEdit plugin.


> Also, what will happen while editing, when one of the rows must be enlarged
> while typing? Will all the rows be reformatted with every keystroke?

Yes, that's the awesome thing about ET. Whatever surrounding lines
falls in the same "text block/cell" will adjust automatically as you
enter the new line. No need to go back to previous lines and adjust
there indentation.


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/




More information about the Lazarus mailing list