Author Topic: A guide to the RichMasm editor  (Read 13669 times)

LordAdef

  • Member
  • ****
  • Posts: 588
Re: A guide to the RichMasm editor
« Reply #45 on: December 20, 2017, 10:35:37 AM »
hi JJ,

Would you refresh my poor memory? How do we actually change colours? it was something like col= ....
I can't find the post.
Cheers

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8522
  • Assembler is fun ;-)
    • MasmBasic
Re: A guide to the RichMasm editor
« Reply #46 on: December 20, 2017, 12:51:59 PM »
Hi Axel,
There should be a bubble help when you move the cursor over the Ctrl G field - you don't see it? Anyway, it's udc=... i.e. user-defined colours.
Cheers & thanks for the feedback.

LordAdef

  • Member
  • ****
  • Posts: 588
Re: A guide to the RichMasm editor
« Reply #47 on: December 22, 2017, 09:19:13 AM »
Hi Axel,
There should be a bubble help when you move the cursor over the Ctrl G field - you don't see it? Anyway, it's udc=... i.e. user-defined colours.
Cheers & thanks for the feedback.

There is one in fact! I never noticed it. But I now remember what I was looking for: the "?" trick to open the colour picker!

But thanks!

LordAdef

  • Member
  • ****
  • Posts: 588
Re: A guide to the RichMasm editor
« Reply #48 on: January 05, 2018, 08:02:46 AM »
Hi Johen,

Is there any plan for future enhancements regarding Richmasm?
Cheers Alex

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8522
  • Assembler is fun ;-)
    • MasmBasic
Re: A guide to the RichMasm editor
« Reply #49 on: January 05, 2018, 08:14:39 AM »
Right now I am happy with it.
Did you know that you can hit Ctrl F and type e.g. api:CreateW, Return?
Or that hitting F4 twice autoformats a whole para?
Or that Ctrl D inserts a hyperlink if there is a URL on the clipboard?
Or that \Masm32\MasmBasic\Res\Keywords.ini holds interesting info, e.g. on swi<blank> or .rep<blank>?
Or that Shift Tab on a block of selected text does not the same as Right Shift Tab?

Seriously: Do you miss something?

LordAdef

  • Member
  • ****
  • Posts: 588
Re: A guide to the RichMasm editor
« Reply #50 on: January 05, 2018, 08:49:50 AM »
Thanks Johen,

Richmasm is fine as it is, seriously. There are a couple of things here and there, as it´s always the case. I could maybe write it down some of the things I would find useful based on my daily experience. Since we all use and like different things, everyone would have some different needs.

1. I use col=? all the time. But it would be nice the colour picker could save the custom colours (as of now, it keeps them as long as RM is open).
2. Concerning col=? at al, I wished there were some window buttons we can simply clic it instead of typing col=?
3. Any way .asm files could be rich edited too, as with .asc?
4. I wish it could make me coffee too!  :eusa_dance:

My question was mainly out of curiosity. You´re playing with some windows toys, I thought implementing some windows interface like buttons would be in your future plans.
« Last Edit: January 05, 2018, 11:34:12 AM by LordAdef »

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5496
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: A guide to the RichMasm editor
« Reply #51 on: January 05, 2018, 11:25:17 AM »
Alex,

I asked about the coffee machine as well but no success yet.  :P
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8522
  • Assembler is fun ;-)
    • MasmBasic
Re: A guide to the RichMasm editor
« Reply #52 on: January 05, 2018, 12:37:13 PM »
1. I use col=? all the time. But it would be nice the colour picker could save the custom colours (as of now, it keeps them as long as RM is open).
2. Concerning col=? at al, I wished there were some window buttons we can simply clic it instead of typing col=?
3. Any way .asm files could be rich edited too, as with .asc?
4. I wish it could make me coffee too!  :eusa_dance:

My question was mainly out of curiosity. You´re playing with some windows toys, I thought implementing some windows interface like buttons would be in your future plans.

Hi Alex,
extract your personal beta from the attachment, then:
1.+2: Shift-click on the light blue up button to the left of "Case" (->OK for foreground, Shift OK for background colour)
3. You can misuse the .asm ending, but inside it's either rich or poor...
4. If Hutch promises to ... ehm, no blackmailing, sorry, but no coffee either 8)

LordAdef

  • Member
  • ****
  • Posts: 588
Re: A guide to the RichMasm editor
« Reply #53 on: January 05, 2018, 05:57:25 PM »
NICE!!

JJ, Thanks you, really!

One extra nice feature would be a "shift F4". Instead of the current F4, shift F4 would insert a " COMMENT # code   #". So we don´t loose our formating. :t

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8522
  • Assembler is fun ;-)
    • MasmBasic
