home *** CD-ROM | disk | FTP | other *** search
-
- The HASWIN window library.
- ===========================
- Copyright H.A. Shaw 1990.
- ===========================
-
- HASWIN is designed to take as much of the workload of operating
- under the WIMP environment away from the user program as possible. This
- is so that the user program (and its programmer) can concentrate on the
- actual application leaving all the mundane tasks to HASWIN. In order to
- do this HASWIN provides an interface to the SWI WIMP_Poll that a user
- application would normally call to find out what changes are happening
- in the WIMP that the program must respond to. The HASWIN routine
- "haswin_poll()" calls the WIMP and deals with most circumstances on its
- own. It calls the user provided routines to deal with things it cannot
- know about such as drawing inside windows, loading or saving files and
- RAM data transfers. It always confirms its default actions with the user
- program by calling the user routines before it takes any action itself.
- The user routines can prevent HASWIN from continuing to process by
- returning the value HASWIN_FALSE when they exit. HASWIN will then abandon
- the current processing and the routine haswin_poll() will return.
- To continue processing other WIMP events haswin_poll() should be called
- again. If haswin_poll() is called it is garennteed to return eventually,
- even if there is no WIMP event to process.
- HASWIN allows the user program to provide its own polling routine
- that HASWIN will call. If provided, the routine is called before HASWIN
- performs its actions and this allows the routine to extend, or replace
- the default actions of HASWIN on a per-call basis and this greatly extends
- the HASWIN library's functionality. The user routine must be a C function
- of global scope defined as follows...
-
- int routine(int code, buffer *buf);
-
- A HASWIN function is provided to inform HASWIN of the existance of
- the user poll routine.
-
- int haswin_setuserpollroutine(int (*routine)(int code, buffer *buf));
- - Set a new user routine to be called from within "haswin_poll()"
- If "routine" is 0 then no routine is set. The routine takes
- two parameters when called.
- - "code" is the WIMP reason code from WIMP_Poll (note: HASWIN
- provides extra reason codes of its own).
- - "buf" is the buffer passed from WIMP_Poll (note: HASWIN can
- add extra things to this buffer as it sees fit).
-
- The user poll routine will be called automatically by HASWIN at
- least once each time "haswin_poll()" is called. The parameter "code"
- contains the possible reason codes and the list below shows the codes
- and describes the WIMP activity that causes them to be used.
-
- HASWIN_POLL_Nothing - A Null_Reason_Code (0) has been received by HASWIN
- from the SWI WIMP_Poll. The buffer contains no
- useful information and may be altered in any way.
- Since HASWIN performs no processing the user
- routine can return any value, which will be ignored
- by HASWIN and passed back to the caller of the
- haswin_poll() that caused the user routine to be
- called.
-
- HASWIN_POLL_Redraw - A Redraw_Window_Request (1) has been received by
- HASWIN from the SWI WIMP_Poll.
- The buffer contains...
- buf->i[ 0] = window handle to be redrawn
- buf->i[ 1] = pointer to window structure
- This reason code is used to inform the user program
- that a window is to be redrawn. If the user
- routine returns HASWIN_FALSE then HASWIN abandons
- the redraw operation and returns HASWIN_FALSE to
- the caller of the haswin_poll() that handled the
- redraw operation. The user routine should not
- alter the buffer.
-
- HASWIN_POLL_PostRedraw - Redrawing of a window is complete.
- The buffer contains...
- buf->i[ 0] = handle of window just redrawn
- buf->i[ 1] = pointer to window structure
- This reason code is used to inform the user program
- that HASWIN has completed the redraw of a window.
- Since HASWIN has no more processing to do it passes
- the return code HASWIN_TRUE or HASWIN_FALSE back
- to the caller of the haswin_poll() that handled the
- the redraw operation. The user routine should not
- alter the buffer.
-
- HASWIN_POLL_Open - A Open_Window_Request (2) has been received by
- HASWIN from the SWI WIMP_Poll.
- The buffer contains...
- buf->i[ 0] = window handle
- buf->i[ 1] = visable area minimum X coordinate
- buf->i[ 2] = visable area minimum Y coordinate
- buf->i[ 3] = visable area maximum X coordinate
- buf->i[ 4] = visable area maximum Y coordinate
- buf->i[ 5] = scroll x offset
- buf->i[ 6] = scroll y offset
- buf->i[ 7] = handle to open window behind
- buf->i[ 8] = pointer to window structure
- This reason code is used to inform the user program
- that a window is to be opened. If the user routine
- returns HASWIN_FALSE then HASWIN abandons the open
- operation and returns HASWIN_FALSE to the caller of
- the haswin_poll() that handled the open operation.
- The user routine can alter the buffer to modify how
- the window will be opened and its position. The
- window handle and pointer to window structure
- fields of the buffer should not be altered.
-
- HASWIN_POLL_Close - A Close_Window_Request (3) has been received by
- HASWIN from the SWI WIMP_Poll.
- The buffer contains...
- buf->i[ 0] = window handle
- buf->i[ 1] = pointer to window structure
- This reason code is used to inform the user program
- that a window is to be closed. If the user routine
- returns HASWIN_FALSE then HASWIN abandons the close
- operation and returns HASWIN_FALSE to the caller of
- the haswin_poll() that handled the close operation.
- The user routine should not alter the buffer.
-
- HASWIN_POLL_Entering - A Pointer_Entering_Window (4) has been received by
- HASWIN from the SWI WIMP_Poll.
- The buffer contains...
- buf->i[ 0] = window handle
- buf->i[ 1] = pointer to window structure
- This reason code is used to inform the user program
- that the mouse pointer is about to enter a window.
- If the user routine returns HASWIN_FALSE then
- HASWIN abandons the processing associated with the
- mouse entering window operation and returns
- HASWIN_FALSE to the caller of the haswin_poll()
- that handled the mouse entering window operation.
- The user routine should not alter the buffer.
-
- HASWIN_POLL_Leaving - A Pointer_Leaving_Window (5) has been received by
- HASWIN from the SWI WIMP_Poll.
- The buffer contains...
- buf->i[ 0] = window handle
- buf->i[ 1] = pointer to window structure
- This reason code is used to inform the user program
- that the mouse pointer is about to leave a window.
- If the user routine returns HASWIN_FALSE then
- HASWIN abandons the processing associated with the
- mouse leaving window operation and returns
- HASWIN_FALSE to the caller of the haswin_poll()
- that handled the mouse leaving window operation.
- The user routine should not alter the buffer.
-
- HASWIN_POLL_Mouse_1st - A Mouse_Click (6) has been received by HASWIN
- from the SWI WIMP_Poll.
- The buffer contains...
- buf->i[ 0] = mouse X coordinate in screen
- buf->i[ 1] = mouse Y coordinate in screen
- buf->i[ 2] = WIMP button state
- buf->i[ 3] = window handle
- buf->i[ 4] = icon handle
- buf->i[ 5] = HASWIN standard button state
- buf->i[ 6] = pointer to window structure
- buf->i[ 7] = pointer to icon structure
- This reason code is used when HASWIN detects
- that a mouse operation has occured but before
- HASWIN does any processing. If the user routine
- returns HASWIN_FALSE then HASWIN abandons the
- processing associated with the mouse click
- operation and returns HASWIN_FALSE to the caller
- of the haswin_poll() that handled the mouse click
- operation. The user routine may alter the buffer
- if it wishes, but HASWIN ignores any attempt to
- change the window or icon handles or structure
- pointers. The X and Y coordinates of the mouse
- and the mouse button state may be changed however.
- Changing the X and Y coordinates can be used, for
- example, to force the mouse to align with character
- positions in the window.
-
- HASWIN_POLL_Mouse_2nd - A Mouse_Click (6) has been received by HASWIN
- from the SWI WIMP_Poll.
- The buffer contains...
- buf->i[ 0] = mouse X coordinate in screen
- buf->i[ 1] = mouse Y coordinate in screen
- buf->i[ 2] = WIMP button state
- buf->i[ 3] = window handle
- buf->i[ 4] = icon handle
- buf->i[ 5] = HASWIN standard button state
- buf->i[ 6] = pointer to window structure
- buf->i[ 7] = pointer to icon structure
- This reason code is used when HASWIN detects
- that a mouse operation has occured but after HASWIN
- has done some processing. If the mouse click was
- on the MENU button this reason code will not be
- used. If the mouse click was a SELECT or ADJUST
- DRAG or DOUBLE CLICK then the reason code
- HASWIN_POLL_Mouse_1st will be used, with a button
- state of SELECT or ADJUST and then this reason code
- will be used with the correct button state. If
- the user routine returns HASWIN_FALSE then HASWIN
- abandons further processing associated with the
- mouse click operation and returns HASWIN_FALSE to
- the caller of the haswin_poll() that handled the
- mouse click operation. The user routine may alter
- the buffer if it wishes, but HASWIN ignores any
- attempt to change the window or icon handles or
- structure pointers. The X and Y coordinates of the
- mouse and the mouse button state may be changed
- however. Changing the state is dangerous since
- HASWIN has already done some processing. Changing
- the X and Y coordinates can be used, for example,
- to force the mouse to align with character
- positions in the window.
-
- HASWIN_POLL_Drag - A User_Drag_Box (7) has been received by HASWIN
- from the SWI WIMP_Poll.
- The buffer contains...
- buf->i[ 0] = minimum X coordinate
- buf->i[ 1] = minimum Y coordinate
- buf->i[ 2] = maximum X coordinate
- buf->i[ 3] = maximum Y coordinate
- buf->i[ 4] = window handle where drag started
- or -1
- buf->i[ 5] = icon handle where drag started or
- -1
- buf->i[ 6] = pointer to window structure where
- drag started or 0
- buf->i[ 7] = pointer to icon structure where
- drag started or 0
- This reason code is used to inform the user program
- that a user drag operation has finished, and that
- the user dragroutine exists, has been called and
- has returned HASWIN_TRUE. If the user routine
- returns HASWIN_FALSE then HASWIN abandons the
- processing associated with the drag operation
- and returns HASWIN_FALSE to the caller of the
- haswin_poll() that handled the drag operation.
- The user routine may alter the buffer if it wishes,
- but HASWIN ignores any changes.
-
- HASWIN_POLL_Key - A Key_Pressed (8) has been received by HASWIN
- from the SWI WIMP_Poll.
- The buffer contains...
- buf->i[ 0] = window handle
- buf->i[ 1] = icon handle or -1
- buf->i[ 2] = X coordinate in screen
- buf->i[ 3] = Y coordinate in screen
- buf->i[ 4] = caret height and flags
- buf->i[ 5] = index into string of icon
- buf->i[ 6] = character code as an int
- buf->i[ 7] = pointer to window structure
- buf->i[ 8] = pointer to icon structure
- This reason code is used to inform the user program
- that a key has been pressed while one of the user
- program's windows was the input focus. If the user
- routine returns HASWIN_FALSE then HASWIN abandons
- the processing of keys and returns HASWIN_FALSE
- to the caller of the haswin_poll() that handled the
- mouse entering window operation. The user routine
- may alter the buffer if it wishes, but HASWIN only
- uses the character code in its processing.
-
- HASWIN_POLL_Menu - A Menu_Selection (9) has been received by HASWIN
- from the SWI WIMP_Poll.
- The buffer contains...
- buf->i[ 0] = number of selected item in menu
- buf->i[ 1] = number of item in 1st sub-menu
- buf->i[ 2] = number of item in 2nd sub-menu
- buf->i[ 3] = number of item in 3rd sub-menu
- ... terminates with item -1
- This reason code is used to inform the user program
- that an item in a menu has been selected. If the
- user routine returns HASWIN_FALSE then HASWIN
- abandons the processing of the menu selection and
- returns HASWIN_FALSE to the caller of the
- haswin_poll() that handled the menu selection
- operation. The user routine should not alter the
- buffer.
-
- HASWIN_POLL_Scroll - A Scroll_Request (10) has been received by HASWIN
- from the SWI WIMP_Poll.
- The buffer contains...
- buf->i[ 0] = window handle
- buf->i[ 1] = visable area minimum X coordinate
- buf->i[ 2] = visable area minimum Y coordinate
- buf->i[ 3] = visable area maximum X coordinate
- buf->i[ 4] = visable area maximum Y coordinate
- buf->i[ 5] = current scroll x offset
- buf->i[ 6] = current scroll y offset
- buf->i[ 7] = handle to open window behind
- buf->i[ 8] = scroll X direction
- buf->i[ 9] = scroll Y direction
- buf->i[10] = pointer to window structure
- This reason code is used to inform the user program
- that a scroll operation has been performed and that
- the window must be updated. If the user routine
- returns HASWIN_FALSE then HASWIN abandons the
- scroll operation, the window does not change, and
- HASWIN_FALSE is returned to the caller of the
- haswin_poll() that handled the scroll request.
- The user routine may alter the buffer if it wishes
- and HASWIN will process the scroll request
- according to the buffer as it is after the call
- to the user routine.
-
- HASWIN_POLL_Scrolled - A Scroll_Request (10) has been received by HASWIN
- from the SWI WIMP_Poll.
- The buffer contains...
- buf->i[ 0] = window handle
- buf->i[ 1] = visable area minimum X coordinate
- buf->i[ 2] = visable area minimum Y coordinate
- buf->i[ 3] = visable area maximum X coordinate
- buf->i[ 4] = visable area maximum Y coordinate
- buf->i[ 5] = calculated new scroll x offset
- buf->i[ 6] = calculated new scroll y offset
- buf->i[ 7] = handle to open window behind
- buf->i[ 8] = scroll X direction
- buf->i[ 9] = scroll Y direction
- buf->i[10] = pointer to window structure
- This reason code is used to inform the user program
- that a scroll operation has been performed and that
- the window must be updated. If the user routine
- returns HASWIN_FALSE then HASWIN abandons the
- scroll operation, the window does not change, and
- HASWIN_FALSE is returned to the caller of the
- haswin_poll() that handled the scroll request.
- The difference between this reason code and the
- reason code "HASWIN_POLL_Scroll" is that this is
- used after HASWIN has calculated the new scroll
- offsets and "HASWIN_POLL_Scroll" is used before.
- The user routine may alter the buffer if it wishes
- and HASWIN will process the scroll request
- according to the buffer as it is after the call
- to the user routine.
-
- HASWIN_POLL_Lose_Caret - A Lose_Caret (11) has been received by HASWIN
- from the SWI WIMP_Poll.
- The buffer contains...
- buf->i[ 0] = window handle
- buf->i[ 1] = icon handle or -1
- buf->i[ 2] = X coordinate in screen
- buf->i[ 3] = Y coordinate in screen
- buf->i[ 4] = caret height and flags
- buf->i[ 5] = index into string if writable icon
-
- HASWIN_POLL_Gane_Caret - A Gain_Caret (12) has been received by HASWIN
- from the SWI WIMP_Poll.
- The buffer contains...
- buf->i[ 0] = window handle
- buf->i[ 1] = icon handle or -1
- buf->i[ 2] = X coordinate in screen
- buf->i[ 3] = Y coordinate in screen
- buf->i[ 4] = caret height and flags
- buf->i[ 5] = index into string if writable icon
-
- HASWIN_POLL_Message - A User_Message (17) has been received by HASWIN
- from the SWI WIMP_Poll.
- Many messages are dealt with automatically by
- HASWIN and result in other calls to the user
- routine. Unknown messages are passed to the user
- routine directly.
- The buffer contains...
- buf->i[ 0] = length of buffer (20-256) in a
- multiple of 4 (ie. words)
- buf->i[ 1] = task handle of sender
- buf->i[ 2] = sender's reference number
- buf->i[ 3] = previous message reference number
- or 0 if this is not a reply
- buf->i[ 4] = message type
- buf->i[ 5] = beginning of message data.
-
- HASWIN_POLL_Message_Rec - A User_Message_Recorded (18) has been received by
- HASWIN from the SWI WIMP_Poll.
- Many messages are dealt with automatically by
- HASWIN and result in other calls to the user
- routine. Unknown messages are passed to the user
- routine directly.
- The buffer contains...
- buf->i[ 0] = length of buffer (20-256) in a
- multiple of 4 (ie. words)
- buf->i[ 1] = task handle of sender
- buf->i[ 2] = sender's reference number
- buf->i[ 3] = previous message reference number
- or 0 if this is not a reply
- buf->i[ 4] = message type
- buf->i[ 5] = beginning of message data.
-
- HASWIN_POLL_Message_Ack - A User_Message_Acknowledge (19) has been received
- by HASWIN from the SWI WIMP_Poll.
- Many messages are dealt with automatically by
- HASWIN and result in other calls to the user
- routine. Unknown messages are passed to the user
- routine directly.
- The buffer contains...
- buf->i[ 0] = length of buffer (20-256) in a
- multiple of 4 (ie. words)
- buf->i[ 1] = task handle of sender
- buf->i[ 2] = sender's reference number
- buf->i[ 3] = previous message reference number
- or 0 if this is not a reply
- buf->i[ 4] = message type
- buf->i[ 5] = beginning of message data.
-
- HASWIN_POLL_poll_Open - A window is about to be opened as part of a HASWIN
- automatic operation.
- The buffer contains...
- buf->i[ 0] = window handle
- buf->i[ 1] = visable area minimum X coordinate
- buf->i[ 2] = visable area minimum Y coordinate
- buf->i[ 3] = visable area maximum X coordinate
- buf->i[ 4] = visable area maximum Y coordinate
- buf->i[ 5] = scroll x offset
- buf->i[ 6] = scroll y offset
- buf->i[ 7] = handle to open window behind
- buf->i[ 8] = pointer to window structure
- This reason code is used to inform a user program
- that a window is to be opened without a direct call
- to a HASWIN routine. Windows can be opened due to
- SELECTing an icon with an associated window,
- opening a window that is a master window for pane
- or slide windows, or some selections from menus.
- If the user routine returns HASWIN_FALSE the
- window will not be opened. The user routine may
- alter the buffer to modify how the window will be
- opened and its position. The window handle and
- pointer to window structure fields of the buffer
- should not be altered.
-
- HASWIN_POLL_poll_Close - A window is about to be closed as part of a HASWIN
- automatic operation.
- The buffer contains...
- buf->i[ 0] = window handle
- buf->i[ 1] = pointer to window structure
- This reason code is used to inform a user program
- that a window is to be closed without a direct call
- to a HASWIN routine. Windows can be closed due to
- ADJUSTing an icon with an associated window,
- closing a window that is a master window for pane
- or slide windows, or some selections from menus.
- If the user routine returns HASWIN_FALSE the
- window will not be closed. The user routine should
- not alter the buffer.
-
- HASWIN_POLL_poll_Menu - A menu is about to be created as part of a HASWIN
- automatic operation. This is usually called as a
- result of a mouse MENU click on a window on icon
- that has associated menus, windows or helps.
- - If the user routine returns HASWIN_FALSE the
- menu will not be created.
-
- HASWIN_POLL_poll_ReMenu - A menu is about to be re-created as part of a
- HASWIN automatic operation. This is usually
- called as a result of a menu selection using
- the ADJUST button so that the menu will not
- be closed.
- - If the user routine returns HASWIN_FALSE the
- menu will not be re-created and will disappear
- when haswin_poll() is next called.
-
- HASWIN_POLL_poll_IHelp - help is about to be displayed about an icon
- - If the user routine returns HASWIN_FALSE the
- help window will not be opened.
-
- HASWIN_POLL_poll_MHelp - help is about to be displayed about a menu
- - If the user routine returns HASWIN_FALSE the
- help window will not be opened.
-
- HASWIN_POLL_poll_WHelp - help is about to be displayed about a window
- - If the user routine returns HASWIN_FALSE the
- help window will not be opened.
-
- HASWIN_POLL_poll_UQuit - The user has asked HASWIN to quit
- - If the user routine returns HASWIN_FALSE the
- menu will not be re-created and will disappear
- when haswin_poll() is next called.
-
- HASWIN_POLL_poll_MQuit - A QUIT message has been received.
- This reason code allows the user routine to
- perform any processing neccessary before the
- user program exits. When the user routine
- returns to its caller HASWIN will terminate
- execution of the user program. This cannot be
- avioded.
-
- HASWIN_POLL_TimeStep - A time period has passed
- - If the user routine returns HASWIN_FALSE the
- menu will not be re-created and will disappear
- when haswin_poll() is next called.
-
- HASWIN_POLL_poll_Load - A DataLoad Message has been received by HASWIN
- from the SWI WIMP_Poll. A file transfer is about
- to take place.
- the buffer contains...
- buf->i[ 0] = length of buffer (20-256) in a
- multiple of 4 (ie. words)
- buf->i[ 1] = task handle of sender
- buf->i[ 2] = sender's reference number
- buf->i[ 3] = previous message reference number
- or 0 if this is not a reply
- buf->i[ 4] =
- buf->i[ 5] = destination window handle.
- buf->i[ 6] = destination icon handle
- buf->i[ 7] = destination x coordinate
- buf->i[ 8] = destination y coordinate
- buf->i[ 9] = estimated filesize in bytes
- buf->i[10] = file type
- buf->c[44] = full pathname of file, ends '\0'
- This reason code is used to inform the user program
- that a load file operation is to be performed. If
- the user routine returns HASWIN_FALSE then HASWIN
- abandons the file operation and HASWIN_FALSE is
- returned to the caller of the haswin_poll() that
- handled the file operation. If the user routine
- returns HASWIN_TRUE then HASWIN sends the correct
- messages to the external task and initiates the
- file transfer, calling the current user load file
- routine as defined by any calls to
- "haswin_(set/push)loadfileroutine()" to do the
- actual file transfer.
-
- HASWIN_POLL_poll_Save - A DataSave Message has been received by HASWIN
- from the SWI WIMP_Poll. A file transfer is about
- to take place.
- the buffer contains...
- buf->i[ 0] = length of buffer (20-256) in a
- multiple of 4 (ie. words)
- buf->i[ 1] = task handle of sender
- buf->i[ 2] = sender's reference number
- buf->i[ 3] = previous message reference number
- or 0 if this is not a reply
- buf->i[ 4] =
- buf->i[ 5] = destination window handle.
- buf->i[ 6] = destination icon handle
- buf->i[ 7] = destination x coordinate
- buf->i[ 8] = destination y coordinate
- buf->i[ 9] = estimated filesize in bytes
- buf->i[10] = file type
- buf->c[44] = full pathname of file, ends '\0'
- This reason code is used to inform the user program
- that a save file operation is to be performed. If
- the user routine returns HASWIN_FALSE then HASWIN
- abandons the file operation and HASWIN_FALSE is
- returned to the caller of the haswin_poll() that
- handled the file operation. If the user routine
- returns HASWIN_TRUE then HASWIN sends the correct
- messages to the external task and initiates the
- file transfer, calling the current user save file
- routine as defined by any calls to
- "haswin_(set/push)savefileroutine()" to do the
- actual file transfer.
-
- HASWIN_POLL_Done - Some other routine has done this
- HASWIN_POLL_poll_RAMrx -
- HASWIN_POLL_poll_RAMtx -
-
-
-
-
- The routine "haswin_poll()" is the called by a user program in order
- to make the HASWIN library operate. Once "haswin_poll()" has been called
- the library takes over the operation of the WIMP environment and calls the
- routines within the user program as it sees fit. It will, however, always
- return to the user program at intervals so that it can either be called
- again, or to allow the user program to perform its own processing. Since
- the WIMP is a cooperative multi-tasking system haswin_poll() might not
- return for some time if the user program gets "swaped" to allow some other
- task to run. The function is defined as...
-
- int haswin_poll(void);
- - Call the SWI WIMP_Poll and call the HASWIN library to perform
- any required functions.
- - Returns HASWIN_TRUE for successful completion of the action, or
- HASWIN_FALSE to indicate some problem. Under usual conditions
- the return value is ignored.
-
- Code of the form...
-
- /*
- * perform once off startup code, setup windows, icons, menus
- * pointers, etc. and inform HASWIN of routines to handle each
- * WIMP operation.
- */
- haswin_setuserpollroutine(userpoll);
- for (;;) {
- haswin_poll();
- /*
- * perform some regular processing
- */
- }
-
- ...is usually the way a user program interfaces HASWIN to its own code.
-
-
- Null_Reason_Code ( 0)
- Redraw_Window_Request ( 1)
- Open_Window_Request ( 2)
-
- Close_Window_Request ( 3)
- - If the window to be closed is not in the HASWIN active windows
- list HASWIN takes no action except to call the user routine with
- the reason code HASWIN_POLL_Close, if one is defined.
-
- Pointer_Entering_Window ( 4)
- - If the window to be entered is not in the HASWIN active windows
- list HASWIN takes no action except to call the user routine with
- the reason code HASWIN_POLL_Entering, if one is defined.
-
- Pointer_Leaving_Window ( 5)
- - If the window to be entered is not in the HASWIN active windows
- list HASWIN takes no action except to call the user routine with
- the reason code HASWIN_POLL_Leaving, if one is defined.
-
- Mouse_Click ( 6)
- - If the window where the mouse operation occured is not in the
- HASWIN active windows list HASWIN takes no action except to call
- the user routine with the reason code HASWIN_POLL_Mouse, if one
- is defined.
-
- User_Drag_Box ( 7)
- - If the window where the drag operation occured started not in the
- HASWIN active windows list HASWIN takes no action except to call
- the user routine with the reason code HASWIN_POLL_Drag, if one
- is defined.
- - If an icon is being dragged and the icon has a dragroutine() then
- call the dragroutine, and if it returns HASWIN_FALSE no further
- action is performed.
- - Otherwise if the user routine is defined it is called with the
- reason code HASWIN_POLL_Drag, and if it returns HASWIN_FALSE no
- further action is performed.
- - Otherwise clear the drag box away.
-
- Key_Pressed ( 8)
- - If the window that was the input focus when the key was pressed
- is not in the HASWIN active windows list HASWIN takes no action
- except to call the user routine with the reason code
- HASWIN_POLL_Key, if one is defined.
- - Otherwise If the key pressed was <Return> use that as if the
- SELECT button was pressed.
- - If the key pressed was F1 to F9 then look for the 0 to 8th icon
- in the window and pretend that the SELECT button was pressed.
- - If the user routine is defined it is called with the reason code
- HASWIN_POLL_Key, and if it returns HASWIN_FALSE no further
- action is performed.
- - Pass the key on by calling the SWI HASWIN_Process_key.
-
- Menu_Selection ( 9)
- - If the window that the menu was generated from is not in the
- HASWIN active windows list HASWIN takes no action except to call
- the user routine with the reason code HASWIN_POLL_Menu, if one is
- defined.
-
- Scroll_Request (10)
- - If the window to be scrolled is not the HASWIN active windows list
- HASWIN takes no action except to call the user routine with the
- reason code HASWIN_POLL_Scroll, if one is defined. Otherwise the
- user routine is called with the reason code HASWIN_POLL_Scroll,
- if one is defined, and if it returns HASWIN_FALSE no further
- action is processed. Otherwise the new window scroll position
- is calculated. The scroll amounts are either obtained from the
- "pagex", "pagey", "scrollx", and "scrolly" fields of the window
- structure or, if these are 0, default scroll amounts are used.
- The default is to page scroll by one current screen width or
- hieght and to line scroll by the size of one character in the
- system font. No alignment of text characters to the top or
- bottom of the window work area is done. After this calculation
- the user routine is called again, but this time with the reason
- code HASWIN_POLL_Scrolled, if one is defined, and if it returns
- HASWIN_FALSE no further action is processed. Otherwise the
- openroutine() for the window is called and if that returns
- HASWIN_FALSE no further action is processed. Otherwise the
- window is reopened at the new position.
-
- Lose_Caret (11)
- - If the window loosing the caret is not the HASWIN active windows
- list HASWIN takes no action except to call the user routine with
- the reason code HASWIN_POLL_Menu, if one is defined.
- Otherwise the user routine is called with the reason code
- HASWIN_POLL_Lose_Caret, if one is defined, and if it returns
- HASWIN_FALSE no further action is processed.
-
- Gain_Caret (12)
- - If the window loosing the caret is not the HASWIN active windows
- list HASWIN takes no action except to call the user routine with
- the reason code HASWIN_POLL_Menu, if one is defined.
- Otherwise the user routine is called with the reason code
- HASWIN_POLL_Gain_Caret, if one is defined, and if it returns
- HASWIN_FALSE no further action is processed.
-
- User_Message (17)
- -
-
- User_Message_Recorded (18)
- -
-
- User_Message_Acknowledge (19)
- -
-
- All other codes
- - If HASWIN receives a reason code from SWI WIMP_Poll that it does
- not understand it is passed unchanged to the user routine if one
- is defined.
-
-
-
-