Subversion Repositories Kolibri OS

Rev

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

Rev 517 Rev 589
Line 318... Line 318...
318
        int     40h
318
        int     40h
319
        dec     eax
319
        dec     eax
320
        jz      .redraw
320
        jz      .redraw
321
        dec     eax
321
        dec     eax
322
        jz      .key
322
        jz      .key
323
        or      eax, -1
-
 
324
        int     40h
323
        jmp     exit
325
.redraw:
324
.redraw:
326
        push    ebx ebp
325
        push    ebx ebp
327
        call    draw_window
326
        call    draw_window
328
        pop     ebp ebx
327
        pop     ebp ebx
329
        jmp     .event
328
        jmp     .event
Line 770... Line 769...
770
        jz      .end
769
        jz      .end
771
        cmp     al, 0x51
770
        cmp     al, 0x51
772
        jz      .pgdn
771
        jz      .pgdn
773
        cmp     al, 0x49
772
        cmp     al, 0x49
774
        jz      .pgup
773
        jz      .pgup
-
 
774
        cmp     al, 0x52
-
 
775
        jz      .ins
-
 
776
        cmp     al, 0x53
-
 
777
        jz      .del
775
        mov     edx, [ebx+36]
778
        mov     edx, [ebx+36]
776
@@:
779
@@:
777
        cmp     dword [edx+4], 0
780
        cmp     dword [edx+4], 0
778
        jz      @f
781
        jz      @f
779
        mov     edx, [edx+4]
782
        mov     edx, [edx+4]
Line 856... Line 859...
856
        or      eax, -1
859
        or      eax, -1
857
        ret     16
860
        ret     16
858
.enter:
861
.enter:
859
        mov     eax, [ebx+36]
862
        mov     eax, [ebx+36]
860
        ret     16
863
        ret     16
-
 
864
.ins:
-
 
865
        push    5
-
 
866
        pop     edx
-
 
867
        jmp     @f
-
 
868
.del:
-
 
869
        push    4
-
 
870
        pop     edx
-
 
871
@@:
-
 
872
        mov     eax, [ebx+36]
-
 
873
        cmp     byte [eax+8], '/'
-
 
874
        jnz     @f
-
 
875
        cmp     word [eax+9], 'cd'
-
 
876
        jnz     @f
-
 
877
        movzx   ecx, byte [eax+11]
-
 
878
        sub     ecx, '0'
-
 
879
        push    24
-
 
880
        pop     eax
-
 
881
        mov     ebx, edx
-
 
882
        int     40h
-
 
883
@@:
-
 
884
        xor     eax, eax
-
 
885
        ret     16
Line 861... Line 886...
861
 
886
 
862
.line_prev:
887
.line_prev:
863
        cmp     eax, [ebx+44]
888
        cmp     eax, [ebx+44]
864
        jnz     @f
889
        jnz     @f
Line 1014... Line 1039...
1014
;       2 = ¢ëà ¢­¨¢ ­¨¥ ¢¯à ¢®
1039
;       2 = ¢ëà ¢­¨¢ ­¨¥ ¢¯à ¢®
1015
;       4 = í«¥¬¥­â ¨¬¥¥â 䮪ãá ¢¢®¤ 
1040
;       4 = í«¥¬¥­â ¨¬¥¥â 䮪ãá ¢¢®¤ 
1016
;       8 = í«¥¬¥­â ¬®¦¥â ¨¬¥âì 䮪ãá ¢¢®¤ 
1041
;       8 = í«¥¬¥­â ¬®¦¥â ¨¬¥âì 䮪ãá ¢¢®¤ 
1017
;       10h: ¤«ï ª­®¯ª¨ = ª­®¯ª  ¯® 㬮«ç ­¨î (Enter ­  ­¥-ª­®¯ª¥)
1042
;       10h: ¤«ï ª­®¯ª¨ = ª­®¯ª  ¯® 㬮«ç ­¨î (Enter ­  ­¥-ª­®¯ª¥)
1018
;            ¤«ï ¯®«ï ¢¢®¤  = ¤ ­­ë¥ ¡ë«¨ ¬®¤¨ä¨æ¨à®¢ ­ë
1043
;            ¤«ï ¯®«ï ¢¢®¤  = ¤ ­­ë¥ ¡ë«¨ ¬®¤¨ä¨æ¨à®¢ ­ë
-
 