Re: A guide to the RichMasm editor
« Reply #54 on: January 05, 2018, 08:57:31 PM »
Have a look at \Masm32\MasmBasic\Res\menus.ini, section [AutoCode]. If you add your own snippets, copy the file to \Masm32\MasmBasic\Res\UserDef\menus.ini - the original \Masm32\MasmBasic\Res\menus.ini gets overwritten with a new installation, but RM will load the UserDef version if it finds one.

Btw I never use COMMENT #whatever#

if 0  ; more efficient:
  This code
  is supposed to
  do something
endif

You can change it to if 1 to make it run, or even use a constant like if usedeb

Another version:
Code: [Select]
  newversion=1
  if newversion
xchg eax, ecx
  else
mov eax, ecx
  endif

If the old branch is big, I select the whole block and apply menu Edit & Format/Small font 8)
« Last Edit: January 06, 2018, 03:05:56 AM by jj2007 »

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8522
  • Assembler is fun ;-)
    • MasmBasic
Re: A guide to the RichMasm editor
« Reply #55 on: January 10, 2018, 05:50:44 AM »
For RichMasm users, attached a beta that allows to use own AutoCode snippets. Extract manually as follows:
\Masm32\MasmBasic\RichMasmBeta.exe
\Masm32\MasmBasic\Res\MenusRM.ini
\Masm32\MasmBasic\Plugins\ac*.asc

The ac* files contain a description for the menus and tooltips, followed by the autocode to be inserted. Example:

#desc[MessageBox#inserts invoke MessageBox, ...]#
        pushad
        MsgBox 0, str$(eax), chr$("Title"), MB_OK
        popad

Users can add their own AutoCode, provided they sit in the MasmBasic\Plugins folder and the name fits the ac*.asc pattern.

The example above appears as follows in the AutoCode menu (of course, the #desc[menu text#tooltip text]# sequence gets skipped when you click the menu, and only the pushad ... popad gets inserted); clicking would insert a MessageBox in the line below some$():


LordAdef

  • Member
  • ****
  • Posts: 588
Re: A guide to the RichMasm editor
« Reply #56 on: January 24, 2018, 04:44:43 AM »
hi Johen,

I thought it would be a great side project to write a plug in for RichMasm. This way I could dig into MasmBasic and also contribute to Richmasm  :icon_redface:.

Would you explain how this plugin works and what can I access?

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8522
  • Assembler is fun ;-)
    • MasmBasic
Re: A guide to the RichMasm editor
« Reply #57 on: January 24, 2018, 06:55:19 AM »
You are ambitious :t
There is one in the templates, third-last row, but I just discovered that it doesn't work properly. It assembles, but RichMasm doesn't recognise it as a plugin. Probably a small problem, but I will have to investigate. Tomorrow.

P.S.: Attached a version that works, but the documentation is partly wrong. Note that after the first build, you have to restart the editor to see the plugin.
« Last Edit: January 24, 2018, 10:56:15 AM by jj2007 »

LordAdef

  • Member
  • ****
  • Posts: 588
Re: A guide to the RichMasm editor
« Reply #58 on: January 24, 2018, 08:30:31 AM »
I meant to start with something really 'basic', with 'masmBasic'  :biggrin:

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 8522
  • Assembler is fun ;-)
    • MasmBasic
Re: A guide to the RichMasm editor
« Reply #59 on: January 24, 2018, 11:12:08 AM »
I thought that was really "basic" ;)

Attached a polished version. Extract all three files to \Masm32\MasmBasic\Plugins\
These two lines show what the editor passes to the plugin:

mov ecx, piBookmarks   ; points to an array of handles
fdeb 1, "Paras received:", hRE, piHandle, piCbMain, piCbRE, piSrcType, $piContent, $Win$(piAux), $Win$(piOut), $piPath, $piOptions, $piStart, piLen, $Win$(piFind), $Win$(piReplace), piNumBM, $Win$([ecx]), $Win$([ecx+4]), piDirty

hRE   handle to the main RichEdit control
piCbMain   pointer to the plugin's WndProc hook (if set, there you get all messages from RichMasm's WndProc)
piCbRE   same but for the subclassed RichEdit control
piContent   pointer to plain text content
piAux   pointer to plain text content of aux window (the Ctrl F12 thing)
piOut    pointer to content of output window
piPath   pointer to document path
piOptions   pointer the OPT_xxx options
piStart   pointer to selected plain text
piLen    length of selected text
piFind   handle of Find window
piReplace   handle of Replace window
piBookmarks   pointer to an array of the bookmark handles

Some of this is pretty useless, but it gives you an idea what is possible.