Author Topic: my editor project  (Read 10701 times)

zedd151

  • Member
  • *****
  • Posts: 1968
Re: my editor project
« Reply #135 on: October 14, 2022, 12:50:28 PM »
I'd never used TEXTRANGE before, how does that work?
Regards, zedd.
:tongue:

NoCforMe

  • Member
  • *****
  • Posts: 1124
Re: my editor project
« Reply #136 on: October 14, 2022, 12:52:39 PM »
Replacing "varGood" with "varBad" requires shifting everything below by one byte, whether you use a table or a new search doesn't matter.

Hmm; my replace text function doesn't have to do any shifting of text at all; it simply replaces RichEdit selections of text. The control takes care of any shifting for me. This seems much simpler, since the control already has all that complexity built into it.

zedd151

  • Member
  • *****
  • Posts: 1968
Re: my editor project
« Reply #137 on: October 14, 2022, 12:54:24 PM »
This sounds like a good comparison test for the Laboratory.  :cool:
Testing different text replace functions that is.
Regards, zedd.
:tongue:

NoCforMe

  • Member
  • *****
  • Posts: 1124
Re: my editor project
« Reply #138 on: October 14, 2022, 12:59:40 PM »
Sorry to keep throwing cold water on your theories, but really, what does it matter? We're talking about a text editor here, a program with a person sitting in front of a keyboard typing and mousing around. Any speed differences in search & replace code is going to be utterly swamped by the time it takes to select a menu item. In other words, negligible.

I suppose it might be interesting just for curiosity's sake, but that's about it.

zedd151

  • Member
  • *****
  • Posts: 1968
Re: my editor project
« Reply #139 on: October 14, 2022, 01:04:48 PM »
Why not, aren't you curious as to which method might be faster than what you would use? I am. You don't have to participate if you don't want to though.  :biggrin: 
« Last Edit: October 14, 2022, 07:01:45 PM by zedd151 »
Regards, zedd.
:tongue:

NoCforMe

  • Member
  • *****
  • Posts: 1124
Re: my editor project
« Reply #140 on: October 14, 2022, 01:06:27 PM »
Why not, aren't you curious as to which method might be faster than what you would use?

Not really. It's of no real practical use. I've got other fish to fry (sizzle ... sizzle ... ).

zedd151

  • Member
  • *****
  • Posts: 1968
Re: my editor project
« Reply #141 on: October 14, 2022, 01:07:13 PM »
It's a perfect thing to do ... If it can't be made faster, how about smaller?
At any rate the algo I'm using is fast enough. But I do wonder if it can be made faster.


edit= remove remark.  :smiley:
« Last Edit: October 14, 2022, 07:12:00 PM by zedd151 »
Regards, zedd.
:tongue:

zedd151

  • Member
  • *****
  • Posts: 1968
Re: my editor project
« Reply #142 on: October 14, 2022, 01:18:30 PM »
It's of no real practical use.
Neither is writing yet another code editor. But I do that because I want to. Something to add to my arsenal of coding tools.  :cool:    I'll let you get back to frying fish ....
« Last Edit: October 14, 2022, 07:01:05 PM by zedd151 »
Regards, zedd.
:tongue:

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: my editor project
« Reply #143 on: October 14, 2022, 07:20:12 PM »
I'd never used TEXTRANGE before, how does that work?

There are many functions using TEXTRANGE, here is one example:
Code: [Select]
GetSomeBytes proc cStart, cEnd, pBuffer
LOCAL txrg:TEXTRANGE
  m2m txrg.chrg.cpMin, cStart
  m2m txrg.chrg.cpMax, cEnd
  m2m txrg.lpstrText, pBuffer
  invoke SendMessage, hRE, EM_GETTEXTRANGE, 0, addr txrg
  ret
GetSomeBytes endp

Hmm; my replace text function doesn't have to do any shifting of text at all; it simply replaces RichEdit selections of text. The control takes care of any shifting for me.

Yes indeed :biggrin:

But you can bet that the control does it much slower than any hand-written function you'd find in our Laboratory. The discussion is moot, though, because you must take RichEd20.dll's built-in function - this is not a plain text control. As I wrote above, I can't really see a difference, speed-wise.

zedd151

  • Member
  • *****
  • Posts: 1968
Re: my editor project
« Reply #144 on: October 14, 2022, 07:27:51 PM »
@jj2007: re TEXTRANGE. Okay, very similar to CHARRANGE, but has pointer to a buffer as a member too. Could be useful I suppose. I'll look into it further, later today.
Regards, zedd.
:tongue:

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: my editor project
« Reply #145 on: October 14, 2022, 08:19:04 PM »

zedd151

  • Member
  • *****
  • Posts: 1968
Re: my editor - menu bar help
« Reply #146 on: October 15, 2022, 02:29:14 AM »
Added help message box, to describe the Menu Bar directly accessible functions. Will add a more in depth help file at a later time.

Edit correction. Menu Bar, not message bar. Lol


Attachment 'basic editor17.zip' removed but is included in the archive In this post
« Last Edit: November 17, 2022, 12:47:38 PM by zedd151 »
Regards, zedd.
:tongue:

zedd151

  • Member
  • *****
  • Posts: 1968
my editor - added functions
« Reply #147 on: October 15, 2022, 03:38:02 AM »
Added a few custom functions and a new "Extra" menu.
Under the Extra menu:
  fixpunc - places a space after comma if missing in selected text
  decomment - removes ";" style commenting from selected text
  uncrlf - removes empty lines in selected text
  untab - replace hard TAB with 4 spaces
  uncap - uncapitalizes certain keywords ex.(INVOKE, CALL, PROTO, PROC, ENDP, QWORD, DWORD, etc) plus registers and a few others.
Useful for 'modernizing' MASM32 SDK example source code for instance. This isn't 1995!  (sorry hutch--)  :tongue:


Attachment 'basic editor18.zip' removed but is included in the archive In this post
« Last Edit: November 17, 2022, 12:48:10 PM by zedd151 »
Regards, zedd.
:tongue:

zedd151

  • Member
  • *****
  • Posts: 1968
Re: my IDE project?
« Reply #148 on: October 15, 2022, 10:25:11 AM »
I had been toying around with the idea of using MDI, and making a version of the editor as an IDE. The MDI children would be all richedit controls one for the .asm file, one for .inc file (when needed), one for .rc file and one for batch file. And additional windows when more than one .asm file or any other type for that matter are needed. If I can cobble together working code for it, I'll try to do that, and posts the results. But in the meantime, I'll continue adding functionality to the plano editor.  :biggrin:  If you don't see an MDI version posted in the next week, probably because I had scrapped the idea. Right now I'm kind of keen on trying it though.
Regards, zedd.
:tongue:

zedd151

  • Member
  • *****
  • Posts: 1968
Re: QE Plugins!
« Reply #149 on: October 15, 2022, 11:51:03 AM »
Nevermind the above post of mine. I will explore that later. I just got news that I can make this editor compatible with qeditor plugins. I have code for the editors side of the plugin interface as well as some crude code for loading up the plugins into the editors menu from an external editable menu.
I will be working the next day or so (probably a few days) on tidying up both of those pieces of code for use in this editor and testing the new code.
The first version that will include the plugin interface will be posted in a stripped down version of the editor, with only the functions necessary for loading and saving files plus the plugin interface and the menu functions.   :biggrin:   
Edit to add:
Later...
After looking at that old code, I think I can write better code than my original code - yuk. Will post the code that I do come up with as soon as it is ready.
« Last Edit: October 15, 2022, 01:16:37 PM by zedd151 »
Regards, zedd.
:tongue: