Rev 183 | Rev 314 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 183 | Rev 283 | ||
---|---|---|---|
Line 213... | Line 213... | ||
213 | test al, al |
213 | test al, al |
214 | jnz @b |
214 | jnz @b |
215 | mov eax, esi |
215 | mov eax, esi |
216 | pop esi |
216 | pop esi |
217 | sub eax, esi |
217 | sub eax, esi |
218 | inc eax ; eax = äëèíà çàãîëîâêà + 2 |
218 | inc eax ; eax = ¤«¨ § £®«®¢ª + 2 |
219 | mov ecx, [ebx+dlgtemplate.width] |
219 | mov ecx, [ebx+dlgtemplate.width] |
220 | cmp eax, ecx |
220 | cmp eax, ecx |
221 | jbe .fullhea |
221 | jbe .fullhea |
222 | sub ecx, 5 |
222 | sub ecx, 5 |
223 | jb .noheader |
223 | jb .noheader |
Line 234... | Line 234... | ||
234 | dec edx |
234 | dec edx |
235 | call get_console_ptr |
235 | call get_console_ptr |
236 | mov ah, [ebx+dlgtemplate.header_color] |
236 | mov ah, [ebx+dlgtemplate.header_color] |
237 | mov al, ' ' |
237 | mov al, ' ' |
238 | stosw |
238 | stosw |
239 | dec ecx |
- | |
240 | .2: |
239 | .2: |
241 | jecxz .3 |
240 | dec ecx |
- | 241 | jz .3 |
|
242 | lodsb |
242 | lodsb |
243 | test al, al |
243 | test al, al |
244 | jz .4 |
244 | jz .4 |
245 | stosw |
245 | stosw |
246 | jmp .2 |
246 | jmp .2 |
Line 402... | Line 402... | ||
402 | push eax |
402 | push eax |
403 | call restore_console_data |
403 | call restore_console_data |
404 | call draw_keybar |
404 | call draw_keybar |
405 | mov eax, ebp |
405 | mov eax, ebp |
406 | call mf_free |
406 | call mf_free |
- | 407 | or [cursor_x], -1 |
|
- | 408 | or [cursor_y], -1 |
|
407 | call draw_image |
409 | call draw_image |
408 | popad |
410 | popad |
409 | ret 8 |
411 | ret 8 |
Line 410... | Line 412... | ||
410 | 412 | ||
Line 953... | Line 955... | ||
953 | 955 | ||
954 | virtual at 0 |
956 | virtual at 0 |
955 | dlgitemtemplate: |
957 | dlgitemtemplate: |
956 | ; «¥¬¥âë: |
958 | ; «¥¬¥âë: |
- | 959 | ; 1 = áâ â¨ç¥áª¨© ⥪áâ |
|
- | 960 | ; 2 = ª®¯ª |
|
957 | ; 1 = áâ â¨ç¥áª¨© ⥪áâ |
961 | ; 3 = ¯®«¥ । ªâ¨à®¢ ¨ï |
958 | .type dd ? |
962 | .type dd ? |
959 | .x1 dd ? |
963 | .x1 dd ? |
960 | .y1 dd ? |
964 | .y1 dd ? |
961 | .x2 dd ? |
965 | .x2 dd ? |
- | 966 | .y2 dd ? |
|
- | 967 | ; ë¥: |
|
- | 968 | ; ¤«ï ⥪áâ : const char* data - ASCIIZ-áâப |
|
- | 969 | ; ¤«ï ª®¯ª¨: const char* data - § £®«®¢®ª |
|
- | 970 | ; ¤«ï । ªâ®à : struct {unsigned maxlength; unsigned pos; unsigned start; |
|
962 | .y2 dd ? |
971 | ; char data[maxlength+1];}* data; |
963 | .data dd ? |
972 | .data dd ? |
964 | .flags dd ? |
973 | .flags dd ? |
965 | ; « £¨: |
974 | ; « £¨: |
966 | ; 0 = ¢ëà ¢¨¢ ¨¥ ¢«¥¢® |
975 | ; 0 = ¢ëà ¢¨¢ ¨¥ ¢«¥¢® |
967 | ; 1 = ¢ëà ¢¨¢ ¨¥ ¯® æ¥âàã |
976 | ; 1 = ¢ëà ¢¨¢ ¨¥ ¯® æ¥âàã |
968 | ; 2 = ¢ëà ¢¨¢ ¨¥ ¢¯à ¢® |
977 | ; 2 = ¢ëà ¢¨¢ ¨¥ ¢¯à ¢® |
- | 978 | ; 4 = í«¥¬¥â ¨¬¥¥â 䮪ãá ¢¢®¤ |
|
- | 979 | ; 8 = í«¥¬¥â ¬®¦¥â ¨¬¥âì 䮪ãá ¢¢®¤ |
|
- | 980 | ; 10h: ¤«ï ª®¯ª¨ = ª®¯ª ¯® 㬮«ç ¨î (Enter ¥-ª®¯ª¥) |
|
969 | ; 4 = í«¥¬¥â ¨¬¥¥â 䮪ãá ¢¢®¤ |
981 | ; ¤«ï ¯®«ï ¢¢®¤ = ¤ ë¥ ¡ë«¨ ¬®¤¨ä¨æ¨à®¢ ë |
970 | .size = $ |
982 | .size = $ |
971 | end virtual |
983 | end virtual |
972 | ; struct DLGDATA |
984 | ; struct DLGDATA |
973 | ; { |
985 | ; { |
Line 1015... | Line 1027... | ||
1015 | jz .enter |
1027 | jz .enter |
1016 | cmp al, 0xF |
1028 | cmp al, 0xF |
1017 | jz .tab |
1029 | jz .tab |
1018 | cmp al, 0x48 |
1030 | cmp al, 0x48 |
1019 | jz .up |
1031 | jz .up |
- | 1032 | cmp al, 0x50 |
|
- | 1033 | jz .down |
|
- | 1034 | jecxz @f |
|
- | 1035 | cmp [ebx+dlgitemtemplate.type], 3 |
|
- | 1036 | jz .key_edit |
|
- | 1037 | @@: |
|
1020 | cmp al, 0x4B |
1038 | cmp al, 0x4B |
1021 | jz .left |
1039 | jz .left |
1022 | cmp al, 0x4D |
1040 | cmp al, 0x4D |
1023 | jz .right |
1041 | jz .right |
1024 | cmp al, 0x50 |
- | |
1025 | jz .down |
- | |
1026 | .ret0: |
1042 | .ret0: |
1027 | xor eax, eax |
1043 | xor eax, eax |
1028 | ret 16 |
1044 | ret 16 |
1029 | .esc: |
1045 | .esc: |
1030 | or eax, -1 |
1046 | or eax, -1 |
1031 | ret 16 |
1047 | ret 16 |
1032 | .enter: |
1048 | .enter: |
- | 1049 | cmp [ebx+dlgitemtemplate.type], 2 |
|
- | 1050 | jnz @f |
|
- | 1051 | .enter_found: |
|
1033 | mov eax, ebx |
1052 | mov eax, ebx |
1034 | ret 16 |
1053 | ret 16 |
- | 1054 | @@: |
|
- | 1055 | mov ebx, [esp+4] |
|
- | 1056 | add ebx, dlgtemplate.size+12 |
|
- | 1057 | .enter_find: |
|
- | 1058 | cmp [ebx+dlgitemtemplate.type], 2 |
|
- | 1059 | jnz @f |
|
- | 1060 | test [ebx+dlgitemtemplate.flags], 0x10 |
|
- | 1061 | jnz .enter_found |
|
- | 1062 | @@: |
|
- | 1063 | add ebx, dlgitemtemplate.size |
|
- | 1064 | jmp .enter_find |
|
1035 | .tab: |
1065 | .tab: |
1036 | test [ctrlstate], 3 |
1066 | test [ctrlstate], 3 |
1037 | jnz .shift_tab |
1067 | jnz .shift_tab |
1038 | .right: |
1068 | .right: |
1039 | .down: |
1069 | .down: |
Line 1041... | Line 1071... | ||
1041 | and byte [ebx+dlgitemtemplate.flags], not 4 |
1071 | and byte [ebx+dlgitemtemplate.flags], not 4 |
1042 | dec ecx |
1072 | dec ecx |
1043 | jz .find_first_btn |
1073 | jz .find_first_btn |
1044 | @@: |
1074 | @@: |
1045 | add ebx, dlgitemtemplate.size |
1075 | add ebx, dlgitemtemplate.size |
1046 | cmp [ebx+dlgitemtemplate.type], 2 |
1076 | test [ebx+dlgitemtemplate.flags], 8 |
1047 | jz .btn_found |
1077 | jnz .btn_found |
1048 | loop @b |
1078 | loop @b |
1049 | .find_first_btn: |
1079 | .find_first_btn: |
1050 | mov ebx, [esp+4] |
1080 | mov ebx, [esp+4] |
1051 | add ebx, dlgtemplate.size+12 |
1081 | add ebx, dlgtemplate.size+12 |
1052 | @@: |
1082 | @@: |
1053 | cmp [ebx+dlgitemtemplate.type], 2 |
1083 | test [ebx+dlgitemtemplate.flags], 8 |
1054 | jz .btn_found |
1084 | jnz .btn_found |
1055 | add ebx, dlgitemtemplate.size |
1085 | add ebx, dlgitemtemplate.size |
1056 | jmp @b |
1086 | jmp @b |
1057 | .btn_found: |
1087 | .btn_found: |
1058 | or byte [ebx+dlgitemtemplate.flags], 4 |
1088 | or byte [ebx+dlgitemtemplate.flags], 4 |
- | 1089 | .ret_draw: |
|
1059 | mov ebx, [esp+4] |
1090 | mov ebx, [esp+4] |
1060 | call .dodraw |
1091 | call .dodraw |
1061 | call draw_image |
1092 | call draw_image |
1062 | xor eax, eax |
1093 | xor eax, eax |
1063 | ret 16 |
1094 | ret 16 |
Line 1070... | Line 1101... | ||
1070 | sub ecx, [eax+dlgtemplate.size+8] |
1101 | sub ecx, [eax+dlgtemplate.size+8] |
1071 | neg ecx |
1102 | neg ecx |
1072 | jz .find_last_btn |
1103 | jz .find_last_btn |
1073 | @@: |
1104 | @@: |
1074 | sub ebx, dlgitemtemplate.size |
1105 | sub ebx, dlgitemtemplate.size |
1075 | cmp [ebx+dlgitemtemplate.type], 2 |
1106 | test [ebx+dlgitemtemplate.flags], 8 |
1076 | loopnz @b |
1107 | loopz @b |
1077 | jz .btn_found |
1108 | jnz .btn_found |
1078 | .find_last_btn: |
1109 | .find_last_btn: |
1079 | mov ebx, [eax+dlgtemplate.size+8] |
1110 | mov ebx, [eax+dlgtemplate.size+8] |
1080 | imul ebx, dlgitemtemplate.size |
1111 | imul ebx, dlgitemtemplate.size |
1081 | lea ebx, [ebx+eax+dlgtemplate.size+12] |
1112 | lea ebx, [ebx+eax+dlgtemplate.size+12] |
1082 | @@: |
1113 | @@: |
1083 | sub ebx, dlgitemtemplate.size |
1114 | sub ebx, dlgitemtemplate.size |
1084 | cmp [ebx+dlgitemtemplate.type], 2 |
1115 | test [ebx+dlgitemtemplate.flags], 8 |
1085 | jnz @b |
1116 | jz @b |
1086 | jmp .btn_found |
1117 | jmp .btn_found |
- | 1118 | .key_edit: |
|
- | 1119 | ; ®¡à ¡®âª ª« ¢¨è ¢ ¯®«¥ ¢¢®¤ |
|
- | 1120 | test al, 0x80 |
|
- | 1121 | jnz .ret0 |
|
- | 1122 | or [ebx+dlgitemtemplate.flags], 0x10 |
|
- | 1123 | mov edx, [ebx+dlgitemtemplate.data] |
|
- | 1124 | cmp al, 0x4B |
|
- | 1125 | jz .editor_left |
|
- | 1126 | cmp al, 0x4D |
|
- | 1127 | jz .editor_right |
|
- | 1128 | cmp al, 0x47 |
|
- | 1129 | jz .editor_home |
|
- | 1130 | cmp al, 0x4F |
|
- | 1131 | jz .editor_end |
|
- | 1132 | cmp al, 0x0E |
|
- | 1133 | jz .editor_backspace |
|
- | 1134 | cmp al, 0x53 |
|
- | 1135 | jz .editor_del |
|
- | 1136 | test [ctrlstate], 0x3C |
|
- | 1137 | jnz .ret_draw |
|
- | 1138 | ; query keyboard layout |
|
- | 1139 | pushad |
|
- | 1140 | push 26 |
|
- | 1141 | pop eax |
|
- | 1142 | push 2 |
|
- | 1143 | pop ebx |
|
- | 1144 | xor ecx, ecx |
|
- | 1145 | cmp [ctrlstate], 1 |
|
- | 1146 | sbb ecx, -2 |
|
- | 1147 | mov edx, layout |
|
- | 1148 | int 0x40 |
|
- | 1149 | popad |
|
- | 1150 | ; translate scancode to ASCII |
|
- | 1151 | movzx eax, al |
|
- | 1152 | movzx eax, byte [layout+eax] |
|
- | 1153 | push eax |
|
- | 1154 | ; insert entered symbol |
|
- | 1155 | xor eax, eax |
|
- | 1156 | lea edi, [edx+12] |
|
- | 1157 | or ecx, -1 |
|
- | 1158 | repnz scasb |
|
- | 1159 | not ecx |
|
- | 1160 | pop eax |
|
- | 1161 | cmp ecx, [edx] |
|
- | 1162 | ja .ret_test ; buffer capacity exceeded |
|
- | 1163 | lea edi, [edx+ecx+12-1] |
|
- | 1164 | mov esi, [edx+4] |
|
- | 1165 | lea esi, [edx+esi+12] |
|
- | 1166 | @@: |
|
- | 1167 | mov cl, [edi] |
|
- | 1168 | mov [edi+1], cl |
|
- | 1169 | dec edi |
|
- | 1170 | cmp edi, esi |
|
- | 1171 | jae @b |
|
- | 1172 | mov [esi], al |
|
- | 1173 | inc dword [edx+4] |
|
- | 1174 | @@: jmp .ret_test |
|
- | 1175 | .editor_left: |
|
- | 1176 | mov ecx, [edx+4] |
|
- | 1177 | jecxz @f |
|
- | 1178 | dec dword [edx+4] |
|
- | 1179 | @@: jmp .ret_test |
|
- | 1180 | .editor_right: |
|
- | 1181 | mov ecx, [edx+4] |
|
- | 1182 | cmp byte [edx+ecx+12], 0 |
|
- | 1183 | jz @b |
|
- | 1184 | inc dword [edx+4] |
|
- | 1185 | jmp @b |
|
- | 1186 | .editor_home: |
|
- | 1187 | and dword [edx+4], 0 |
|
- | 1188 | jmp @b |
|
- | 1189 | .editor_end: |
|
- | 1190 | lea edi, [edx+12] |
|
- | 1191 | xor eax, eax |
|
- | 1192 | or ecx, -1 |
|
- | 1193 | repnz scasb |
|
- | 1194 | not ecx |
|
- | 1195 | dec ecx |
|
- | 1196 | mov [edx+4], ecx |
|
- | 1197 | .ret_test: |
|
- | 1198 | mov eax, [edx+4] |
|
- | 1199 | cmp [edx+8], eax |
|
- | 1200 | jl .ret_test.l1 |
|
- | 1201 | mov [edx+8], eax |
|
- | 1202 | jmp .ret_test.l2 |
|
- | 1203 | .ret_test.l1: |
|
- | 1204 | add eax, [ebx+dlgitemtemplate.x1] |
|
- | 1205 | sub eax, [ebx+dlgitemtemplate.x2] |
|
- | 1206 | cmp [edx+8], eax |
|
- | 1207 | jge .ret_test.l2 |
|
- | 1208 | mov [edx+8], eax |
|
- | 1209 | .ret_test.l2: |
|
- | 1210 | jmp .ret_draw |
|
- | 1211 | .editor_backspace: |
|
- | 1212 | mov ecx, [edx+4] |
|
- | 1213 | jecxz .ret_test |
|
- | 1214 | dec dword [edx+4] |
|
- | 1215 | lea esi, [edx+ecx+12] |
|
- | 1216 | lea edi, [esi-1] |
|
- | 1217 | .copy_and_ret_test: |
|
- | 1218 | @@: |
|
- | 1219 | lodsb |
|
- | 1220 | stosb |
|
- | 1221 | test al, al |
|
- | 1222 | jnz @b |
|
- | 1223 | jmp .ret_test |
|
- | 1224 | .editor_del: |
|
- | 1225 | mov ecx, [edx+4] |
|
- | 1226 | lea edi, [ecx+edx+12] |
|
- | 1227 | lea esi, [edi+1] |
|
- | 1228 | cmp byte [edi], 0 |
|
- | 1229 | jz .ret_test |
|
- | 1230 | jmp .copy_and_ret_test |
|
Line 1087... | Line 1231... | ||
1087 | 1231 | ||
- | 1232 | .dodraw: |
|
- | 1233 | or [cursor_x], -1 |
|
1088 | .dodraw: |
1234 | or [cursor_y], -1 |
1089 | add ebx, dlgtemplate.size+8 |
1235 | add ebx, dlgtemplate.size+8 |
1090 | mov ecx, [ebx] |
1236 | mov ecx, [ebx] |
1091 | add ebx, 4 |
1237 | add ebx, 4 |
1092 | jecxz .done_draw |
1238 | jecxz .done_draw |
1093 | .draw_loop: |
1239 | .draw_loop: |
1094 | push ecx |
1240 | push ecx |
1095 | mov eax, [ebx+dlgitemtemplate.type] |
1241 | mov eax, [ebx+dlgitemtemplate.type] |
1096 | dec eax |
1242 | dec eax |
1097 | jz .draw_text |
1243 | jz .draw_text |
- | 1244 | dec eax |
|
- | 1245 | jz .draw_button |
|
1098 | dec eax |
1246 | dec eax |
- | 1247 | jnz .draw_loop_continue |
|
- | 1248 | call draw_editbox |
|
- | 1249 | jmp .draw_loop_continue |
|
1099 | jnz .draw_loop_continue |
1250 | .draw_button: |
1100 | call draw_button |
1251 | call draw_button |
1101 | jmp .draw_loop_continue |
1252 | jmp .draw_loop_continue |
1102 | .draw_text: |
1253 | .draw_text: |
1103 | call draw_static_text |
1254 | call draw_static_text |
Line 1112... | Line 1263... | ||
1112 | ; à¨á㥬 áâ â¨ç¥áª¨© ⥪áâ |
1263 | ; à¨á㥬 áâ â¨ç¥áª¨© ⥪áâ |
1113 | mov ah, [dialog_main_color] |
1264 | mov ah, [dialog_main_color] |
1114 | draw_text: |
1265 | draw_text: |
1115 | ; ®¯à¥¤¥«ï¥¬ ¤«¨ã áâப¨ |
1266 | ; ®¯à¥¤¥«ï¥¬ ¤«¨ã áâப¨ |
1116 | mov esi, [ebx+dlgitemtemplate.data] |
1267 | mov esi, [ebx+dlgitemtemplate.data] |
- | 1268 | draw_text_esi: |
|
1117 | test esi, esi |
1269 | test esi, esi |
1118 | jz .ret |
1270 | jz .ret |
1119 | or ecx, -1 |
1271 | or ecx, -1 |
1120 | @@: |
1272 | @@: |
1121 | inc ecx |
1273 | inc ecx |
Line 1161... | Line 1313... | ||
1161 | mov al, ' ' |
1313 | mov al, ' ' |
1162 | rep stosw |
1314 | rep stosw |
1163 | pop ecx |
1315 | pop ecx |
1164 | cmp ecx, edx |
1316 | cmp ecx, edx |
1165 | jbe .text_copy |
1317 | jbe .text_copy |
- | 1318 | cmp [ebx+dlgitemtemplate.type], 3 |
|
- | 1319 | jnz @f |
|
- | 1320 | mov ecx, edx |
|
- | 1321 | jmp .text_copy |
|
- | 1322 | @@: |
|
1166 | cmp edx, 3 |
1323 | cmp edx, 3 |
1167 | jb .ret |
1324 | jb .ret |
1168 | mov al, '.' |
1325 | mov al, '.' |
1169 | stosw |
1326 | stosw |
1170 | stosw |
1327 | stosw |
Line 1201... | Line 1358... | ||
1201 | test [ebx+dlgitemtemplate.flags], 4 |
1358 | test [ebx+dlgitemtemplate.flags], 4 |
1202 | jz @f |
1359 | jz @f |
1203 | mov ah, [dialog_selected_btn_color] |
1360 | mov ah, [dialog_selected_btn_color] |
1204 | @@: |
1361 | @@: |
1205 | jmp draw_text |
1362 | jmp draw_text |
- | 1363 | ||
- | 1364 | draw_editbox: |
|
- | 1365 | mov edx, [ebx+dlgitemtemplate.data] |
|
- | 1366 | test [ebx+dlgitemtemplate.flags], 4 |
|
- | 1367 | jz @f |
|
- | 1368 | mov eax, [ebx+dlgitemtemplate.x1] |
|
- | 1369 | add eax, [edx+4] |
|
- | 1370 | sub eax, [edx+8] |
|
- | 1371 | mov ecx, [esp+16] |
|
- | 1372 | add eax, [ecx+dlgtemplate.x] |
|
- | 1373 | mov [cursor_x], eax |
|
- | 1374 | mov eax, [ebx+dlgitemtemplate.y1] |
|
- | 1375 | add eax, [ecx+dlgtemplate.y] |
|
- | 1376 | mov [cursor_y], eax |
|
- | 1377 | @@: |
|
- | 1378 | mov ah, [dialog_edit_color] |
|
- | 1379 | test [ebx+dlgitemtemplate.flags], 10h |
|
- | 1380 | jnz @f |
|
- | 1381 | mov ah, [dialog_unmodified_edit_color] |
|
- | 1382 | @@: |
|
- | 1383 | mov esi, [ebx+dlgitemtemplate.data] |
|
- | 1384 | add esi, [edx+8] |
|
- | 1385 | add esi, 12 |
|
- | 1386 | jmp draw_text_esi |