Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
255 heavyiron 1
;-----------------------------------------------------------
2
;-----------instruments of menu-----------------------------
3
;-----------------------------------------------------------
4
TakeInstruments:
1643 mario79 5
;|||||||||||||||||||FILE||||||||||||||||||||||
6
	cmp	[number_panel],7
7
	jne	no_file
255 heavyiron 8
 
1643 mario79 9
;<<<<>>>>>>
10
	cmp	[number_menu],1
11
	jne	no_new
255 heavyiron 12
 
1643 mario79 13
	mov	eax,80
14
	mov	ebx,100
15
	mov	ecx,150
16
	mov	edx,90
17
	mov	 esi,1
18
	call	draw_volume_rectangle
255 heavyiron 19
 
1643 mario79 20
	mov	eax,177
21
	mov	ebx,115
22
	mov	ecx,40
23
	mov	edx,14
24
	mov	 esi,4
25
	call	draw_volume_rectangle
255 heavyiron 26
 
1643 mario79 27
	mov	eax,177
28
	mov	ebx,115+24
29
	mov	ecx,40
30
	mov	edx,14
31
	mov	 esi,4
32
	call	draw_volume_rectangle
255 heavyiron 33
 
1643 mario79 34
	mov	eax,175
35
	mov	ebx,170
36
	mov	ecx,40
37
	mov	edx,15
38
	mov	esi,1
39
	call	draw_volume_rectangle
255 heavyiron 40
 
1643 mario79 41
	mov	eax,90
42
	mov	ebx,118
43
	mov	ecx,0xffffff
44
	mov	edx,new_text1
45
	mov	esi,14
46
	call	print_text
255 heavyiron 47
 
1643 mario79 48
	mov	eax,90
49
	mov	ebx,118+24
50
	mov	ecx,0xffffff
51
	mov	edx,new_text2
52
	mov	esi,14
53
	call	print_text
255 heavyiron 54
 
1643 mario79 55
	mov	eax,185
56
	mov	ebx,175
57
	mov	ecx,0xffffff
58
	mov	edx,ok_text
59
	mov	esi,2
60
	call	print_text
255 heavyiron 61
 
1643 mario79 62
	mov	edx,1000000000000000000000000000000b+1000
63
	mcall	8,<177,40>,<115,14>,
255 heavyiron 64
 
1643 mario79 65
	mov	edx,1000000000000000000000000000000b+1001
66
	mcall	,,<139,14>,
255 heavyiron 67
 
1643 mario79 68
	mov	edx,1000000000000000000000000000000b+1002
69
	mcall	,<175,40>,<170,15>
255 heavyiron 70
 
1643 mario79 71
no_activate_space:
72
	mcall	10
255 heavyiron 73
 
1643 mario79 74
	cmp	eax,1
75
	je	exit_new
255 heavyiron 76
 
1643 mario79 77
	cmp	eax,3
78
	jne	no_activate_space
255 heavyiron 79
 
1643 mario79 80
	mcall	17
81
	shr	eax,8
255 heavyiron 82
 
1643 mario79 83
	cmp	eax,1000
84
	jl	no_activate_space
255 heavyiron 85
 
1643 mario79 86
	cmp	eax,1000
87
	jne	no_picture_size_x
255 heavyiron 88
 
1643 mario79 89
	mov	eax,180
90
	mov	ebx,119
91
	mov	ecx,5
92
	call	dialog_line
255 heavyiron 93
 
1643 mario79 94
	mov	eax,string_
95
	mov	ebx,13
96
	call	find_symvol
255 heavyiron 97
 
1643 mario79 98
	dec	eax
99
	mov	[length_number],eax
100
	mov	eax,string_
101
	call	value
255 heavyiron 102
 
1643 mario79 103
	mov	[Picture_SizeX],eax
104
	jmp	no_activate_space
105
;---------------------------------------------------------------------
106
no_picture_size_x:
107
	cmp	eax,1001
108
	jne	no_picture_size_y
255 heavyiron 109
 
1643 mario79 110
	mov	eax,180
