I found many of {$IFDEF SYN_LAZARUS} in SynEdit, my ask is SynEdit used outside Lazarus (like Delphi for example)?
Thanks in advance.

Mailing lists / lazarus / 2011-03
8 messages · 2 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
I found many of {$IFDEF SYN_LAZARUS} in SynEdit, my ask is SynEdit used outside Lazarus (like Delphi for example)?
Thanks in advance.
Zaher Dirkey wroteI found many of {$IFDEF SYN_LAZARUS} in SynEdit, my ask is SynEdit used outside Lazarus (like Delphi for example)?
they are a relict from another time....
They were once meant to mark all places were SynEdit in Lazarus changed from the original synedit.
But they do no longer work.
Only the SYN_LAZARUS version compiles, without it it will not even compile. I started remove them a year or 2 back, but never finished....
Martin
Can i remove it, and send the patch?
Regards
yes, but...
do it in small bits, because I still need/want to review. And I am a bit low on time...
Also, if you do any other cleanup: do it in separate patches please
Obviously the functionality need no review, just checking for typos, or flipping the if and else part, etc (big operations like this, almost always introduce an error somewhere)
otherwise I had them all removed already
Also I want to check any bigger block (several lines / if still existing), if the code still serves as inspirations. But small bits, are fine.
If you want to clean up a particular bit, in order to start reading into the code, thats cool...
---
Actually, just thinking about, could be easiest to run a perl script over it.....
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110331/3387956c/attachment.html>
2011/3/31 Martin
Ok, i will do it in small patches, i prefer use my hand for more be carefully clean it up.
yes, but... do it in small bits, because I still need/want to review. And I am a bit low…
2011/3/31 Martin
Hi, i started to cleanup
http://bugs.freepascal.org/view.php?id=19215
Please check this lines in SynTextDrawer
procedure TheFontStock.SetStyle(Value: TFontStyles);
// ASSERT(idx <= High(TheStockFontPatterns)); //Check this lineSY
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110422/13e55aa3/attachment.html>
I will look at it in due course.
In case... your clean up may be so you can add features later; and seeing you gone for TextDrawer first.
If you want to add features around drawing, here are a few of my ideas (all without any idea when..., just distant ideas)
1) Introduction of a TSynCanvas
- More or less to wrap the TSynEdit.Handle
- The class could be known by other classes in SynEdit (without circle references) and would be used for any Invalidate, invalidateLines, invalidateRect request.
- Maybe also for painting, so painting is in an event, and the handle is passed in by the caller.
Also painting is done from other classes, more below
2) Introduction of a TSynViewPort (or TsynEditViewPort) represents the textarea (as opposed to gutter).
SynEdit takes care of the layout (eg Gutter AlLeft, ViewPort alClient...), and the classes are responsible for the painting, (using TsynCanvas, and the arguments to the paint event)
TSynViewPort will also be responsible to store TopLine, LeftChar, LinesInWindow, CharsInWindow
TSynViewPort would still use TextDrawer, but some stuff may move...
----
Ideally this would even allow to have none LCL versions, like fpgui, msegui, or delphi... => but that is a long way
You are af course invited to bring up your ideas too.
The real reason to choose TextDrawer it is simple to start, and i have problem with my highlighter printing the text, my bug not catches yet.
It is need more understand the SynEdit and more discusses, I also have some feature like to have it in the SynEdit.
Thanks