Subversion Repositories Kolibri OS

Rev

Rev 283 | Rev 474 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 283 Rev 314
Line 1... Line 1...
1
; int __stdcall GenericBox(DLGTEMPLATE* dlg, void* DlgProc);
1
; int __stdcall GenericBox(DLGTEMPLATE* dlg, void* DlgProc);
2
;       int __stdcall DlgProc(DLGTEMPLATE* dlg, int msg, int param1, int param2);
2
;       int __stdcall DlgProc(DLGTEMPLATE* dlg, int msg, int param1, int param2);
Line 3... Line 3...
3
 
3
 
4
virtual at 0
4
virtual at 0
-
 
5
dlgtemplate:
-
 
6
; ”« £¨:
-
 
7
; ¡¨â 0: ¨á¯®«ì§®¢ âì áâ ­¤ àâ­ë¥ æ¢¥â  ¤¨ «®£ 
-
 
8
; ¡¨â 1: ¨á¯®«ì§®¢ âì áâ ­¤ àâ­ë¥ æ¢¥â  ¯à¥¤ã¯à¥¦¤¥­¨ï/®è¨¡ª¨
-
 
9
; (¥á«¨ «î¡®© ¨§ íâ¨å ¡¨â®¢ ãáâ ­®¢«¥­, ¯®«ï main_color,border_color,header_color
5
dlgtemplate:
10
;  ¨£­®à¨àãîâáï)
6
.flags          dd      ?
11
.flags          dd      ?
7
.x              dd      ?
12
.x              dd      ?
8
.y              dd      ?
13
.y              dd      ?
9
.width          dd      ?
14
.width          dd      ?
Line 56... Line 61...
56
.sizeerr:
61
.sizeerr:
57
        popad
62
        popad
58
        or      eax, -1
63
        or      eax, -1
59
        ret     8
64
        ret     8
60
.sizeok:
65
.sizeok:
-
 
66
; set color if required
-
 
67
        test    byte [ebx+dlgtemplate.flags], 1
-
 
68
        jz      @f
-
 
69
        mov     edi, dialog_colors
-
 
70
        jmp     .setcolor
-
 
71
@@:
-
 
72
        test    byte [ebx+dlgtemplate.flags], 2
-
 
73
        jz      @f
-
 
74
        mov     edi, warning_colors
-
 
75
.setcolor:
-
 
76
        mov     al, [dialog_main_color-dialog_colors+edi]
-
 
77
        mov     [ebx+dlgtemplate.main_color], al
-
 
78
        mov     al, [dialog_border_color-dialog_colors+edi]
-
 
79
        mov     [ebx+dlgtemplate.border_color], al
-
 
80
        mov     al, [dialog_header_color-dialog_colors+edi]
-
 
81
        mov     [ebx+dlgtemplate.header_color], al
-
 
82
@@:
61
; allocate memory for data under dialog
83
; allocate memory for data under dialog
-
 
84
; for 'No memory' dialog use static data area
-
 
85
        mov     ebp, nomem_dlgsavearea
-
 
86
        cmp     ebx, nomem_dlgdata
-
 
87
        jz      .allocated
62
        mov     eax, [ebx+dlgtemplate.width]
88
        mov     eax, [ebx+dlgtemplate.width]
63
        add     eax, [ebx+dlgtemplate.border_size_x]
89
        add     eax, [ebx+dlgtemplate.border_size_x]
64
        add     eax, [ebx+dlgtemplate.border_size_x]
90
        add     eax, [ebx+dlgtemplate.border_size_x]
65
        inc     eax
91
        inc     eax
66
        inc     eax
92
        inc     eax
Line 71... Line 97...
71
        mul     edx
97
        mul     edx
72
        add     eax, eax
98
        add     eax, eax
73
        call    mf_alloc
99
        call    mf_alloc
74
        test    eax, eax
100
        test    eax, eax
75
        jnz     @f
101
        jnz     @f
76
; TODO: add error message
-
 
77
        popad
102
        popad
78
        or      eax, -1
103
        or      eax, -1
79
        ret     8
104
        ret     8
80
@@:
105
@@:
81
        mov     ebp, eax
106
        mov     ebp, eax
-
 
107
.allocated:
82
; save data
108
; save data
83
        mov     eax, [ebx+dlgtemplate.y]
109
        mov     eax, [ebx+dlgtemplate.y]
84
        add     eax, [ebx+dlgtemplate.height]
110
        add     eax, [ebx+dlgtemplate.height]