111
	mov	ebx,119+24
112
	mov	ecx,5
113
	call	dialog_line
255 heavyiron 114
 
1643 mario79 115
	mov	eax,string_
116
	mov	ebx,13
117
	call	find_symvol
255 heavyiron 118
 
1643 mario79 119
	dec	eax
120
	mov	[length_number],eax
121
	mov	eax,string_
122
	call	value
255 heavyiron 123
 
1643 mario79 124
	mov	[Picture_SizeY],eax
125
	jmp	no_activate_space
126
;---------------------------------------------------------------------
127
no_picture_size_y:
128
	cmp	eax,1002
129
	jne	no_activate_space
255 heavyiron 130
 
1643 mario79 131
exit_new:
132
	mov	edx,11100000000000000000000000000000b+1002
133
	mcall	8,<175,40>,<170,15>
255 heavyiron 134
 
1643 mario79 135
	mov	edx,11100000000000000000000000000000b+1001
136
	mcall	,<177,40>,<139,14>
255 heavyiron 137
 
1643 mario79 138
	mov	edx,11100000000000000000000000000000b+1000
139
	mcall	,,<115,14>
255 heavyiron 140
 
1643 mario79 141
;get memory for new picture
142
	call	GetMemory
255 heavyiron 143
 
1643 mario79 144
	and	[save_flag],0
145
	and	[number_panel],0
146
	and	[number_menu],0
255 heavyiron 147
 
1643 mario79 148
	call	cleare_work_arrea
149
	call	drawwin
150
	jmp	still
151
;---------------------------------------------------------------------
152
no_new:
153
;<<<<>>>>>>
154
	cmp	[number_menu],2
155
	jne	no_open
255 heavyiron 156
 
1643 mario79 157
;	opendialog drawwin,open_1,open_2,file_path
1632 mario79 158
;---------------------------------------------------------------------
159
	mov	[OpenDialog_data.type],0 ; open
160
 
161
	push    dword OpenDialog_data
162
	call    [OpenDialog_Start]
163
 
164
	cmp	[OpenDialog_data.status],1
165
	jne	still
166
;---------------------------------------------------------------------
1643 mario79 167
open_1:
168
	mcall	40,100111b
1632 mario79 169
 
1643 mario79 170
	mov	eax,file_path
171
	mov	ebx,[ScreenPointer]
172
	add	ebx,0x10000
255 heavyiron 173
 
1643 mario79 174
	call	load_heading_of_file
255 heavyiron 175
 
1643 mario79 176
	mov	esi,[ScreenPointer]
177
	add	esi,0x10000
178
;-------------is this BMP file ?----------------
179
	xor	eax,eax
180
	mov	ax,[esi]
181
	mov	[type],ax
255 heavyiron 182
 
1643 mario79 183
	cmp	[type],word 'BM'
184
	jne	no_bmp_file
255 heavyiron 185
 
1643 mario79 186
	xor	eax,eax
187
	xor	ebx,ebx
188
	mov	eax,[esi+18]
189
	mov	ebx,[esi+22]
190
	mov	[Picture_SizeX],eax
191
	mov	[Picture_SizeY],ebx
192
	jmp	exit_type
193
;---------------------------------------------------------------------
194
no_bmp_file:
195
;-------------is this GIF file ?----------------
196
	xor	eax,eax
197
	mov	ax,[esi]
198
	mov	[type],ax
255 heavyiron 199
 
1643 mario79 200
	cmp	[type],'GI'
201
	jne	no_gif_file
255 heavyiron 202
 
1643 mario79 203
	add	esi,6
204
	xor	eax,eax
205
	xor	ebx,ebx
206
	mov	ax,word[esi]
207
	mov	bx,word[esi+2]
208
	mov	[Picture_SizeX],eax
209
	mov	[Picture_SizeY],ebx
210
	jmp	exit_type
211
;---------------------------------------------------------------------
212
no_gif_file:
213
	jmp	no_unpakcing_file
214
;---------------------------------------------------------------------
215
exit_type:
216
;----------------------------------------------------------
217
;Get momory for unpacking picture and for picture's bufers
218
;----------------------------------------------------------
219
	call	GetMemory
