Subversion Repositories Kolibri OS

Rev

Rev 648 | 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
bt_check_text_type                 = 00000001b
675 andrew_pro 3
bt_check_picture_type              = 00000010b
4
bt_check_picture_text_type         = 00000100b
5
bt_no_draw                         = 00001000b
6
bt_check_3D_type                   = 00010000b
7
bt_check_full_redraw               = 10000000b
648 andrew_pro 8
bt_full_redraw_off                 = 01111111b
675 andrew_pro 9
648 andrew_pro 10
 
11
bt_crossing                        = 00000001b
675 andrew_pro 12
bt_crossing_pressing               = 00000011b
13
bt_crossing_pressing_off           = 11111100b
648 andrew_pro 14
15
 
16
17
 
18
;******************craete Button**********************
19
;****************************************************
20
;IN
21
;pointer to parend
22
;pointer to Buttton's structure
23
;OUT
24
;pointer to initialized Button's structure
25
align 4
26
27
 
28
29
 
30
      mov eax,[esp+8] ;control
31
32
 
33
34
 
35
      call craete_control
36
37
 
38
      mov ecx,dword button
39
      mov [eax],dword button
40
41
 
42
      mov esi,[PointerToStructureForButton]
43
      mov edi,eax
44
      add edi,control_header_size
45
      rep movsb
46
47
 
48
      xor ecx,ecx
49
      xor edx,edx
50
      xor esi,esi
51
      xor edi,edi
52
      mov cx,[ebx+2]   ;button x
53
      mov dx,[ebx+4]   ;button y
54
      mov si,[ebx+6]   ;button size x
55
      mov di,[ebx+8]   ;button size y
56
57
 
58
      add ecx,border_width
59
      add edx,[skin_height]
60
      ;copy information to control
61
      mov [eax+24],ecx
62
      mov [eax+28],edx
63
      mov [eax+32],esi
64
      mov [eax+36],edi
65
66
 
67
68
 
69
;*******************Draw Button**********************
70
;****************************************************
71
;IN
72
;pointer to control of button
73
;message
74
;OUT
75
;not returned value
76
align 4
77
78
 
79
80
 
81
      mov eax,[esp+8]
82
83
 
84
      mov esi,[esp+4]
85
      mov [PointerForButton],esi
86
      ;copy control to local control
87
      mov edi,dword Button
88
      mov ecx,control_header_size+bt_control_data_size
89
      cld
90
      rep movsb
91
92
 
93
 
94
      jne no_redraw_all_button
95
96
 
97
      no_redraw_all_button:
98
99
 
100
      jne no_keys_button
101
102
 
103
      no_keys_button:
104
105
 
106
      jne no_pressed_button_button
107
108
 
109
      no_pressed_button_button:
110
111
 
112
      jne no_mouse_button
113
114
 
115
      mov edi,[eax+8]
116
      mov ecx,[eax+12]
117
      mov [Button.mouseX],si
118
      mov [Button.mouseY],di
119
      mov [ButtonsOfMouse],ecx
120
121
 
122
123
 
124
 
125
      jne no_delete_button
126
127
 
128
      no_delete_button:
129
130
 
131
      mov eax,[PointerForButton]
132
      mov ebx,[eax+24]           ;x
133
      mov ecx,[eax+28]           ;y
134
      mov edx,[eax+32]           ;size x
135
      mov esi,[eax+36]           ;size y
136
      ;set current coordinats and sizes in zakladka
137
      mov [Button.x],bx
138
      mov [Button.y],cx
139
      mov [Button.width],dx
140
      mov [Button.height],si
141
142
 
143
 
144
145
 
146
      mov al,[Button.type]
147
      and al,bt_check_full_redraw
148
      test al,al
149
      jz  no_redraw_button
150
151
 
152
153
 
154
      mov edi,[PointerForButton]
155
      add esi,control_header_size
156
      add edi,control_header_size
157
      mov ecx,2
158
      cld
159
      rep movsb
160
161
 
162
      mov al,[Button.type]
163
      and al,bt_no_draw
164
      test al,al
165
      jnz  no_draw_button
166
167
 
168
      mov eax,[Button.color1]
169
      mov ebx,0xffffff
170
      mov ecx,20
171
      mov edx,dword colors_table1
172
      call gradient
173
174
 
175
      mov ebx,[Button.color1]
176
      mov ecx,20
177
      mov edx,dword colors_table2
178
      call gradient
179
180
 
181
      mov al,[Button.type]
182
183
 
184
      test al,al
185
      jz no_3d_button
186
187
 
188
      mov eax,[Button.color1]
189
      mov ebx,[Button.color2]
190
      and eax,0xffffff
191
      and ebx,0xffffff
192
      xor ecx,ecx
193
      xor edx,edx
194
      xor esi,esi
195
      xor edi,edi
196
      mov cx,[Button.x]
197
      mov dx,[Button.y]
198
      mov si,[Button.width]
199
      mov di,[Button.height]
200
      add cx,1
201
      add dx,2
202
      sub si,1
203
      sub di,3
204
      call rectangle_gradient_up
205
206
 
207
      mov [Line.color],eax
208
209
 
210
      xor eax,eax
211
      xor ebx,ebx
212
      xor ecx,ecx
213
      mov ax,[Button.x]
214
      mov bx,[Button.y]
215
      mov cx,[Button.height]
216
      mov [Line.x1],eax
217
      mov [Line.x2],eax
218
      mov [Line.y1],ebx
219
      mov [Line.y2],ebx
220
      add [Line.y1],3
221
      add [Line.y2],ecx
222
      call DrawLine
223
224
 
225
      xor eax,eax
226
      xor ebx,ebx
227
      xor ecx,ecx
228
      xor esi,esi
229
      mov ax,[Button.x]
230
      mov bx,[Button.y]
231
      mov cx,[Button.height]
232
      mov si,[Button.width]
233
      add eax,esi
234
      mov [Line.x1],eax
235
      mov [Line.x2],eax
236
      mov [Line.y1],ebx
237
      mov [Line.y2],ebx
238
      add [Line.y1],3
239
      add [Line.y2],ecx
240
      call DrawLine
241
242
 
243
      xor eax,eax
244
      xor ebx,ebx
245
      xor ecx,ecx
246
      xor esi,esi
247
      mov ax,[Button.x]
248
      mov bx,[Button.y]
249
      mov cx,[Button.height]
250
      mov si,[Button.width]
251
      add ebx,ecx
252
      mov [Line.x1],eax
253
      mov [Line.x2],eax
254
      mov [Line.y1],ebx
255
      mov [Line.y2],ebx
256
      add [Line.x1],1
257
      sub esi,1
258
      add [Line.x2],esi
259
      call DrawLine
260
261
 
262
      xor ecx,ecx
263
      xor esi,esi
264
      mov si,[Button.height]
265
      mov di,[Button.width]
266
      mov eax,13
267
      mov bx,[Button.x]
268
      mov cx,[Button.y]
269
      mov edx,0xffffff
270
      add ebx,2
271
      add ecx,1
272
      shl ebx,16
273
      shl ecx,16
274
      sub edi,3
275
      add ebx,edi
276
      add ecx,2
277
      mcall
278
279
 
280
      xor eax,eax
281
      xor ebx,ebx
282
      xor ecx,ecx
283
      xor edx,edx
284
      mov ax,[Button.x]
285
      mov bx,[Button.y]
286
      mov cx,[Button.height]
287
288
 
289
      mov dx,[Button.height]
290
      sub edx,3+2
291
      mov esi,[pointer+edx*3]
292
      and esi,0xffffff
293
      add eax,1
294
      mov [Line.x1],eax
295
      mov [Line.x2],eax
296
      mov [Line.y1],ebx
297
      mov [Line.y2],ebx
298
      mov [Line.color],esi; dword 0xffffff
299
      add [Line.y1],2
300
      sub ecx,3
301
      add [Line.y2],ecx
302
      call DrawLine
303
304
 
305
      xor eax,eax
306
      xor ebx,ebx
307
      xor ecx,ecx
308
      xor edx,edx
309
      mov ax,[Button.x]
310
      mov bx,[Button.y]
311
      mov cx,[Button.height]
312
313
 
314
      sub eax,1
315
      mov [Line.x1],eax
316
      mov [Line.x2],eax
317
      mov [Line.y1],ebx
318
      mov [Line.y2],ebx
319
      add [Line.y1],2
320
      sub ecx,3
321
      add [Line.y2],ecx
322
      call DrawLine
323
324
 
325
      and eax,0xffffff
326
      mov [Button.color2],eax
327
      mov [Line.color],eax
328
329
 
330
      xor eax,eax
331
      xor ebx,ebx
332
      xor ecx,ecx
333
      xor esi,esi
334
      mov ax,[Button.x]
335
      mov bx,[Button.y]
336
      mov cx,[Button.height]
337
      mov si,[Button.width]
338
      mov [Line.x1],eax
339
      mov [Line.x2],eax
340
      mov [Line.y1],ebx
341
      mov [Line.y2],ebx
342
      add [Line.y2],2
343
      call DrawLine
344
345
 
346
      xor eax,eax
347
      xor ebx,ebx
348
      xor ecx,ecx
349
      xor esi,esi
350
      mov ax,[Button.x]
351
      mov bx,[Button.y]
352
      mov cx,[Button.height]
353
      mov si,[Button.width]
354
      add eax,esi
355
      mov [Line.x1],eax
356
      mov [Line.x2],eax
357
      mov [Line.y1],ebx
358
      mov [Line.y2],ebx
359
      add [Line.y2],2
360
      call DrawLine
361
362
 
363
      xor eax,eax
364
      xor ebx,ebx
365
      xor ecx,ecx
366
      xor esi,esi
367
      mov ax,[Button.x]
368
      mov bx,[Button.y]
369
      mov cx,[Button.height]
370
      mov si,[Button.width]
371
      add eax,1
372
      mov [Line.x1],eax
373
      mov [Line.x2],eax
374
      mov [Line.y1],ebx
375
      mov [Line.y2],ebx
376
      add [Line.y2],1
377
      call DrawLine
378
379
 
380
      xor eax,eax
381
      xor ebx,ebx
382
      xor ecx,ecx
383
      xor esi,esi
384
      mov ax,[Button.x]
385
      mov bx,[Button.y]
386
      mov cx,[Button.height]
387
      mov si,[Button.width]
388
      add eax,esi
389
      sub eax,1
390
      mov [Line.x1],eax
391
      mov [Line.x2],eax
392
      mov [Line.y1],ebx
393
      mov [Line.y2],ebx
394
      add [Line.y2],1
395
      call DrawLine
396
397
 
398
      xor eax,eax
399
      xor ebx,ebx
400
      xor ecx,ecx
401
      xor esi,esi
402
      mov ax,[Button.x]
403
      mov bx,[Button.y]
404
      mov cx,[Button.height]
405
      mov si,[Button.width]
406
      mov [Line.x1],eax
407
      mov [Line.x2],eax
408
      mov [Line.y1],ebx
409
      mov [Line.y2],ebx
410
      add [Line.x1],2
411
      sub esi,2
412
      add [Line.x2],esi
413
      call DrawLine
414
415
 
416
      mov ebx,[pointer+3*9]
417
      and eax,0xffffff
418
      and ebx,0xffffff
419
      call calculate_average_color
420
421
 
422
423
 
424
      xor eax,eax
425
      xor ebx,ebx
426
      mov ax,[Button.x]
427
      mov bx,[Button.y]
428
      mov [Pixel.x],eax
429
      mov [Pixel.y],ebx
430
      call DrawPixel
431
432
 
433
      xor eax,eax
434
      xor ebx,ebx
435
      xor ecx,ecx
436
      mov ax,[Button.x]
437
      mov bx,[Button.y]
438
      mov cx,[Button.width]
439
      add eax,ecx
440
      mov [Pixel.x],eax
441
      mov [Pixel.y],ebx
442
      call DrawPixel
443
444
 
445
      xor eax,eax
446
      xor ebx,ebx
447
      mov ax,[Button.x]
448
      mov bx,[Button.y]
449
      add eax,1
450
      add ebx,1
451
      mov [Pixel.x],eax
452
      mov [Pixel.y],ebx
453
      call DrawPixel
454
455
 
456
      xor eax,eax
457
      xor ebx,ebx
458
      xor ecx,ecx
459
      mov ax,[Button.x]
460
      mov bx,[Button.y]
461
      mov cx,[Button.width]
462
      add eax,ecx
463
      sub eax,1
464
      add ebx,1
465
      mov [Pixel.x],eax
466
      mov [Pixel.y],ebx
467
      call DrawPixel
468
469
 
470
      xor eax,eax
471
      xor ebx,ebx
472
      mov ax,[Button.x]
473
      mov bx,[Button.y]
474
      add bx,[Button.height]
475
      mov [Pixel.x],eax
476
      mov [Pixel.y],ebx
477
      call DrawPixel
478
479
 
480
      xor eax,eax
481
      xor ebx,ebx
482
      xor ecx,ecx
483
      mov ax,[Button.x]
484
      mov bx,[Button.y]
485
      mov cx,[Button.width]
486
      add eax,ecx
487
      add bx,[Button.height]
488
      mov [Pixel.x],eax
489
      mov [Pixel.y],ebx
490
      call DrawPixel
491
492
 
493
      xor eax,eax
494
      xor ebx,ebx
495
      mov ax,[Button.x]
496
      mov bx,[Button.y]
497
      add eax,1
498
      add bx,[Button.height]
499
      sub ebx,2
500
      mov [Pixel.x],eax
501
      mov [Pixel.y],ebx
502
      call DrawPixel
503
504
 
505
      xor eax,eax
506
      xor ebx,ebx
507
      xor ecx,ecx
508
      mov ax,[Button.x]
509
      mov bx,[Button.y]
510
      mov cx,[Button.width]
511
      add eax,ecx
512
      sub eax,1
513
      add bx,[Button.height]
514
      sub ebx,2
515
      mov [Pixel.x],eax
516
      mov [Pixel.y],ebx
517
      call DrawPixel
518
519
 
520
521
 
522
      ;*********2D button**********
523
      ;****************************
524
      xor eax,eax
525
      mov al,[Button.type]
526
      and al,bt_check_3D_type
527
      test al,al
528
      jnz no_2D_button
529
530
 
531
      and edx,0xffffff
532
533
 
534
      xor ecx,ecx
535
      xor esi,esi
536
      xor edi,edi