85
        add     eax, [ebx+dlgtemplate.border_size_y]
111
        add     eax, [ebx+dlgtemplate.border_size_y]
86
        inc     eax
112
        inc     eax
Line 400... Line 426...
400
        mov     eax, [ebx+dlgtemplate.x]
426
        mov     eax, [ebx+dlgtemplate.x]
401
        sub     eax, [ebx+dlgtemplate.border_size_x]
427
        sub     eax, [ebx+dlgtemplate.border_size_x]
402
        push    eax
428
        push    eax
403
        call    restore_console_data
429
        call    restore_console_data
404
        call    draw_keybar
430
        call    draw_keybar
-
 
431
        cmp     ebx, nomem_dlgdata
-
 
432
        jz      @f
405
        mov     eax, ebp
433
        mov     eax, ebp
406
        call    mf_free
434
        call    mf_free
-
 
435
@@:
407
        or      [cursor_x], -1
436
        or      [cursor_x], -1
408
        or      [cursor_y], -1
437
        or      [cursor_y], -1
409
        call    draw_image
438
        call    draw_image
410
        popad
439
        popad
411
        ret     8
440
        ret     8
Line 524... Line 553...
524
; +36: dd cur_variant
553
; +36: dd cur_variant
525
; +40: dd num_variants
554
; +40: dd num_variants
526
; +44: dd begin_variant
555
; +44: dd begin_variant
527
; +48: dd end_variant
556
; +48: dd end_variant
528
; +52: dd cur_variant_idx
557
; +52: dd cur_variant_idx
529
        call    mf_alloc
558
        call    xmalloc
530
        test    eax, eax
559
        test    eax, eax
531
        jnz     @f
560
        jnz     @f
532
.ret_bad:
561
.ret_bad:
533
        popad
562
        popad
534
        or      eax, -1
563
        or      eax, -1
Line 993... Line 1022...
993
; int __stdcall DialogBox(DLGDATA* dlg);
1022
; int __stdcall DialogBox(DLGDATA* dlg);
994
DialogBox:
1023
DialogBox:
995
        push    ManagerDlgProc
1024
        push    ManagerDlgProc
996
        push    dword [esp+8]
1025
        push    dword [esp+8]
997
        call    GenericBox
1026
        call    GenericBox
998
        ret     8
1027
        ret     4
Line 999... Line 1028...
999
 
1028
 
-
 
1029
ManagerDlgProc:
1000
ManagerDlgProc:
1030
        mov     ebp, ebx
1001
        mov     eax, [esp+8]
1031
        mov     eax, [esp+8]
1002
        dec     eax
1032
        dec     eax
1003
        jz      .draw
1033
        jz      .draw
1004
        dec     eax
1034
        dec     eax
Line 1050... Line 1080...
1050
        jnz     @f
1080
        jnz     @f
1051
.enter_found:
1081
.enter_found:
1052
        mov     eax, ebx
1082
        mov     eax, ebx
1053
        ret     16
1083
        ret     16
1054
@@:
1084
@@:
1055
        mov     ebx, [esp+4]
-
 
1056
        add     ebx, dlgtemplate.size+12
1085
        lea     ebx, [ebp+dlgtemplate.size+12]
1057
.enter_find:
1086
.enter_find:
1058
        cmp     [ebx+dlgitemtemplate.type], 2
1087
        cmp     [ebx+dlgitemtemplate.type], 2
1059
        jnz     @f
1088
        jnz     @f
1060
        test    [ebx+dlgitemtemplate.flags], 0x10
1089
        test    [ebx+dlgitemtemplate.flags], 0x10
1061
        jnz     .enter_found
1090
        jnz     .enter_found
Line 1075... Line 1104...
1075
        add     ebx, dlgitemtemplate.size
1104
        add     ebx, dlgitemtemplate.size
1076
        test    [ebx+dlgitemtemplate.flags], 8
1105
        test    [ebx+dlgitemtemplate.flags], 8
1077
        jnz     .btn_found
1106
        jnz     .btn_found
1078
        loop    @b
1107
        loop    @b
1079
.find_first_btn:
1108
.find_first_btn:
1080
        mov     ebx, [esp+4]
-
 
1081
        add     ebx, dlgtemplate.size+12
1109
        lea     ebx, [ebp+dlgtemplate.size+12]
1082
@@:
1110
@@:
1083
        test    [ebx+dlgitemtemplate.flags], 8
1111
        test    [ebx+dlgitemtemplate.flags], 8
1084
        jnz     .btn_found
