'============================================================================
'  ALERTS.TXT -- Visual Cadd 3.0.1 Documentation for PB/DLL6.0
'  Sample code for VCSetAlertAppDll and VCSetAlertAppDllEx callbacks
'
'  Last Update: October 1, 1999
'============================================================================
'
' These callbacks are user-defined AND exported FROM the user's DLL.
' Each code SET IN VCSetAlertAppDll(Ex) results IN calls TO one of these
' callbacks.  Refer TO each CALLBACK declaration below FOR details about
' parameters AND when it is called.
'
' Syntax FOR VCSetAlertAppDll:
'   CALL VCSetAlertAppDll (iError%, "YourAlert.dll", "YourAlertName", _
'                             iCode0%)
'
' Syntax FOR VCSetAlertAppDllEx:
'   CALL VCSetAlertAppDllEx (iError%, "YourAlert.dll", "YourAlertName", _
'                            iCode0%, iCode1%)
'
' "YourAlert.dll" is NAME of the DLL containing the callbacks,  substitute
' the NAME of your custom DLL.
'
' "YourAlertName" is the NAME which prefixes the FUNCTION names IN the
' callbacks, substitute your custom NAME both IN VCSetAlertAppDll(Ex)
' AND IN the declarations below.
'
' iCode0%, iCode1% are the codes FOR the alerts which you desire.
'
' Refer to VCType.inc or the API Help file FOR their values.
' Codes which begin ALERT_APP_... are used IN the iCode0% parameter of
' either VCSetAlertAppDll OR VCSetAlertAppDllEx.
' Codes which begin ALERT_APP_EX_... are used IN the iCode1% parameter
' of VCSetAlertAppDllEx.  Refer TO the API Help file FOR further information.
'
' Parameters, IN general:
'      ALL of the callbacks are defined WITH a parameter list.  Many of the
'      callbacks DO NOT pass actual parameters, so the parameter list is
'      merely a place holder.
'      It is important TO retain these placeholders, because VCADD expects
'      this syntax.
'      Where parameters are actually passed, the declaration uses a
'      parameter NAME AND gives a description of the parameter.
'
'============================================================================
'  user-tool initiating - ALERT_APP_UTOOL_INIT
'  parameter: LOWRD(lParam) is Tool ID
'  note: called when a user-tool, started by VCSetUserTool, is starting.
SUB Your_Init ALIAS "YourAlertName_Init" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  user-tool terminating - ALERT_APP_UTOOL_TERMINATE
'  note: called when a user-tool, started by VCSetUserTool, is terminating.
SUB Your_Terminate ALIAS "YourAlertName_Terminate" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  user-tool aborting - ALERT_APP_UTOOL_ABORT
'  note: called when a user-tool, started by VCSetUserTool, is aborting.
SUB Your_Abort ALIAS "YourAlertName_Abort" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  user-tool mousedown - ALERT_APP_UTOOL_MOUSEDOWN
'  note: called when a user-tool, started by VCSetUserTool, receives
'      mouse-click INPUT FROM the user.
'      Points entered by the user FROM the keyboard are translated into
'      the equivalent mouse-click AND sent AS a mouse-down.
'      Refer TO API Help file FOR VCGetUserToolLBDown FOR mousedown
'      location.
SUB Your_MouseDown ALIAS "YourAlertName_MouseDown" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  user-tool mousemove - ALERT_APP_UTOOL_MOUSEMOVE
'  note: called when a user-tool, started by VCSetUserTool, receives
'      mousemove INPUT FROM the user.
'      Refer TO API Help file FOR VCGetUserToolMouseMove FOR mousemove
'      location.
SUB Your_MouseMove ALIAS "YourAlertName_MouseMove" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  user-tool mouseup - ALERT_APP_UTOOL_MOUSEUP
'  note: called when a user-tool, started by VCSetUserTool, receives
'      mouseup INPUT FROM the user.
'      Refer TO API Help file FOR VCGetUserToolLBUp FOR mouseup
'      location.
SUB Your_MouseUp ALIAS "YourAlertName_MouseUp" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  user-tool penup - ALERT_APP_UTOOL_PENUP
'  note: called when a user-tool, started by VCSetUserTool, receives
'      PenUp FROM the user.
SUB Your_PenUp ALIAS "YourAlertName_PenUp _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  user-tool ERASE rubberband - ALERT_APP_UTOOL_ERASERUBBER
'  note: called when a user-tool, started by VCSetUserTool, needs TO ERASE
'      ANY possible rubberband FROM the screen, due TO VCADD needing
'      TO change OR redraw the drawing view.
SUB Your_EraseRubber ALIAS "YourAlertName_EraseRubber" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  tool start - ALERT_APP_TOOL_START
'  parameters: LOWRD(lParam) is Tool ID, HIWRD(lParam) is Tool TYPE
'      Tool TYPE: 0, tool will abort other running tools
'          1, tool is nestable IN other running tools
'          2, tool is nestable AND generates tool start AND complete messages
'  note: called when a tool is starting.
'      When the user completes a tool normally, the typical sequence is:
'          1. Tool_Complete ON tool completing.
'          2. Tool_Start ON the DEFAULT tool AS it restarts.
'      When the user aborts a tool WITH Escape key, the typical sequence is:
'          1. Tool_Abort ON tool aborting.
'          2. Tool_Complete ON tool aborting.
'          3. Tool_Start ON the DEFAULT tool AS it restarts.
'      When the user aborts a tool by starting another tool, the typical
'          sequence is:
'          1. Tool_Start ON the tool the user started.
'          2. Tool_Abort ON tool aborting.
'          3. Tool_Complete ON tool aborting.
SUB Your_ToolStart ALIAS "YourAlertName_ToolStart" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  tool complete - ALERT_APP_TOOL_COMPLETE
'  parameters: LOWRD(lParam) is Tool ID, HIWRD(lParam) is Tool TYPE
'      Tool TYPE: 0, tool will abort other running tools
'          1, tool is nestable IN other running tools
'          2, tool is nestable AND generates tool start AND complete messages
'  note: called when a tool is completing.
'      See ToolStart FOR discussion of when this alert is generated.
SUB Your_ToolComplete ALIAS "YourAlertName_ToolComplete" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  tool abort - ALERT_APP_TOOL_ABORT
'  parameters: LOWRD(lParam) is Tool ID, HIWRD(lParam) is Tool TYPE
'      Tool TYPE: 0, tool will abort other running tools
'          1, tool is nestable IN other running tools
'          2, tool is nestable AND generates tool start AND complete messages
'  note: called when a tool is aborting.
'      See ToolStart FOR discussion of when this alert is generated.
SUB Your_ToolAbort ALIAS "YourAlertName_ToolAbort" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  world mousedown - ALERT_APP_WORLD_MOUSEDOWN
'  note: called when the user mouse-clicks IN the drawing.
'      This CALLBACK will receive ALL mousedowns, compared TO the CALLBACK
'      FOR user-tools which receives only mousedowns FOR that user-tool.
'      Refer TO API Help file FOR VCGetLastPoint FOR mousedown location.
SUB Your_WorldMouseDown ALIAS "YourAlertName_WorldMouseDown" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  world mouseup - ALERT_APP_WORLD_MOUSEUP
'  note: called when the user mouseups IN the drawing.
SUB Your_WorldMouseUp ALIAS "YourAlertName_WorldMouseUp" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  world mousemove - ALERT_APP_WORLD_MOUSEMOVE
'  note: called when the user mousemoves IN the drawing.
'      Refer TO API Help file FOR VCGetCurrentPoint FOR mousemove location.
SUB Your_WorldMouseMove ALIAS "YourAlertName_WorldMouseMove" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  command LINE character - ALERT_APP_CMDLINE_CHAR
'  parameter: LOWRD(wParam) is character code
'  note: called when the user enters command LINE INPUT FROM the keyboard.
'      Command LINE INPUT may also be captured through
'      PreTranslateGetMessage AND the WM_CHAR message.
'      That method may have advantages IN certain cases, AS it allows
'      the message TO be 'eaten' and not passed on to VCADD.
SUB Your_Char ALIAS "YourAlertName_Char" _
       (wParam AS LONG, lParam AS LONG) EXPORT
