Subversion Repositories Kolibri OS

Rev

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

Rev 5673 Rev 6214
Line 16... Line 16...
16
;;           2) new type of window (you need kernel 114 revision or higher)
16
;;           2) new type of window (you need kernel 114 revision or higher)
17
;;   Calc 1.32
17
;;   Calc 1.32
18
;;           1) fixed arccos
18
;;           1) fixed arccos
19
;;   Calc 1.33
19
;;   Calc 1.33
20
;;           1) align button captions in proper way, finally!
20
;;           1) align button captions in proper way, finally!
21
 
-
 
-
 
21
;;   Calc 1.4 - Leency
-
 
22
;;           1) better GUI, big fonts
Line 22... Line 23...
22
 
23
 
23
use32
24
use32
24
        org     0x0
25
        org     0x0
25
        db      'MENUET01'      ; 8 byte id
26
        db      'MENUET01'      ; 8 byte id
Line 29... Line 30...
29
        dd      E_END           ; memory for app
30
        dd      E_END           ; memory for app
30
        dd      E_END           ; esp
31
        dd      E_END           ; esp
31
        dd      0x0,0x0         ; I_Param , I_Icon
32
        dd      0x0,0x0         ; I_Param , I_Icon
Line 32... Line 33...
32
 
33
 
-
 
34
include '../../../macros.inc'
-
 
35
include '../../../KOSfuncs.inc'
-
 
36
 
-
 
37
macro DrawBar  x, y, width, height, color 
-
 
38
{
-
 
39
	mcall 13, (x) shl 16 + (width), (y) shl 16 + (height), color
-
 
40
}
-
 
41
 
-
 
42
macro DrawRectangle  x, y, w, h, color 
-
 
43
{
-
 
44
	DrawBar x,y,w,1,color
-
 
45
	DrawBar x,y+h,w,1
-
 
46
	DrawBar x,y,1,h
-
 
47
	DrawBar x+w,y,1,h+1
Line 33... Line 48...
33
include '../../../macros.inc'
48
}
34
 
49
 
35
START:
50
START:
36
red:
51
red:
Line 631... Line 646...
631
 
646
 
632
;   *********************************************
647
;   *********************************************
633
;   ******* WINDOW DEFINITIONS AND DRAW *********
648
;   ******* WINDOW DEFINITIONS AND DRAW *********
Line -... Line 649...
-
 
649
;   *********************************************
-
 
650
 
634
;   *********************************************
651
BTNSP_X equ 39
635
 
652
 
Line 636... Line 653...
636
draw_window:
653
draw_window:
Line 637... Line 654...
637
        mcall   12, 1
654
        mcall   12, 1
Line 638... Line -...
638
 
-
 
639
        mcall   48, 3, sc, sizeof.system_colors
-
 
640
 
655
 
641
        mcall   48, 4
656
        mcall   48, 3, sc, sizeof.system_colors
642
 
657
 
643
        mov     ecx, eax
658
		mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
644
        xor     eax, eax                     
659
 
645
        mov     ebx, 200 shl 16 + 256
660
		mov     ecx, 200 shl 16 + 210
Line 646... Line 661...
646
        add     ecx, 200 shl 16 + 163
661
		add     ecx, eax                ; add skin height to window height 
647
        mov     edx, [sc.work]
662
        mov     edx, [sc.work]
648
        or      edx, 0x34000000
663
        or      edx, 0x34000000
649
        mov     edi, title
664
		mov     edi, title
650
        mcall
665
        mcall   0, <250, 317>
651
 
666
		
652
        mov     eax, 8
667
        mov     eax, SF_DEFINE_BUTTON
653
        mov     ebx, 19 shl 16 + 28
668
        mov     ebx, 19 shl 16 + 36
654
        mov     ecx, 55 shl 16 + 18
669
        mov     ecx, 55 shl 16 + 22
655
        mov     edx, 6
670
        mov     edx, 6
656
        mov     esi, [sc.work_button]
671
        mov     esi, [sc.work_button]
657
        mov     edi, 7
672
        mov     edi, 7
658
newbutton:
673
newbutton:
659
        dec     edi
674
        dec     edi
660
        jnz     no_new_row
675
        jnz     no_new_row
661
        mov     edi, 7
676
        mov     edi, 7
662
        mov     ebx, 19 shl 16 + 28
677
        mov     ebx, 19 shl 16 + 36
663
        add     ecx, 20 shl 16
678
        add     ecx, 28 shl 16
Line 664... Line 679...
664
no_new_row:
679
no_new_row:
665
        mcall
680
        mcall
