Author Topic: A general purpose code editor with scripting support  (Read 346 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10313
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
A general purpose code editor with scripting support
« on: November 29, 2022, 10:24:38 AM »
Over time a number of people have wanted a coding editor that they can modify and develop for their own personal preference. The attached zip file has a reasonably simple editor that supports calling a tweaked version of a script engine that can read the script form used in the MASM64 SDK to build working templates.

It is intentionally under developed so that it can be individually customised to personal preference, it just does the main hack stuff, File IO, search and replace, about box etc ....
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10313
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: A general purpose code editor with scripting support
« Reply #1 on: December 01, 2022, 09:51:11 AM »
A simple mod to add your own "Tools" menu and call any tools of your choice.

Open the "rsrc.rc" file and add the following script to it. This gives you a new menu on the menu bar.

    POPUP "&Tools", , , 0
    BEGIN
        MENUITEM "Run Color Picker", 350
        MENUITEM "", , 0x0800 /*MFT_SEPARATOR*/
        MENUITEM "Run Get Color", 351
    END

In the .data? section, add the following two (2) items.

      pBuffer   db 260 dup (?)  ; allocate a buffer for the app path
      pPath     dq ?

In the entry_point procedure, add the line,

    mov pPath, rv(GetAppPath,ADDR pBuffer)              ; get the editor path for later use

In the "WndProc" procedure within the .switch block for WM_COMMAND, add the following two ".case" items.

          .case 350
            mov pBuf, ptr$(buff)                        ; get pointer to 260 byte buffer
            mcat pBuf,pPath,"cpicker.exe"               ; add file name to path
            exec pBuf

          .case 351
            mov pBuf, ptr$(buff)                        ; get pointer to 260 byte buffer
            mcat pBuf,pPath,"getcolor.exe"              ; add file name to path
            exec pBuf

If you have copied the two (2) small apps cpicker.exe and getcolor.exe into the same directory as the editor, selecting them from the menu will work correctly. The reason for the editor path prefixing the buffer is so the apps on the menu can be called from any location on the computer.

The two small apps are only used as test pieces, with this simple mod, you can set up as many tools as you want on one or more menus and extend the editor to fit what you require.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

HSE

  • Member
  • *****
  • Posts: 2362
  • AMD 7-32 / i3 10-64
Re: A general purpose code editor with scripting support
« Reply #2 on: December 03, 2022, 01:31:20 AM »
 :thumbsup: Fantastic Hutch!
Equations in Assembly: SmplMath

daydreamer

  • Member
  • *****
  • Posts: 2305
  • my kind of REAL10 Blonde
Re: A general purpose code editor with scripting support
« Reply #3 on: December 03, 2022, 06:28:13 AM »
Great hutch :thumbsup:
I think i will be forced to use hll for the kind of editor i want to try make: Android simplest code editor

my none asm creations
http://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

Vortex

  • Member
  • *****
  • Posts: 2745
Re: A general purpose code editor with scripting support
« Reply #4 on: December 03, 2022, 07:33:44 AM »
Hi Hutch,

Very nice tool :thumbsup:

Gunther

  • Member
  • *****
  • Posts: 4156
  • Forgive your enemies, but never forget their names
Re: A general purpose code editor with scripting support
« Reply #5 on: December 03, 2022, 08:19:03 PM »
Steve,

that's a very useful tool. Thank you very kindly for this.  :thumbsup:
You have to know the facts before you can distort them.