News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Ambitious project: EditX control

Started by NoCforMe, March 06, 2022, 02:40:18 PM

Previous topic - Next topic

NoCforMe

This post is about something I'm planning on doing that doesn't exist yet, something pretty ambitious. My plan is to create a new type of Win32 edit control, one that has a few more capabilities than the standard edit (or RichEdit) control. My main reason for starting this project is that I want to be able to select text by columns. I used to use an editor called MultiEdit that did this; any of you ever use this? It was a great piece of software from the 1990s, originally running under DOS and then later under early versions of Windows, which had some outstanding features: you could use its macro language to customize it, it had superior block-handling and text-marking functions, support for several programming languages, regular expression search and replace, lots more. And you could select text by columns.

Now why would you need to do that? Well, if you have a file such as this:

1. Sunrise:

Day Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
1 07:36 07:20 06:42 06:49 06:02 05:33 05:35 06:00 06:33 07:04 07:40 07:16
2 07:36 07:19 06:41 06:48 06:01 05:33 05:35 06:01 06:34 07:05 07:42 07:17
3 07:36 07:18 06:39 06:46 06:00 05:32 05:36 06:02 06:35 07:07 07:43 07:18
4 07:36 07:17 06:37 06:44 05:59 05:32 05:36 06:03 06:36 07:08 07:44 07:19
5 07:36 07:16 06:36 06:43 05:57 05:32 05:37 06:04 06:37 07:09 07:45 07:20
6 07:36 07:15 06:34 06:41 05:56 05:31 05:38 06:05 06:38 07:10 06:47 07:21
7 07:36 07:13 06:32 06:39 05:55 05:31 05:38 06:06 06:39 07:11 06:48 07:22
8 07:36 07:12 06:31 06:38 05:54 05:31 05:39 06:07 06:40 07:12 06:49 07:23
. . .

2. Sunset:

Day Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
1 16:46 17:22 17:57 19:33 20:07 20:37 20:47 20:26 19:41 18:48 18:00 16:36
2 16:47 17:23 17:59 19:34 20:08 20:38 20:47 20:25 19:39 18:47 17:59 16:36
3 16:48 17:24 18:00 19:35 20:09 20:39 20:47 20:24 19:37 18:45 17:58 16:35
4 16:49 17:26 18:01 19:36 20:10 20:39 20:47 20:22 19:36 18:43 17:57 16:35
5 16:50 17:27 18:02 19:38 20:11 20:40 20:46 20:21 19:34 18:42 17:56 16:35
6 16:51 17:28 18:03 19:39 20:12 20:41 20:46 20:20 19:32 18:40 16:54 16:35
7 16:52 17:30 18:05 19:40 20:13 20:41 20:46 20:19 19:30 18:38 16:53 16:35
8 16:53 17:31 18:06 19:41 20:14 20:42 20:45 20:17 19:29 18:36 16:52 16:35
. . .


and you want to arrange these values in a single column, you need to be able to select a column and copy and paste it. (What I'm after here is determining day length for all the days in a year by subtracting sunrise time from sunset time.) I could do this by hand, of course, by copying and pasting each time one by one, but that's a pain in the ass, and I don't have the patience for it. (Besides, this is why they invented computers!)

I still have my old copy of MultiEdit, but I've finally reached the end of the line with it OS-wise: it ran fine under XP, but no longer runs under Windows 7. :nie: So I want to see if I can possibly get this project at least to the proof-of-concept stage.

There are lots of things that need to be done in order to even design a simple edit control, one that has most of the functionality of the existing Win32 one. Here's at least a partial list:

  • Backspace/delete
  • Tabs
  • Cursor keys
  • Buffer memory mgmt.
  • Caret
  • Insert/overwrite
  • Selection
  • Copy/cut/paste
  • Scrolling
Memory management alone is a huge task, especially if I want to be able to handle extremely large files, say with memory-mapped files.

And then there are the extra goodies I have in mind:

  • Line #s
  • Column selection
  • Basic formatting (bold, italic, etc.)
(that last one would require saving the file in a special format that would retain the text formatting, something like Notepad)

I've got a very basic test bed up and running; I can type text into an EditX window and have the caret track the text correctly, but only for typing forward and backspacing. There's still a long way to go. I'll post some code when it's a little farther along.

If anyone has any suggestions (besides "You're nuts! Forget about it!"), I'd like to hear them. It's a challenging project, but it's also fun, especially when I actually get something to work.
Assembly language programming should be fun. That's why I do it.

jj2007

Sounds like fun :thumbsup:

I started such a project years ago but got a bit stuck with the undo/redo chain, so it has been on ice since; but I do use it frequently to view spreadsheets. Here is a tab-delimited testfile, real data from the UN btw.

hutch--

I stick to richedit 3.0, in 64 bit it can handle over 700 meg, unlimited undo/redo, fast in text mode but no joy to do technicolor, can be done but is a pain. With only slight fiddles it will do RTF in real technicolor. Writing an editor from scratch is a massive task and very hard to get all of the useful features.

JK

Maybe you should take a look here: https://www.scintilla.org/
It can do everything you want, it is very well documented and it´s free.

JK

HSE

Quote from: NoCforMe on March 06, 2022, 02:40:18 PM
I've finally reached the end of the line with it OS-wise: it ran fine under XP, but no longer runs under Windows 7. :nie:

Just use DosBox or other emulator  :thumbsup:
Equations in Assembly: SmplMath

wjr

I used Multi-Edit before for a quite while, but switched in 2010, so a suggestion to consider EmEditor as an alternative (it has an "Edit / Selection Mode / Sticky Vertical Mode" menu option).

avcaballero

Any text editor based on Scintilla has those feautures, for example notepad ++ that is which I use regularly

fearless

Could be worth looking at Catch22 tutorial if you havent already: https://www.catch22.net/tuts/neatpad#

NoCforMe

Quote from: JK on March 07, 2022, 04:11:20 AM
Maybe you should take a look here: https://www.scintilla.org/
It can do everything you want, it is very well documented and it´s free.
Here's a problem with that software:
QuoteCurrent development occurs on the default branch as 5.* which requires a recent C++ compiler that supports C++17.
As you can probably guess from my handle, no C compilers here ...
Assembly language programming should be fun. That's why I do it.

NoCforMe

Quote from: hutch-- on March 06, 2022, 11:43:08 PM
I stick to richedit 3.0, in 64 bit it can handle over 700 meg, unlimited undo/redo, fast in text mode but no joy to do technicolor, can be done but is a pain. With only slight fiddles it will do RTF in real technicolor. Writing an editor from scratch is a massive task and very hard to get all of the useful features.
But you're missing something, Hutch: a RichEdit control cannot do column selection, which is what got me into this project in the first place. Besides, it's a great challenge in and of itself, so therefore for me worth doing (or at least dying trying!)
Assembly language programming should be fun. That's why I do it.

hutch--

I am old enough to have used a Microsoft PWB which could do column selection but that had much to do with the client area being in DOS text mode where the mouse cursor top X and bottom Y were used as reference to pick characters within that rectangle.

In modern graphics based Windows applications, you would use a transparent overlay to do the mouse selection then get the characters within the rectangle. Kids stuff if you knew how to do it. :biggrin:

jj2007

Here is the last version of my "table control" - for inspiration. Drag a tab-delimited or csv file over the executable. If you need a big file for testing, here is one, straight from the UN. Excel needs 3 seconds to open it, my proggie does in 65 milliseconds. Sorting a column is also a factor 20-30 faster :cool: