[Lazarus] Stringgrid woes...

Michael Van Canneyt michael.vancanneyt at wisa.be
Fri Mar 13 17:03:04 CET 2009


On Fri, Mar 13, 2009 at 2:16 PM, Martin Friebe <lazarus at mfriebe.de> wrote:
>> What is the end goal of code folding? Maybe is in the middle of the
>> overall goal and I am simply acting to quickly. Either way, I will
>> voice my concerns...
>>
> There is a general plan/idea to add some configuration (have to see how
> much) to define what you want to have foldable and what not. It wasn't
> seen as urgent yet (at least not by me...)

OK thanks. So configuration is in the pipeline - that is good to know. :)


> Most (if not all) of the places that allow folding now, do so in Delphi
> as well. this is part of why they have been added, to make it easier for
> (ex-) Delphi users.

I did not know that. I last used Delphi 7 which had no code folding.
I've only seen code folding in other editors and they were not that
verbose as the current synedit in Lazarus. This is why I thought I
would mention it.


> IMHO most of the new ones are reasonable?
> - Except maybe for: "Program" / "Unit" and "Implementation" /
> "interface"; but they don't occur very often in a normal unit.

I don't see the point of 'Program' or 'Unit' level. Many the others
could be useful.

> - Folding at "procedure" in addition to the begin => arguable, if it
> should be instead of the begin?

I'm not sure about this one either. I would have thought the first
'begin' after a procedure or function should be ok.


>> At the moment it is more like trying to spot a line of code that
>> doesn't have a [+] in the gutter!!  This is just causing clutter and
>> not actually adding any value as far as I can see. Especially now that
>> the code folding lines and +/- signs are inside the editor code area
>> and not the gutter area. OK, so we all know synedit now supports code
>>
> You can change this:
> The gutter divider line is moveable, and the code fold background color
> adjustable.

I know the gutter divider line is movable, but I didn't know the
background color is adjustable. I'll give this another try. See the
original bug report for my editor colour scheme - it's not quite
standard colours which probably exaggerated the problem a bit. ;-)

> Enviroment=>options=>editor=>color=> "code folding tree" (3rd in box)

Thanks, this makes code folding look a lot better already. My gutter
is a different colour to the editor background. Now the code folding
tree blends in much better with the gutter part.

>> code folding. The idea of "draw code divider" was simply to draw a
>> horizontal line at the end of each procedure or method (like visual
>> basic 6 did). I have no interest in drawing horizontal divider lines
>> wherever code folding can occur. And with the current verbose level of
>
> That can be looked at / I can see the benefit of such a feature.

Before horizontal line drawing between procedures / functions, I have
seen programmers add spaces to separate methods. Or use comments as
dividers. eg: {-------------------------------}

Those are all waisted efforts and get in the way of coding and
programs such as 'pasdoc'. The visual effect of synedit drawing the
line (without anything actually being in the source code) is brilliant
and gives a much better look!

I think it will be worth having as a separate feature to code folding.
And at the moment I can only see it being useful between procedures,
functions and methods. I would ignore nested methods for now - it can
be added at a later date if the need arises.


> Not sure where it gets broken? Are the pictures from different versions
> of lazarus? or are they with different settings?

Nope, the screenshots in the bug report is all taken using the same
project, settings and Lazarus version. I simply switched tabs and took
screenshots.

> If you want then at begin/end level you need to set the divider draw
> level higher => the down side is, there will be additional dividers.
> This may not be the effect you desire, but it is the effect intended.

I think my original idea or method dividers got lost somewhere. :-)  I
only indented the feature to have dividers between procedures,
functions and methods. No nested methods and no other code folding
areas.


Regards,
  - Graeme -


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




More information about the Lazarus mailing list