Hello,
I've been learning how to use AtSynEdit, but have been really struggling with:
- Macro Record
- Macro Playback
I was wondering if someone could show some example code, with events etc..
(this could be a nice addition to AtSynEdit Demo's Folder, as well)
Thank you most sincerely..
AtSynEdit - Example Macro Code
-
- Posts: 2300
- Joined: 25.08.2021 18:15
CudaText does it OK. It handles events OnCommand, OnCommandAfter.
In OnCommand you handle command codes. if it is cmd_MacroStart (it's CudaText constant) then you remember that 'macro record begins'.
if it is cmd_MacroStop then you remember that 'macro record stops'.
if it is another command, which you want in macros, and flag "macro begins" is set, you remember that command in a list.
==========
Later yon playback that recorded command codes using TATSynEdit.DoCommand().
In OnCommand you handle command codes. if it is cmd_MacroStart (it's CudaText constant) then you remember that 'macro record begins'.
if it is cmd_MacroStop then you remember that 'macro record stops'.
if it is another command, which you want in macros, and flag "macro begins" is set, you remember that command in a list.
==========
Later yon playback that recorded command codes using TATSynEdit.DoCommand().