Stewart Obert wrote:
I'm trying to build macro recording into the Scintilla Class/ActiveX
I've been working on.
I'm a bit lost on this one though. As near as I can guess from looking
at other sources is lParam is the pointer in memory where the character
was entered if I entered say the letter p, or perhaps if I pasted
something into it. However I've tried getting the data stored at that
pointer and just gotten a lot of useless information.
So as it stands I'm at a bit of a loss on what exactly is happening and
I would need to handle and how I would need to handle it to catch the
neccisary info. The way I see it I need one bit of information most the
time, and occasionally 2.
As I see it if a paste or copy, event or something of that nature is
called then I just need to send that msg to scintilla. That's easy
enough.
Where I run into problems is entering text. If I ! say enter the
character "f" then I need to I presume know which character was
entered. I thought I could use the scMsg variable I have which is
derived from the SCNotification type (just SCNotification converted from
C++ to VB) and call scMsg.ch. That unfortunatly did not work. I'm
guessing that the ch only has something assigned to it when entered.
Anyway as it stands what I've done as a bit of a hack is created a
variable that each time text is added I store the ch to it. Then when
scn_macrorecord is called I pass that with it.
This works but I figure there must be a better way. Any help is greatly
appreciated. Thanks
The trivial comment is that, as stated in the ScintillaDoc.html
description of the SCNotification struct, ch is only set for the
SCN_CHARADDED and SCN_KEY notifications.
The model for macro recording (at least as I see it) is not what you
think... you really are just getting what is passed in to Scintilla.
So what I think this translates to for your case is that you should be
seeing SCN_MACRORECORD notifications with a message value like
SCI_INSERTTEXT, a wParam with a char count, and an lParam pointing to
a char string.
Further, it is up to client code (or an extended "smart" wrapper) to
copy these for possible future playback... in particular, as I see it
from the doc (but without checking the code), you would need to stash
copies of any strings yourself and use *those* when doing a playback.
I expect this is true if what is being passed in is indeed the "raw"
data from the Scintilla calls (nothing constrains a Scintilla client
to keep pointer values valid indefinitely).
Robert Roessler
[EMAIL PROTECTED]
http://www.rftp.com
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest