Subversion Repositories Kolibri OS

Rev

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