1112
        jnz     .btn_found
1085
        add     ebx, dlgitemtemplate.size
1113
        add     ebx, dlgitemtemplate.size
1086
        jmp     @b
1114
        jmp     @b
1087
.btn_found:
1115
.btn_found:
1088
        or      byte [ebx+dlgitemtemplate.flags], 4
1116
        or      byte [ebx+dlgitemtemplate.flags], 4
1089
.ret_draw:
1117
.ret_draw:
1090
        mov     ebx, [esp+4]
1118
        mov     ebx, ebp
1091
        call    .dodraw
1119
        call    .dodraw
1092
        call    draw_image
1120
        call    draw_image
1093
        xor     eax, eax
1121
        xor     eax, eax
1094
        ret     16
1122
        ret     16
1095
.shift_tab:
1123
.shift_tab:
1096
.left:
1124
.left:
1097
.up:
1125
.up:
1098
        jecxz   .ret0
1126
        jecxz   .ret0
1099
        and     byte [ebx+dlgitemtemplate.flags], not 4
1127
        and     byte [ebx+dlgitemtemplate.flags], not 4
1100
        mov     eax, [esp+4]
-
 
1101
        sub     ecx, [eax+dlgtemplate.size+8]
1128
        sub     ecx, [ebp+dlgtemplate.size+8]
1102
        neg     ecx
1129
        neg     ecx
1103
        jz      .find_last_btn
1130
        jz      .find_last_btn
1104
@@:
1131
@@:
1105
        sub     ebx, dlgitemtemplate.size
1132
        sub     ebx, dlgitemtemplate.size
1106
        test    [ebx+dlgitemtemplate.flags], 8
1133
        test    [ebx+dlgitemtemplate.flags], 8
1107
        loopz   @b
1134
        loopz   @b
1108
        jnz     .btn_found
1135
        jnz     .btn_found
1109
.find_last_btn:
1136
.find_last_btn:
1110
        mov     ebx, [eax+dlgtemplate.size+8]
1137
        mov     ebx, [ebp+dlgtemplate.size+8]
1111
        imul    ebx, dlgitemtemplate.size
1138
        imul    ebx, dlgitemtemplate.size
1112
        lea     ebx, [ebx+eax+dlgtemplate.size+12]
1139
        lea     ebx, [ebx+ebp+dlgtemplate.size+12]
1113
@@:
1140
@@:
1114
        sub     ebx, dlgitemtemplate.size
1141
        sub     ebx, dlgitemtemplate.size
1115
        test    [ebx+dlgitemtemplate.flags], 8
1142
        test    [ebx+dlgitemtemplate.flags], 8
1116
        jz      @b
1143
        jz      @b
1117
        jmp     .btn_found
1144
        jmp     .btn_found
Line 1260... Line 1287...
1260
        ret
1287
        ret
Line 1261... Line 1288...
1261
 
1288
 
1262
draw_static_text:
1289
draw_static_text:
1263
; à¨á㥬 áâ â¨ç¥áª¨© ⥪áâ
1290
; à¨á㥬 áâ â¨ç¥áª¨© ⥪áâ
-
 
1291
        mov     ah, [dialog_main_color]
-
 
1292
        test    byte [ebp+dlgtemplate.flags], 2
-
 
1293
        jz      draw_text
1264
        mov     ah, [dialog_main_color]
1294
        mov     ah, [warning_main_color]
1265
draw_text:
1295
draw_text:
1266
; ®¯à¥¤¥«ï¥¬ ¤«¨­ã áâப¨
1296
; ®¯à¥¤¥«ï¥¬ ¤«¨­ã áâப¨
1267
        mov     esi, [ebx+dlgitemtemplate.data]
1297
        mov     esi, [ebx+dlgitemtemplate.data]
1268
draw_text_esi:
1298
draw_text_esi:
Line 1297... Line 1327...
1297
        jmp     .text_draw
1327
        jmp     .text_draw
1298
.text_align_left:
1328
.text_align_left:
1299
        xor     eax, eax
1329
        xor     eax, eax
1300
.text_draw:
1330
.text_draw:
1301
        push    ecx
1331
        push    ecx
1302
        mov     ecx, [esp+24]
-
 
1303
        push    eax
1332
        push    eax
1304
        mov     eax, [ebx+dlgitemtemplate.x1]
1333
        mov     eax, [ebx+dlgitemtemplate.x1]
1305
        add     eax, [ecx+dlgtemplate.x]
1334
        add     eax, [ebp+dlgtemplate.x]