220
;----------------------------------------------------------
221
;--------------------Load file in memory-------------------
222
;----------------------------------------------------------
223
	mov	eax,file_path
224
	mov	ebx,[PointerToCopyPicture]
225
	add	ebx,1000
226
	call	load_file
227
;----------------------------------------------------------
228
;-------------------Unpacking picture----------------------
229
;----------------------------------------------------------
230
	mov	esi,[PointerToCopyPicture]
231
	add	esi,1000
232
	mov	edi,[PointerToPicture]
233
	mov	eax,[ScreenPointer]
255 heavyiron 234
 
1643 mario79 235
	cmp	[type],'BM'
236
	jne	no_unpakcing_bmp_file
237
	;BMP DECODER
255 heavyiron 238
 
1643 mario79 239
	call	bmptoimg
255 heavyiron 240
 
1643 mario79 241
	mov	[save_flag],1
242
	jmp	draw_1
243
;---------------------------------------------------------------------
244
no_unpakcing_bmp_file:
245
	cmp	[type],'GI'
246
	jne	no_unpakcing_file
247
	;GIF DECODER
248
	sub	edi,8
255 heavyiron 249
 
1643 mario79 250
	call	ReadGIF
255 heavyiron 251
 
1643 mario79 252
	mov	[save_flag],1
253
	jmp	draw_1
254
;---------------------------------------------------------------------
255
no_unpakcing_file:
256
	call	load_icons
1636 mario79 257
draw_1:
1643 mario79 258
	call	drawwin
259
open_2:
260
	mov	[Scroll1CoordinatX],9
261
	mov	[Scroll2CoordinatY],89
262
	and	[number_panel],0
263
	and	[number_menu],0
264
	jmp	still
265
;---------------------------------------------------------------------
266
no_open:
267
 ;<<<<<<<<<<>>>>>>>>>>>
268
	cmp	[number_menu],3
269
	jne	no_save_
255 heavyiron 270
 
1643 mario79 271
	mov	al,[save_flag]
272
	test	al,al
273
	jz	no_save_file
274
	jmp	save_enter
275
;---------------------------------------------------------------------
276
no_save_file:
277
	and	[number_panel],0
278
	and	[number_menu],0
279
	jmp	still
280
;---------------------------------------------------------------------
281
no_save_:
282
 ;<<<<<<<<>>>>>>>>>>
283
	cmp	[number_menu],4
284
	jne	no_save
255 heavyiron 285
 
1643 mario79 286
; savedialog drawwin,save1,save2,file_path
1632 mario79 287
;---------------------------------------------------------------------
1636 mario79 288
; replace extension to '.bmp'
289
	push	eax esi
290
	mov	esi,[OpenDialog_data.filename_area]
291
	xor	eax,eax
292
	cld
293
@@:
294
	lodsb
295
	test	eax,eax
296
	jnz	@r
1643 mario79 297
	sub	esi,5
1636 mario79 298
	cmp	[esi],byte '.'
299
	jne	@f
1643 mario79 300
	mov	[esi],dword '.bmp'
1636 mario79 301
@@:
302
	pop	esi eax
303
;---------------------------------------------------------------------
1632 mario79 304
	mov	[OpenDialog_data.type],1 ; save
305
 
306
	push    dword OpenDialog_data
307
	call    [OpenDialog_Start]
1643 mario79 308
 
1632 mario79 309
	cmp	[OpenDialog_data.status],1
310
	jne	still
311
;---------------------------------------------------------------------
1643 mario79 312
save1:
313
save_enter:
314
	mcall	40,100111b
255 heavyiron 315
 
1643 mario79 316
	call	analizing_picture_to_palette
255 heavyiron 317
 
1643 mario79 318
	;eax => number of colors in picture
319
	mov	ebx,[PointerToPicture]
320
	mov	ecx,[PointerToEditBufer]
321
	mov	edx,[PointerToPalette]
322
	mov	esi,[Picture_SizeX]
