[41] | 1 | ; Project name : Assembly Library
|
---|
| 2 | ; Description : Defines for Menu library.
|
---|
| 3 | %ifndef MENU_INC
|
---|
| 4 | %define MENU_INC
|
---|
| 5 |
|
---|
| 6 | ;--------------------------------------------------------------------
|
---|
| 7 | ; Menu Library users need to use this macro since it will provide
|
---|
| 8 | ; compatibility with future library versions.
|
---|
| 9 | ;
|
---|
| 10 | ; CALL_MENU_LIBRARY
|
---|
| 11 | ; Parameters:
|
---|
| 12 | ; %1: Function to call (functionName from MENU_LIB)
|
---|
| 13 | ; BP: Menu handle
|
---|
| 14 | ; Registers: Depends on function to call
|
---|
| 15 | ; Returns:
|
---|
| 16 | ; Depends on function to call
|
---|
| 17 | ; Corrupts registers:
|
---|
| 18 | ; AX (unless used as a return register), DI
|
---|
| 19 | ;--------------------------------------------------------------------
|
---|
| 20 | %macro CALL_MENU_LIBRARY 1
|
---|
| 21 | %ifidn %1, Close
|
---|
| 22 | call MenuInit_CloseMenuWindow
|
---|
| 23 |
|
---|
| 24 | %elifidn %1, SetUserDataFromDSSI
|
---|
| 25 | call MenuInit_SetUserDataFromDSSI
|
---|
| 26 |
|
---|
| 27 | %elifidn %1, GetUserDataToDSSI
|
---|
| 28 | call MenuInit_GetUserDataToDSSI
|
---|
| 29 |
|
---|
| 30 | %elifidn %1, SetTitleHeightFromAL
|
---|
| 31 | call MenuInit_SetTitleHeightFromAL
|
---|
| 32 |
|
---|
[48] | 33 | %elifidn %1, GetHighlightedItemToAX
|
---|
| 34 | call MenuInit_GetHighlightedItemToAX
|
---|
| 35 |
|
---|
[41] | 36 | %elifidn %1, SetTotalItemsFromAX
|
---|
| 37 | call MenuInit_SetTotalItemsFromAX
|
---|
| 38 |
|
---|
| 39 | %elifidn %1, SetInformationHeightFromAL
|
---|
| 40 | call MenuInit_SetInformationHeightFromAL
|
---|
| 41 |
|
---|
| 42 | %elifidn %1, SetTimeoutValueFromAX
|
---|
| 43 | call MenuTime_SetSelectionTimeoutValueFromAX
|
---|
| 44 |
|
---|
| 45 | %else
|
---|
[177] | 46 | mov di, %1
|
---|
[41] | 47 | call Menu_FunctionFromDI
|
---|
| 48 | %endif
|
---|
| 49 | %endmacro
|
---|
| 50 |
|
---|
[177] | 51 | %if 0
|
---|
| 52 | ;;;
|
---|
| 53 | ;;; struc no longer needed with direct call to function
|
---|
| 54 | ;;;
|
---|
| 55 |
|
---|
[41] | 56 | ; Menu library functions
|
---|
| 57 | struc MENU_LIB
|
---|
| 58 | .DisplayWithHandlerInBXandUserDataInDXAX resb 2
|
---|
| 59 | .Close:
|
---|
| 60 | .RefreshWindow resb 2
|
---|
| 61 |
|
---|
| 62 | .SetUserDataFromDSSI:
|
---|
| 63 | .GetUserDataToDSSI:
|
---|
| 64 |
|
---|
| 65 | .SetTitleHeightFromAL:
|
---|
[48] | 66 | .ClearTitleArea resb 2
|
---|
[41] | 67 | .RefreshTitle resb 2
|
---|
| 68 |
|
---|
[48] | 69 | .GetHighlightedItemToAX:
|
---|
[41] | 70 | .HighlightItemFromAX resb 2
|
---|
| 71 | .SetTotalItemsFromAX:
|
---|
| 72 | .RefreshItemFromAX resb 2
|
---|
| 73 |
|
---|
| 74 | .SetInformationHeightFromAL:
|
---|
[48] | 75 | .ClearInformationArea resb 2
|
---|
[41] | 76 | .RefreshInformation resb 2
|
---|
| 77 |
|
---|
[60] | 78 | .StartSelectionTimeoutWithTicksInAX resb 2
|
---|
[41] | 79 |
|
---|
| 80 | %ifdef INCLUDE_MENU_DIALOGS
|
---|
| 81 | .StartProgressTaskWithIoInDSSIandParamInDXAX resb 2
|
---|
| 82 | .SetProgressValueFromAX resb 2
|
---|
| 83 |
|
---|
| 84 | .DisplayMessageWithInputInDSSI resb 2
|
---|
| 85 | .GetSelectionToAXwithInputInDSSI resb 2
|
---|
| 86 | .GetWordWithIoInDSSI resb 2
|
---|
| 87 | .GetStringWithIoInDSSI resb 2
|
---|
| 88 | .GetFileNameWithIoInDSSI resb 2
|
---|
[54] | 89 | .GetDriveWithIoInDSSI resb 2
|
---|
[41] | 90 | %endif
|
---|
| 91 | endstruc
|
---|
[177] | 92 | %endif
|
---|
[41] | 93 |
|
---|
| 94 | ; Menu initialization parameters
|
---|
| 95 | struc MENUINIT
|
---|
| 96 | .wItems resb 2 ; Number of items in menu
|
---|
[52] | 97 | .wHighlightedItem resb 2 ; Index for highlighted item
|
---|
[41] | 98 |
|
---|
| 99 | .wTitleAndInfoLines:
|
---|
| 100 | .bTitleLines resb 1 ; Number of title lines
|
---|
| 101 | .bInfoLines resb 1 ; Number of information lines
|
---|
| 102 |
|
---|
| 103 | .wWidthAndHeight:
|
---|
| 104 | .bWidth resb 1 ; Menu width in characters
|
---|
| 105 | .bHeight resb 1 ; Menu height in characters
|
---|
| 106 | endstruc
|
---|
| 107 |
|
---|
| 108 |
|
---|
| 109 | ; All menu parameters
|
---|
| 110 | struc MENU
|
---|
| 111 | .menuInit resb MENUINIT_size ; Must be first
|
---|
| 112 | .fnEventHandler resb 2 ; Offset to Menu event handler
|
---|
| 113 | .dwUserData resb 4 ; User specified data
|
---|
| 114 |
|
---|
| 115 | .bFlags resb 1 ; Menu flags
|
---|
[45] | 116 | resb 1
|
---|
[41] | 117 | .wTimeoutCounter resb 2
|
---|
| 118 | .wFirstVisibleItem resb 2 ; Index for first visible item on the menu
|
---|
| 119 | endstruc
|
---|
| 120 |
|
---|
| 121 | ; Flags for MENU.wFlags
|
---|
| 122 | FLG_MENU_EXIT EQU (1<<0) ; Close and exit menu
|
---|
| 123 | FLG_MENU_NOHIGHLIGHT EQU (1<<1) ; Never highlight items
|
---|
| 124 | FLG_MENU_USER_HANDLES_SCROLLING EQU (1<<2)
|
---|
[60] | 125 | FLG_MENU_TIMEOUT_COUNTDOWN EQU (1<<3) ; Timeout countdown in progress
|
---|
[41] | 126 |
|
---|
| 127 |
|
---|
| 128 | MENU_VERTICAL_BORDER_LINES EQU 5 ; Title top and bottom + Info top and bottom + bottom shadow
|
---|
| 129 | MENU_HORIZONTAL_BORDER_LINES EQU 3 ; Left + Right borders + Right shadow
|
---|
| 130 | MENU_TEXT_ROW_OFFSET EQU 1
|
---|
| 131 | MENU_TEXT_COLUMN_OFFSET EQU 2
|
---|
[105] | 132 | MENU_TIMEOUT_STRING_CHARACTERS EQU 19
|
---|
[62] | 133 | MENU_TIMEOUT_SECONDS_FOR_HURRY EQU 3
|
---|
[41] | 134 |
|
---|
[44] | 135 | SCROLL_TRACK_CHARACTER EQU BLOCK_EVEN_BACKGROUND_AND_FOREGROUND
|
---|
| 136 | SCROLL_THUMB_CHARACTER EQU BLOCK_FULL_FOREGROUND
|
---|
[41] | 137 |
|
---|
| 138 | NO_ITEM_SELECTED EQU -1
|
---|
| 139 | NO_ITEM_HIGHLIGHTED EQU -1
|
---|
[48] | 140 | NO_TIMEOUT_USED EQU 0
|
---|
[41] | 141 |
|
---|
| 142 |
|
---|
| 143 | ; Keyboard keys (scan codes) used by menu library
|
---|
[178] | 144 | ;MENU_KEY_ENTER EQU 1Ch
|
---|
| 145 | ;MENU_KEY_ESC EQU 01h
|
---|
[41] | 146 | MENU_KEY_UP EQU 48h
|
---|
| 147 | MENU_KEY_DOWN EQU 50h
|
---|
| 148 | MENU_KEY_PGUP EQU 49h
|
---|
| 149 | MENU_KEY_PGDN EQU 51h
|
---|
| 150 | MENU_KEY_HOME EQU 47h
|
---|
| 151 | MENU_KEY_END EQU 4Fh
|
---|
| 152 |
|
---|
| 153 |
|
---|
| 154 | %endif ; MENU_INC
|
---|