News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How can I add auto indents to my IDE

Started by David, December 16, 2009, 06:33:34 PM

Previous topic - Next topic

David

So I made a colored IDE using RichEdit box, however, I am having trouble using auto indents.

For example, if somebody indents five, it auto takes you to where the text above it was at.

i.e.

              ;I type something here
             ;then when i press tab once it takes me here, instead of pressing tab twice.  How do they do this?  Can anybody give me an example (not in code) but in writing ;about which functions would be used?

;Also, when somebody types

.WHILE TRUE
      ;how do I make it indent here in the next line?  Do SendKeys like that?  Or use a special API function for the rich text box?  If so, which function would this be?
.ENDW

jj2007

Hi,
Here is a list of the messages I used to get autoindents with RichMasm. Basically, you have to study the line before, and add a tab if needed.
Hope this helps,
JJ

  invoke SendMessage, hRE, EM_EXGETSEL, 0, eax
  invoke SendMessage, hRE, EM_GETTEXTRANGE, 0, eax
  invoke SendMessage, hRE, EM_LINEINDEX, eax, 0
  invoke SendMessage, hRE, EM_EXLINEFROMCHAR, 0, eax
  invoke SendMessage, hRE, EM_GETTEXTRANGE, 0, eax
  invoke SendMessage, hRE, EM_EXSETSEL, 0, addr chrg
  invoke SendMessage, hRE, EM_SETTEXTEX, addr stx, reptxt ; replace with new text