537
      mov si,[Button.width]
538
      mov di,[Button.height]
539
      mov eax,13
540
      mov bx,[Button.x]
541
      mov cx,[Button.y]
542
      add ebx,1
543
      add ecx,1
544
      sub si,1
545
      sub di,1
546
      shl ebx,16
547
      shl ecx,16
548
      add ebx,esi
549
      add ecx,edi
550
      mcall
551
552
 
553
      and eax,0xffffff
554
      mov [Line.color],eax
555
556
 
557
      xor ebx,ebx
558
      xor ecx,ecx
559
      mov ax,[Button.x]
560
      mov bx,[Button.y]
561
      mov cx,[Button.height]
562
      mov [Line.x1],eax
563
      mov [Line.x2],eax
564
      mov [Line.y1],ebx
565
      mov [Line.y2],ebx
566
      add [Line.y2],ecx
567
      call DrawLine
568
569
 
570
      xor ebx,ebx
571
      xor esi,esi
572
      mov ax,[Button.x]
573
      mov bx,[Button.y]
574
      mov si,[Button.width]
575
      mov [Line.x1],eax
576
      mov [Line.x2],eax
577
      mov [Line.y1],ebx
578
      mov [Line.y2],ebx
579
      add [Line.x2],esi
580
      call DrawLine
581
582
 
583
      and eax,0xffffff
584
      mov [Line.color],eax
585
586
 
587
      xor ebx,ebx
588
      xor ecx,ecx
589
      xor esi,esi
590
      mov ax,[Button.x]
591
      mov bx,[Button.y]
592
      mov cx,[Button.height]
593
      mov si,[Button.width]
594
      add eax,esi
595
      mov [Line.x1],eax
596
      mov [Line.x2],eax
597
      mov [Line.y1],ebx
598
      mov [Line.y2],ebx
599
      add [Line.y2],ecx
600
      call DrawLine
601
602
 
603
      xor ebx,ebx
604
      xor ecx,ecx
605
      xor esi,esi
606
      mov ax,[Button.x]
607
      mov bx,[Button.y]
608
      mov cx,[Button.height]
609
      mov si,[Button.width]
610
      add ebx,ecx
611
      mov [Line.x1],eax
612
      mov [Line.x2],eax
613
      mov [Line.y1],ebx
614
      mov [Line.y2],ebx
615
      add [Line.x2],esi
616
      call DrawLine
617
618
 
619
620
 
621
622
 
623
      xor eax,eax
624
      mov al,[Button.type]
625
626
 
627
      test al,al
628
      jz no_button_only_with_text
629
630
 
631
       jmp end_case_button
632
      no_button_only_with_text:
633
634
 
635
      xor eax,eax
636
      mov al,[Button.type]
637
      and al,bt_check_picture_type
638
      test al,al
639
      jz no_button_only_with_picture
640
641
 
642
        jmp end_case_button
643
      no_button_only_with_picture:
644
645
 
646
 
647
      mov al,[Button.type]
648
      and al,bt_check_picture_text_type
649
      test al,al
650
      jz no_button_with_text_and_picture
651
652
 
653
      xor eax,eax
654
      xor ebx,ebx
655
      mov ax,[Button.textX]
656
      mov bx,[Button.textY]
657
      add ax,[Button.x]
658
      add bx,[Button.y]
659
      mov [Font.x],eax
660
      mov [Font.y],ebx
661
      call DrawString
662
663
 
664
      xor eax,eax
665
      xor ebx,ebx
666
      mov ax,[Button.imageX]
667
      mov bx,[Button.imageY]
668
      add ax,[Button.x]
669
      add bx,[Button.y]
670
      mov [xo],eax
671
      mov [x],eax
672
      mov [y],ebx
673
674
 
675
      xor edi,edi
676
      mov si,[Button.imageSizeX]
677
      mov di,[Button.imageSizeY]
678
      mov ebp,[Button.image]
679
680
 
681
      inc eax
682
683
 
684
685
 
686
          mov [x],ebx
687
688
 
689
          mov si,[Button.imageSizeX]
690
691
 
692
693
 
694
             and edx,0xffffff
695
             cmp edx,[Button.transparentColor]
696
             je no_draw_pixel_
697
698
 
699
               mov ecx,[y]
700
               mcall
701
             no_draw_pixel_:
702
703
 
704
             add [x],1
705
          dec esi
706
          jnz  loop_x_image_
707
708
 
709
        dec edi
710
        jnz loop_y_image_
711
712
 
713
714
 
715
716
 
717
718
 
719
      xor ebx,ebx
720
      xor ecx,ecx
721
      xor edx,edx
722
      xor esi,esi
723
      xor edi,edi
724
      mov ax,[Button.x]
725
      mov bx,[Button.y]
726
      mov cx,[Button.width]
727
      mov dx,[Button.height]
728
      mov si,[Button.mouseX]
729
      mov di,[Button.mouseY]
