Recent

Author Topic: Text editor wanted  (Read 14074 times)

john60

  • New Member
  • *
  • Posts: 24
Text editor wanted
« on: July 03, 2018, 09:25:01 am »
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

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Text editor wanted
« Reply #1 on: July 03, 2018, 10:07:26 am »
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.html

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.
« Last Edit: July 03, 2018, 10:17:34 am by Handoko »

Guva

  • Jr. Member
  • **
  • Posts: 82
Re: Text editor wanted
« Reply #2 on: July 03, 2018, 02:55:11 pm »
Basic template for creating editor, with tabbed support http://freepascal.ru/forum/viewtopic.php?f=10&t=11265

john60

  • New Member
  • *
  • Posts: 24
Re: Text editor wanted
« Reply #3 on: July 04, 2018, 11:23:13 am »
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

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Text editor wanted
« Reply #4 on: July 04, 2018, 11:47:52 am »
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

  • Full Member
  • ***
  • Posts: 201
Re: Text editor wanted
« Reply #5 on: July 04, 2018, 11:55:22 am »

john60

  • New Member
  • *
  • Posts: 24
Re: Text editor wanted
« Reply #6 on: July 05, 2018, 09:27:37 am »
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

  • Hero Member
  • *****
  • Posts: 3944
Re: Text editor wanted
« Reply #7 on: July 05, 2018, 12:26:55 pm »
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.

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
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Text editor wanted
« Reply #8 on: July 05, 2018, 01:03:25 pm »
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.

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

  • New Member
  • *
  • Posts: 24
Re: Text editor wanted
« Reply #9 on: July 05, 2018, 03:33:34 pm »
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

  • New Member
  • *
  • Posts: 24
Re: Text editor wanted
« Reply #10 on: July 05, 2018, 03:40:40 pm »
Hi Martin_fr
Quote
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).

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

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: Text editor wanted
« Reply #11 on: July 05, 2018, 06:12:48 pm »
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

  • Hero Member
  • *****
  • Posts: 3944
Re: Text editor wanted
« Reply #12 on: July 05, 2018, 07:10:23 pm »
Hi Martin_fr
Quote
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).

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
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Handoko

  • Hero Member
  • *****
  • Posts: 5131
  • My goal: build my own game engine using Lazarus
Re: Text editor wanted
« Reply #13 on: July 05, 2018, 07:12:05 pm »
Hi 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.
« Last Edit: July 05, 2018, 07:52:42 pm by Handoko »

john60

  • New Member
  • *
  • Posts: 24
Re: Text editor wanted
« Reply #14 on: July 05, 2018, 10:01:31 pm »

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.
   

 

TinyPortal © 2005-2018