1306
        push    edx
1335
        push    edx
1307
        mov     edx, [ebx+dlgitemtemplate.y1]
1336
        mov     edx, [ebx+dlgitemtemplate.y1]
1308
        add     edx, [ecx+dlgtemplate.y]
1337
        add     edx, [ebp+dlgtemplate.y]
1309
        call    get_console_ptr
1338
        call    get_console_ptr
1310
        pop     edx
1339
        pop     edx
1311
        pop     ecx
1340
        pop     ecx
1312
        mov     ah, [esp+5]
1341
        mov     ah, [esp+5]
1313
        mov     al, ' '
1342
        mov     al, ' '
Line 1335... Line 1364...
1335
@@:
1364
@@:
1336
        lodsb
1365
        lodsb
1337
        stosw
1366
        stosw
1338
        loop    @b
1367
        loop    @b
1339
.ret:
1368
.ret:
1340
        mov     ecx, [esp+20]
-
 
1341
        mov     eax, [ecx+dlgtemplate.x]
1369
        mov     eax, [ebp+dlgtemplate.x]
1342
        mov     edx, [ecx+dlgtemplate.y]
1370
        mov     edx, [ebp+dlgtemplate.y]
1343
        add     eax, [ebx+dlgitemtemplate.x2]
1371
        add     eax, [ebx+dlgitemtemplate.x2]
1344
        inc     eax
1372
        inc     eax
1345
        add     edx, [ebx+dlgitemtemplate.y1]
1373
        add     edx, [ebx+dlgitemtemplate.y1]
1346
        mov     ecx, edi
1374
        mov     ecx, edi
1347
        call    get_console_ptr
1375
        call    get_console_ptr
Line 1352... Line 1380...
1352
        mov     al, ' '
1380
        mov     al, ' '
1353
        rep     stosw
1381
        rep     stosw
1354
        ret
1382
        ret
Line 1355... Line 1383...
1355
 
1383
 
-
 
1384
draw_button:
-
 
1385
        mov     ecx, dialog_colors
-
 
1386
        test    byte [ebp+dlgtemplate.flags], 2
-
 
1387
        jz      @f
-
 
1388
        mov     ecx, warning_colors
1356
draw_button:
1389
@@:
1357
        mov     ah, [dialog_normal_btn_color]
1390
        mov     ah, [dialog_normal_btn_color-dialog_colors+ecx]
1358
        test    [ebx+dlgitemtemplate.flags], 4
1391
        test    [ebx+dlgitemtemplate.flags], 4
1359
        jz      @f
1392
        jz      @f
1360
        mov     ah, [dialog_selected_btn_color]
1393
        mov     ah, [dialog_selected_btn_color-dialog_colors+ecx]
1361
@@:
1394
@@:
Line 1362... Line 1395...
1362
        jmp     draw_text
1395
        jmp     draw_text
1363
 
1396
 
1364
draw_editbox:
1397
draw_editbox:
1365
        mov     edx, [ebx+dlgitemtemplate.data]
1398
        mov     edx, [ebx+dlgitemtemplate.data]
1366
        test    [ebx+dlgitemtemplate.flags], 4
1399
        test    [ebx+dlgitemtemplate.flags], 4
1367
        jz      @f
1400
        jz      @f
1368
        mov     eax, [ebx+dlgitemtemplate.x1]
1401
        mov     eax, [ebx+dlgitemtemplate.x1]
1369
        add     eax, [edx+4]
-
 
1370
        sub     eax, [edx+8]
1402
        add     eax, [edx+4]
1371
        mov     ecx, [esp+16]
1403
        sub     eax, [edx+8]
1372
        add     eax, [ecx+dlgtemplate.x]
1404
        add     eax, [ebp+dlgtemplate.x]
1373
        mov     [cursor_x], eax
1405
        mov     [cursor_x], eax
1374
        mov     eax, [ebx+dlgitemtemplate.y1]
1406
        mov     eax, [ebx+dlgitemtemplate.y1]
1375
        add     eax, [ecx+dlgtemplate.y]
1407
        add     eax, [ebp+dlgtemplate.y]
1376
        mov     [cursor_y], eax
1408
        mov     [cursor_y], eax
-
 
1409
@@:
-
 
1410
        mov     ecx, dialog_colors
-
 
1411
        test    byte [ebp+dlgtemplate.flags], 2
-
 
1412
        jz      @f
-
 
1413
        mov     ecx, warning_colors
1377
@@:
1414
@@:
1378
        mov     ah, [dialog_edit_color]
