Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 485
Line 14... Line 14...
14
  dd     0x1000        ; memory for app
14
  dd     0x1000        ; memory for app
15
  dd     0x1000        ; esp
15
  dd     0x1000        ; esp
16
  dd     0x0 , 0x0     ; I_Param , I_Icon
16
  dd     0x0 , 0x0     ; I_Param , I_Icon
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 -... Line 20...
-
 
20
 
20
 
21
START:                             ; start of execution
21
START:                             ; start of execution
22
 
Line 22... Line 23...
22
 
23
  red: 
Line 23... Line 24...
23
    call draw_window               ; draw window
24
    call draw_window               ; draw window
24
    call clear_data                ; clear status bar
25
    call clear_data                ; clear status bar
Line 25... Line 26...
25
 
26
 
26
still:
27
still:
27
 
28
 
28
    mov  eax,10                    ; wait here for event
-
 
29
    int  0x40                      ; do it
-
 
30
 
29
    mov  eax,10                    ; wait here for event
31
    cmp  eax,1                     ; redraw request ?
-
 
32
    je   red                       ; yes jump to it
-
 
33
    cmp  eax,2                     ; key in buffer ?
-
 
34
    je   key                       ; yes jump to it
-
 
35
    cmp  eax,3                     ; button in buffer ?
-
 
36
    je   button                    ; yes jump to it
-
 
Line 37... Line 30...
37
    jmp  still                     ; start again
30
    mcall                      ; do it
38
 
31
 
39
  red:                             ; redraw
32
    cmp  eax,1                     ; redraw request ?
40
    call draw_window               ; redraw window
33
    jz   red                       ; yes jump to it
Line 41... Line 34...
41
    call clear_data                ; clear status info
34
    cmp  eax,2                     ; key in buffer ?
42
    jmp  still                     ; start again
35
    jnz   button
43
 
36
 
Line 44... Line 37...
44
  key:                             ; key
37
  key:                             ; key
45
    mov  eax,2                     ; just read it and ignore
38
    mov  eax,2                     ; just read it and ignore
46
    int  0x40                      ; do it
39
    mcall                      ; do it
47
    jmp  still                     ; start again
40
    jmp  still                     ; start again
48
 
41
 
Line 49... Line 42...
49
  button:                          ; button
42
  button:                          ; button
50
    mov  eax,17                    ; get id
43
    mov  eax,17                    ; get id
51
    int  0x40                      ; do it
44
    mcall                      ; do it
Line 90... Line 83...
90
 
83
 
Line 91... Line 84...
91
    push eax                       ; save register
84
    push eax                       ; save register
92
 
85
 
93
    mov  eax,12                    ; function 12: tell os about windowdraw
86
    mov  eax,12                    ; function 12: tell os about windowdraw
Line 94... Line 87...
94
    mov  ebx,1                     ; 1, start of draw
87
    mov  ebx,1                     ; 1, start of draw
95
    int  0x40                      ; do it
88
    mcall                      ; do it
96
 
89
 
97
    mov  eax,0                     ; function 0: define and draw window
90
    mov  eax,0                     ; function 0: define and draw window
98
    mov  ebx,50*65536              ; [x start] *65536
91
    mov  ebx,50*65536              ; [x start] *65536
99
    add  ebx,[x_size]              ; add [x size]
92
    add  ebx,[x_size]              ; add [x size]
100
    mov  ecx,50*65536              ; [y start] *65536
93
    mov  ecx,50*65536              ; [y start] *65536
101
    add  ecx,[y_size]              ; add [y size]
94
    add  ecx,[y_size]              ; add [y size]
Line 102... Line 95...
102
    mov  edx,0x80ffffff            ; colour of work area RRGGBB
95
    mov  edx,0x80ffffff            ; colour of work area RRGGBB
103
    mov  esi,0x806688dd            ; grab bar colour. negative glide
96
    mov  esi,0x806688dd            ; grab bar colour. negative glide
104
    int  0x40                      ; do it
97
    mcall                      ; do it
105
 
98
 