730
      call CheckCrossingBox
731
732
 
733
      jne no_crossing
734
735
 
736
        mov bl,[Button.type]
737
        and bl,bt_check_3D_type
738
        test bl,bl
739
        jz button_active_2D
740
741
 
742
           mov eax,[ButtonsOfMouse]
743
744
 
745
           je button_pressed_3d_
746
747
 
748
             mov al,[Button.type]
749
             and al,bt_no_draw
750
             test al,al
751
             jnz no_draw_active_button_3d_
752
753
 
754
755
 
756
757
 
758
           jmp exit_button_pressed_3d_
759
760
 
761
762
 
763
           mov al,[Button.type]
764
           and al,bt_no_draw
765
           test al,al
766
           jnz no_draw_pressed_button_3d_
767
768
 
769
770
 
771
772
 
773
774
 
775
776
 
777
778
 
779
         mov esi,dword Button
780
         mov edi,[PointerForButton]
781
         add esi,control_header_size
782
         add edi,control_header_size
783
         mov ecx,2
784
         cld
785
         rep movsb
786
         jmp no_crossing
787
788
 
789
790
 
791
           mov eax,[ButtonsOfMouse]
792
793
 
794
           je button_pressed_2d
795
796
 
797
           mov al,[Button.type]
798
           and al,bt_no_draw
799
           test al,al
800
           jnz no_active_button_2d_
801
802
 
803
804
 
805
806
 
807
           jmp exit_button_pressed_2d
808
           button_pressed_2d:
809
810
 
811
           mov al,[Button.type]
812
           and al,bt_no_draw
813
           test al,al
814
           jnz no_draw_pressed_button_2d_
815
816
 
817
818
 
819
820
 
821
           exit_button_pressed_2d:
822
823
 
824
825
 
826
         mov esi,dword Button
827
         mov edi,[PointerForButton]
828
         add esi,control_header_size
829
         add edi,control_header_size
830
         mov ecx,2
831
         cld
832
         rep movsb
833
      no_crossing:
834
835
 
836
      je yes_crossing
837
      xor ebx,ebx
838
      mov bl,[Button.flag]
839
      and bl,bt_crossing
840
      test bl,bl
841
      jz yes_crossing
842
843
 
844
        mov bl,[Button.type]
845
        and bl,bt_check_3D_type
846
        test bl,bl
847
        jz button_put_2D
848
849
 
850
851
 
852
         mov al,[Button.type]
853
         and al,bt_no_draw
854
         test al,al
855
         jnz no_draw_button_active_3d__
856
857
 
858
         no_draw_button_active_3d__:
859
860
 
861
862
 
863
         mov esi,dword Button
864
         mov edi,[PointerForButton]
865
         add edi,control_header_size
866
         add esi,control_header_size
867
         mov ecx,2
868
         cld
869
         rep movsb
870
         jmp yes_crossing
871
872
 
873
874
 
875
876
 
877
        mov al,[Button.type]
878
        and al,bt_no_draw
879
        test al,al
880
        jnz no_draw_button_active_2d__
881
882
 
883
884
 
885
886
 
887
888
 
889
        mov esi,dword Button
890
        mov edi,[PointerForButton]
891
        add esi,control_header_size
892
        add edi,control_header_size
893
        mov ecx,2
894
        cld
895
        rep movsb
896
      yes_crossing:
897
898
 
899
900
 
901
902
 
903
904
 
905
      mov ebx,[Button.text]
906
      call GetLengthString
907
      imul eax,6  ;[Font.sizeX]
908
      xor ebx,ebx
909
      mov bx,[Button.width]
910
      shr eax,1
911
      shr ebx,1
912
      sub ebx,eax
913
      xor eax,eax
914
      mov ax,[Button.x]
915
      add eax,ebx
916
      mov [Font.x],eax
917
      xor ebx,ebx
918
      mov bx,[Button.height]
919
      shr ebx,1
920
      sub ebx,3;[Font.sizeY]
921
      xor eax,eax
922
      mov ax,[Button.y]
923
      add eax,ebx
924
      mov [Font.y],eax
925
      call DrawString
926
927
 
928
929
 
930
931
 
932
        xor edi,edi
933
        xor eax,eax
934
        xor ebx,ebx
935
        mov ax,[Button.height]
936
        mov bx,[Button.width]
937
        mov di,[Button.imageSizeY]
938
        mov si,[Button.imageSizeX]
939
        shr ax,1
940
        shr bx,1
941
        shr si,1
942
        shr di,1
943
        sub ax,di
944
        sub bx,si
945
        add ax,[Button.y]
946
        add bx,[Button.x]
947
        mov [xo],ebx
948
        mov [x],ebx
949
        mov [y],eax
950
951
 
952
        xor edi,edi
953
        mov si,[Button.imageSizeX]
954
        mov di,[Button.imageSizeY]
955
        mov ebp,[Button.image]
956
957
 