1044
;       20h: ¤«ï ¯®«ï ¢¢®¤  = ­¥ ®â®¡à ¦ âì ¢¢®¤¨¬ë¥ ¤ ­­ë¥ (¯®ª §ë¢ âì '*')
1019
.size = $
1045
.size = $
1020
end virtual
1046
end virtual
1021
;       struct DLGDATA
1047
;       struct DLGDATA
1022
;       {
1048
;       {
1023
;               DLGTEMPLATE dialog;     /* window description */
1049
;               DLGTEMPLATE dialog;     /* window description */
Line 1307... Line 1333...
1307
; ®¯à¥¤¥«ï¥¬ ¤«¨­ã áâப¨
1333
; ®¯à¥¤¥«ï¥¬ ¤«¨­ã áâப¨
1308
        mov     esi, [ebx+dlgitemtemplate.data]
1334
        mov     esi, [ebx+dlgitemtemplate.data]
1309
draw_text_esi:
1335
draw_text_esi:
1310
        test    esi, esi
1336
        test    esi, esi
1311
        jz      .ret
1337
        jz      .ret
-
 
1338
        push    -1
1312
        or      ecx, -1
1339
        pop     ecx
1313
@@:
1340
@@:
1314
        inc     ecx
1341
        inc     ecx
1315
        cmp     byte [ecx+esi], 0
1342
        cmp     byte [ecx+esi], 0
1316
        jnz     @b
1343
        jnz     @b
1317
; ¢ ecx ¤«¨­  áâப¨
1344
; ¢ ecx ¤«¨­  áâப¨
Line 1370... Line 1397...
1370
        mov     ecx, edx
1397
        mov     ecx, edx
1371
        sub     ecx, 3
1398
        sub     ecx, 3
1372
        sub     esi, ecx
1399
        sub     esi, ecx
1373
.text_copy:
1400
.text_copy:
1374
        jecxz   .ret
1401
        jecxz   .ret
-
 
1402
; check for password editboxes
-
 
1403
        cmp     [ebx+dlgitemtemplate.type], 3
-
 
1404
        jnz     @f
-
 
1405
        test    [ebx+dlgitemtemplate.flags], 20h
-
 
1406
        jz      @f
-
 
1407
        mov     al, '*'
-
 
1408
        rep     stosw
-
 
1409
        jmp     .ret
1375
@@:
1410
@@:
1376
        lodsb
1411
        lodsb
1377
        stosw
1412
        stosw
1378
        loop    @b
1413
        loop    @b
1379
.ret:
1414
.ret:
Line 1439... Line 1474...
1439
        or      dword [nomem_dlgdata+8], -1
1474
        or      dword [nomem_dlgdata+8], -1
1440
        push    nomem_dlgdata
1475
        push    nomem_dlgdata
1441
        call    DialogBox
1476
        call    DialogBox
1442
        ret
1477
        ret
Line 1443... Line -...
1443
 
-
 
1444
; int __stdcall SayErr(const char* title, int x, int y,
1478
 
1445
;                       int num_strings, const char* strings[],
1479
; int __stdcall SayErr(int num_strings, const char* strings[],
1446
;                       int num_buttons, const char* buttons[]);
-
 
1447
; may be x=-1 and/or y=-1
1480
;                      int num_buttons, const char* buttons[]);
-
 
1481
SayErr:
-
 
1482
        pop     eax
-
 
1483
        push    aError
1448
SayErr:
1484
        push    eax
1449
        push    2
1485
        push    2
Line 1450... Line 1486...
1450
        jmp     @f
1486
        jmp     @f
1451
 
1487
 
1452
; int __stdcall Message(const char* title, int x, int y,
1488
; int __stdcall Message(const char* title,
1453
;                       int num_strings, const char* strings[],
1489
;                       int num_strings, const char* strings[],
1454
;                       int num_buttons, const char* buttons[]);
1490
;                       int num_buttons, const char* buttons[]);
1455
Message:
1491
Message:
1456
        push    1
-
 
1457
@@:
-
 
1458
; [esp+4] = title
-
 
1459
; [esp+8] = x
-
 
1460
; [esp+12] = y
-
 
1461
; [esp+16] = num_strings
-
 
1462
; [esp+20] = strings
-
 
1463
; [esp+24] = num_buttons
1492
        push    1
-
 
1493
@@:
-
 
1494
        pop     eax
-
 
1495
; [esp+4] = title
-
 
1496
; [esp+8] = num_strings
-
 
1497
; [esp+12] = strings
1464
; [esp+28] = buttons
1498
; [esp+16] = num_buttons
1465
        pop     eax
1499
; [esp+20] = buttons
1466
        pushad
1500
        pushad
1467
        mov     ecx, [esp+4+16]
1501
        mov     ecx, [esp+32+8]
1468
        add     ecx, [esp+4+24]
1502
        add     ecx, [esp+32+16]
1469
        imul    ecx, dlgitemtemplate.size
1503
        imul    ecx, dlgitemtemplate.size
1470
        add     ecx, dlgtemplate.size+12
1504
        add     ecx, dlgtemplate.size+12
1471
        call    xpgalloc
1505
        call    xpgalloc
Line 1477... Line 1511...
1477
@@:
1511
@@:
1478
        mov     ebx, eax
1512
        mov     ebx, eax
1479
        mov     edi, eax
1513
        mov     edi, eax
1480
        mov     eax, [esp+28]
1514
        mov     eax, [esp+28]
1481
        stosd                           ; dlgtemplate.flags
1515
        stosd                           ; dlgtemplate.flags
1482
        mov     eax, [esp+32+8]
1516
        or      eax, -1
1483
        stosd                           ; dlgtemplate.x
1517
        stosd                           ; dlgtemplate.x
1484
        mov     eax, [esp+32+12]
-
 
1485
        stosd                           ; dlgtemplate.y
1518
        stosd                           ; dlgtemplate.y
1486
; calculate width
1519
; calculate width
1487
        mov     ecx, [esp+32+16]
1520
        mov     ecx, [esp+32+8]
1488
        mov     esi, [esp+32+20]
1521
        mov     esi, [esp+32+12]
1489
        xor     edx, edx
1522
        xor     edx, edx
1490
.calcwidth:
1523
.calcwidth:
1491
        lodsd
1524
        lodsd
1492
@@:
1525
@@:
1493
        inc     eax
1526
        inc     eax
Line 1498... Line 1531...
1498
        cmp     edx, eax
1531
        cmp     edx, eax
1499
        ja      @f
1532
        ja      @f
1500
        mov     edx, eax
1533
        mov     edx, eax
1501
@@:
1534
@@:
1502
        loop    .calcwidth
1535
        loop    .calcwidth
1503
        mov     ecx, [esp+32+24]
1536
        mov     ecx, [esp+32+16]
1504
        mov     esi, [esp+32+28]
1537
        mov     esi, [esp+32+20]
1505
        xor     ebp, ebp
1538
        xor     ebp, ebp
1506
.calcwidth2:
1539
.calcwidth2:
1507
        lodsd
1540
        lodsd
1508
@@:
1541
@@:
1509
        inc     eax
1542
        inc     eax
Line 1525... Line 1558...
1525
        jb      @f
1558
        jb      @f
1526
        mov     edx, eax
1559
        mov     edx, eax
1527
@@:
1560
@@:
1528
        mov     eax, edx
1561
        mov     eax, edx
1529
        stosd                           ; dlgtemplate.width
1562
        stosd                           ; dlgtemplate.width
1530
        mov     eax, [esp+32+16]
1563
        mov     eax, [esp+32+8]
1531
        inc     eax
1564
        inc     eax
1532
        stosd                           ; dlgtemplate.height
1565
        stosd                           ; dlgtemplate.height
1533
        mov     eax, 3
1566
        mov     eax, 3
1534
        stosd                           ; dlgtemplate.border_size_x
1567
        stosd                           ; dlgtemplate.border_size_x
1535
        mov     al, 2
1568
        mov     al, 2
Line 1538... Line 1571...
1538
        stosd                           ; dlgtemplate.title
1571
        stosd                           ; dlgtemplate.title
1539
        xor     eax, eax
1572
        xor     eax, eax
1540
        stosd                           ; (ignored)
1573
        stosd                           ; (ignored)
1541
        stosd                           ; DlgProc
1574
        stosd                           ; DlgProc
1542
        stosd                           ; userdata
1575
        stosd                           ; userdata
1543
        mov     eax, [esp+32+16]
1576
        mov     eax, [esp+32+8]
1544
        add     eax, [esp+32+24]
1577
        add     eax, [esp+32+16]
1545
        stosd                           ; num_items
1578
        stosd                           ; num_items
1546
; fill strings
1579
; fill strings
1547
        xor     ecx, ecx
1580
        xor     ecx, ecx
1548
        mov     esi, [esp+32+20]
1581
        mov     esi, [esp+32+12]
1549
@@:
1582
@@:
1550
        mov     eax, 1
1583
        mov     eax, 1
1551
        stosd                           ; dlgitemtemplate.type
1584
        stosd                           ; dlgitemtemplate.type
1552
        dec     eax
1585
        dec     eax
1553
        stosd                           ; dlgitemtemplate.x1
1586
        stosd                           ; dlgitemtemplate.x1
Line 1559... Line 1592...
1559
        stosd                           ; dlgitemtemplate.y2
1592
        stosd                           ; dlgitemtemplate.y2
1560
        movsd                           ; dlgitemtemplate.data
1593
        movsd                           ; dlgitemtemplate.data
1561
        mov     eax, 1
1594
        mov     eax, 1
1562
        stosd                           ; dlgitemtemplate.flags
1595
        stosd                           ; dlgitemtemplate.flags
1563
        inc     ecx
1596
        inc     ecx
1564
        cmp     ecx, [esp+32+16]
1597
        cmp     ecx, [esp+32+8]
1565
        jb      @b
1598
        jb      @b
1566
; fill buttons
1599
; fill buttons
1567
        mov     ecx, [esp+32+24]
1600
        mov     ecx, [esp+32+16]
1568
        mov     esi, [esp+32+28]
1601
        mov     esi, [esp+32+20]
1569
        sub     edx, ebp
1602
        sub     edx, ebp
1570
        jc      .big
1603
        jc      .big
1571
        shr     edx, 1
1604
        shr     edx, 1
1572
        inc     edx
1605
        inc     edx
1573
        jmp     .fillbtns
1606
        jmp     .fillbtns
Line 1594... Line 1627...
1594
        pop     eax
1627
        pop     eax
1595
        stosd                           ; dlgitemtemplate.y2
1628
        stosd                           ; dlgitemtemplate.y2
1596
        mov     eax, [esi-4]
1629
        mov     eax, [esi-4]
1597
        stosd                           ; dlgitemtemplate.data
1630
        stosd                           ; dlgitemtemplate.data
1598
        mov     eax, 9
1631
        mov     eax, 9
1599
        cmp     ecx, [esp+32+24]
1632
        cmp     ecx, [esp+32+16]
1600
        jnz     @f
1633
        jnz     @f
1601
        or      al, 4
1634
        or      al, 4
1602
@@:
1635
@@:
1603
        stosd                           ; dlgitemtemplate.flags
1636
        stosd                           ; dlgitemtemplate.flags
1604
        loop    .fillbtns
1637
        loop    .fillbtns
Line 1609... Line 1642...
1609
        sub     eax, ebx
1642
        sub     eax, ebx
1610
        sub     eax, dlgtemplate.size+12
1643
        sub     eax, dlgtemplate.size+12
1611
        xor     edx, edx
1644
        xor     edx, edx
1612
        mov     ecx, dlgitemtemplate.size
1645
        mov     ecx, dlgitemtemplate.size
1613
        div     ecx
1646
        div     ecx
1614
        sub     eax, [esp+32+16]
1647
        sub     eax, [esp+32+8]
1615
@@:
1648
@@:
1616
        mov     [esp+28], eax
1649
        mov     [esp+28], eax
1617
        mov     ecx, ebx
1650
        mov     ecx, ebx
1618
        call    pgfree
1651
        call    pgfree
1619
        popad
1652
        popad
1620
        ret     28
1653
        ret     20