Subversion Repositories Kolibri OS

Rev

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

Rev 6216 Rev 7431
Line 33... Line 33...
33
 
33
 
34
include '../../../macros.inc'
34
include '../../../macros.inc'
35
include '../../../gui_patterns.inc'
35
include '../../../gui_patterns.inc'
Line -... Line 36...
-
 
36
include '../../../KOSfuncs.inc'
-
 
37
 
-
 
38
hotkeys_count equ 26
-
 
39
asci:   db 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 43, 61, 13, 45, 42, 47, 44, 46, 27, 182, \
-
 
40
           97, 98, 99,100,101,102
-
 
41
butid:  db 12, 13, 14, 19, 20, 21, 26, 27, 28, 34, 15, 39, 39, 22, 36, 29, 35, 35, 1,  2  , \
36
include '../../../KOSfuncs.inc'
42
           6,  7,  8,  9,  10, 11
37
 
43
 
38
START:
44
START:
39
red:
45
red:
40
        call    draw_window
46
        call    draw_window
Line 51... Line 57...
51
        shr     eax, 8
57
        shr     eax, 8
52
        jmp     testbut
58
        jmp     testbut
Line 53... Line 59...
53
 
59
 
54
key:
60
key:
-
 
61
        mcall   2       ; get ASCII key code
55
        mcall   2       ; get ASCII key code
62
		and     eax, 0xffff ; supress scancodes
56
        shr     eax, 8
63
        shr     eax, 8
57
        mov     edi, asci       ; convert ASCII into button id
64
        mov     edi, asci       ; convert ASCII into button id
58
        mov     ecx, 18
65
        mov     ecx, hotkeys_count
59
        cld
66
        cld
60
        repne   scasb
67
        repne   scasb
61
        jne     still
68
        jne     still
62
        sub     edi, asci
69
        sub     edi, asci
Line 259... Line 266...
259
        cmp     eax, 15
266
        cmp     eax, 15
260
        jne     no_add
267
        jne     no_add
261
        call    calculate
268
        call    calculate
262
        call    new_entry
269
        call    new_entry
263
        mov     [calc], '+'
270
        mov     [calc], '+'
-
 
271
		call    print_display
264
        jmp     still
272
        jmp     still
Line 265... Line 273...
265
 
273
 
266
no_add:
274
no_add:
267
        cmp     eax, 22
275
        cmp     eax, 22
268
        jne     no_sub
276
        jne     no_sub
269
        call    calculate
277
        call    calculate
270
        call    new_entry
278
        call    new_entry
-
 
279
        mov     [calc], '-'
271
        mov     [calc], '-'
280
		call    print_display
Line 272... Line 281...
272
        jmp     still
281
        jmp     still
273
  
282
  
274
no_sub:
283
no_sub:
275
        cmp     eax, 29
284
        cmp     eax, 29
276
        jne     no_div
285
        jne     no_div
277
        call    calculate
286
        call    calculate
-
 
287
        call    new_entry
278
        call    new_entry
288
        mov     [calc], '/'
Line 279... Line 289...
279
        mov     [calc], '/'
289
		call    print_display
280
        jmp     still
290
        jmp     still
281
 
291
 
282
no_div:
292
no_div:
283
        cmp     eax, 36
293
        cmp     eax, 36
284
        jne     no_mul
294
        jne     no_mul
-
 
295
        call    calculate
285
        call    calculate
296
        mov     [calc], '*'
Line 286... Line 297...
286
        mov     [calc], '*'
297
        call    new_entry
287
        call    new_entry
298
		call    print_display
288
        jmp     still
299
        jmp     still
Line 702... Line 713...
702
        cmp     [edx - 1], byte 0
713
        cmp     [edx - 1], byte 0
703
		jne     next_button
714
		jne     next_button
704
        cmp     [edx], byte 'x'
715
        cmp     [edx], byte 'x'
705
        jne     next_line
716
        jne     next_line
Line -... Line 717...
-
 
717
 
-
 
718
		DrawRectangle3D DISPLAY_X-1,DISPLAY_Y-1,DISPLAY_W+2,DISPLAY_H+2, [sc.work_3d_dark], [sc.work_3d_light]
-
 
719
		DrawRectangle DISPLAY_X,DISPLAY_Y,DISPLAY_W,DISPLAY_H, [sc.work_graph]
-
 
720
        mcall   38, < DISPLAY_X+1, DISPLAY_W+DISPLAY_X-1>, , 0xE0E0E0 ; internal shadow
-
 
721
		mcall     , < DISPLAY_X+1,  DISPLAY_X+1>, ,          ; internal shadow
706
 
722
		
Line 707... Line 723...
707
        call    print_display
723
        call    print_display
708
 
724
 
Line 709... Line 725...
709
        mcall   12, 2
725
        mcall   12, 2
710
        ret
726
        ret
711
 
-
 
712
print_display:
-
 
713
        pusha
-
 
714
		DrawRectangle3D DISPLAY_X-1,DISPLAY_Y-1,DISPLAY_W+2,DISPLAY_H+2, [sc.work_3d_dark], [sc.work_3d_light]
-
 
715
		DrawRectangle DISPLAY_X,DISPLAY_Y,DISPLAY_W,DISPLAY_H, [sc.work_graph]
727
 
716
        mcall   38, < DISPLAY_X+1, DISPLAY_W+DISPLAY_X-1>, , 0xE0E0E0 ; internal shadow
728
print_display:
Line 717... Line 729...
717
		mcall     , < DISPLAY_X+1,  DISPLAY_X+1>, ,          ; internal shadow
729
        pusha
718
		mcall   13, < DISPLAY_X+2, DISPLAY_W-2>, , 0xFFFfff ; background
730
		mcall   13, < DISPLAY_X+2, DISPLAY_W-2>, , 0xFFFfff ; background
Line 838... Line 850...
838
        db 1,'4',   1,'5', 1,'6', 1,'-', 3,'1/x', 3,'Cos', 4,'Acos', 0
850
        db 1,'4',   1,'5', 1,'6', 1,'-', 3,'1/x', 3,'Cos', 4,'Acos', 0
839
        db 1,'7',   1,'8', 1,'9', 1,'/', 3,'x^2', 3,'Tan', 4,'Atan', 0
851
        db 1,'7',   1,'8', 1,'9', 1,'/', 3,'x^2', 3,'Tan', 4,'Atan', 0
840
        db 3,'+/-', 1,'0', 1,'.', 1,'*', 3,'Sqr', 2,'Pi',  1,'=', 0
852
        db 3,'+/-', 1,'0', 1,'.', 1,'*', 3,'Sqr', 2,'Pi',  1,'=', 0
841
        db 'x'
853
        db 'x'
Line 842... Line -...
842
 
-
 
843
asci:   db 49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 43, 61, 45, 42, 47, 44, 46, 27
-
 
844
butid:  db 12, 13, 14, 19, 20, 21, 26, 27, 28, 34, 15, 39, 22, 36, 29, 35, 35, 1
-
 
845
 
854
 
Line 846... Line 855...
846
I_END:
855
I_END:
847
 
856
 
848
sc      system_colors
857
sc      system_colors