-
 
681
        add     ebx, BTNSP_X shl 16
Line 666... Line 682...
666
        add     ebx, 30 shl 16
682
        inc     edx
-
 
683
        cmp     edx, BTNSP_X
667
        inc     edx
684
        jbe     newbutton
668
        cmp     edx, 39
685
 
669
        jbe     newbutton
686
        mcall   , <253, 36>, <55, 22>, 2, 0xF0969D        ; 'C'
670
 
687
        mcall   , <235,54>, <20,26>, 3, [sc.work]        ; 'dec-bin-hex'
671
        mcall   , <199, 28>, <55, 18>, 2        ; 'C'
688
		mov     esi, [sc.work_button]
672
        mcall   , <220,  8>, < 7,  8>, 3        ; 'dec-bin-hex'
689
 
673
 
690
 
674
 
691
        mov     ecx, [sc.work_button_text]
675
        mov     ecx, [sc.work_button_text]
692
		or      ecx, 0x10000000
676
        mov     edx, text
693
        mov     edx, text
677
        mov     edi, 55 - 15
694
        mov     edi, 31
678
next_line:
695
next_line:
679
        inc     edx
696
        inc     edx
680
        and     edi, 0x0000ffff
697
        and     edi, 0x0000ffff
681
        add     edi, 20 SHL 16 + 20
698
        add     edi, 24 SHL 16 + 28
682
next_button:
699
next_button:
683
        movzx   esi, byte[edx - 1]
700
        movzx   esi, byte[edx - 1]
684
        imul    eax, esi, 6
701
        imul    eax, esi, 8
685
        neg     eax
702
        neg     eax
686
        add     eax, 29
703
        add     eax, 29
687
        shr     eax, 1
704
        shr     eax, 1
688
        shl     eax, 16
705
        shl     eax, 16
689
        mov     ebx, edi
706
        mov     ebx, edi
Line 703... Line 720...
703
        ret
720
        ret
Line 704... Line 721...
704
 
721
 
705
print_display:
722
print_display:
706
        pusha
723
        pusha
707
        mcall   13, < 21, 206>, <22, 24>, 0xFFFfff
724
        mcall   13, < 21, 206>, <22, 24>, 0xFFFfff
708
        mcall   38, < 19, 227>, <20, 20>, [sc.work_graph]
725
		DrawRectangle 19,20,208,26, [sc.work_graph]
709
        mcall   38, < 20, 226>, <21, 21>, 0xE0E0E0 ; internal shadow
-
 
710
        mcall   38, < 19, 227>, <45, 45>, [sc.work_graph]
-
 
711
        mcall   38, < 19,  19>, <21, 44>, [sc.work_graph]
726
        mcall   38, < 20, 226>, <21, 21>, 0xE0E0E0 ; internal shadow
712
		mcall   38, < 20,  20>, <23, 43>, 0xE0E0E0 ; internal shadow
-
 
Line 713... Line -...
713
        mcall   38, <227, 227>, <21, 44>, [sc.work_graph]
-
 
714
		
-
 
715
        mov     eax, 4
727
		mcall   38, < 20,  20>, <23, 43>, 0xE0E0E0 ; internal shadow
716
        mov     ebx, 135 shl 16 + 7
728
		
717
        mov     ecx, [sc.work_text]
-
 
718
        or      ecx, 0x40000000
-
 
719
        mov     edx, calc
729
        mov     ecx, [sc.work_text]
720
        mov     esi, 1
-
 
Line 721... Line 730...
721
        mov     edi, [sc.work]
730
        or      ecx, 0x40000000
722
        mcall
731
        mcall   4, <135,7>,,calc,1,[sc.work]
723
 
732
 
724
        mov     ebx, 198 shl 16 + 8
733
        mov     ebx, 250 shl 16 + 26
725
        mov     edx, [display_type]
734
        mov     edx, [display_type]
726
        shl     edx, 2
735
        shl     edx, 2
-
 
736
        add     edx, display_type_text
727
        add     edx, display_type_text
737
        mov     esi, 3
Line 728... Line 738...
728
        mov     esi, 3
738
        mov     edi, [sc.work]
729
        mov     edi, [sc.work]
739
		or      ecx, 0x10000000
730
        mcall
740
        mcall
Line 798... Line 808...
798
        ret
808
        ret
Line 799... Line 809...
799
 
809
 
Line 800... Line 810...
800
 
810
 
Line 801... Line 811...
801
;data
811
;data
802
 
812
 
803
title   db 'Calc 1.35', 0
813
title   db 'Calc 1.4', 0
804
 
814