Subversion Repositories Kolibri OS

Rev

Rev 3951 | Rev 6342 | 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
;---------------------------------------------------------------------
6328 IgorA 167
;open_1:
3951 mario79 168
	mcall	40,0x80000027 ; 100111b
1632 mario79 169
 
6328 IgorA 170
	call load_picture
255 heavyiron 171
 
1643 mario79 172
	call	load_icons
173
	call	drawwin
6328 IgorA 174
 
1643 mario79 175
	mov	[Scroll1CoordinatX],9
176
	mov	[Scroll2CoordinatY],89
177
	and	[number_panel],0
178
	and	[number_menu],0
179
	jmp	still
180
;---------------------------------------------------------------------
181
no_open:
182
 ;<<<<<<<<<<>>>>>>>>>>>
183
	cmp	[number_menu],3
184
	jne	no_save_
255 heavyiron 185
 
1643 mario79 186
	mov	al,[save_flag]
187
	test	al,al
188
	jz	no_save_file
189
	jmp	save_enter
190
;---------------------------------------------------------------------
191
no_save_file:
192
	and	[number_panel],0
193
	and	[number_menu],0
194
	jmp	still
195
;---------------------------------------------------------------------
196
no_save_:
197
 ;<<<<<<<<>>>>>>>>>>
198
	cmp	[number_menu],4
199
	jne	no_save
255 heavyiron 200
 
1643 mario79 201
; savedialog drawwin,save1,save2,file_path
1632 mario79 202
;---------------------------------------------------------------------
1636 mario79 203
; replace extension to '.bmp'
204
	push	eax esi
205
	mov	esi,[OpenDialog_data.filename_area]
206
	xor	eax,eax
207
	cld
208
@@:
209
	lodsb
210
	test	eax,eax
211
	jnz	@r
1643 mario79 212
	sub	esi,5
1636 mario79 213
	cmp	[esi],byte '.'
214
	jne	@f
1643 mario79 215
	mov	[esi],dword '.bmp'
1636 mario79 216
@@:
217
	pop	esi eax
218
;---------------------------------------------------------------------
1632 mario79 219
	mov	[OpenDialog_data.type],1 ; save
220
 
221
	push    dword OpenDialog_data
222
	call    [OpenDialog_Start]
1643 mario79 223
 
1632 mario79 224
	cmp	[OpenDialog_data.status],1
225
	jne	still
226
;---------------------------------------------------------------------
1643 mario79 227
save1:
228
save_enter:
3951 mario79 229
	mcall	40,0x80000027 ; 100111b
255 heavyiron 230
 
1643 mario79 231
	call	analizing_picture_to_palette
255 heavyiron 232
 
1643 mario79 233
	;eax => number of colors in picture
234
	mov	ebx,[PointerToPicture]
235
	mov	ecx,[PointerToEditBufer]
236
	mov	edx,[PointerToPalette]
237
	mov	esi,[Picture_SizeX]
238
	mov	edi,[Picture_SizeY]
255 heavyiron 239
 
1643 mario79 240
	call	coding_bmp
255 heavyiron 241
 
1643 mario79 242
	mov	eax,file_path
243
	mov	ecx,ebx
244
	mov	ebx,[PointerToEditBufer]
255 heavyiron 245
 
1643 mario79 246
	call	save_file
255 heavyiron 247
 
1643 mario79 248
	mov	[save_flag],1
249
	and	[number_panel],0
250
	and	[number_menu],0
251
	call	drawwin
252
	jmp	still
253
;---------------------------------------------------------------------
254
;save2:
255
;	and	[number_panel],0
256
;	and	[number_menu],0
257
;	jmp	still
258
;---------------------------------------------------------------------
259
no_save:
260
 ;<<<<<>>>>>>
261
	cmp	[number_menu],5
262
	jne	no_exit_program
255 heavyiron 263
 
1643 mario79 264
	mov	eax,-1
265
	mcall
266
;---------------------------------------------------------------------
267
no_exit_program:
268
no_file:
269
;|||||||||||||||||||||||||||||EDIT|||||||||||||||||||||||||
270
;<<<<<<<<<>>>>>>>>>
271
	cmp	[number_panel],6
272
	jne	still	;no_edit
255 heavyiron 273
 
1643 mario79 274
	cmp	[number_menu],1
275
	jne	no_undo
255 heavyiron 276
 
1643 mario79 277
	cmp	[number_undo],1
278
	jne	no_one____
255 heavyiron 279
 
1643 mario79 280
	mov	esi,[PointerToCopyPicture]
255 heavyiron 281
 
1643 mario79 282
no_one____:
283
	cmp	[number_undo],2
284
	jne	no_two____
255 heavyiron 285
 
1643 mario79 286
	mov	esi,[PointerToCopyPicture2]