323
	mov	edi,[Picture_SizeY]
255 heavyiron 324
 
1643 mario79 325
	call	coding_bmp
255 heavyiron 326
 
1643 mario79 327
	mov	eax,file_path
328
	mov	ecx,ebx
329
	mov	ebx,[PointerToEditBufer]
255 heavyiron 330
 
1643 mario79 331
	call	save_file
255 heavyiron 332
 
1643 mario79 333
	mov	[save_flag],1
334
	and	[number_panel],0
335
	and	[number_menu],0
336
	call	drawwin
337
	jmp	still
338
;---------------------------------------------------------------------
339
;save2:
340
;	and	[number_panel],0
341
;	and	[number_menu],0
342
;	jmp	still
343
;---------------------------------------------------------------------
344
no_save:
345
 ;<<<<<>>>>>>
346
	cmp	[number_menu],5
347
	jne	no_exit_program
255 heavyiron 348
 
1643 mario79 349
	mov	eax,-1
350
	mcall
351
;---------------------------------------------------------------------
352
no_exit_program:
353
no_file:
354
;|||||||||||||||||||||||||||||EDIT|||||||||||||||||||||||||
355
;<<<<<<<<<>>>>>>>>>
356
	cmp	[number_panel],6
357
	jne	still	;no_edit
255 heavyiron 358
 
1643 mario79 359
	cmp	[number_menu],1
360
	jne	no_undo
255 heavyiron 361
 
1643 mario79 362
	cmp	[number_undo],1
363
	jne	no_one____
255 heavyiron 364
 
1643 mario79 365
	mov	esi,[PointerToCopyPicture]
255 heavyiron 366
 
1643 mario79 367
no_one____:
368
	cmp	[number_undo],2
369
	jne	no_two____
255 heavyiron 370
 
1643 mario79 371
	mov	esi,[PointerToCopyPicture2]
255 heavyiron 372
 
1643 mario79 373
no_two____:
374
	mov	edi,[PointerToPicture]
375
	mov	ecx,[Picture_SizeX]
376
	imul	ecx,[Picture_SizeY]
377
	lea	ecx,[ecx+ecx*2]
378
	add	ecx,4
379
	shr	ecx,2
380
	cld
381
	rep	movsd
382
	call	MovePictureToWorkScreen
255 heavyiron 383
 
1643 mario79 384
	dec	[number_undo]
385
	jnz	no_null_undo
255 heavyiron 386
 
1643 mario79 387
	mov	[number_undo],1
255 heavyiron 388
 
1643 mario79 389
no_null_undo:
390
	and	[number_panel],0
391
	and	[number_menu],0
392
	jmp	still
393
;---------------------------------------------------------------------
394
no_undo:
395
;<<<<<<<<<>>>>>>>>>
396
	cmp	[number_menu],2
397
	jne	no_copy
255 heavyiron 398
 
1643 mario79 399
	cmp	[instrument_used],1
400
	jne	no_copy
401
	cmp	[Activate_instrument],0
402
	jne	no_copy
255 heavyiron 403
 
1643 mario79 404
	mov	eax,[OldX]
405
	mov	ebx,[OldY]
255 heavyiron 406
 
1643 mario79 407
	cmp	eax,[rectangular_shade_x]
408
	jl	no_remove_x_copy
255 heavyiron 409
 
1643 mario79 410
	mov	ecx,[rectangular_shade_x]
411
	mov	[OldX],ecx			 ; OldX <-----> rectangulare_shade_x
412
	mov	[rectangular_shade_x],eax
255 heavyiron 413
 
1643 mario79 414
no_remove_x_copy:
415
	cmp	ebx,[rectangular_shade_y]
416
	jl	no_remove_y_copy
255 heavyiron 417
 
1643 mario79 418
	mov	ecx,[rectangular_shade_y]
419
	mov	[OldY],ecx			 ; OldY <-----> rectangulare_shade_y
420
	mov	[rectangular_shade_y],ebx
255 heavyiron 421
 
1643 mario79 422
no_remove_y_copy:
423
	mov	eax,[OldX]
