; This file contains application level error codes for using with
; GetLastError/SetLastError functions inside Fresh IDE
; LastError and ErrorMessage functions uses these error codes
; together with system error codes to create error messagebox.
;----------------------------------------------------------------

errFresh = $20000000   ; 29-th bit set for application defined error codes.

errtypeError   = MB_OK or MB_ICONERROR
errtypeWarning = MB_OK or MB_ICONWARNING
errtypeInfo    = MB_OK or MB_ICONINFORMATION
errtypeNULL    = 0


macro ErrorsList [name, type, message] {
common
  local count
  count = 1

forward
  local lblmsg

  name = count + errFresh
  count = count + 1

  dd name, type, lblmsg

common
  dd 0

forward
  lblmsg du message, 0

}


iglobal

  label FreshErrorMessages dword
  ErrorsList               \
    errCanceled,        errtypeNULL,    "Canceled operation.",                                                 \
    errLoadBmp,         errtypeError,   "LoadImage API can't load specified bitmap image.",                    \
    errNotCompiled,     errtypeInfo,    "You must compile the source in order to use this feature.",           \
    errSourceEditor,    errtypeInfo,    "Active editor, containing compiled source is required.",              \
    errOpenDialog,      errtypeError,   "Failed to show open dialog.",                                         \
    errAddressNotFound, errtypeError,   "Address not found. Check the value.",                                 \
    errNotImplemented,  errtypeInfo,    "Sorry, but this feature is not implemented yet. :)",                  \
    errNotDefined,      errtypeInfo,    "This symbol is not defined. Try to compile without errors.",          \
    errCompilerHang,    errtypeError,   "Previous compilation is not finished. Wait a little and try again.",  \
    errCompilerMemory,  errtypeError,   "Can't allocate memory for compiler. Check the project settings.",     \
    errRunLinux,        errtypeError,   "Linux application can't be started.",                                 \
    errRunObject,       errtypeError,   "Can't execute object file.",                                          \
    errNotProject,      errtypeError,   <"This file is not a project file in Fresh project format.",13,"New project has been created.">,        \
    errTextNotFound,    errtypeError,   "Text not found"


  errmsgUnknownError text 'Unknown Fresh error reported. Probably bug...'
endg