255 heavyiron 287
 
1643 mario79 288
no_two____:
289
	mov	edi,[PointerToPicture]
290
	mov	ecx,[Picture_SizeX]
291
	imul	ecx,[Picture_SizeY]
292
	lea	ecx,[ecx+ecx*2]
293
	add	ecx,4
294
	shr	ecx,2
295
	cld
296
	rep	movsd
297
	call	MovePictureToWorkScreen
255 heavyiron 298
 
1643 mario79 299
	dec	[number_undo]
300
	jnz	no_null_undo
255 heavyiron 301
 
1643 mario79 302
	mov	[number_undo],1
255 heavyiron 303
 
1643 mario79 304
no_null_undo:
305
	and	[number_panel],0
306
	and	[number_menu],0
307
	jmp	still
308
;---------------------------------------------------------------------
309
no_undo:
310
;<<<<<<<<<>>>>>>>>>
311
	cmp	[number_menu],2
312
	jne	no_copy
255 heavyiron 313
 
1643 mario79 314
	cmp	[instrument_used],1
315
	jne	no_copy
316
	cmp	[Activate_instrument],0
317
	jne	no_copy
255 heavyiron 318
 
1643 mario79 319
	mov	eax,[OldX]
320
	mov	ebx,[OldY]
255 heavyiron 321
 
1643 mario79 322
	cmp	eax,[rectangular_shade_x]
323
	jl	no_remove_x_copy
255 heavyiron 324
 
1643 mario79 325
	mov	ecx,[rectangular_shade_x]
326
	mov	[OldX],ecx			 ; OldX <-----> rectangulare_shade_x
327
	mov	[rectangular_shade_x],eax
255 heavyiron 328
 
1643 mario79 329
no_remove_x_copy:
330
	cmp	ebx,[rectangular_shade_y]
331
	jl	no_remove_y_copy
255 heavyiron 332
 
1643 mario79 333
	mov	ecx,[rectangular_shade_y]
334
	mov	[OldY],ecx			 ; OldY <-----> rectangulare_shade_y
335
	mov	[rectangular_shade_y],ebx
255 heavyiron 336
 
1643 mario79 337
no_remove_y_copy:
338
	mov	eax,[OldX]
339
	mov	ebx,[OldY]
340
	mov	ecx,[rectangular_shade_x]
341
	mov	edx,[rectangular_shade_y]
342
	inc	eax
343
	inc	ebx
344
	dec	ecx
345
	dec	edx
255 heavyiron 346
 
1643 mario79 347
	mov	[x],eax
348
	mov	[y],ebx
349
	mov	esi,eax
350
	mov	edi,ebx
351
	mov	[Dx_],1
352
	mov	[Dy_],1
255 heavyiron 353
 
1643 mario79 354
	sub	ecx,eax
355
	jnz	no_signum_fill_r_x_copy
255 heavyiron 356
 
1643 mario79 357
	mov	[Dx_],-1
255 heavyiron 358
 
1643 mario79 359
no_signum_fill_r_x_copy:
360
	sub	edx,ebx
361
	jnz	no_signum_fill_r_y_copy
255 heavyiron 362
 
1643 mario79 363
	mov	[Dy_],-1
255 heavyiron 364
 
1643 mario79 365
no_signum_fill_r_y_copy:
366
	mov	ebx,[rectangular_shade_y]
367
	sub	ebx,edi
255 heavyiron 368
 
1643 mario79 369
	mov	edx,[PointerToEditBufer]
370
	mov	[y],edi
255 heavyiron 371
 
1643 mario79 372
loop_fill_rectangle_y_copy:
373
	mov	[x],esi
255 heavyiron 374
 
1643 mario79 375
loop_fill_rectangle_x_copy:
376
	push	esi edi
377
	mov	eax,[PointerToPicture]
378
	mov	ebx,[Picture_SizeX]
379
	mov	esi,[x]
380
	mov	edi,[y]
381
	call	GetColorOfPixel
382
	mov	[edx],ax
383
	shr	eax,16
384
	mov	[edx+2],al
385
	pop	edi esi
255 heavyiron 386
 
1643 mario79 387
	add	edx,3
388
	mov	eax,[x]
389
	add	eax,[Dx_]
390
	mov	[x],eax
255 heavyiron 391
 
1643 mario79 392
	cmp	eax,[rectangular_shade_x]
393
	jl	loop_fill_rectangle_x_copy
255 heavyiron 394
 
1643 mario79 395
	mov	eax,[y]
396
	add	eax,[Dy_]
397
	mov	[y],eax
255 heavyiron 398
 
1643 mario79 399
	cmp	eax,[rectangular_shade_y]
400
	jl	loop_fill_rectangle_y_copy
255 heavyiron 401
 
1643 mario79 402
	call	MovePictureToWorkScreen