106
    mov  eax,4                     ; function 4: write text to window
99
    mov  eax,4                     ; function 4: write text to window
107
    mov  ebx,6*65536+7             ; [x start] *65536 + [y start]
100
    mov  ebx,6*65536+7             ; [x start] *65536 + [y start]
Line 108... Line 101...
108
    mov  ecx,0x00ffffff            ; text colour
101
    mov  ecx,0x00ffffff            ; text colour
109
    mov  edx,window_text           ; pointer to text beginning
102
    mov  edx,window_text           ; pointer to text beginning
110
    mov  esi,12                    ; text length
103
    mov  esi,12                    ; text length
111
    int  0x40                      ; do it
104
    mcall                      ; do it
112
 
105
 
113
    mov  eax,8                     ; function 8: define and draw button
106
    mov  eax,8                     ; function 8: define and draw button
Line 114... Line 107...
114
    mov  ebx,(381-18)*65536+13     ; [x start] *65536 + [x size]
107
    mov  ebx,(381-18)*65536+13     ; [x start] *65536 + [x size]
115
    mov  ecx,4*65536+13            ; [y start] *65536 + [y size]
108
    mov  ecx,4*65536+13            ; [y start] *65536 + [y size]
116
    mov  edx,1                     ; button id
109
    mov  edx,1                     ; button id
117
    mov  esi,0x6688dd              ; button color RRGGBB
110
    mov  esi,0x6688dd              ; button color RRGGBB
118
    int  0x40                      ; do it
111
    mcall                      ; do it
119
 
112
 
120
    mov  eax,13                    ; function 13: draw bar
113
    mov  eax,13                    ; function 13: draw bar
121
    mov  ebx,1*65536               ; [x start] *65536
114
    mov  ebx,1*65536               ; [x start] *65536
122
    add  ebx,[x_size]              ; add [x size]
115
    add  ebx,[x_size]              ; add [x size]
123
    dec  ebx                       ; x size - 1
116
    dec  ebx                       ; x size - 1
Line 124... Line 117...
124
    mov  ecx,[y_size]              ; [y start] *65536
117
    mov  ecx,[y_size]              ; [y start] *65536
125
    sub  ecx,17                    ; minus height
118
    sub  ecx,17                    ; minus height
126
    shl  ecx,16                    ; *65536
119
    shl  ecx,16                    ; *65536
127
    add  ecx,17                    ; add height
120
    add  ecx,17                    ; add height
128
    mov  edx,0x006688dd            ; bar colour
121
    mov  edx,0x006688dd            ; bar colour
129
    int  0x40                      ; do it
122
    mcall                      ; do it
130
 
123
 
131
    mov  eax,4                     ; function 4 : write text to window
124
    mov  eax,4                     ; function 4 : write text to window
Line 132... Line 125...
132
    mov  ebx,5*65536               ; [x start] *65536
125
    mov  ebx,5*65536               ; [x start] *65536
133
    add  ebx,[y_size]              ; add [y start]
126
    add  ebx,[y_size]              ; add [y start]
134
    sub  ebx,12                    ; move up
127
    sub  ebx,12                    ; move up
Line 135... Line 128...
135
    xor  ecx,ecx                   ; text colour
128
    xor  ecx,ecx                   ; text colour
Line 136... Line 129...
136
    mov  edx,button_no             ; pointer to text beginning
129
    mov  edx,button_no             ; pointer to text beginning
137
    mov  esi,14                    ; text length
130
    mov  esi,14                    ; text length
138
    int  0x40                      ; do it
131
    mcall                      ; do it
Line 139... Line 132...
139
 
132
 
140
    add  ebx,95*65536              ; move xy position
133
    add  ebx,95*65536              ; move xy position
Line 141... Line 134...
141
    mov  edx,menu_text             ; pointer to text beginning
134
    mov  edx,menu_text             ; pointer to text beginning
Line 158... Line 151...
158
    mov  ebx,1*65536               ; [x start] *65536
151
    mov  ebx,1*65536               ; [x start] *65536
