Subversion Repositories Kolibri OS

Rev

Rev 682 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
648 andrew_pro 1
 
2
pb_redraw_all                     = 10000000b
3
pb_redraw_all_off                 = 01111111b
4
;pb_special_progress_on            = 00000001b
675 andrew_pro 5
;pb_special_progress_off           = 11111110b
6
648 andrew_pro 7
 
8
;****************craete ProgressBar********************
9
;****************************************************
10
;IN
11
;pointer to parend
12
;pointer to ProgressBar's structure
13
;OUT
14
;pointer to initialized control
15
align 4
16
17
 
18
19
 
706 andrew_pro 20
      push ecx
21
      push edx
22
      push esi
23
      push edi
24
      push ebp
25
648 andrew_pro 26
 
706 andrew_pro 27
      mov eax,[esp+24+8]
28
29
 
648 andrew_pro 30
31
 
32
      call craete_control
33
34
 
35
      mov [eax],dword progress_bar
36
37
 
38
      mov esi,[PointerToStructureForProgressBar]
39
      mov edi,eax
40
      add edi,control_header_size
41
      rep movsb
42
43
 
44
45
 
46
      mov ecx,[ebx+10]  ;x
47
      mov edx,[ebx+14]  ;y
48
      mov esi,[ebx+18]  ;size x
49
      mov edi,[ebx+22]  ;size y
50
      add ecx,border_width
51
      add edx,[skin_height]
52
      ;copy information to control
53
      mov [eax+24],ecx
54
      mov [eax+28],edx
55
      mov [eax+32],esi
56
      mov [eax+36],edi
57
58
 
706 andrew_pro 59
      pop edi
60
      pop esi
61
      pop edx
62
      pop ecx
63
      pop ebx
64
65
 
648 andrew_pro 66
67
 
68
;*****************Draw ProgressBar********************
69
;****************************************************
70
;IN
71
;pointer to control of ProgressBar
72
;message
73
;OUT
74
;not returned value
75
align 4
76
77
 
78
79
 
80
      mov eax,[esp+8]
81
82
 
83
      mov esi,[esp+4]
84
      mov [PointerForProgressBar],esi
85
86
 
87
      add esi,control_header_size
88
      mov edi,dword ProgressBar
89
      mov ecx,pb_control_data_size
90
      rep movsb
91
92
 
93
 
94
      ;load coordinats and size from control
95
      mov eax,[PointerForProgressBar]
96
      mov ebx,[eax+24]           ;x
97
      mov ecx,[eax+28]           ;y
98
      mov edx,[eax+32]           ;size x
99
      mov esi,[eax+36]           ;size y
100
      ;set current coordinats and sizes in EeditBox
101
      mov [ProgressBar.x],ebx
102
      mov [ProgressBar.y],ecx
103
      mov [ProgressBar.sizex],edx
104
      mov [ProgressBar.sizey],esi
105
106
 
107
108
 
109
 
110
      jne no_destroy_progress_bar
111
112
 
113
      no_destroy_progress_bar:
114
115
 
116
      jne no_redraw_all_progress_bar
117
118
 
119
120
 
121
122
 
123
      jne no_special_message_progress_bar
124
125
 
675 andrew_pro 126
         mov al,[ProgressBar.type]
127
         and al,activate_trap
128
         test al,al
129
         jz no_draw_progress_bar
130
648 andrew_pro 131
 
675 andrew_pro 132
133
 
682 andrew_pro 134
           jae nofull_redraw
135
                call draw_all_progress_bar
136
           nofull_redraw:
137
138
 
675 andrew_pro 139
140
 
141
         jmp exit_progress_bar
142
143
 
648 andrew_pro 144
145
 
146
      mov al,[ProgressBar.type]
147
      and al,pb_redraw_all
148
      test al,al
149
      jz no_draw_all_progress_bar
150
151
 
152
153
 
154
155
 
156
157
 
158
159
 
160
 
161
162
 
682 andrew_pro 163
      add edi,control_header_size
164
      mov esi,dword ProgressBar
165
      mov ecx,pb_control_data_size
166
      rep movsb
167
168
 
648 andrew_pro 169
170
 
171
172
 
173
         mov ebx,dword 0xffffff
174
         mov ecx,20
175
         mov edx,dword colors_table1
176
         call gradient
177
178
 
179
         mov ebx,[ProgressBar.x]