424
	mov	ebx,[OldY]
425
	mov	ecx,[rectangular_shade_x]
426
	mov	edx,[rectangular_shade_y]
427
	inc	eax
428
	inc	ebx
429
	dec	ecx
430
	dec	edx
255 heavyiron 431
 
1643 mario79 432
	mov	[x],eax
433
	mov	[y],ebx
434
	mov	esi,eax
435
	mov	edi,ebx
436
	mov	[Dx_],1
437
	mov	[Dy_],1
255 heavyiron 438
 
1643 mario79 439
	sub	ecx,eax
440
	jnz	no_signum_fill_r_x_copy
255 heavyiron 441
 
1643 mario79 442
	mov	[Dx_],-1
255 heavyiron 443
 
1643 mario79 444
no_signum_fill_r_x_copy:
445
	sub	edx,ebx
446
	jnz	no_signum_fill_r_y_copy
255 heavyiron 447
 
1643 mario79 448
	mov	[Dy_],-1
255 heavyiron 449
 
1643 mario79 450
no_signum_fill_r_y_copy:
451
	mov	ebx,[rectangular_shade_y]
452
	sub	ebx,edi
255 heavyiron 453
 
1643 mario79 454
	mov	edx,[PointerToEditBufer]
455
	mov	[y],edi
255 heavyiron 456
 
1643 mario79 457
loop_fill_rectangle_y_copy:
458
	mov	[x],esi
255 heavyiron 459
 
1643 mario79 460
loop_fill_rectangle_x_copy:
461
	push	esi edi
462
	mov	eax,[PointerToPicture]
463
	mov	ebx,[Picture_SizeX]
464
	mov	esi,[x]
465
	mov	edi,[y]
466
	call	GetColorOfPixel
467
	mov	[edx],ax
468
	shr	eax,16
469
	mov	[edx+2],al
470
	pop	edi esi
255 heavyiron 471
 
1643 mario79 472
	add	edx,3
473
	mov	eax,[x]
474
	add	eax,[Dx_]
475
	mov	[x],eax
255 heavyiron 476
 
1643 mario79 477
	cmp	eax,[rectangular_shade_x]
478
	jl	loop_fill_rectangle_x_copy
255 heavyiron 479
 
1643 mario79 480
	mov	eax,[y]
481
	add	eax,[Dy_]
482
	mov	[y],eax
255 heavyiron 483
 
1643 mario79 484
	cmp	eax,[rectangular_shade_y]
485
	jl	loop_fill_rectangle_y_copy
255 heavyiron 486
 
1643 mario79 487
	call	MovePictureToWorkScreen
255 heavyiron 488
 
1643 mario79 489
	and	[number_panel],0
490
	and	[number_menu],0
491
	mov	[DrawSprite_flag],1
492
	jmp	still
493
;---------------------------------------------------------------------
494
no_copy:
495
;<<<<<<<<<>>>>>>>
496
	cmp	[number_menu],3
497
	jne	no_paste
255 heavyiron 498
 
1643 mario79 499
	cmp	[instrument_used],1
500
	jne	no_paste
255 heavyiron 501
 
1643 mario79 502
	cmp	[Activate_instrument],0
503
	jne	no_paste
255 heavyiron 504
 
1643 mario79 505
	mov	eax,[OldX]
506
	mov	ebx,[OldY]
255 heavyiron 507
 
1643 mario79 508
	cmp	eax,[rectangular_shade_x]
509
	jl	no_remove_x_paste
255 heavyiron 510
 
1643 mario79 511
	mov	ecx,[rectangular_shade_x]
512
	mov	[OldX],ecx 		  ; OldX <-----> rectangulare_shade_x
513
	mov	[rectangular_shade_x],eax
255 heavyiron 514
 
1643 mario79 515
no_remove_x_paste:
516
	cmp	ebx,[rectangular_shade_y]
517
	jl	no_remove_y_paste
255 heavyiron 518
 
1643 mario79 519
	mov	ecx,[rectangular_shade_y]
520
	mov	[OldY],ecx 		  ; OldY <-----> rectangulare_shade_y