958
        inc eax
959
960
 
961
962
 
963
           mov [x],ebx
964
965
 
966
          mov si,[Button.imageSizeX]
967
968
 
969
970
 
971
             and edx,0xffffff
972
             cmp edx,[Button.transparentColor]
973
             je no_draw_pixel
974
975
 
976
               mov ecx,[y]
977
               mcall
978
             no_draw_pixel:
979
980
 
981
             add [x],1
982
          dec esi
983
          jnz  loop_x_image
984
985
 
986
        dec edi
987
        jnz loop_y_image
988
989
 
990
991
 
992
 
993
994
 
995
      mov [Line.color],0xffffff;eax
996
997
 
998
      xor ebx,ebx
999
      xor ecx,ecx
1000
      mov ax,[Button.x]
1001
      mov bx,[Button.y]
1002
      mov cx,[Button.height]
1003
      mov [Line.x1],eax
1004
      mov [Line.x2],eax
1005
      mov [Line.y1],ebx
1006
      mov [Line.y2],ebx
1007
      add [Line.y1],3
1008
      sub ecx,1
1009
      add [Line.y2],ecx
1010
      call DrawLine
1011
1012
 
1013
      xor ebx,ebx
1014
      xor ecx,ecx
1015
      xor esi,esi
1016
      mov ax,[Button.x]
1017
      mov bx,[Button.y]
1018
      mov cx,[Button.height]
1019
      mov si,[Button.width]
1020
      add eax,esi
1021
      mov [Line.x1],eax
1022
      mov [Line.x2],eax
1023
      mov [Line.y1],ebx
1024
      mov [Line.y2],ebx
1025
      add [Line.y1],3
1026
      sub ecx,1
1027
      add [Line.y2],ecx
1028
      call DrawLine
1029
1030
 
1031
      xor ebx,ebx
1032
      xor ecx,ecx
1033
      xor esi,esi
1034
      mov ax,[Button.x]
1035
      mov bx,[Button.y]
1036
      mov cx,[Button.height]
1037
      add ebx,ecx
1038
      mov [Line.x1],eax
1039
      mov [Line.x2],eax
1040
      mov [Line.y1],ebx
1041
      mov [Line.y2],ebx
1042
      add [Line.x1],1
1043
      xor ecx,ecx
1044
      mov cx,[Button.width]
1045
      sub ecx,1
1046
      add [Line.x2],ecx
1047
      call DrawLine
1048
1049
 
1050
      xor ebx,ebx
1051
      xor ecx,ecx
1052
      xor esi,esi
1053
      mov ax,[Button.x]
1054
      mov bx,[Button.y]
1055
      mov [Line.x1],eax
1056
      mov [Line.x2],eax
1057
      mov [Line.y1],ebx
1058
      mov [Line.y2],ebx
1059
      add [Line.x1],1
1060
      xor ecx,ecx
1061
      mov cx,[Button.width]
1062
      sub ecx,1
1063
      add [Line.x2],ecx
1064
      call DrawLine
1065
1066
 
1067
1068
 
1069
1070
 
1071
      mov ebx,0xffffff
1072
      mov ecx,20
1073
      mov edx,dword pointer
1074
      call gradient
1075
1076
 
1077
      and eax,0xffffff
1078
      mov [Line.color],eax
1079
1080
 
1081
      xor ebx,ebx
1082
      xor ecx,ecx
1083
      mov ax,[Button.x]
1084
      mov bx,[Button.y]
1085
      mov cx,[Button.height]
1086
      mov [Line.x1],eax
1087
      mov [Line.x2],eax
1088
      mov [Line.y1],ebx
1089
      mov [Line.y2],ebx
1090
      add [Line.y1],3
1091
      sub ecx,1
1092
      add [Line.y2],ecx
1093
      call DrawLine
1094
1095
 
1096
      xor ebx,ebx
1097
      xor ecx,ecx
1098
      xor esi,esi
1099
      mov ax,[Button.x]
1100
      mov bx,[Button.y]
1101
      mov cx,[Button.height]
1102
      mov si,[Button.width]
1103
      add eax,esi
1104
      mov [Line.x1],eax
1105
      mov [Line.x2],eax
1106
      mov [Line.y1],ebx
1107
      mov [Line.y2],ebx
1108
      add [Line.y1],3
1109
      sub ecx,1
1110
      add [Line.y2],ecx
1111
      call DrawLine
1112
1113
 
1114
 
1115
      xor ebx,ebx
1116
      xor ecx,ecx
1117
      xor esi,esi
1118
      mov ax,[Button.x]
1119
      mov bx,[Button.y]
1120
      mov cx,[Button.height]
1121
      add ebx,ecx
1122
      mov [Line.x1],eax
1123
      mov [Line.x2],eax
1124
      mov [Line.y1],ebx
1125
      mov [Line.y2],ebx
1126
      add [Line.x1],1
1127
      xor ecx,ecx
1128
      mov cx,[Button.width]
1129
      sub ecx,1
1130
      add [Line.x2],ecx
1131
      call DrawLine
1132
1133
 
1134
      xor ebx,ebx
1135
      xor ecx,ecx
1136
      xor esi,esi
1137
      mov ax,[Button.x]
1138
      mov bx,[Button.y]
1139
      mov [Line.x1],eax
1140
      mov [Line.x2],eax
1141
      mov [Line.y1],ebx
1142
      mov [Line.y2],ebx
1143
      add [Line.x1],1
1144
      xor ecx,ecx
1145
      mov cx,[Button.width]
1146
      sub ecx,1
1147
      add [Line.x2],ecx
1148
      call DrawLine
1149
1150
 
1151
1152
 
1153
1154
 
1155
 
1156
      mov ebx,0xffffff
1157
      mov ecx,20
1158
      mov edx,dword pointer
1159
      call gradient
1160
1161
 
1162
      and edx,0xffffff
1163
      mov [Line.color],edx
1164
1165
 
1166
      xor ebx,ebx
1167
      xor ecx,ecx
1168
      mov ax,[Button.x]
1169
      mov bx,[Button.y]
1170
      mov cx,[Button.height]
1171
      mov [Line.x1],eax
1172
      mov [Line.x2],eax
1173
      mov [Line.y1],ebx
1174
      mov [Line.y2],ebx
1175
      add [Line.y1],3
1176
      sub ecx,1
1177
      add [Line.y2],ecx
1178
      call DrawLine
1179
1180
 
1181
      xor ebx,ebx
1182
      xor ecx,ecx
1183
      xor esi,esi
1184
      mov ax,[Button.x]
1185
      mov bx,[Button.y]
1186
      mov cx,[Button.height]
1187
      mov si,[Button.width]
1188
      add eax,esi
1189
      mov [Line.x1],eax
1190
      mov [Line.x2],eax
1191
      mov [Line.y1],ebx
1192
      mov [Line.y2],ebx
1193
      add [Line.y1],3
1194
      sub ecx,1
1195
      add [Line.y2],ecx
1196
      call DrawLine
1197
1198
 
1199
      xor ebx,ebx
1200
      xor ecx,ecx
1201
      xor esi,esi
1202
      mov ax,[Button.x]
1203
      mov bx,[Button.y]
1204
      mov cx,[Button.height]
1205
      add ebx,ecx
1206
      mov [Line.x1],eax
1207
      mov [Line.x2],eax
1208
      mov [Line.y1],ebx
1209
      mov [Line.y2],ebx
1210
      add [Line.x1],1
1211
      xor ecx,ecx
1212
      mov cx,[Button.width]
1213
      sub ecx,1
1214
      add [Line.x2],ecx
1215
      call DrawLine
1216
1217
 
1218
      xor ebx,ebx
1219
      xor ecx,ecx
1220
      xor esi,esi
1221
      mov ax,[Button.x]
1222
      mov bx,[Button.y]
1223
      mov [Line.x1],eax
1224
      mov [Line.x2],eax
1225
      mov [Line.y1],ebx
1226
      mov [Line.y2],ebx
1227
      add [Line.x1],1
1228
      xor ecx,ecx
1229
      mov cx,[Button.width]
1230
      sub ecx,1
1231
      add [Line.x2],ecx
1232
      call DrawLine
1233
1234
 
1235
1236
 
1237
1238
 
1239
      and edx,0xffffff
1240
      ;mov [Button.color2],edx
1241
1242
 
1243
      xor ebx,ebx
1244
      xor ecx,ecx
1245
      mov ax,[Button.x]
1246
      mov bx,[Button.y]
1247
      mov cx,[Button.height]
1248
      mov [Line.x1],eax
1249
      mov [Line.x2],eax
1250
      mov [Line.y1],ebx
1251
      mov [Line.y2],ebx
1252
      mov [Line.color],edx
1253
      add [Line.y2],ecx
1254
      call DrawLine
1255
1256
 
1257
      xor ebx,ebx
1258
      xor esi,esi
1259
      mov ax,[Button.x]
1260
      mov bx,[Button.y]
1261
      mov si,[Button.width]
1262
      mov [Line.x1],eax
1263
      mov [Line.x2],eax
1264
      mov [Line.y1],ebx
1265
      mov [Line.y2],ebx
1266
      add [Line.x2],esi
1267
      call DrawLine
1268
1269
 
1270
      xor ebx,ebx
1271
      xor ecx,ecx
1272
      xor esi,esi
1273
      mov ax,[Button.x]
1274
      mov bx,[Button.y]
1275
      mov cx,[Button.height]
1276
      mov si,[Button.width]
1277
      add eax,esi
1278
      mov [Line.x1],eax
1279
      mov [Line.x2],eax
1280
      mov [Line.y1],ebx
1281
      mov [Line.y2],ebx
1282
      add [Line.y2],ecx