180
         mov ecx,[ProgressBar.y]
181
         mov edx,[ProgressBar.color1]
182
         shl ebx,16
183
         shl ecx,16
184
         add ebx,[ProgressBar.sizex]
185
         add ecx,[ProgressBar.sizey]
186
         mcall
187
188
 
189
         mov ebx,[ProgressBar.y]
190
         add eax,[ProgressBar.sizex]
191
         add ebx,[ProgressBar.sizey]
192
         mov [v],eax    ;v=x+sizex
193
         mov [v2],ebx   ;v2=y+sizey
194
195
 
196
         mov eax,[ProgressBar.color3]
197
         and eax,0xffffff
198
         mov [Line.color],eax
199
         mov [Pixel.color],eax
200
201
 
202
         mov eax,[ProgressBar.x]
203
         mov ebx,[ProgressBar.y]
204
         mov ecx,[v]
205
         add eax,1
206
         sub ecx,1
207
         mov [Line.x1],eax
208
         mov [Line.x2],ecx
209
         mov [Line.y1],ebx
210
         mov [Line.y2],ebx
211
         call DrawLine
212
213
 
214
         mov eax,[v]
215
         mov ebx,[v2]
216
         mov ecx,[ProgressBar.y]
217
         add ecx,1
218
         sub ebx,1
219
         mov [Line.x1],eax
220
         mov [Line.x2],eax
221
         mov [Line.y1],ecx
222
         mov [Line.y2],ebx
223
         call DrawLine
224
225
 
226
         mov eax,[ProgressBar.x]
227
         mov ebx,[v]
228
         mov ecx,[v2]
229
         add eax,1
230
         sub ebx,1
231
         mov [Line.x1],eax
232
         mov [Line.x2],ebx
233
         mov [Line.y1],ecx
234
         mov [Line.y2],ecx
235
         call DrawLine
236
237
 
238
         mov eax,[ProgressBar.x]
239
         mov ebx,[ProgressBar.y]
240
         mov ecx,[v2]
241
         add ebx,1
242
         sub ecx,1
243
         mov [Line.x1],eax
244
         mov [Line.x2],eax
245
         mov [Line.y1],ebx
246
         mov [Line.y2],ecx
247
         call DrawLine
248
249
 
250
         mov eax,[ProgressBar.x]
251
         mov ebx,[ProgressBar.y]
252
         mov ecx,ebx
253
         add eax,1
254
         add ebx,1
255
         add ecx,2
256
         mov [Line.x1],eax
257
         mov [Line.x2],eax
258
         mov [Line.y1],ebx
259
         mov [Line.y2],ecx
260
         call DrawLine
261
262
 
263
         mov eax,[ProgressBar.x]
264
         mov ebx,[ProgressBar.y]
265
         add eax,2
266
         add ebx,1
267
         mov [Pixel.x],eax
268
         mov [Pixel.y],ebx
269
         call DrawPixel
270
271
 
272
         mov eax,[ProgressBar.x]
273
         mov ebx,[v2]
274
         mov ecx,ebx
275
         add eax,1
276
         sub ebx,1
277
         sub ecx,2
278
         mov [Line.x1],eax
279
         mov [Line.x2],eax
280
         mov [Line.y1],ebx
281
         mov [Line.y2],ecx
282
         call DrawLine
283
284
 
285
         mov eax,[ProgressBar.x]
286
         mov ebx,[v2]
287
         add eax,2
288
         sub ebx,1
289
         mov [Pixel.x],eax
290
         mov [Pixel.y],ebx
291
         call DrawPixel
292
293
 
294
         mov eax,[v]
295
         mov ebx,[ProgressBar.y]
296
         mov ecx,ebx
297
         sub eax,1
298
         add ebx,1
299
         add ecx,2
300
         mov [Line.x1],eax
301
         mov [Line.x2],eax
302
         mov [Line.y1],ebx
303
         mov [Line.y2],ecx
304
         call DrawLine
305
306
 
307
         mov eax,[v]
308
         mov ebx,[ProgressBar.y]
309
         sub eax,2
310
         add ebx,1
311
         mov [Pixel.x],eax
312
         mov [Pixel.y],ebx
313
         call DrawPixel
314
315
 
316
         mov eax,[v]
317
         mov ebx,[v2]
318
         mov ecx,ebx
319
         sub eax,1
320
         sub ebx,2
