%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
%                                                                           %
%  AsmEdit control - Documentation                                          %
%  Copyright  Tomasz Grysztar                                              %
%  Modifications by Tommy Lillehagen                                        %
%                                                                           %
%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%


%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
%  History                                                                  %
%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%

  Version 1.1 [10.08.03 - 18:49]

  [+] Added built-in color themes to AsmEdit (AEM_SETCOLORTHEME)
  [+] Now you select the whole line by double-click in the left-margin
  [-] Fixed "caret-in-margin" bug
  [-] Fixed default font-size

  Version 1.0 [10.08.03 - 12:12]

  [+] Added messages for file handling (AEM_LOAD, AEM_SAVE)
  [+] Added support for left-margin (AEM_SETMARGINWIDTH, AEM_SETMARGINCOLOR)
  [+] Popup-menu is now supported (AEM_SETPOPUPMENU)
  [-] New syntax highlighting procedure for FASM syntax built in the control
      (see AEM_SETSYNTAXHIGHLIGHT)
  [*] Included AsmPad as a demonstration of the control's usage.


%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
%  Todo                                                                     %
%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%

  * Highlighting of lines (breakpoint/error etc.)
  * Dynamic bookmarks
  * Indent/outdent selection if press tab/shift+tab
  * AsmEdit as include-file


%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%
%  Messages reference                                                       %
%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%

  WM_COPY
  WM_CUT
  WM_PASTE
  WM_CLEAR
  WM_SETTEXT
  WM_GETTEXTLENGTH
  WM_GETTEXT
  WM_SETFONT
  WM_GETFONT
  WM_UNDO / EM_UNDO
  EM_CANUNDO
  EM_EMPTYUNDOBUFFER
  EM_REPLACESEL

  Parameters:
    As for standard messages of those names.

  Return:
    As for standard messages of those names.

-----------------------------------------------------------------------------

  AEM_SETMODE

  Parameters:
    wparam = new mode value
    lparam = ignored, should be zero

  Return:
    Always returns zero.

  Remarks:
    Mode value can be zero or any combination of the following constants:
      AEMODE_OVERWRITE   - overwrite mode,
      AEMODE_VERTICALSEL - vertical selection mode.

-----------------------------------------------------------------------------

  AEM_GETMODE

  Parameters:
    wparam = ignored, should be zero
    lparam = ignored, should be zero

  Return:
    Current mode value.

-----------------------------------------------------------------------------

  AEM_SETSYNTAXHIGHLIGHT

  Parameters:
    wparam = pointer to table of syntax colors
    lparam = pointer to syntax highlight procedure or 0

  Return:
    Always returns zero.

  Remarks:
    Syntax procedure is SyntaxProc(lpLine,lpColors), both parameters are
    pointers to buffer of length 256. First is the pointer to the data of
    line that has to be syntax highlighted (it is padded with spaces to the
    maximum length), second is the pointer to colors for the each character
    in line, initially filled with zeros. Each color value occupies one byte
    and is index to the table of syntax colors (each field in that table is
    the standard 32-bit color value, table is indexed from 1) or zero for
    the unhighlighed color.
    If lparam equals to zero, the control will highlight text as FASM source.
    If wparam equals to zero, there will be no syntax highlighting.

-----------------------------------------------------------------------------

  AEM_GETLINEDATA

  Parameters:
    wparam = line number
    lparam = pointer to buffer for the line data

  Return:
    Always returns zero.

  Remarks:
    If line number is zero, current line is selected, if it's -1, the last
    line is selected. Buffer should have length of 256 bytes.

-----------------------------------------------------------------------------

  AEM_SETPOS

  Parameters:
    wparam = pointer to AEPOS structure
    lparam = ignored, should be zero

  Return:
    Always returns zero.

  Remarks:
    Fields of AEPOS should be set to the following values:
      caretLine         = number of line in which caret has to be placed,
                          zero means current line, -1 means last line
      caretPosition     = position in line where caret has to be placed,
                          zero means current position, 257 is the maximum
      selectionLine     = number of line where the selection has to begin,
                          zero means current line, -1 means last line
                          the end of selection is marked by caret position,
      selectionPosition = position in line where selection has to begin,
                          zero means current position, 257 is the maximum.

-----------------------------------------------------------------------------

  AEM_GETPOS

  Parameters:
    wparam = pointer to AEPOS structure
    lparam = ignored, should be zero

  Return:
    Always returns zero.

  Remarks:
    Fields of AEPOS are filled with the following information:
      caretLine         = number of line in which caret is placed
      caretPosition     = position in line where caret is placed
      selectionLine     = number of line where the selection begins
      selectionPosition = position in line where selection begins.

-----------------------------------------------------------------------------

  AEM_FINDFIRST

  Parameters:
    wparam = search flags
    lparam = pointer to string to search for

  Return:
    TRUE if string was found, FALSE otherwise.

  Remarks:
    Flags can be zero or any combination of the following values:
      AEFIND_CASESENSITIVE - case sensitive search,
      AEFIND_WHOLEWORDS    - accept whole words only,
      AEFIND_BACKWARD      - search backward from current position.

-----------------------------------------------------------------------------

  AEM_FINDNEXT

  Parameters:
    wparam = ignored, should be zero
    lparam = ignored, should be zero

  Return:
    TRUE if string was found, FALSE otherwise.

  Remarks:
    AEM_FINDFIRST has to be called first.

-----------------------------------------------------------------------------

  AEM_CANFINDNEXT

  Parameters:
    wparam = ignored, should be zero
    lparam = ignored, should be zero

  Return:
    TRUE if there is some search to be completed, FALSE otherwise.

-----------------------------------------------------------------------------

  AEM_GETWORDATCARET

  Parameters:
    wparam = size of buffer
    lparam = pointer to buffer

  Return:
    Always returns zero.

  Remarks:
    The buffer is filled with the string containing word in which the caret
    is placed.

-----------------------------------------------------------------------------

  AEM_SETTEXTCOLOR

  Parameters:
    wparam = color for text
    lparam = color for text background

  Return:
    Always returns zero.

-----------------------------------------------------------------------------

  AEM_SETSELCOLOR

  Parameters:
    wparam = color for selected text
    lparam = color for selected background

  Return:
    Always returns zero.

-----------------------------------------------------------------------------

  AEM_SETPOPUPMENU

  Parameters:
    wparam = ignored, should be zero
    lparam = handle of popup menu

  Return:
    Always returns zero.

-----------------------------------------------------------------------------

  AEM_SETMARGINCOLOR

  Parameters:
    wparam = color for margin background
    lparam = color for margin border

  Return:
    Always returns zero.

-----------------------------------------------------------------------------

  AEM_SETMARGINWIDTH

  Parameters:
    wparam = gap between border and text
    lparam = width of margin

  Return:
    Always returns zero.

-----------------------------------------------------------------------------

  AEM_LOAD

  Parameters:
    wparam = ignored, should be zero
    lparam = pointer to filename

  Return:
    If the function succeeds, the return value is 0.
    Else, the return value is 1.

-----------------------------------------------------------------------------

  AEM_SAVE

  Parameters:
    wparam = ignored, should be zero
    lparam = pointer to filename

  Return:
    If the function succeeds, the return value is 0.
    Else, the return value is 1.

-----------------------------------------------------------------------------

  AEM_SETCOLORTHEME

  Parameters:
    wparam = ignored, should be zero
    lparam = color theme

  Return:
    Always returns zero.

  Remarks:
    lparam can be one of the following values:
      ACT_BLACK, ACT_WHITE, ACT_BLUE

-----------------------------------------------------------------------------