* * *

Author Topic: Text editor wanted  (Read 2931 times)

john60

  • New member
  • *
  • Posts: 15
Re: Text editor wanted
« Reply #15 on: July 05, 2018, 10:27:38 pm »
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

  • Administrator
  • Hero Member
  • *
  • Posts: 4781
    • wiki
Re: Text editor wanted
« Reply #16 on: July 05, 2018, 11:16:57 pm »
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

  • New member
  • *
  • Posts: 15
Re: Text editor wanted
« Reply #17 on: July 06, 2018, 09:27:50 am »
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

  • Administrator
  • Hero Member
  • *
  • Posts: 4781
    • wiki
Re: Text editor wanted
« Reply #18 on: July 06, 2018, 11:37:57 am »
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.
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

  • New member
  • *
  • Posts: 15
Re: Text editor wanted
« Reply #19 on: July 06, 2018, 04:34:54 pm »
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

  • Hero Member
  • *****
  • Posts: 2570
  • My goal: build my own game engine using Lazarus
Re: Text editor wanted
« Reply #20 on: July 06, 2018, 04:52:46 pm »
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

  • New member
  • *
  • Posts: 15
Re: Text editor wanted
« Reply #21 on: July 07, 2018, 10:08:03 am »
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

  • Hero Member
  • *****
  • Posts: 4905
Re: Text editor wanted
« Reply #22 on: July 07, 2018, 10:22:15 am »
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/).
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus