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