521
	mov	[rectangular_shade_y],ebx
255 heavyiron 522
 
1643 mario79 523
no_remove_y_paste:
524
	mov	eax,[OldX]
525
	mov	ebx,[OldY]
526
	mov	ecx,[rectangular_shade_x]
527
	mov	edx,[rectangular_shade_y]
528
	inc	eax
529
	inc	ebx
530
	dec	ecx
531
	dec	edx
255 heavyiron 532
 
1643 mario79 533
	mov	[x],eax
534
	mov	[y],ebx
535
	mov	esi,eax
536
	mov	edi,ebx
537
	mov	[Dx_],1
538
	mov	[Dy_],1
255 heavyiron 539
 
1643 mario79 540
	sub	ecx,eax
541
	jnz	no_signum_fill_r_x_paste
255 heavyiron 542
 
1643 mario79 543
	mov	[Dx_],-1
255 heavyiron 544
 
1643 mario79 545
no_signum_fill_r_x_paste:
546
	sub	edx,ebx
547
	jnz	no_signum_fill_r_y_paste
255 heavyiron 548
 
1643 mario79 549
	mov	[Dy_],-1
255 heavyiron 550
 
1643 mario79 551
no_signum_fill_r_y_paste:
552
	mov	edx,[PointerToEditBufer]
553
	mov	[y],edi
255 heavyiron 554
 
1643 mario79 555
loop_fill_rectangle_y_paste:
556
	mov	[x],esi
255 heavyiron 557
 
1643 mario79 558
loop_fill_rectangle_x_paste:
559
	push	esi edi
560
	mov	ecx,[edx]
561
	and	ecx,0xffffff ;color
562
	mov	eax,[PointerToPicture]
563
	mov	ebx,[Picture_SizeX]
564
	mov	esi,[x]
565
	mov	edi,[y]
566
	call	PutPixel
567
	pop	edi esi
255 heavyiron 568
 
1643 mario79 569
	add	edx,3
255 heavyiron 570
 
1643 mario79 571
	mov	eax,[x]
572
	add	eax,[Dx_]
573
	mov	[x],eax
574
	cmp	eax,[rectangular_shade_x]
575
	jl	loop_fill_rectangle_x_paste
255 heavyiron 576
 
1643 mario79 577
	mov	eax,[y]
578
	add	eax,[Dy_]
579
	mov	[y],eax
580
	cmp	eax,[rectangular_shade_y]
581
	jl	loop_fill_rectangle_y_paste
255 heavyiron 582
 
1643 mario79 583
	call	MovePictureToWorkScreen
584
	and	[number_panel],0
585
	and	[number_menu],0
586
	mov	[Paste_flag],1
587
	jmp	still
588
;---------------------------------------------------------------------
589
no_paste:
590
;<<<<<<<<<>>>>>>>>>
591
	cmp	[number_menu],4
592
	jne	no_cut
255 heavyiron 593
 
1643 mario79 594
	cmp	[instrument_used],1
595
	jne	no_cut
255 heavyiron 596
 
1643 mario79 597
	cmp	[Activate_instrument],0
598
	jne	no_cut
255 heavyiron 599
 
1643 mario79 600
	mov	eax,[OldX]
601
	mov	ebx,[OldY]
255 heavyiron 602
 
1643 mario79 603
	cmp	eax,[rectangular_shade_x]
604
	jl	no_remove_x_cut
255 heavyiron 605
 
1643 mario79 606
	mov	ecx,[rectangular_shade_x]
607
	mov	[OldX],ecx 		  ; OldX <-----> rectangulare_shade_x
608
	mov	[rectangular_shade_x],eax
255 heavyiron 609
 
1643 mario79 610
no_remove_x_cut:
611
	cmp	ebx,[rectangular_shade_y]
612
	jl	no_remove_y_cut
255 heavyiron 613
 
1643 mario79 614
	mov	ecx,[rectangular_shade_y]
615
	mov	[OldY],ecx 		  ; OldY <-----> rectangulare_shade_y