' ===========================================================================
'  entity erased - ALERT_APP_ENTITY_ERASED
'  note: called when an entity is erased.
SUB Your_EntityErased ALIAS "YourAlertName_EntityErased" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  entity selected - ALERT_APP_ENTITY_SELECT_CHANGE
'  note: called when an entity selection changes.
SUB Your_EntitySelectChange ALIAS "YourAlertName_EntitySelectChange" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  beginning TO redraw - ALERT_APP_WORLD_BEGIN_REDRAW
'  note: called when a drawing begins TO redraw.
SUB Your_WorldBeginRedraw ALIAS "YourAlertName_WorldBeginRedraw" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  done redrawing - ALERT_APP_WORLD_END_REDRAW
'  note: called when a drawing completes redrawing.
SUB Your_WorldEndRedraw ALIAS "YourAlertName_WorldEndRedraw" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  beginning TO PRINT - ALERT_APP_WORLD_BEGIN_PRINT
'  note: called when a drawing begins TO print.
SUB Your_WorldBeginPrint ALIAS "YourAlertName_WorldBeginPrint" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  done printing - ALERT_APP_WORLD_END_PRINT
'  note: called when a drawing completes printing.
SUB Your_WorldEndPrint ALIAS "YourAlertName_WorldEndPrint" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  DIALOG opening - ALERT_APP_EX_DIALOG_OPEN_MESSAGE
'  parameter: LOWRD(lParam) is DIALOG ID
'  note: called when a DIALOG has opened.
SUB Your_DialogOpen ALIAS "YourAlertName_DialogOpen" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  DIALOG closing - ALERT_APP_EX_DIALOG_CLOSE_MESSAGE
'  parameter: LOWRD(lParam) is DIALOG ID
'  note: called when a DIALOG has closed.
SUB Your_DialogClose ALIAS "YourAlertName_DialogClose" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  VCADD application closing - ALERT_APP_CLOSE
'  note: called when the VCADD application is closing.
SUB Your_AppClose ALIAS "YourAlertName_AppClose" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  VCADD drawing closing - ALERT_APP_WORLD_CLOSE
'  note: called when a VCADD drawing is closing.
SUB Your_DrawingClose ALIAS "YourAlertName_DrawingClose" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  VCADD main FRAME closing - ALERT_APP_FRAME_CLOSE
'  note: called when the main VCADD FRAME window is closing.
SUB Your_FrameClose ALIAS "YourAlertName_FrameClose" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  VCADD main FRAME resizing - ALERT_APP_FRAME_RESIZE
'  note: called when the main VCADD FRAME window is resizing.
SUB Your_FrameResize ALIAS "YourAlertName_FrameResize" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  VCADD activating - ALERT_APP_ACTIVATE
'  note: called when the VCADD application is being activated.
SUB Your_Activate ALIAS "YourAlertName_Activate" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  VCADD deactivating - ALERT_APP_DEACTIVATE
'  note: called when the VCADD application is being de-activated.
SUB Your_DeActivate ALIAS "YourAlertName_DeActivate" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  VCADD user-alert received - ALERT_APP_EX_USER_ALERT_MESSAGE
'  parameter: lParam is the code sent by user
'  notes: called when VCADD receives a user alert sent by the
'      user's application.
'      This is analogous TO WM_USER messages AND allows the user
'      TO SEND AND process user-defined messages.
'      User posts a user alert TO VCADD WITH the following:
'      lError& = PostMessage (VCGethWndFrame(), %WM_COMMAND, _
'                %VCM_USER_ALERT, lParam)
'      Note:  %VCM_USER_ALERT is defined AS 2801 IN VCTypes32.inc
SUB Your_UserAlert ALIAS "YourAlertName_UserAlert" _
       (wParam AS LONG, lParam AS LONG) EXPORT
