News:

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

Main Menu

A guide to the RichMasm editor

Started by jj2007, April 28, 2016, 10:09:34 PM

Previous topic - Next topic

LordAdef

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

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

Quote from: jj2007 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.

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

Hi Johen,

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

jj2007

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

#50
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.

hutch--

Alex,

I asked about the coffee machine as well but no success yet.  :P

jj2007

Quote from: LordAdef on January 05, 2018, 08:49:50 AM1. 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

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

#54
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:
  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)

jj2007

#55
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

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

#57
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.

LordAdef

I meant to start with something really 'basic', with 'masmBasic'  :biggrin:

jj2007

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.