Text editor wanted lazarus / 8-Other ---------------------------------------------------------------------- john60 · 2018-07-03 07:25 I'm not sure of the best place to ask - I hope this is OK I'm looking for a FPC/Lazarus text editor with some simple code editing features. Nothing fancy - but must provide full PD source code for me to expand on and be well annotated or documented. It should be procedural based making minimal use of objects if it must use any. If such a thing exists I'd welcome a heads up. TIA ---------------------------------------------------------------------- Handoko · 2018-07-03 08:07 Hello john60, Welcome to the forum. Have you tried TSynEdit or ATSynEdit? You can use them to create your own editors. Read more: http://wiki.freepascal.org/TSynEdit http://wiki.freepascal.org/ATSynEdit Users use TSynEdit/ATSynEdit to create many text editors, like: FreeEdit: https://forum.lazarus.freepascal.org/index.php/topic,10318.msg50973.ht ml Mini Edit: https://github.com/parmaja/miniedit CudaText: http://uvviewsoft.com/cudatext/index.html And these are some others Pascal-written text editors: http://texteditors.org/cgi-bin/wiki.pl?action=browse&diff=1&id=Qed- Pascal https://sourceforge.net/projects/filthyeditor/ https://sourceforge.net/projects/gleditor/ As far as I know, all the names mentioned above are free with source code. But it doesn't mean they are in the Public Domain. Make sure you read their license first before you fork them. ---------------------------------------------------------------------- Guva · 2018-07-03 12:55 Basic template for creating editor, with tabbed support http://freepascal.ru/forum/viewtopic.php?f=10&t=11265 ---------------------------------------------------------------------- john60 · 2018-07-04 09:23 Hi Handoko Thanks for the helpful post. I just took a quick look at leeledumbos freeedt program - that may well be enough scaffolding to kickstart my own editor so thanks for that. I can't see any copyright messages so I'll try and contact him. I did look at synedit but it's really too complex/object based for my use. This thread went off topic real fast (from my request right into everyone elses favourite editor) I hope that's not normal on the forum. ---------------------------------------------------------------------- marcov · 2018-07-04 09:47 You are right, and I'm sorry I participated in that,  being a moderator and all that. I cleaned the thread a bit. Handoko's answer is fairly complete, it only misses the most basic one, TMemo :-) The only advanced thing to add I can think of is that there might be some Delphi codebases that use the Scintilla editor DLL that are portable to Lazarus. Most people prefer synedit though, because the stability and bug status of Windows builds of Scintilla seem to constantly change. ---------------------------------------------------------------------- fred · 2018-07-04 09:55 There is also Notepas https://github.com/beNative/Notepas ---------------------------------------------------------------------- john60 · 2018-07-05 07:27 marcov - no problem - it's a tempting subject for people to wade in I guess. After looking at all the examples I've decided it's best to start from scratch as my needs are just a little bit different from the norm anyway. I was hoping to find something that would help kickstart my editor but given my constraints It was a bit of a long shot anyway. Thanks for all the input everyone. ---------------------------------------------------------------------- 440bx · 2018-07-05 10:26 Quote from: john60 on July 05, 2018, 09:27:37 amI was hoping to find something that would help kickstart my editor but given my constraints It was a bit of a long shot anyway. I'm just curious, you mention "constraints", would it be ok to ask what the constraints are ?  while I'm asking questions, what features do you want to have in your editor ? Thanks ---------------------------------------------------------------------- Martin_fr · 2018-07-05 11:03 Quote from: john60 on July 03, 2018, 09:25:01 amI'm looking for a FPC/Lazarus text editor with some simple code editing features. Nothing fancy - but must provide full PD source code for me to expand on and be well annotated or documented. It should be procedural based making minimal use of objects if it must use any. PD or opensource + gpl/mpl/...? When you say you are looking for an editor that you can modify... Do you look for: 1 - an editor component, such a TMemo, TSynEdit, ATSynEdit....   That has no menu, or anything, just the text handling 2 - a app with menu to load/save/copy/paste.... If 2, then does it matter if the component is OO (or otherwise needs experience to read the code)? There are various editors based on SynEdit/AtSynEdit. They may make a good starting point. It really depends what feature you want to add. You may not have to touch the code in SynEdit (And synedit is highly configurable). Though it lacks documentation (there is some doc in Spanish, afaik). ---------------------------------------------------------------------- john60 · 2018-07-05 13:33 Just so we're clear - I've decided to build from scratch so this thread is now a conversation rather than request. (I've spent the morning putting it together and starting the docs so I'm committed) Sure 440bx - my constraints are that it must eventually be re-written in a new programming language (and system which I'm still researching for.) That means I want to avoid anything like objects or complex features such as overloading or data encapsulation or whatever  to make the porting as easy as I can. (Hence my call for procedural code) The editor fits into a new IDE. The fewer objects I use the better although I may just use synedit in the short term to help me create the structure. In terms of editor features - some standard stuff and other stuff specific to my design. I may decide to make the IDE open source at some point which is why I'm keen to use lazarus/fpc. ---------------------------------------------------------------------- john60 · 2018-07-05 13:40 Hi Martin_fr QuoteThere are various editors based on SynEdit/AtSynEdit. They may make a good starting point. ... It really depends what feature you want to add. You may not have to touch the code in SynEdit (And synedit is highly configurable). Though it lacks documentation (there is some doc in Spanish, afaik). I've made a hole to drop a synedit window in for now but as you say - no docs. And I don't have time to waste trawling through hierarchical code most of which I have no interest in or use for. I was hoping for something more basic - perhaps a very old pre-delphi editor or something along those lines that would compile without too much effort. It was a long shot but worth a try. ---------------------------------------------------------------------- Martin_fr · 2018-07-05 16:12 If you have specific questions on SynEdit config/usage, then ask them here. Some very basic info: http://wiki.lazarus.freepascal.org/SynEdit Also go into the example folder of your IDE, there are a very few examples. (there is one for searching in the text, but that example is in svn only / next release / it works with older synedit too though) ---------------------------------------------------------------------- 440bx · 2018-07-05 17:10 Quote from: john60 on July 05, 2018, 03:40:40 pmHi Martin_fr QuoteThere are various editors based on SynEdit/AtSynEdit. They may make a good starting point. ... It really depends what feature you want to add. You may not have to touch the code in SynEdit (And synedit is highly configurable). Though it lacks documentation (there is some doc in Spanish, afaik). I've made a hole to drop a synedit window in for now but as you say - no docs. And I don't have time to waste trawling through hierarchical code most of which I have no interest in or use for. I was hoping for something more basic - perhaps a very old pre-delphi editor or something along those lines that would compile without too much effort. It was a long shot but worth a try. Hello John60, Your request reminded me of Turbo Pascal Editor Toolbox which used to be a Borland product way way back.  I found a place where you can download it from (looks legit but, I can't assure anything beyond "looks").  https://winworldpc.com/product/turbo-pascal-toolbox/40 I had that software (legally purchased) and was quite pleased with the code.  It has code for 3 or 4 editors of varying abilities, from really simple to one that closely mimicked the one in the Turbo Pascal IDE of the time. Hopefully that will be helpful to you ---------------------------------------------------------------------- Handoko · 2018-07-05 17:12 Quote from: john60 on July 05, 2018, 03:40:40 pmHi Martin_fr Quote... It really depends what feature you want to add. You may not have to touch the code in SynEdit (And synedit is highly configurable). Though it lacks documentation (there is some doc in Spanish, afaik). I've made a hole to drop a synedit window in for now but as you say - no docs. And I don't have time to waste trawling through... Using TSynEdit isn't as hard as you think. I wrote a small program to organize my data. At the beginning it used TMemo, it worked and I was happy with it. I knew TSynEdit and I knew it offers more features than TMemo but I was too lazy to try new things. But I often heard people were talking about TSynEdit or CudaText in this forum. So I decided to try TSynEdit. Not much tutorials can be found. But after some reading and testing the example codes I can find, wow it's not as hard as I thought. Now, I have modified my program to use TSynEdit. As a programmer you should try anything you can touch and explore any new possibilities. Don't just limit yourself in the area you feel comfort. Well, if the project you're going to build is a commercial app or it's has a deadline, you should use the things you already familiar with. But if it is a hobby-project lack of documentation should not be the reason not to try it. ---------------------------------------------------------------------- john60 · 2018-07-05 20:01 hi 440bx - I have to time manage very tightly because of other commitments so I made a start this morning and have a basic working one now (lazarus is good that way)  after a sort. I'll allot another couple of hours over the weekend for this to move it on and finish the basic docs so I'm committed now. I do wish I'd thought of TP myself though. I'll take a look at your link anyway - if only to remind me of things I may have forgotten. ---------------------------------------------------------------------- john60 · 2018-07-05 20:27 hi handoko It's not difficulty in using it that is the issue - it's the replacement code I'd need to write to replace it. Since that isn't possible yet (the entire system doesn't exist and won't for some time) I need to limit the complexity of the environment. No it's not a hobby software project its an entire system - processor upwards. ---------------------------------------------------------------------- Martin_fr · 2018-07-05 21:16 Well we still dont know what you aim for as end product (and understandable, you may not be allowed to say...) Other point you might need to consider. Do you need/prefer: - a system drawn editor (tmemo) - a custom drawn editor (synedit) The first just tells windows (or the OS) to do the job. It is limited to what the OS offers, and functions/look may vary by platform. SynEdit is highly customizable. It has lots of hooks to add extra code... If you make a copy of it, then you can also strip a lot of code out. Btw, there is an other version of SynEdit, that has a different internal design (but I know little about it / I do not even know if it is still maintained, or works with the current Lazarus / I do not think it will be any easier). http://wiki.lazarus.freepascal.org/SynEdit#SynEdit_2.0_port ---------------------------------------------------------------------- john60 · 2018-07-06 07:27 martin_fr I'm sure synedit does whatever you use it for very well - it's only use to me is as a stop-gap to speed up development. If it had a good VHDL add on that would be useful - for now. Sure I can tell you what I'm doing - there's no mystery - I'm creating a complete new computer system from scratch. I'm using lazarus to create some tools that will run on windows and linux to aid in development and testing.  Those tools will need converting to the new system at some stage so the simpler the code the better. That means avoiding anything undocumented or object based where possible. It also means other things you'd normally just drag and drop are no good to me. Like I said before - what I'm doing is a little bit different. ---------------------------------------------------------------------- Martin_fr · 2018-07-06 09:37 Quote from: john60 on July 06, 2018, 09:27:50 amI'm sure synedit does whatever you use it for very well - it's only use to me is as a stop- gap to speed up development. If it had a good VHDL add on that would be useful - for now. You mean a highlighter? I do not know of any existing one, but there is a tutorial http://wiki.lazarus.freepascal.org/SynEdit_Highlighter Sample files are in the example folder. Or you mean word completion? That you need to do yourself, but there is an example (in the example folder) on the completion add on too. Quote Those tools will need converting to the new system at some stage so the simpler the code the better. That means avoiding anything undocumented or object based where possible. It also means other things you'd normally just drag and drop are no good to me. Like I said before - what I'm doing is a little bit different. It depends how different. If the entire cpu/memory arch is different, and you need to change the way memory is accessed, then this will make it very hard. Also for synedit to work, you need at least a true monospaced font. If you will not have that, then you are in trouble. As for adapting the OS calls, that should be moderate work. - IIRC All text drawing is done in one single unit (you may consider looking at 2): textdrawer.pas (you dont need all of it, just some) - gutters can be removed, if you do not want to port them - caret is in one place, and can be either system, or custom drawn - word completion, if used would need to open an extra window - then need to provide or fake input from the OS (keydown/up/press), mouse, focus It is quite a list, but the mandatory parts come with any editor. -------------------- Btw, you may want to look at mse ide too: I don't know how complex their editor is. But mse is all custom drawn (no LCL). Maybe that will be easier to port. No idea. ---------------------------------------------------------------------- john60 · 2018-07-06 14:34 VHDL would have been a handy addition but it doesn't matter. The simple FPC highlighting will do for now.  I may take a look at the do-it yourself highlighter later. I don't ever use word/code  completion. By different I do mean very.  The OS doesn't work the way you're used to any more than the hardware so "Porting" to the system is porting concepts not code then writing from scratch. Once again - avoiding bells and whistles is key. I could use some icons for the buttons though  - is there a freely usable set for that do you know? ---------------------------------------------------------------------- Handoko · 2018-07-06 14:52 It is very easy to find free images from the Internet, but many of them have some license restrictions. You may try OpenClipart first, it's license is in CC Zero Public Domain: https://openclipart.org/ ---------------------------------------------------------------------- john60 · 2018-07-07 08:08 Thanks - those are a bit "flowery" for my needs but I found a set by mark james that will do nicely at http://famfamfam.com/ ---------------------------------------------------------------------- wp · 2018-07-07 08:22 icons8 has a huge collection in various styles: https://icons8.com/icon/new-icons/all. Free, but you must provide an attribution link to their site (https://icons8.com/license/). ---------------------------------------------------------------------- M.A.R.C. · 2019-06-22 06:39 Oh! I didn't see this discussion before. I have been working on something similar to IDE for an FPGA architecture and using VHDL as language. This work has near to 10 years. I did use Synedit for the VHDL code editor. See attached images to have a look. ---------------------------------------------------------------------- john60 · 2019-08-09 21:02 very nice M.A.R.C. If you're ever interested in sharing let me know I'd love to take a closer look. I use Vivado for VHDL but something a bit "cleaner" has advantages. I can also see other uses if what I'm seeing is what I think I'm seeing. ---------------------------------------------------------------------- Handoko · 2019-08-10 02:31 M.A.R.C's SBA Creator is open source, it can be found here: https://sourceforge.net/projects/sbacreator/ ---------------------------------------------------------------------- avra · 2019-08-10 07:05 Quote from: Handoko on August 10, 2019, 04:31:06 amM.A.R.C's SBA Creator is open sourceI do not see sources of SBA Creator. Only VHDL examples, VHDL libs, and binary setups. I would be interested if there is source for synthesis part of SBA Creator: https://bfc64698-a-62cb3a1a-s-sites.googlegroups.com/site/simplebusarc hitecture/examples/SBA_Imagen3.png If it is available somewhere please let me know... ---------------------------------------------------------------------- john60 · 2019-08-10 11:12 As you say - Miguel has very generously made this open source (I havnt had time to look yet but) try here avra: http://sba.accesus.com/software-tools/sba-creator ---------------------------------------------------------------------- valdir.marcos · 2019-08-10 12:14 Quote from: avra on August 10, 2019, 09:05:54 amI would be interested if there is source for synthesis part of SBA Creator: https://bfc64698-a-62cb3a1a-s-sites.googlegroups.com/site/simplebusarc hitecture/examples/SBA_Imagen3.pngImage is attached just to ease the thread reading. ---------------------------------------------------------------------- Edson · 2019-08-10 14:58 Quote from: john60 on July 06, 2018, 09:27:50 amI'm using lazarus to create some tools that will run on windows and linux to aid in development and testing.  Those tools will need converting to the new system at some stage so the simpler the code the better. That means avoiding anything undocumented or object based where possible. This remimd me, the compiler I'm creating in Lazarus, to be self- compiled later. Not objects, not advanced features: http://blog.pucp.edu.pe/blog/tito/2019/01/05/crea-tu-propio- compilador-casero-parte-1/ ---------------------------------------------------------------------- M.A.R.C. · 2019-08-11 04:16 Quote from: john60 on August 09, 2019, 11:02:42 pmvery nice M.A.R.C. If you're ever interested in sharing let me know I'd love to take a closer look. I use Vivado for VHDL but something a bit "cleaner" has advantages. I can also see other uses if what I'm seeing is what I think I'm seeing. Quote from: Handoko on August 10, 2019, 04:31:06 amM.A.R.C's SBA Creator is open source, it can be found here: https://sourceforge.net/projects/sbacreator/ Sorry but the SBA System Creator is not open source, SBA is. We decided to make the tool open only to a reduced number of collaborators in our group. But is free. The code editor in the SBAcreator is enhanced by Synedit. It has several kinds of highlighters for VHDL, Verilog, TCL, and others, plug-ins support, but I hope to add more useful abilities in the future. Regards, M.A.R.C. ---------------------------------------------------------------------- avra · 2019-08-12 07:08 Quote from: john60 on August 10, 2019, 01:12:10 pmAs you say - Miguel has very generously made this open source (I havnt had time to look yet but) try here avra: http://sba.accesus.com/software-tools/sba-creator I did find that link but as already said, it is only for binary setup, VHDL examples and VHDL libs. No source of Synthesis node like editor. Quote from: valdir.marcos on August 10, 2019, 02:14:38 pmQuote from: avra on August 10, 2019, 09:05:54 amI would be interested if there is source for synthesis part of SBA Creator: https://bfc64698-a-62cb3a1a-s-sites.googlegroups.com/site/simplebusarc hitecture/examples/SBA_Imagen3.pngImage is attached just to ease the thread reading.Yes, thanks. That is what I am after. Node like editor for Lazarus.