1415
        mov     ah, [dialog_edit_color-dialog_colors+ecx]
1379
        test    [ebx+dlgitemtemplate.flags], 10h
1416
        test    [ebx+dlgitemtemplate.flags], 10h
1380
        jnz     @f
1417
        jnz     @f
1381
        mov     ah, [dialog_unmodified_edit_color]
1418
        mov     ah, [dialog_unmodified_edit_color-dialog_colors+ecx]
1382
@@:
1419
@@:
1383
        mov     esi, [ebx+dlgitemtemplate.data]
1420
        mov     esi, [ebx+dlgitemtemplate.data]
1384
        add     esi, [edx+8]
1421
        add     esi, [edx+8]
-
 
1422
        add     esi, 12
-
 
1423
        jmp     draw_text_esi
-
 
1424
 
-
 
1425
; void __stdcall SayNoMem(void);
-
 
1426
SayNoMem:
-
 
1427
        or      dword [nomem_dlgdata+4], -1
-
 
1428
        or      dword [nomem_dlgdata+8], -1
-
 
1429
        push    nomem_dlgdata
-
 
1430
        call    DialogBox
-
 
1431
        ret
-
 
1432
 
-
 
1433
; int __stdcall SayErr(const char* title, int x, int y,
-
 
1434
;                       int num_strings, const char* strings[],
-
 
1435
;                       int num_buttons, const char* buttons[]);
-
 
1436
; may be x=-1 and/or y=-1
-
 
1437
; [esp+4] = title
-
 
1438
; [esp+8] = x
-
 
1439
; [esp+12] = y
-
 
1440
; [esp+16] = num_strings
-
 
1441
; [esp+20] = strings
-
 
1442
; [esp+24] = num_buttons
-
 
1443
; [esp+28] = buttons
-
 
1444
SayErr:
-
 
1445
        mov     eax, [esp+16]
-
 
1446
        add     eax, [esp+24]
-
 
1447
        imul    eax, dlgitemtemplate.size
-
 
1448
        add     eax, dlgtemplate.size+12
-
 
1449
        call    xmalloc
-
 
1450
        test    eax, eax
-
 
1451
        jnz     @f
-
 
1452
        or      eax, -1
-
 
1453
        ret     28
-
 
1454
@@:
-
 
1455
        pushad
-
 
1456
        mov     ebx, eax
-
 
1457
        mov     edi, eax
-
 
1458
        mov     eax, 2
-
 
1459
        stosd                           ; dlgtemplate.flags
-
 
1460
        mov     eax, [esp+32+8]
-
 
1461
        stosd                           ; dlgtemplate.x
-
 
1462
        mov     eax, [esp+32+12]
-
 
1463
        stosd                           ; dlgtemplate.y
-
 
1464
; calculate width
-
 
1465
        mov     ecx, [esp+32+16]
-
 
1466
        mov     esi, [esp+32+20]
-
 
1467
        xor     edx, edx
-
 
1468
.calcwidth:
-
 
1469
        lodsd
-
 
1470
@@:
-
 
1471
        inc     eax
-
 
1472
        cmp     byte [eax-1], 0
-
 
1473
        jnz     @b
-
 
1474
        sub     eax, [esi-4]
-
 
1475
        inc     eax
-
 
1476
        cmp     edx, eax
-
 
1477
        ja      @f
-
 
1478
        mov     edx, eax
-
 
1479
@@:
-
 
1480
        loop    .calcwidth
-
 
1481
        mov     ecx, [esp+32+24]
-
 
1482
        mov     esi, [esp+32+28]
-
 
1483
        xor     ebp, ebp
-
 
1484
.calcwidth2:
-
 
1485
        lodsd
-
 
1486
@@:
-
 
1487
        inc     eax
-
 
1488
        cmp     byte [eax-1], 0
-
 
1489
        jnz     @b
-
 
1490
        sub     eax, [esi-4]
-
 
1491
        inc     eax
-
 
1492
        add     ebp, eax
-
 
1493
        loop    .calcwidth2
-
 
1494
        inc     ebp
-
 
1495
        inc     ebp
-
 
1496
        cmp     edx, ebp
-
 
1497
        ja      @f
-
 
1498
        mov     edx, ebp
-
 
1499
@@:
-
 
1500
        mov     eax, [cur_width]
-
 
1501
        sub     eax, 8
-
 
1502
        cmp     edx, eax
-
 
1503
        jb      @f
-
 
1504
        mov     edx, eax
-
 
1505
@@:
-
 