255 heavyiron 403
 
1643 mario79 404
	and	[number_panel],0
405
	and	[number_menu],0
406
	mov	[DrawSprite_flag],1
407
	jmp	still
408
;---------------------------------------------------------------------
409
no_copy:
410
;<<<<<<<<<>>>>>>>
411
	cmp	[number_menu],3
412
	jne	no_paste
255 heavyiron 413
 
1643 mario79 414
	cmp	[instrument_used],1
415
	jne	no_paste
255 heavyiron 416
 
1643 mario79 417
	cmp	[Activate_instrument],0
418
	jne	no_paste
255 heavyiron 419
 
1643 mario79 420
	mov	eax,[OldX]
421
	mov	ebx,[OldY]
255 heavyiron 422
 
1643 mario79 423
	cmp	eax,[rectangular_shade_x]
424
	jl	no_remove_x_paste
255 heavyiron 425
 
1643 mario79 426
	mov	ecx,[rectangular_shade_x]
427
	mov	[OldX],ecx 		  ; OldX <-----> rectangulare_shade_x
428
	mov	[rectangular_shade_x],eax
255 heavyiron 429
 
1643 mario79 430
no_remove_x_paste:
431
	cmp	ebx,[rectangular_shade_y]
432
	jl	no_remove_y_paste
255 heavyiron 433
 
1643 mario79 434
	mov	ecx,[rectangular_shade_y]
435
	mov	[OldY],ecx 		  ; OldY <-----> rectangulare_shade_y
436
	mov	[rectangular_shade_y],ebx
255 heavyiron 437
 
1643 mario79 438
no_remove_y_paste:
439
	mov	eax,[OldX]
440
	mov	ebx,[OldY]
441
	mov	ecx,[rectangular_shade_x]
442
	mov	edx,[rectangular_shade_y]
443
	inc	eax
444
	inc	ebx
445
	dec	ecx
446
	dec	edx
255 heavyiron 447
 
1643 mario79 448
	mov	[x],eax
449
	mov	[y],ebx
450
	mov	esi,eax
451
	mov	edi,ebx
452
	mov	[Dx_],1
453
	mov	[Dy_],1
255 heavyiron 454
 
1643 mario79 455
	sub	ecx,eax
456
	jnz	no_signum_fill_r_x_paste
255 heavyiron 457
 
1643 mario79 458
	mov	[Dx_],-1
255 heavyiron 459
 
1643 mario79 460
no_signum_fill_r_x_paste:
461
	sub	edx,ebx
462
	jnz	no_signum_fill_r_y_paste
255 heavyiron 463
 
1643 mario79 464
	mov	[Dy_],-1
255 heavyiron 465
 
1643 mario79 466
no_signum_fill_r_y_paste:
467
	mov	edx,[PointerToEditBufer]
468
	mov	[y],edi
255 heavyiron 469
 
1643 mario79 470
loop_fill_rectangle_y_paste:
471
	mov	[x],esi
255 heavyiron 472
 
1643 mario79 473
loop_fill_rectangle_x_paste:
474
	push	esi edi
475
	mov	ecx,[edx]
476
	and	ecx,0xffffff ;color
477
	mov	eax,[PointerToPicture]
478
	mov	ebx,[Picture_SizeX]
479
	mov	esi,[x]
480
	mov	edi,[y]
481
	call	PutPixel
482
	pop	edi esi
255 heavyiron 483
 
1643 mario79 484
	add	edx,3
255 heavyiron 485
 
1643 mario79 486
	mov	eax,[x]
487
	add	eax,[Dx_]
488
	mov	[x],eax
489
	cmp	eax,[rectangular_shade_x]
490
	jl	loop_fill_rectangle_x_paste
255 heavyiron 491
 
1643 mario79 492
	mov	eax,[y]
493
	add	eax,[Dy_]
494
	mov	[y],eax
495
	cmp	eax,[rectangular_shade_y]
496
	jl	loop_fill_rectangle_y_paste
255 heavyiron 497
 
1643 mario79 498
	call	MovePictureToWorkScreen
499
	and	[number_panel],0
500
	and	[number_menu],0
501
	mov	[Paste_flag],1
502
	jmp	still
503
;---------------------------------------------------------------------
504
no_paste:
505
;<<<<<<<<<>>>>>>>>>
506
	cmp	[number_menu],4
507
	jne	no_cut
255 heavyiron 508
 
1643 mario79 509
	cmp	[instrument_used],1
510
	jne	no_cut
255 heavyiron 511
 
1643 mario79 512
	cmp	[Activate_instrument],0
513
	jne	no_cut
255 heavyiron 514
 
1643 mario79 515
	mov	eax,[OldX]
516
	mov	ebx,[OldY]
255 heavyiron 517
 