321
         sub ecx,1
322
         mov [Line.x1],eax
323
         mov [Line.x2],eax
324
         mov [Line.y1],ebx
325
         mov [Line.y2],ecx
326
         call DrawLine
327
328
 
329
         mov eax,[v]
330
         mov ebx,[v2]
331
         sub eax,2
332
         sub ebx,1
333
         mov [Pixel.x],eax
334
         mov [Pixel.y],ebx
335
         call DrawPixel
336
337
 
338
         and eax,0xffffff
339
         mov [Line.color],eax
340
         mov [Pixel.color],eax
341
342
 
343
         mov eax,[ProgressBar.x]
344
         mov ebx,[v]
345
         mov ecx,[ProgressBar.y]
346
         add ecx,1
347
         add eax,3
348
         sub ebx,3
349
         mov [Line.x1],eax
350
         mov [Line.x2],ebx
351
         mov [Line.y1],ecx
352
         mov [Line.y2],ecx
353
         call DrawLine
354
355
 
356
         mov eax,[ProgressBar.x]
357
         mov ebx,[ProgressBar.y]
358
         add eax,2
359
         add ebx,2
360
         mov [Pixel.x],eax
361
         mov [Pixel.y],ebx
362
         call DrawPixel
363
364
 
365
         mov eax,[v]
366
         mov ebx,[v2]
367
         mov ecx,[ProgressBar.y]
368
         sub eax,1
369
         sub ebx,3
370
         add ecx,3
371
         mov [Line.x1],eax
372
         mov [Line.x2],eax
373
         mov [Line.y1],ecx
374
         mov [Line.y2],ebx
375
         call DrawLine
376
377
 
378
         mov eax,[v]
379
         mov ebx,[ProgressBar.y]
380
         sub eax,2
381
         add ebx,2
382
         mov [Pixel.x],eax
383
         mov [Pixel.y],ebx
384
         call DrawPixel
385
386
 
387
         mov eax,[ProgressBar.x]
388
         mov ebx,[v]
389
         mov ecx,[v2]
390
         sub ebx,3
391
         sub ecx,1
392
         add eax,3
393
         mov [Line.x1],eax
394
         mov [Line.x2],ebx
395
         mov [Line.y1],ecx
396
         mov [Line.y2],ecx
397
         call DrawLine
398
399
 
400
         mov eax,[v]
401
         mov ebx,[v2]
402
         sub eax,2
403
         sub ebx,2
404
         mov [Pixel.x],eax
405
         mov [Pixel.y],ebx
406
         call DrawPixel
407
408
 
409
         mov eax,[ProgressBar.x]
410
         mov ebx,[ProgressBar.y]
411
         mov ecx,[v2]
412
         add eax,1
413
         add ebx,3
414
         sub ecx,3
415
         mov [Line.x1],eax
416
         mov [Line.x2],eax
417
         mov [Line.y1],ebx
418
         mov [Line.y2],ecx
419
         call DrawLine
420
421
 
422
         mov eax,[ProgressBar.x]
423
         mov ebx,[v2]
424
         add eax,2
425
         sub ebx,2
426
         mov [Pixel.x],eax
427
         mov [Pixel.y],ebx
428
         call DrawPixel
429
430
 
431
432
 
433
434
 
435
         jae min_size_ok
436
437
 
438
         min_size_ok:
439
440
 
441
         jle max_size_ok
442
443
 
444
         max_size_ok:
445
446
 
447
         sub eax,6
448
         mov [v2],eax
449
450
 
451
         fild [v2]
452
         fmul st0,st1
453
         fistp [v3]
454
         fstp st0
455
456
 
457
         mov ebx,0xffffff
458
         mov ecx,[ProgressBar.x]
459
         mov edx,[ProgressBar.y]
460
         mov esi,[v3]
461
         mov edi,[ProgressBar.sizey]
462
         sub edi,4
463
         shr edi,1
464
         add ecx,3
465
         add edx,1
466
467
 
468
469
 
470
         mov ebx,0xffffff
471
         mov ecx,[ProgressBar.x]
472
         mov edx,[ProgressBar.y]
473
         mov esi,[v3]
474
         mov edi,[ProgressBar.sizey]
475
         sub edi,4
476
         shr edi,1
477
         add ecx,3
478
         add edx,2
479
         add edx,edi
480
481
 
482
483
 
484