159
    add  ebx,[x_size]              ; +[x_size]
152
    add  ebx,[x_size]              ; +[x_size]
160
    dec  ebx                       ; x size - 1
153
    dec  ebx                       ; x size - 1
161
    mov  ecx,21*65536+17           ; [y start] *65536 +[y size]
154
    mov  ecx,21*65536+17           ; [y start] *65536 +[y size]
162
    mov  edx,[menu_colour]         ; menu colour
155
    mov  edx,[menu_colour]         ; menu colour
163
    int  0x40                      ; do it
156
    mcall                      ; do it
Line 164... Line 157...
164
 
157
 
165
    mov  [main_pos],1              ; start position first button
158
    mov  [main_pos],1              ; start position first button
Line 166... Line 159...
166
    xor  edi,edi                   ; data offset = 0
159
    xor  edi,edi                   ; data offset = 0
Line 182... Line 175...
182
    add  bl,75                     ; +[x size]
175
    add  bl,75                     ; +[x size]
183
    mov  ecx,21*65536+16           ; [y start] *65536 +[y size]
176
    mov  ecx,21*65536+16           ; [y start] *65536 +[y size]
184
    xor  edx,edx                   ; clear register
177
    xor  edx,edx                   ; clear register
185
    mov  dl,[MENU_DATA+edi+2]      ; get byte button id number
178
    mov  dl,[MENU_DATA+edi+2]      ; get byte button id number
186
    mov  esi,[menu_colour]         ; button colour
179
    mov  esi,[menu_colour]         ; button colour
187
    int  0x40                      ; do it
180
    mcall                      ; do it
188
    mov  eax,4                     ; function 4: write text to window
181
    mov  eax,4                     ; function 4: write text to window
189
    add  ebx,6*65536-49            ; move xy position
182
    add  ebx,6*65536-49            ; move xy position
190
    xor  ecx,ecx                   ; text colour
183
    xor  ecx,ecx                   ; text colour
191
    mov  edx,MENU_DATA+3           ; point at menu text
184
    mov  edx,MENU_DATA+3           ; point at menu text
192
    add  edx,edi                   ; add our offset
185
    add  edx,edi                   ; add our offset
193
    mov  esi,11                    ; number of characters
186
    mov  esi,11                    ; number of characters
194
    int  0x40                      ; do it
187
    mcall                      ; do it
Line 195... Line 188...
195
 
188
 
196
is_main_bar:
189
is_main_bar:
Line 197... Line 190...
197
    add  [main_pos],76             ; update button position
190
    add  [main_pos],76             ; update button position
Line 215... Line 208...
215
    mov  eax,47                    ; function 47: display number to window
208
    mov  eax,47                    ; function 47: display number to window
216
    mov  edx,70*65536              ; [x start] *65536
209
    mov  edx,70*65536              ; [x start] *65536
217
    add  edx,[y_size]              ; +[y start]
210
    add  edx,[y_size]              ; +[y start]
218
    sub  edx,12                    ; move position
211
    sub  edx,12                    ; move position
219
    xor  esi,esi                   ; text colour
212
    xor  esi,esi                   ; text colour
220
    int  0x40                      ; do it
213
    mcall                      ; do it
221
    pop  eax                       ; restore register
214
    pop  eax                       ; restore register
Line 222... Line 215...
222
 
215
 
223
    cmp  [button_press],1          ; has a sub button been pressed
216
    cmp  [button_press],1          ; has a sub button been pressed
Line 236... Line 229...
236
    add  ebx,[y_size]              ; +[y start]
229
    add  ebx,[y_size]              ; +[y start]
237
    sub  ebx,12                    ; move position
230
    sub  ebx,12                    ; move position
238
    mov  esi,1                     ; 1 character
231
    mov  esi,1                     ; 1 character
239
    mov  eax,4                     ; function 4: write text to window
232
    mov  eax,4                     ; function 4: write text to window
240
    xor  ecx,ecx                   ; text colour
233
    xor  ecx,ecx                   ; text colour
241
    int  0x40                      ; do it