1643 mario79 518
	cmp	eax,[rectangular_shade_x]
519
	jl	no_remove_x_cut
255 heavyiron 520
 
1643 mario79 521
	mov	ecx,[rectangular_shade_x]
522
	mov	[OldX],ecx 		  ; OldX <-----> rectangulare_shade_x
523
	mov	[rectangular_shade_x],eax
255 heavyiron 524
 
1643 mario79 525
no_remove_x_cut:
526
	cmp	ebx,[rectangular_shade_y]
527
	jl	no_remove_y_cut
255 heavyiron 528
 
1643 mario79 529
	mov	ecx,[rectangular_shade_y]
530
	mov	[OldY],ecx 		  ; OldY <-----> rectangulare_shade_y
531
	mov	[rectangular_shade_y],ebx
255 heavyiron 532
 
1643 mario79 533
no_remove_y_cut:
534
	mov	eax,[OldX]
535
	mov	ebx,[OldY]
536
	mov	ecx,[rectangular_shade_x]
537
	mov	edx,[rectangular_shade_y]
538
	inc	eax
539
	inc	ebx
540
	dec	ecx
541
	dec	edx
255 heavyiron 542
 
1643 mario79 543
	mov	[x],eax
544
	mov	[y],ebx
545
	mov	esi,eax
546
	mov	edi,ebx
547
	mov	[Dx_],1
548
	mov	[Dy_],1
255 heavyiron 549
 
1643 mario79 550
	sub	ecx,eax
551
	jnz	no_signum_fill_r_x
255 heavyiron 552
 
1643 mario79 553
	mov	[Dx_],-1
255 heavyiron 554
 
1643 mario79 555
no_signum_fill_r_x:
556
	sub	edx,ebx
557
	jnz	no_signum_fill_r_y
255 heavyiron 558
 
1643 mario79 559
	mov	[Dy_],-1
255 heavyiron 560
 
1643 mario79 561
no_signum_fill_r_y:
562
	mov	[y],edi
255 heavyiron 563
 
1643 mario79 564
loop_fill_rectangle_y:
565
	mov	[x],esi
255 heavyiron 566
 
1643 mario79 567
loop_fill_rectangle_x:
568
	push	esi edi
569
	mov	eax,[PointerToPicture]
570
	mov	ebx,[Picture_SizeX]
571
	mov	ecx,dword 0xffffff
572
	mov	esi,[x]
573
	mov	edi,[y]
574
	call	PutPixel
575
	pop	edi esi
255 heavyiron 576
 
1643 mario79 577
	mov	eax,[x]
578
	add	eax,[Dx_]
579
	mov	[x],eax
255 heavyiron 580
 
1643 mario79 581
	cmp	eax,[rectangular_shade_x]
582
	jl	loop_fill_rectangle_x
255 heavyiron 583
 
1643 mario79 584
	mov	eax,[y]
585
	add	eax,[Dy_]
586
	mov	[y],eax
255 heavyiron 587
 
1643 mario79 588
	cmp	eax,[rectangular_shade_y]
589
	jl	loop_fill_rectangle_y
255 heavyiron 590
 
1643 mario79 591
	call	MovePictureToWorkScreen
255 heavyiron 592
 
1643 mario79 593
	and	[number_panel],0
594
	and	[number_menu],0
595
	jmp	still
596
;---------------------------------------------------------------------
597
no_cut:
598
;<<<<<>>>>>
599
	cmp	[number_menu],5
600
	jne	no_cleare_all
255 heavyiron 601
 
1643 mario79 602
	call	cleare_work_arrea
603
	call	MovePictureToWorkScreen
255 heavyiron 604
 
1643 mario79 605
	and	[number_panel],0
606
	and	[number_menu],0
607
	jmp	still
608
;---------------------------------------------------------------------
609
no_cleare_all:
610
;<<<<<>>>>>
611
	cmp	[number_menu],6
612
	jne	still	;no_to_allocate_all
255 heavyiron 613
 
1643 mario79 614
	mov	[OldX],1
615
	mov	[OldY],1
616
	mov	eax,[Picture_SizeX]
617
	mov	ebx,[Picture_SizeY]
618
	dec	eax
619
	dec	ebx
620
	mov	[rectangular_shade_x],eax
621
	mov	[rectangular_shade_y],ebx
622
	mov	[instrument_used],1
623
	mov	[Activate_instrument],1
624
	mov	[Current_instrument],30
625
	mov	[crossing],0
626
	and	[number_panel],0
627
	and	[number_menu],0
628
;	call	TakeButtonInstruments
629
;	call	MovePictureToWorkScreen
630
	jmp	still
631
;---------------------------------------------------------------------
632
;no_to_allocate_all:
633
;no_edit:
634
;	jmp	still
635
;---------------------------------------------------------------------