1283
      call DrawLine
1284
1285
 
1286
      xor ebx,ebx
1287
      xor ecx,ecx
1288
      xor esi,esi
1289
      mov ax,[Button.x]
1290
      mov bx,[Button.y]
1291
      mov cx,[Button.height]
1292
      mov si,[Button.width]
1293
      add ebx,ecx
1294
      mov [Line.x1],eax
1295
      mov [Line.x2],eax
1296
      mov [Line.y1],ebx
1297
      mov [Line.y2],ebx
1298
      add [Line.x2],esi
1299
      call DrawLine
1300
1301
 
1302
1303
 
1304
1305
 
1306
      and edx,0xffffff
1307
1308
 
1309
      xor ebx,ebx
1310
      xor ecx,ecx
1311
      mov ax,[Button.x]
1312
      mov bx,[Button.y]
1313
      mov cx,[Button.height]
1314
      mov [Line.x1],eax
1315
      mov [Line.x2],eax
1316
      mov [Line.y1],ebx
1317
      mov [Line.y2],ebx
1318
      mov [Line.color],edx
1319
      add [Line.y2],ecx
1320
      call DrawLine
1321
1322
 
1323
      xor ebx,ebx
1324
      xor esi,esi
1325
      mov ax,[Button.x]
1326
      mov bx,[Button.y]
1327
      mov si,[Button.width]
1328
      mov [Line.x1],eax
1329
      mov [Line.x2],eax
1330
      mov [Line.y1],ebx
1331
      mov [Line.y2],ebx
1332
      add [Line.x2],esi
1333
      call DrawLine
1334
1335
 
1336
      and edx,0xffffff
1337
1338
 
1339
      xor ebx,ebx
1340
      xor ecx,ecx
1341
      xor esi,esi
1342
      mov ax,[Button.x]
1343
      mov bx,[Button.y]
1344
      mov cx,[Button.height]
1345
      mov si,[Button.width]
1346
      add eax,esi
1347
      mov [Line.x1],eax
1348
      mov [Line.x2],eax
1349
      mov [Line.y1],ebx
1350
      mov [Line.y2],ebx
1351
      mov [Line.color],edx
1352
      add [Line.y2],ecx
1353
      call DrawLine
1354
1355
 
1356
      xor ebx,ebx
1357
      xor ecx,ecx
1358
      xor esi,esi
1359
      mov ax,[Button.x]
1360
      mov bx,[Button.y]
1361
      mov cx,[Button.height]
1362
      mov si,[Button.width]
1363
      add ebx,ecx
1364
      mov [Line.x1],eax
1365
      mov [Line.x2],eax
1366
      mov [Line.y1],ebx
1367
      mov [Line.y2],ebx
1368
      add [Line.x2],esi
1369
      call DrawLine
1370
1371
 
1372
1373
 
1374
1375
 
1376
      xor ebx,ebx
1377
      xor ecx,ecx
1378
      mov ax,[Button.x]
1379
      mov bx,[Button.y]
1380
      mov cx,[Button.height]
1381
      mov [Line.x1],eax
1382
      mov [Line.x2],eax
1383
      mov [Line.y1],ebx
1384
      mov [Line.y2],ebx
1385
      and [Line.color],0
1386
      add [Line.y2],ecx
1387
      call DrawLine
1388
1389
 
1390
      xor ebx,ebx
1391
      xor esi,esi
1392
      mov ax,[Button.x]
1393
      mov bx,[Button.y]
1394
      ;mov cx,[Button.height]
1395
      mov si,[Button.width]
1396
      mov [Line.x1],eax
1397
      mov [Line.x2],eax
1398
      mov [Line.y1],ebx
1399
      mov [Line.y2],ebx
1400
      add [Line.x2],esi
1401
      call DrawLine
1402
1403
 
1404
      xor ebx,ebx
1405
      xor ecx,ecx
1406
      xor esi,esi
1407
      mov ax,[Button.x]
1408
      mov bx,[Button.y]
1409
      mov cx,[Button.height]
1410
      mov si,[Button.width]
1411
      add eax,esi
1412
      mov [Line.x1],eax
1413
      mov [Line.x2],eax
1414
      mov [Line.y1],ebx
1415
      mov [Line.y2],ebx
1416
      mov [Line.color],0xffffff
1417
      add [Line.y2],ecx
1418
      call DrawLine
1419
1420
 
1421
      xor ebx,ebx
1422
      xor ecx,ecx
1423
      xor esi,esi
1424
      mov ax,[Button.x]
1425
      mov bx,[Button.y]
1426
      mov cx,[Button.height]
1427
      mov si,[Button.width]
1428
      add ebx,ecx
1429
      mov [Line.x1],eax
1430
      mov [Line.x2],eax
1431
      mov [Line.y1],ebx
1432
      mov [Line.y2],ebx
1433
      add [Line.x2],esi
1434
      call DrawLine
1435
1436
 
1437