616
	mov	[rectangular_shade_y],ebx
255 heavyiron 617
 
1643 mario79 618
no_remove_y_cut:
619
	mov	eax,[OldX]
620
	mov	ebx,[OldY]
621
	mov	ecx,[rectangular_shade_x]
622
	mov	edx,[rectangular_shade_y]
623
	inc	eax
624
	inc	ebx
625
	dec	ecx
626
	dec	edx
255 heavyiron 627
 
1643 mario79 628
	mov	[x],eax
629
	mov	[y],ebx
630
	mov	esi,eax
631
	mov	edi,ebx
632
	mov	[Dx_],1
633
	mov	[Dy_],1
255 heavyiron 634
 
1643 mario79 635
	sub	ecx,eax
636
	jnz	no_signum_fill_r_x
255 heavyiron 637
 
1643 mario79 638
	mov	[Dx_],-1
255 heavyiron 639
 
1643 mario79 640
no_signum_fill_r_x:
641
	sub	edx,ebx
642
	jnz	no_signum_fill_r_y
255 heavyiron 643
 
1643 mario79 644
	mov	[Dy_],-1
255 heavyiron 645
 
1643 mario79 646
no_signum_fill_r_y:
647
	mov	[y],edi
255 heavyiron 648
 
1643 mario79 649
loop_fill_rectangle_y:
650
	mov	[x],esi
255 heavyiron 651
 
1643 mario79 652
loop_fill_rectangle_x:
653
	push	esi edi
654
	mov	eax,[PointerToPicture]
655
	mov	ebx,[Picture_SizeX]
656
	mov	ecx,dword 0xffffff
657
	mov	esi,[x]
658
	mov	edi,[y]
659
	call	PutPixel
660
	pop	edi esi
255 heavyiron 661
 
1643 mario79 662
	mov	eax,[x]
663
	add	eax,[Dx_]
664
	mov	[x],eax
255 heavyiron 665
 
1643 mario79 666
	cmp	eax,[rectangular_shade_x]
667
	jl	loop_fill_rectangle_x
255 heavyiron 668
 
1643 mario79 669
	mov	eax,[y]
670
	add	eax,[Dy_]
671
	mov	[y],eax
255 heavyiron 672
 
1643 mario79 673
	cmp	eax,[rectangular_shade_y]
674
	jl	loop_fill_rectangle_y
255 heavyiron 675
 
1643 mario79 676
	call	MovePictureToWorkScreen
255 heavyiron 677
 
1643 mario79 678
	and	[number_panel],0
679
	and	[number_menu],0
680
	jmp	still
681
;---------------------------------------------------------------------
682
no_cut:
683
;<<<<<>>>>>
684
	cmp	[number_menu],5
685
	jne	no_cleare_all
255 heavyiron 686
 
1643 mario79 687
	call	cleare_work_arrea
688
	call	MovePictureToWorkScreen
255 heavyiron 689
 
1643 mario79 690
	and	[number_panel],0
691
	and	[number_menu],0
692
	jmp	still
693
;---------------------------------------------------------------------
694
no_cleare_all:
695
;<<<<<>>>>>
696
	cmp	[number_menu],6
697
	jne	still	;no_to_allocate_all
255 heavyiron 698
 
1643 mario79 699
	mov	[OldX],1
700
	mov	[OldY],1
701
	mov	eax,[Picture_SizeX]
702
	mov	ebx,[Picture_SizeY]
703
	dec	eax
704
	dec	ebx
705
	mov	[rectangular_shade_x],eax
706
	mov	[rectangular_shade_y],ebx
707
	mov	[instrument_used],1
708
	mov	[Activate_instrument],1
709
	mov	[Current_instrument],30
710
	mov	[crossing],0
711
	and	[number_panel],0
712
	and	[number_menu],0
713
;	call	TakeButtonInstruments
714
;	call	MovePictureToWorkScreen
715
	jmp	still
716
;---------------------------------------------------------------------
717
;no_to_allocate_all:
718
;no_edit:
719
;	jmp	still
720
;---------------------------------------------------------------------