'============================================================================
'  VCADD GetMessage (FROM PostMessage) -
'        ALERT_APP_EX_PRE_TRANSLATE_GET_MESSAGE
'  parameter: pMsg is pointer TO Windows message structure
'  RETURN value: TRUE TO eat message AND NOT allow VCADD TO process it
'        FALSE TO allow VCADD TO process message
'  notes: called when VCADD gets a message FROM the Windows message
'      queue.
'      Messages IN this queue originate AS PostMessages.
'      VCADD can be prevented FROM receiving AND processing the message
'      by returning TRUE FROM this CALLBACK function.
FUNCTION Your_PreTranslateMessage _
         ALIAS "YourAlertName_PreTranslateGetMessage" _
         (Msg AS tagMSG) EXPORT AS LONG
'============================================================================
'  VCADD FrameMessage (FROM SendMessage) -
'      ALERT_APP_EX_PRE_TRANSLATE_FRAME_MESSAGE
'  parameter: pMsg is pointer TO Windows message structure
'  RETURN value: TRUE TO eat message AND NOT allow VCADD TO process it
'        FALSE TO allow VCADD TO process message
'  notes: called when VCADD handles a Windows SendMessage.
'      VCADD can be prevented FROM receiving AND processing the message
'      by returning TRUE FROM this CALLBACK function.
FUNCTION Your_PreTranslateFrameMessage _
         ALIAS "YourAlertName_PreTranslateFrameMessage" _
         (Msg AS tagMSG) EXPORT AS LONG
'============================================================================
'  VCADD DIALOG messages -
'      ALERT_APP_EX_PRE_TRANSLATE_DIALOG_MESSAGE
'  parameter: pMsg is pointer TO Windows message structure
'  RETURN value: TRUE TO eat message AND NOT allow VCADD TO process it
'        FALSE TO allow VCADD TO process message
'  notes: called when VCADD processes DIALOG box messages.
'      VCADD can be prevented FROM receiving AND processing the message
'      by returning TRUE FROM this CALLBACK function.
FUNCTION Your_PreTranslateDialogMessage _
         ALIAS "YourAlertName_PreTranslateDialogMessage" _
         (Msg AS tagMSG) EXPORT AS LONG
'============================================================================

