ImageChecked = 8

iglobal

ActionList MainActionList, MainAccels,                                                                             \
  actNew,         0, '&New...',         <Ctrl, 'N'>,         'Creates new file.',          OnNew,               \
  actOpen,        1, '&Open',           <Ctrl, 'O'>,         'Open file',                  OnOpen,              \
  actSave,        2, '&Save',           <Ctrl, 'S'>,         'Save file',                  OnSave,              \
  actSaveAs,     -1, 'Save &As',        <NONE>,              'Save file with new name',    OnSaveAs,            \
  actExit,       -1, '&Exit',           <Alt,  'X'>,         'Exit program',               OnExit,              \
\
  actUndo,        3, '&Undo',           <Ctrl, 'Z'>,         'Undo last change',           OnUndo,              \
  actCut ,        4, 'Cu&t',            <Ctrl, 'X'>,         'Cut to clipboard',           OnCut,               \
  actCopy,        5, '&Copy',           <Ctrl, 'C'>,         'Copy to clipboard',          OnCopy,              \
  actPaste,       6, '&Paste',          <Ctrl, 'V'>,         'Paste from clipboard',       OnPaste


CoolMenu MainMenu,                      \
  mfSubmenu, '&File',                   \
    mfNormal, actNew,                   \
    mfNormal, actOpen,                  \
    mfNormal, actSave,                  \
    mfNormal, actSaveAs,                \
    mfSeparator, NONE,                  \
    mfNormal, actExit,                  \
  mfEnd, NONE,                          \
  mfSubmenu, '&Edit',                   \
    mfNormal, actUndo,                  \
    mfSeparator, NONE,                  \
    mfNormal, actCut,                   \
    mfNormal, actCopy,                  \
    mfNormal, actPaste,                 \
  mfEnd, NONE

CoolToolbar MainToolbar,                \
  bfButton, actNew,                     \
  bfButton, actOpen,                    \
  bfButton, actSave,                    \
  bfSeparator, NONE,                    \
  bfButton, actUndo,                    \
  bfSeparator, NONE,                    \
  bfButton, actCut,                     \
  bfButton, actCopy,                    \
  bfButton, actPaste

endg


proc OnNew, .wparam, .lparam
begin
        invoke  SendDlgItemMessageA, [hMainForm], 1, WM_SETTEXT, 0, 0
        return
endp

proc OnOpen, .wparam, .lparam
begin
        invoke  MessageBoxA, [hMainForm],               \
                'So, this is simply example. You have to write this action handler yourself. Check "actions.asm" to see where you should code it.', \
                'Just an example.', MB_ICONINFORMATION or MB_OK
        return
endp


proc OnSave, .wparam, .lparam
begin
        invoke  MessageBoxA, [hMainForm],               \
                'So, this is simply example. You have to write this action handler yourself. Check "actions.asm" to see where you should code it.', \
                'Just an example.', MB_ICONINFORMATION or MB_OK
        return
endp

proc OnSaveAs, .wparam, .lparam
begin
        invoke  MessageBoxA, [hMainForm],               \
                'So, this is simply example. You have to write this action handler yourself. Check "actions.asm" to see where you should code it.', \
                'Just an example.', MB_ICONINFORMATION or MB_OK
        return
endp

proc OnExit, .wparam, .lparam
begin
        invoke  MessageBoxA, [hMainForm],               \
                'So, this is simply example. You have to write this action handler yourself. Check "actions.asm" to see where you should code it.', \
                'Just an example.', MB_ICONINFORMATION or MB_OK
        return
endp

proc OnUndo, .wparam, .lparam
begin
        invoke  MessageBoxA, [hMainForm],               \
                'So, this is simply example. You have to write this action handler yourself. Check "actions.asm" to see where you should code it.', \
                'Just an example.', MB_ICONINFORMATION or MB_OK
        return
endp

proc OnCut, .wparam, .lparam
begin
        invoke  MessageBoxA, [hMainForm],               \
                'So, this is simply example. You have to write this action handler yourself. Check "actions.asm" to see where you should code it.', \
                'Just an example.', MB_ICONINFORMATION or MB_OK
        return
endp

proc OnCopy, .wparam, .lparam
begin
        invoke  MessageBoxA, [hMainForm],               \
                'So, this is simply example. You have to write this action handler yourself. Check "actions.asm" to see where you should code it.', \
                'Just an example.', MB_ICONINFORMATION or MB_OK
        return
endp

proc OnPaste, .wparam, .lparam
begin
        invoke  MessageBoxA, [hMainForm],               \
                'So, this is simply example. You have to write this action handler yourself. Check "actions.asm" to see where you should code it.', \
                'Just an example.', MB_ICONINFORMATION or MB_OK
        return
endp