1506
        mov     eax, edx
-
 
1507
        stosd                           ; dlgtemplate.width
-
 
1508
        mov     eax, [esp+32+16]
-
 
1509
        inc     eax
-
 
1510
        stosd                           ; dlgtemplate.height
-
 
1511
        mov     eax, 3
-
 
1512
        stosd                           ; dlgtemplate.border_size_x
-
 
1513
        mov     al, 2
-
 
1514
        stosd                           ; dlgtemplate.border_size_y
-
 
1515
        mov     eax, [esp+32+4]
-
 
1516
        stosd                           ; dlgtemplate.title
-
 
1517
        xor     eax, eax
-
 
1518
        stosd                           ; (ignored)
-
 
1519
        stosd                           ; DlgProc
-
 
1520
        stosd                           ; userdata
-
 
1521
        mov     eax, [esp+32+16]
-
 
1522
        add     eax, [esp+32+24]
-
 
1523
        stosd                           ; num_items
-
 
1524
; fill strings
-
 
1525
        xor     ecx, ecx
-
 
1526
        mov     esi, [esp+32+20]
-
 
1527
@@:
-
 
1528
        mov     eax, 1
-
 
1529
        stosd                           ; dlgitemtemplate.type
-
 
1530
        dec     eax
-
 
1531
        stosd                           ; dlgitemtemplate.x1
-
 
1532
        mov     eax, ecx
-
 
1533
        stosd                           ; dlgitemtemplate.y1
-
 
1534
        lea     eax, [edx-1]
-
 
1535
        stosd                           ; dlgitemtemplate.x2
-
 
1536
        mov     eax, ecx
-
 
1537
        stosd                           ; dlgitemtemplate.y2
-
 
1538
        movsd                           ; dlgitemtemplate.data
-
 
1539
        mov     eax, 1
-
 
1540
        stosd                           ; dlgitemtemplate.flags
-
 
1541
        inc     ecx
-
 
1542
        cmp     ecx, [esp+32+16]
-
 
1543
        jb      @b
-
 
1544
; fill buttons
-
 
1545
        mov     ecx, [esp+32+24]
-
 
1546
        mov     esi, [esp+32+28]
-
 
1547
        sub     edx, ebp
-
 
1548
        jc      .big
-
 
1549
        shr     edx, 1
-
 
1550
        inc     edx
-
 
1551
        jmp     .fillbtns
-
 
1552
.big:
-
 
1553
        xor     edx, edx
-
 
1554
.fillbtns:
-
 
1555
        mov     eax, 2
-
 
1556
        stosd                           ; dlgitemtemplate.type
-
 
1557
        mov     eax, edx
-
 
1558
        stosd                           ; dlgitemtemplate.x1
-
 
1559
        mov     eax, [ebx+dlgtemplate.height]
-
 
1560
        dec     eax
-
 
1561
        stosd                           ; dlgitemtemplate.y1
-
 
1562
        push    eax
-
 
1563
        lodsd
-
 
1564
        sub     eax, edx
-
 
1565
@@:
-
 
1566
        inc     edx
-
 
1567
        cmp     byte [eax+edx-1], 0
-
 
1568
        jnz     @b
-
 
1569
        mov     eax, edx
-
 
1570
        inc     edx
-
 
1571
        stosd                           ; dlgitemtemplate.x2
-
 
1572
        pop     eax
-
 
1573
        stosd                           ; dlgitemtemplate.y2
-
 
1574
        mov     eax, [esi-4]
-
 
1575
        stosd                           ; dlgitemtemplate.data
-
 
1576
        mov     eax, 9
-
 
1577
        cmp     ecx, [esp+32+24]
-
 
1578
        jnz     @f
-
 
1579
        or      al, 4
-
 
1580
@@:
-
 
1581
        stosd                           ; dlgitemtemplate.flags
-
 
1582
        loop    .fillbtns
-
 
1583
        push    ebx
-
 
1584
        call    DialogBox
-
 
1585
        cmp     eax, -1
-
 
1586
        jz      @f
-
 
1587
        sub     eax, ebx
-
 
1588
        sub     eax, dlgtemplate.size+12
-
 
1589
        xor     edx, edx
-
 
1590
        mov     ecx, dlgitemtemplate.size
-
 
1591
        div     ecx
-
 
1592
        sub     eax, [esp+32+16]
-
 
1593
@@:
-
 
1594
        mov     [esp+28], eax
-
 
1595
        mov     eax, ebx
-
 
1596
        call    mf_free