234
    mcall                      ; do it
242
    pop  eax                       ; restore register
235
    pop  eax                       ; restore register
Line 243... Line 236...
243
 
236
 
244
draw_get_out:
237
draw_get_out:
Line 254... Line 247...
254
    mov  ecx,[y_size]              ; [y start]
247
    mov  ecx,[y_size]              ; [y start]
255
    sub  ecx,15                    ; move position
248
    sub  ecx,15                    ; move position
256
    shl  ecx,16                    ; *65536
249
    shl  ecx,16                    ; *65536
257
    add  ecx,13                    ; [y size]
250
    add  ecx,13                    ; [y size]
258
    mov  edx,0x00aaaaaa            ; bar colour
251
    mov  edx,0x00aaaaaa            ; bar colour
259
    int  0x40                      ; do it
252
    mcall                      ; do it
260
    mov  ebx,185*65536+11          ; move position
253
    mov  ebx,185*65536+11          ; move position
261
    int  0x40                      ; do it again
254
    mcall                      ; do it again
Line 262... Line 255...
262
 
255
 
263
    pop  eax                       ; restore register
256
    pop  eax                       ; restore register
Line 264... Line 257...
264
    ret                            ; return
257
    ret                            ; return
Line 307... Line 300...
307
    shl  ebx,16                    ; *65536
300
    shl  ebx,16                    ; *65536
308
    add  ebx,76                    ; [x size]
301
    add  ebx,76                    ; [x size]
309
    mov  ecx,[but_pos]             ; [y start]
302
    mov  ecx,[but_pos]             ; [y start]
310
    shl  ecx,16                    ; *65536
303
    shl  ecx,16                    ; *65536
311
    add  ecx,17                    ; [y size]
304
    add  ecx,17                    ; [y size]
312
    int  0x40                      ; do it
305
    mcall                      ; do it
313
    jmp  is_sub_bar                ; jump button code
306
    jmp  is_sub_bar                ; jump button code
Line 314... Line 307...
314
 
307
 
315
is_sub_button:
308
is_sub_button:
316
    mov  eax,8                     ; function 8: define and draw button
309
    mov  eax,8                     ; function 8: define and draw button
Line 321... Line 314...
321
    add  ebx,75                    ; [x size]
314
    add  ebx,75                    ; [x size]
322
    mov  ecx,[but_pos]             ; [y start]
315
    mov  ecx,[but_pos]             ; [y start]
323
    shl  ecx,16                    ; *65536
316
    shl  ecx,16                    ; *65536
324
    add  ecx,16                    ; [y size]
317
    add  ecx,16                    ; [y size]
325
    mov  esi,[menu_colour]         ; button colour
318
    mov  esi,[menu_colour]         ; button colour
326
    int  0x40                      ; do it
319
    mcall                      ; do it
Line 327... Line 320...
327
 
320
 
328
    mov  ebx,[sub_pos]             ; [x start]
321
    mov  ebx,[sub_pos]             ; [x start]
329
    shl  ebx,16                    ; *65536
322
    shl  ebx,16                    ; *65536
330
    add  ebx,6*65536               ; move position
323
    add  ebx,6*65536               ; move position
Line 333... Line 326...
333
    xor  ecx,ecx                   ; clear register
326
    xor  ecx,ecx                   ; clear register
334
    mov  edx,MENU_DATA+3           ; point to button text
327
    mov  edx,MENU_DATA+3           ; point to button text
335
    add  edx,edi                   ; add offset
328
    add  edx,edi                   ; add offset
336
    mov  esi,11                    ; number of characters
329
    mov  esi,11                    ; number of characters
337
    mov  eax,4                     ; function 4: write text to window
330
    mov  eax,4                     ; function 4: write text to window
338
    int  0x40                      ; do it
331
    mcall                      ; do it
339
is_sub_bar:
332
is_sub_bar:
340
    add  [but_pos],17              ; move y position
333
    add  [but_pos],17              ; move y position
Line 341... Line 334...
341
 
334
 
342
not_sub_menu:
335
not_sub_menu: