News:

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

Main Menu

MasmBasic

Started by jj2007, May 23, 2012, 10:16:07 PM

Previous topic - Next topic

LordAdef

Quote from: jj2007 on April 17, 2017, 04:29:09 AM
Quote from: LordAdef on April 16, 2017, 08:33:38 PMAny chance of you giving us this powerful colour enhancement?

Real MenTM select the text, hit Ctrl G and type col=ff8000h :P

and how do the Real Men set the bk colour?

jj2007

Quote from: LordAdef on April 17, 2017, 04:40:21 PM
and how do the Real Men set the bk colour?

Ha :t

You are getting ambitious here :icon_mrgreen:

1. Make a copy of
\Masm32\MasmBasic\Res\RichMasm.ini and place it in
\Masm32\MasmBasic\Res\UserDef\RichMasm.ini

2. Edit the lines under udc=nn, i.e. lines 18 to 25
3. Restart the editor.

That's for the document background. In case you want different backgrounds for individual sentences:
1. Try that in Micros**t Word (and tell me if that is possible :bgrin:)
2. Paste the result in RichMasm.

As mentioned in the 124 bugs thread, I need to add a warning that mat=0 destroys the work. If I find the time, I may add a Ctrl G bgc=bbggrrH function, too.

Attached a beta for you, Alex 8)

LordAdef

Thanks JJ, I will try that.



QuoteYou are getting ambitious here :icon_mrgreen:

Nice one!  ::)


I use the Office trick often, it works.

Do you have plans to implement that infamous colour tab as we talked about in the other thread? That would be a great for a future upgrade version.

jj2007


LordAdef

Hi JJ,

I just checked the beta you sent it. The UserDef worked! Thanks
But the Beta didn`t build my project.

When you say a "Beta for you", is it something related to the colour things we were talking about it? I didn´t see the difference.

ps (And I´m still using an old version of RM... I´ve got to update it but it was running so nicely I didn´t stop to do it)

jj2007

Quote from: LordAdef on April 22, 2017, 06:40:50 PMBut the Beta didn`t build my project.

What happened? Details please 8)

QuoteWhen you say a "Beta for you", is it something related to the colour things we were talking about it? I didn´t see the difference.

Hey, that was ages ago :P I can't remember what was "beta" at that moment. Anyway, current version is online and works like a charm.

LordAdef

QuoteWhat happened? Details please

Never mind, I´ve downloaded the latest version and everything is sweet!!

I got it=> you got the code for "bgc=" in there, right? That´s niice.

I know we are doing BGR, but would it be possible in the future to invert it to RGB? A lot more convenient when using color pickers that returns you the Hex values, and they usually do it in RGB. It´s only a Copy/Paste.

I like this online one, check it out, quite convenient: https://www.webpagefx.com/web-design/color-picker/a1d490


jj2007

Hmmmm... what about bgc=? and col=? instead of an online colour picker?

Of course, this requires major changes in the RichMasm source ::)

  void Val(esi)
  ...
  .if edx==-127           ; user typed col=? or bgc=?
      void RgbCol(?)      ; let the colour picker do it
  .endif

LordAdef

that would be fantastic!

jj2007

Update 24 April features a new option for the RgbCol macro:
QuoteRgbCol, CgaCol, SysCol
      mov eax, RgbCol(ebx, 0, 0)            ; any mix of reg32, vars and immediates is allowed
      mov bl, 127            ; only bl will be used
      invoke SetTextColor, hDC, RgbCol(ebx, 0, 0)      ; Red Green Blue for Gdi32 functions
      invoke SetTextColor, hDC, SysCol(ebx)            ; use the system palette
      invoke SetTextColor, hDC, RgbCol(?)            ; use the colour picker
      mov hPG, rv(GdipCreatePen1, RgbCol(alpha, red, green, blue), FP4(3.0), UnitWorld, addr pPen)
Rem      - Gdi functions want RGB values, i.e. three parameters
      - in contrast, GdiPlus expects ARGB, i.e. four parameters; the first one, alpha, defines
        transparency ranging from 0=fully transparent to 255=opaque
      - CgaCol(index) may be used with console colours; see ConsoleColor for identifiers
      - SysCol(index) returns a GetSystemPaletteEntries colour for use in Gui applications

See Reply #393 above for an application in RichMasm - greetings to Alex :biggrin:

(the void avoids a mov eax, eax)

LordAdef

===== THIS IS SO NICE JJ!!!! Thanks a lot ======


ps: edit to add: I mean this is reeeeally nice! Now I see RichMasm "flying clolours"  :greenclp: :eusa_clap: :eusa_dance:

jj2007

Don't overdo it, Alex. Rich text is certainly better than poor text, but with a lot of experience, I limit the use of colour nowadays to MB keywords, push/pop pairs (easier to see if the stack is balanced), and a few very specific tricky code consequences. Btw you can see this "default use" when selecting a block of text and hitting F4 aka "comment" twice.

Another example - red for @Backwards, blue for @Forward jumps (I prefer .Repeat ... .Exit .if ... .Until, though):

            xchg eax, ebx
  @@:
  dec edx
            jl @F
            stosb                  ; insert new empty elements
            jmp @B
  @@:  xchg eax, edi
            pop ebx

This helps to grasp how the loop works. It is much more important to have this visual aid when the loop spans over 20 or 50 lines, of course.

Christmas tree looks nice at first sight, but it doesn't help to focus attention on the really important parts. Which applies, btw, also to the VS or Scintilla style automatic highlighting.

LordAdef

QuoteDon't overdo it, Alex. Rich text is certainly better than poor text, but with a lot of experience, I limit the use of colour nowadays to MB keywords, push/pop pairs (easier to see if the stack is balanced), and a few very specific tricky code consequences.

Oh, don´t worry. In fact I never did it. But it´s invaluable for temporary modifications. I usually colour when trying things out. Later, when things look right, I bring them back to default.

I´m posting my game there at my thread, you will see it´s being used carefully.

jj2007

Quote from: LordAdef on April 24, 2017, 10:28:42 PMit´s invaluable for temporary modifications

Exactly :t

What I frequently use:

if 1
  ... 50 lines of active code ...
else
  ... 50 lines of alternative code ...
endif

LordAdef

JJ,

only FYI, a behaviour I don't recall from the previous 2 versions but now in place:

If you select some code and build (while the code is still selected) it generates an error. I found this by chance when selecting some code, F4 and build. The commented bit must be unselected now in order for the build to be successful.

Nothing out of this world,  but I thought I should let you know.