Subversion Repositories Kolibri OS

Rev

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

Rev 317 Rev 485
Line 14... Line 14...
14
  dd      0x1000       ; required amount of memory
14
  dd      0x1000       ; required amount of memory
15
  dd      0x1000       ; esp
15
  dd      0x1000       ; esp
16
  dd      0x00000000   ; reserved=no extended header
16
  dd      0x00000000   ; reserved=no extended header
Line 17... Line 17...
17
 
17
 
18
include 'lang.inc'
18
include 'lang.inc'
Line 19... Line 19...
19
include 'macros.inc'
19
include '..\..\..\..\macros.inc'
Line 20... Line 20...
20
 
20
 
21
START:                          ; start of execution
21
START:                          ; start of execution
22
 
22
 
Line 23... Line 23...
23
    mov  eax,18
23
    mov  eax,18
24
    mov  ebx,5
24
    mov  ebx,5
25
    int  0x40
25
    mcall
26
 
26
 
Line 36... Line 36...
36
    div  ebx
36
    div  ebx
37
    add  dl,48
37
    add  dl,48
38
    mov  [edi],dl
38
    mov  [edi],dl
39
    sub  edi,1
39
    sub  edi,1
40
    loop newnum
40
    loop newnum
-
 
41
    
-
 
42
    mov  eax,48
-
 
43
    mov  ebx,3
-
 
44
    mov  ecx,sc
-
 
45
    mov  edx,sizeof.system_colors
-
 
46
    mcall
-
 
47
 
41
red:
48
red:
42
    call draw_window            ; at first, draw the window
49
    call draw_window            ; at first, draw the window
Line 43... Line 50...
43
 
50
 
Line 44... Line 51...
44
still:
51
still:
45
 
52
 
Line 46... Line 53...
46
    mov  eax,10                 ; wait here for event
53
    mov  eax,10                 ; wait here for event
47
    int  0x40
54
    mcall
48
 
55
 
49
    cmp  eax,1                  ; redraw request ?
56
    cmp  eax,1                  ; redraw request ?
Line 55... Line 62...
55
 
62
 
Line 56... Line 63...
56
    jmp  still
63
    jmp  still
57
 
64
 
58
  key:                          ; key
65
  key:                          ; key
59
    mov  eax,2                  ; just read it and ignore
66
    mov  eax,2                  ; just read it and ignore
Line 60... Line 67...
60
    int  0x40
67
    mcall
61
    jmp  still
68
    jmp  still
62
 
69
 
Line 63... Line 70...
63
  button:                       ; button
70
  button:                       ; button
64
    mov  eax,17                 ; get id
71
    mov  eax,17                 ; get id
65
    int  0x40
72
    mcall
66
 
73
 
Line 67... Line 74...
67
    cmp  ah,1                   ; button id=1 ?
74
    cmp  ah,1                   ; button id=1 ?
68
    jnz  still
75
    jnz  still
69
    or   eax,-1                 ; close this program
76
    or   eax,-1                 ; close this program
Line 77... Line 84...
77
 
84
 
Line 78... Line 85...
78
draw_window:
85
draw_window:
79
 
86
 
80
    mov  eax,12                    ; function 12:tell os about windowdraw
-
 
81
    mov  ebx,1                     ; 1, start of draw
-
 
82
    int  0x40
-
 
83
 
-
 
84
    mov  eax,48
87
    mov  eax,12                    ; function 12:tell os about windowdraw
85
    mov  ebx,3
-
 
86
    mov  ecx,sc
-
 
Line 87... Line 88...
87
    mov  edx,sizeof.system_colors
88
    mov  ebx,1                     ; 1, start of draw
88
    int  0x40
89
    mcall
89
 
90
 
90
                                   ; DRAW WINDOW
91
                                   ; DRAW WINDOW
91
    mov  eax,0                     ; function 0 : define and draw window
92
    mov  eax,0                     ; function 0 : define and draw window
92
    mov  ebx,100*65536+200         ; [x start] *65536 + [x size]
93
    mov  ebx,100*65536+200         ; [x start] *65536 + [x size]
93
    mov  ecx,100*65536+65          ; [y start] *65536 + [y size]
94
    mov  ecx,100*65536+65          ; [y start] *65536 + [y size]
94
    mov  edx,[sc.work]             ; color of work area RRGGBB,8->color glide
95
    mov  edx,[sc.work]             ; color of work area RRGGBB,8->color glide
Line 95... Line 96...
95
    or   edx,0x33000000            ; color of grab bar  RRGGBB,8->color
96
    or   edx,0x33000000            ; color of grab bar  RRGGBB,8->color
96
    mov  edi,header                ; WINDOW LABEL
97
    mov  edi,title                ; WINDOW LABEL
97
    int  0x40
98
    mcall
98
 
99
 
99
 
100
 
100
    mov  ebx,20*65536+14           ; draw info text with function 4
101
    mov  ebx,20*65536+14           ; draw info text with function 4
Line 101... Line 102...
101
    mov  ecx,[sc.work_text]
102
    mov  ecx,[sc.work_text]
102
    mov  edx,text
103
    mov  edx,text
103
    mov  esi,24
104
    mov  esi,24
Line 104... Line 105...
104
    mov  eax,4
105
    mov  eax,4
Line 105... Line 106...
105
    int  0x40
106
    mcall
Line 106... Line 107...
106
    
107
    
107
    mov  eax,12                    ; function 12:tell os about windowdraw
108
    mov  eax,12                    ; function 12:tell os about windowdraw
Line 108... Line 109...
108
    mov  ebx,2                     ; 2, end of draw
109
    mov  ebx,2                     ; 2, end of draw
Line 109... Line 110...
109
    int  0x40
110
    mcall
Line 110... Line 111...
110
 
111