Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
4036 GerdtR 1
;иногда неверно определяется ширина менюшки
2
 
4146 GerdtR 3
ICONS_DAT	equ '/rd/1/icons.dat'
4
ICON_STRIP	equ '/rd/1/iconstrp.png'
5
ICON_SIZE	equ 68
6
IMG_SIZE	equ 32
7
TEXT_BOTTOM_Y	equ 14
8
IMAGE_TOP_Y	equ 10	  ;>=1
9
ALIGN_SIZE	equ 68
10
NAME_LENGTH	equ 11
11
MIN_NO_MOVING	equ 8
12
			   ;для диалога создания/редактирования
13
ICONSX		equ 20
14
ICONSY		equ 80
3853 GerdtR 15
ICONS_DRAW_COUNTW equ 10  ;количество иконок в ширину
16
ICONS_DRAW_COUNTH equ 2   ;количество иконок в высоту
4146 GerdtR 17
SPCW		equ 3	  ;пробел между иконками по горизонтали
18
SPCH		equ 3
3853 GerdtR 19
END_ICONS_AREAW equ ICONSX+(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW
20
END_ICONS_AREAH equ ICONSY+(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH-SPCH
21
 
22
 
23
 
4146 GerdtR 24
SizeData	equ bufStdIco+32
25
BegData 	equ fiStdIco.point
3853 GerdtR 26
;------------------------------------------------------------------------------
4146 GerdtR 27
	use32
28
	org 0x0
29
	db 'MENUET01'	; 8 byte id
30
	dd 0x01 	; header version
31
	dd START	; start of code
32
	dd I_END	; size of image
33
	dd ENDMEM	; memory for app
34
	dd stack_main	; esp
35
	dd 0		; boot parameters
36
	dd 0		; path
3853 GerdtR 37
;------------------------------------------------------------------------------
38
include 'lang.inc'
39
include '../../macros.inc'
40
include '../../proc32.inc'
41
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
42
include '../../dll.inc'
4003 GerdtR 43
;include '../../debug.inc'
3853 GerdtR 44
 
45
;------------------------------------------------------------------------------
4146 GerdtR 46
START:		; start of execution
47
	mcall	68,11
48
	stdcall dll.Load,IMPORTS
49
	test	eax,eax
50
	jnz	ErrLoadLibs
3853 GerdtR 51
 
52
; unpack deflate
4146 GerdtR 53
	mov	eax,[unpack_DeflateUnpack2]
54
	mov	[deflate_unpack],eax
3853 GerdtR 55
;---------------------------------------------------------------------
56
; get size of file ICONSTRP.PNG
4146 GerdtR 57
	mcall	70,fiStdIco
58
	test	eax,eax
59
	jnz	ErrorStrp
3853 GerdtR 60
; get memory for ICONSTRP.PNG
4146 GerdtR 61
	mov	ecx,dword[bufStdIco+32]
62
	mov	[fiStdIco.size],ecx
63
	mov	[img_size],ecx
64
	mcall	68,12
65
	mov	[fiStdIco.point],eax
66
	mov	[image_file],eax
3853 GerdtR 67
; load ICONSTRP.PNG
4146 GerdtR 68
	mov	dword[fiStdIco],0
69
	mcall	70,fiStdIco
70
	test	eax,eax
71
	jnz	close
3853 GerdtR 72
; convert PNG to RAW
4146 GerdtR 73
	xor	eax,eax
74
	mov	[return_code],eax
3853 GerdtR 75
;int3
76
 
4146 GerdtR 77
	push	image_file
78
	call	[cnv_png_import.Start]
3853 GerdtR 79
 
4146 GerdtR 80
	mov	eax,[raw_pointer]
81
	mov	ebx,[eax+32]
82
	mov	[strip_file_size],ebx
83
	mov	eax,[eax+28]
84
	add	eax,[raw_pointer]
85
	mov	[strip_file],eax
3853 GerdtR 86
; back memory to system
4146 GerdtR 87
	mcall	68,13,[fiStdIco.point]
3853 GerdtR 88
 
4146 GerdtR 89
	mov	eax,[raw_pointer]
90
	mov	eax,[eax+8]
91
	shr	eax,5
92
	mov	[icon_count],eax
3853 GerdtR 93
 
4146 GerdtR 94
	and	eax,0x7
95
	mov	[cur_band_compensation],eax
3853 GerdtR 96
 
97
;########## загружаем данные иконок в память ##########################
98
 
4146 GerdtR 99
	mcall	70,fiIni		     ;выделяем память, достаточной для хранения ini файла. Её точно хватит для хранения данных об иконках
100
	test	eax,eax
101
	jnz	ErrorIni
3853 GerdtR 102
 
4146 GerdtR 103
	cmp	dword[bufIni+32],0
104
	je	ErrorIni
105
	mcall	68,12,dword[bufIni+32]
106
	mov	dword[BegData],eax
107
	jmp	NoErrIni
3853 GerdtR 108
 
109
  ErrorIni:
4146 GerdtR 110
	mcall	70,fiRunProg
111
	mcall	-1
3853 GerdtR 112
 
113
  NoErrIni:
4146 GerdtR 114
	m2m	[PIcoDB],[BegData]
3853 GerdtR 115
 
4146 GerdtR 116
	stdcall [ini_enum_sections],IconIni,LoadIconsData
3853 GerdtR 117
;int3
4146 GerdtR 118
	mov	eax,dword[PIcoDB]
119
	sub	eax,[BegData]
120
	mov	dword[SizeData],eax
121
	mov	eax,[BegData]
122
	cmp	eax,[PIcoDB]
123
	jne	@f
124
	mov	dword[eax],0
125
	mov	dword[SizeData],0
3853 GerdtR 126
   @@:
127
;######################################################################
128
 
4146 GerdtR 129
	call	FillIconsOffs		       ;заполняет MaxNumIcon,IconsOffs
3853 GerdtR 130
 
4146 GerdtR 131
	mcall	40,0100000b		       ;нужны только события мыши, перерисовка иконок будет в другом потоке
3853 GerdtR 132
 
4146 GerdtR 133
	mov	eax,[icon_count]
134
	mov	bl,ICONS_DRAW_COUNTH
135
	div	bl
136
	test	ah,ah
137
	jz	@f
138
	inc	al
3853 GerdtR 139
     @@:
4146 GerdtR 140
	and	eax,0FFh
141
	mov	[sbIcons.max_area],eax
3853 GerdtR 142
 
4146 GerdtR 143
	mcall	51,1,BGRedrawThread,stack_bredraw	;запускаем поток перерисовки иконок
144
	stdcall [OpenDialog_Init],OpenDialog_data
3853 GerdtR 145
 
146
messages:
4146 GerdtR 147
	mcall	10
148
	sub	eax,6
149
	jz	MSGMouse
3853 GerdtR 150
 
4146 GerdtR 151
	jmp	messages
3853 GerdtR 152
 
153
 
154
MSGMouse:
4146 GerdtR 155
	mcall	37,0	;GetMousePos
156
	xor	ebx,ebx
157
	mov	bx,ax
158
	shr	eax,16
159
	mov	ecx,ebx
160
	mov	ebx,eax
3853 GerdtR 161
 
4146 GerdtR 162
	mcall	34
163
	cmp	eax,1
164
	jne	messages
3853 GerdtR 165
 
4146 GerdtR 166
	cmp	[RButtonActiv],1
167
	je	messages
3853 GerdtR 168
 
4146 GerdtR 169
	mov	[MouseY],ecx
170
	mov	[MouseX],ebx
3853 GerdtR 171
 
172
 
4146 GerdtR 173
	mcall	37,2
174
	test	al,001b
175
	jnz	LButtonPress
176
	test	al,010b
177
	jnz	RButtonPress
178
	jmp	messages
3853 GerdtR 179
 
180
ErrLoadLibs:
4146 GerdtR 181
	;dps     'Не удалось загрузить необходимые библиотеки'
182
	;debug_newline
183
	jmp	close
3853 GerdtR 184
ErrorStrp:
4146 GerdtR 185
	;dps     'Ошибка открытия iconstrp.png'
186
	;debug_newline
3853 GerdtR 187
close:
4146 GerdtR 188
	mcall	-1
3853 GerdtR 189
 
190
LButtonPress:
4146 GerdtR 191
	stdcall GetNumIcon,[MouseX],[MouseY],-1
3853 GerdtR 192
;int3
4146 GerdtR 193
	cmp	eax,-1
194
	jnz	@f
3853 GerdtR 195
 
196
    WaitLB1:
4146 GerdtR 197
	mcall	37,2
198
	test	al,001b
199
	jz	messages
200
	;Yield
201
	mcall	5,1
202
	jmp	WaitLB1
3853 GerdtR 203
 
204
 
205
     @@:
4146 GerdtR 206
	push	eax
207
	stdcall DrawIcon,eax,1
3853 GerdtR 208
   WaitLB:
4146 GerdtR 209
	mcall	37,2
210
	test	al,001b
211
	jz	endWaitLB
3853 GerdtR 212
 
4146 GerdtR 213
	mcall	37,0
214
	xor	ebx,ebx
215
	mov	bx,ax
216
	shr	eax,16
217
	sub	eax,[MouseX]
218
	jns	@f
219
	neg	eax
3853 GerdtR 220
      @@:
4146 GerdtR 221
	sub	ebx,[MouseY]
222
	jns	@f
223
	neg	ebx
3853 GerdtR 224
      @@:
4146 GerdtR 225
	cmp	[bFixIcons],0
226
	jne	@f
227
	cmp	eax,MIN_NO_MOVING
228
	ja	MovingIcon
229
	cmp	ebx,MIN_NO_MOVING
230
	ja	MovingIcon
3853 GerdtR 231
      @@:
4146 GerdtR 232
	;Yield
233
	mcall	5,1	;Sleep   1
3972 GerdtR 234
 
4146 GerdtR 235
	jmp	WaitLB
3853 GerdtR 236
   endWaitLB:
237
 
4146 GerdtR 238
	mcall	37,0
239
	xor	ebx,ebx
240
	mov	bx,ax
241
	shr	eax,16
242
	mov	ecx,ebx
243
	mov	ebx,eax
244
	mov	[MouseX],ebx
245
	mov	[MouseY],ecx
3853 GerdtR 246
 
4146 GerdtR 247
	stdcall GetNumIcon,[MouseX],[MouseY],-1
248
	cmp	eax,[esp]	;[esp] = номер иконки
249
	jne	@f
3853 GerdtR 250
 
4146 GerdtR 251
	mov	edi,[IconsOffs+eax*4]
252
	or	ecx,-1
253
	xor	al,al
254
	repne	scasb
255
	mov	ebx,edi
256
	repne	scasb
257
			     ;run program
258
	mov	dword[fiRunProg+8],edi
259
	mov	dword[fiRunProg+21],ebx
260
	mcall	70,fiRunProg
261
	test	eax,80000000h
262
	jz	@f
3853 GerdtR 263
 
4146 GerdtR 264
	mov	dword[fiRunProg+8],ErrRunProg
265
	mov	dword[fiRunProg+21],pthNotify
266
	mcall	70,fiRunProg
3853 GerdtR 267
 
268
     @@:
4146 GerdtR 269
	pop	eax
270
	stdcall RestoreBackgrnd,eax
271
	jmp	messages
3853 GerdtR 272
 
273
;-------------------------------------------------------------------------------
274
MovingIcon:
4146 GerdtR 275
	stdcall GetNumIcon,[MouseX],[MouseY],-1
276
	mov	[SelIcon],eax
277
	mov	[IconNoDraw],eax
278
	stdcall RestoreBackgrnd,[SelIcon]
3853 GerdtR 279
 
280
;        mov     ecx,[MaxNumIcon]
281
;        xor     ebx,ebx
282
;   .MI: push    ecx
283
;        cmp     ebx,[SelIcon]
284
;        je      @f
285
;        stdcall DrawIcon,ebx,0
286
;      @@:
287
;        inc     ebx
288
;        pop     ecx
289
;        loop    .MI
290
 
291
 
292
 
293
;dps 'Moving'
294
;debug_newline
295
;        mov     edi,[SelIcon]
296
;        mov     edi,[IconsOffs+edi*4]
297
;        or      ecx,-1
298
;        xor     al,al
299
;        repne scasb
300
;        repne scasb
301
;        repne scasb
302
;        repne scasb
303
;        xor     ebx,ebx
304
;        xor     esi,esi
305
;        mov     bx,word[edi+2]
306
;        mov     si,word[edi]
307
;        stdcall GetNumIcon,ebx,esi,[SelIcon]
308
;        cmp     eax,-1
309
;        je      @f
310
;  dps 'Q'
311
;        stdcall DrawIcon,eax,0
312
;     @@:
313
;
314
;        add     ebx,ICON_SIZE-1
315
;        stdcall GetNumIcon,ebx,esi,[SelIcon]
316
;        cmp     eax,-1
317
;        je      @f
318
;  dps 'Q'
319
;        stdcall DrawIcon,eax,0
320
;
321
;     @@:
322
;        add     esi,ICON_SIZE-1
323
;        stdcall GetNumIcon,ebx,esi,[SelIcon]
324
;        cmp     eax,-1
325
;        je      @f
326
;  dps 'Q'
327
;        stdcall DrawIcon,eax,0
328
;
329
;     @@:
330
;        sub     ebx,ICON_SIZE-1
331
;        stdcall GetNumIcon,ebx,esi,[SelIcon]
332
;        cmp     eax,-1
333
;        je      @f
334
;   dps 'Q'
335
;        stdcall DrawIcon,eax,0
336
;     @@:
337
 
338
 
339
; Sleep 40
340
 
341
;qweqwe:
342
 
4146 GerdtR 343
	mov    [MovingActiv],1
344
	mcall	51,1,MovingWnd,stack_mov	;CreateThread MovingWnd,stack_dlg
3853 GerdtR 345
   .WaitLB:
4146 GerdtR 346
	mcall	37,2	;GetMouseKey
347
	test	al,001b
348
	jz	.endWaitLB
3853 GerdtR 349
 
4146 GerdtR 350
	;Yield
351
	mcall	5,1	;Sleep 1
352
	jmp	.WaitLB
3853 GerdtR 353
   .endWaitLB:
354
 
4007 GerdtR 355
 
4146 GerdtR 356
	mcall	37,0		;GetMousePos
357
	xor	ebx,ebx
358
	mov	bx,ax
359
	shr	eax,16
3853 GerdtR 360
 
4146 GerdtR 361
	sub	eax,1+ICON_SIZE/2
362
	jnc	@f
363
	xor	eax,eax
364
      @@:
3853 GerdtR 365
 
4146 GerdtR 366
	sub	ebx,ICON_SIZE/2-7
367
	jnc	@f
368
	xor	ebx,ebx
3853 GerdtR 369
      @@:
4146 GerdtR 370
 
371
	cmp	ax,[wsX]
372
	jae	@f
373
	mov	ax,[wsX]
3853 GerdtR 374
      @@:
375
 
4146 GerdtR 376
	cmp	bx,[wsY]
377
	jae	@f
378
	mov	bx,[wsY]
379
      @@:			    ;eax,ebx - реальная координата. Все координаты в проге относительно левого верхнего угла рабочей области
380
 
381
	xor	edx,edx
382
	mov	dx,[wsXe]
383
	sub	edx,ICON_SIZE
384
	cmp	eax,edx
385
	jbe	@f
386
	mov	eax,edx
3853 GerdtR 387
      @@:
388
 
4146 GerdtR 389
	mov	dx,[wsYe]
390
	sub	edx,ICON_SIZE
391
	cmp	ebx,edx
392
	jbe	@f
393
	mov	ebx,edx
3853 GerdtR 394
      @@:
395
 
4146 GerdtR 396
	xor	edx,edx 	     ;преобразовываем в относительные
397
	mov	dx,[wsW]
398
	shr	edx,1
399
	add	dx,[wsX]
400
	cmp	eax,edx
401
	jbe	@f
402
	sub	ax,[wsXe]
403
	inc	ax
404
	jmp	.mov1
3853 GerdtR 405
      @@:
4146 GerdtR 406
	sub	ax,[wsX]
407
    .mov1:
3853 GerdtR 408
 
4146 GerdtR 409
	xor	edx,edx
410
	mov	dx,[wsH]
411
	shr	edx,1
412
	add	dx,[wsY]
413
	cmp	ebx,edx
414
	jbe	@f
415
	sub	bx,[wsYe]
416
	inc	bx
417
	jmp	.mov2
3853 GerdtR 418
      @@:
4146 GerdtR 419
	sub	bx,[wsY]
420
    .mov2:
3853 GerdtR 421
 
4146 GerdtR 422
	stdcall SetPosition,[SelIcon],eax,ebx
3853 GerdtR 423
 
3984 GerdtR 424
 
4146 GerdtR 425
	m2m	[PIcoDB],[BegData]
426
	stdcall [ini_enum_sections],IconIni,Ini_SavePos  ;in RButton.inc
3853 GerdtR 427
 
4146 GerdtR 428
	mov	[bNotSave],1
429
	mov	[IconNoDraw],-1
3853 GerdtR 430
 
4146 GerdtR 431
	mov    [MovingActiv],0		;только теперь отключаем окно с мышью
4007 GerdtR 432
 
4146 GerdtR 433
	jmp	messages
3853 GerdtR 434
 
435
;-------------------------------------------------------------------------------
436
 
437
RButtonPress:
4146 GerdtR 438
	cmp	[RButtonActiv],1
439
	je	messages
440
	mov	[RButtonActiv],1
3853 GerdtR 441
 
442
     @@:
4146 GerdtR 443
	mcall	37,2	;GetMouseKey
444
	test	al,010b
445
	jz	@f
446
	mcall	5,1	;Yield
447
	jmp	@b
3853 GerdtR 448
     @@:
449
 
4146 GerdtR 450
	mcall	51,1,RButtonWin,stack_rmenu	  ;CreateThread RButtonWin,stack_rmenu
3853 GerdtR 451
 
4146 GerdtR 452
	jmp	messages
3853 GerdtR 453
 
454
 
455
;###############################################################################
456
;ret eax = 1/0 = удача/ошибка
457
proc DrawIcon NumIcon:DWORD,Activ:DWORD ;NumIcon = 0..n
4146 GerdtR 458
local	IconData:DWORD
459
	push	ebx edi esi
3853 GerdtR 460
 
4146 GerdtR 461
	mov	ecx,ICON_SIZE*ICON_SIZE
462
	xor	eax,eax
463
	mov	edi,IconArea
464
	rep	stosd
3853 GerdtR 465
 
4146 GerdtR 466
	mov	eax,[NumIcon]
467
	cmp	eax,[MaxNumIcon]
468
	jb	@f
469
	xor	eax,eax
470
	pop	esi edi ebx
471
	ret
3853 GerdtR 472
      @@:
473
 
4146 GerdtR 474
	mov	esi,[IconsOffs+eax*4]
475
	mov	[IconData],esi
3853 GerdtR 476
 
4146 GerdtR 477
			      ;рисуем текст
478
	mov	edi,esi
479
	xor	al,al
480
	or	ecx,-1
481
	repne scasb
482
	mov	edx,esi
483
	mov	eax,edi
484
	sub	eax,esi
485
	dec	eax
486
	shl	eax,1		 ;*6
487
	lea	eax,[eax*2+eax]
488
	mov	ebx,ICON_SIZE
489
	sub	ebx,eax
490
	shr	ebx,1	     ;ebx = x текста
491
	shl	ebx,16
492
	mov	bx,ICON_SIZE
493
	sub	bx,TEXT_BOTTOM_Y
494
	mov	ecx,88000000h
495
	mov	edi,IconAreaH
496
	add	ebx,-1*10000h+0
497
	mcall	4
498
	add	ebx,2*10000h+0
499
	mcall	;4
500
	add	ebx,-1*10000h-1
501
	mcall	;4
502
	add	ebx,0*10000h+2
503
	mcall	;4
504
	add	ebx,1*10000h+0
505
	mcall	;4
506
	inc	ebx;add     ebx,0*10000h+1
507
	mcall	;4
508
	add	ebx,-1*10000h+0
509
	mcall	;4
510
	add	ebx,0*10000h-2
511
	mov	ecx,88FFFFFFh
512
	mcall	;4
513
				    ;рисуем картинку
3853 GerdtR 514
 
4146 GerdtR 515
	mov	edi,esi
516
	xor	al,al
517
	or	ecx,-1
518
	repne	scasb
519
	repne	scasb
520
	repne	scasb
521
	mov	al,[edi]
522
	cmp	al,'9'
523
	ja	PathToIcon
524
	cmp	al,'/'
525
	jne	GetIconInd
3853 GerdtR 526
 
527
   PathToIcon:
4146 GerdtR 528
	mov	al,30h		 ;заглушка!!!!!!!!!!!!!
529
	mov	byte[edi+1],0
3853 GerdtR 530
 
4146 GerdtR 531
	jmp	CopyToMem
3853 GerdtR 532
   GetIconInd:
533
 
4146 GerdtR 534
	sub	al,30h
535
	cmp	byte[edi+1],0
536
	je	@f
537
	shl	eax,1
538
	lea	eax,[eax*4+eax]
539
	xor	edx,edx
540
	mov	dl,[edi+1]
541
	sub	dl,30h
542
	add	eax,edx
543
     @@:	     ;eax=num icon
544
	cmp	eax,[icon_count]
545
	jb	@f
546
	xor	eax,eax
3853 GerdtR 547
     @@:
4146 GerdtR 548
	test	eax,eax
549
	je	DI1
550
	mov	ecx,eax
551
	xor	eax,eax
3853 GerdtR 552
      @@:
4146 GerdtR 553
	add	eax,IMG_SIZE*IMG_SIZE*4
554
	loop	@b
3853 GerdtR 555
     DI1:
4146 GerdtR 556
	add	eax,[raw_pointer]
557
	add	eax,0+4*11
558
	mov	esi,eax
3853 GerdtR 559
 
560
  CopyToMem:
4146 GerdtR 561
	mov	edi,IconArea+((IMAGE_TOP_Y*ICON_SIZE)+((ICON_SIZE-IMG_SIZE)/2))*4
3853 GerdtR 562
 
4146 GerdtR 563
	mov	eax,IMG_SIZE
564
	mov	edx,eax
3853 GerdtR 565
      @@:
4146 GerdtR 566
	mov	ecx,eax
567
	rep	movsd
568
	add	edi,(ICON_SIZE-IMG_SIZE)*4
569
	dec	edx
570
	jnz	@b
3853 GerdtR 571
 
572
;-----------------
4146 GerdtR 573
				;если надо, то рисуем обводку
574
	cmp	[Activ],0
575
	je	.NoSelect
3853 GerdtR 576
 
4146 GerdtR 577
	mov	edi,IconArea
578
	mov	eax,0FF000000h
579
	mov	ecx,ICON_SIZE
580
	rep	stosd
581
	;mov     edi,IconArea+ICON_SIZE*1
3853 GerdtR 582
 
4146 GerdtR 583
	mov	ecx,ICON_SIZE-1
584
    @@: mov	dword[edi],eax
585
	add	edi,(ICON_SIZE)*4
586
	loop	@b
3853 GerdtR 587
 
4146 GerdtR 588
	mov	edi,IconArea+ICON_SIZE*2*4-4
589
	mov	ecx,ICON_SIZE-1
590
    @@: mov	dword[edi],eax
591
	add	edi,(ICON_SIZE)*4
592
	loop	@b
3853 GerdtR 593
 
4146 GerdtR 594
	mov	edi,IconArea+ICON_SIZE*(ICON_SIZE-1)*4+4
595
	mov	ecx,ICON_SIZE-2
596
	rep	stosd
3853 GerdtR 597
 
598
 
4146 GerdtR 599
	mov	edi,IconArea+ICON_SIZE*4+4
600
	mov	eax,0FFFFFFFFh
601
	mov	ecx,ICON_SIZE-2
602
	rep	stosd
3853 GerdtR 603
 
4146 GerdtR 604
	mov	edi,IconArea+ICON_SIZE*4+4
605
	mov	ecx,ICON_SIZE-2
606
    @@: mov	dword[edi],eax
607
	add	edi,(ICON_SIZE)*4
608
	loop	@b
3853 GerdtR 609
 
4146 GerdtR 610
	mov	edi,IconArea+ICON_SIZE*2*4-4*2
611
	mov	ecx,ICON_SIZE-3
612
    @@: mov	dword[edi],eax
613
	add	edi,(ICON_SIZE)*4
614
	loop	@b
3853 GerdtR 615
 
4146 GerdtR 616
	mov	edi,IconArea+ICON_SIZE*(ICON_SIZE-2)*4+4*2
617
	mov	ecx,ICON_SIZE-3
618
	rep	stosd
3853 GerdtR 619
;--------------
620
 
621
   .NoSelect:
4146 GerdtR 622
	mov	edi,[IconData]
623
	xor	al,al
624
	or	ecx,-1
625
	repne	scasb
626
	repne	scasb
627
	repne	scasb
628
	repne	scasb
629
	mov	edx,[edi]
3853 GerdtR 630
 
4146 GerdtR 631
	test	edx,00008000h
632
	jz	@f
633
	add	dx,[wsYe]
634
	jmp	.DI11
3853 GerdtR 635
    @@:
4146 GerdtR 636
	add	dx,[wsY]
637
   .DI11:
638
 
639
	test	edx,80000000h
640
	jz	@f
641
	mov	ax,[wsXe]
642
	shl	eax,16
643
	add	edx,eax
644
	jmp	.DI12
3853 GerdtR 645
    @@:
4146 GerdtR 646
	mov	ax,[wsX]
647
	shl	eax,16
648
	add	edx,eax
649
   .DI12:
3853 GerdtR 650
 
4146 GerdtR 651
	mov	ebx,IconArea
652
	mov	ecx,ICON_SIZE*10000h+ICON_SIZE
653
	mcall	25
3853 GerdtR 654
 
655
;        mov     eax,1
4146 GerdtR 656
	pop	esi edi ebx
657
	ret
3853 GerdtR 658
endp
659
 
660
 
661
 
662
proc RestoreBackgrnd,NumIcon:DWORD
4146 GerdtR 663
	push	ebx edi
664
	mov	eax,[NumIcon]
665
	cmp	eax,[MaxNumIcon]
666
	jb	@f
667
	xor	eax,eax
668
	pop	edi ebx
669
	ret
3853 GerdtR 670
      @@:
671
 
4146 GerdtR 672
	mov	edi,[IconsOffs+eax*4]
673
	xor	al,al
674
	or	ecx,-1
675
	repne	scasb
676
	repne	scasb
677
	repne	scasb
678
	repne	scasb
3853 GerdtR 679
 
4146 GerdtR 680
	mov	ax,[edi+2]
681
	test	ax,8000h
682
	jz	@f
683
	add	ax,[wsXe]
684
	jmp	.rbg1
3853 GerdtR 685
      @@:
4146 GerdtR 686
	add	ax,[wsX]
687
     .rbg1:
3853 GerdtR 688
 
4146 GerdtR 689
	mov	bx,[edi]
690
	test	bx,8000h
691
	jz	@f
692
	add	bx,[wsYe]
693
	jmp	.rbg2
3853 GerdtR 694
      @@:
4146 GerdtR 695
	add	bx,[wsY]
696
     .rbg2:
3853 GerdtR 697
 
4146 GerdtR 698
	mov	cx,ax
699
	shl	ecx,16
700
	add	ax,ICON_SIZE
701
	mov	cx,ax
702
	mov	dx,bx
703
	shl	edx,16
704
	add	bx,ICON_SIZE
705
	mov	dx,bx
706
	dec	ecx
707
	dec	edx
708
	mcall	15,9
709
	pop	edi ebx
710
	ret
3853 GerdtR 711
endp
712
 
713
;ret eax=numIcon
714
proc AddIcon stdcall,x,y,lpIcon,lpName,lpExeFile,lpParams
4146 GerdtR 715
	push	ebx edi esi
3853 GerdtR 716
 
4146 GerdtR 717
	mov	eax,[x]
718
	mov	ebx,[y]
3853 GerdtR 719
 
4146 GerdtR 720
	xor	edx,edx
721
	test	eax,8000h
722
	jnz	@f
723
	mov	dx,[wsW]    ;если надо, то преобразовываем в
724
	shr	edx,1		;отрицательные координаты
725
	add	dx,[wsX]
726
	cmp	eax,edx
727
	jbe	@f
728
	sub	ax,[wsW]
729
	inc	eax
3853 GerdtR 730
      @@:
731
 
4146 GerdtR 732
	test	ebx,8000h
733
	jnz	@f
734
	mov	dx,[wsY]
735
	shr	edx,1
736
	add	dx,[wsH]
737
	cmp	ebx,edx
738
	jbe	@f
739
	sub	bx,[wsH]
740
	inc	ebx
3853 GerdtR 741
      @@:
4146 GerdtR 742
				;поправка на случай выхода за край экрана
3853 GerdtR 743
 
4146 GerdtR 744
	test	eax,8000h
745
	jnz	@f
746
	mov	dx,[wsXe]
747
	sub	edx,ICON_SIZE
748
	cmp	eax,edx
749
	jbe	@f
750
	mov	eax,edx
3853 GerdtR 751
     @@:
752
 
4146 GerdtR 753
	test	ebx,8000h
754
	jnz	@f
755
	mov	dx,[wsYe]
756
	sub	edx,ICON_SIZE
757
	cmp	ebx,edx
758
	jbe	@f
759
	mov	ebx,edx
3853 GerdtR 760
     @@:
761
 
4146 GerdtR 762
	mov	[x],eax
763
	mov	[y],ebx
3853 GerdtR 764
 
4146 GerdtR 765
	xor	al,al
766
	or	ecx,-1
767
	mov	edi,[lpName]
768
	repne	scasb
769
	sub	edi,[lpName]
770
	mov	ebx,edi
771
	mov	edi,[lpExeFile]
772
	repne	scasb
773
	sub	edi,[lpExeFile]
774
	add	ebx,edi
775
	mov	edi,[lpParams]
776
	repne	scasb
777
	sub	edi,[lpParams]
778
	add	ebx,edi
779
	mov	edi,[lpIcon]
780
	repne	scasb
781
	sub	edi,[lpIcon]
782
	add	ebx,edi
783
	add	ebx,4
784
	mov	ecx,dword[SizeData]
785
	add	ecx,ebx
786
	mov	edx,[IconsOffs]
787
	mcall	68,20
3853 GerdtR 788
 
4146 GerdtR 789
	mov	edx,dword[SizeData]
790
	mov	dword[SizeData],ecx
791
	mov	dword[BegData],eax
792
	mov	edi,eax
793
	add	edi,edx
794
	mov	esi,[lpName]
3853 GerdtR 795
    @@: lodsb
4146 GerdtR 796
	stosb
797
	test	al,al
798
	jnz	@b
3853 GerdtR 799
 
4146 GerdtR 800
	mov	esi,[lpExeFile]
3853 GerdtR 801
    @@: lodsb
4146 GerdtR 802
	stosb
803
	test	al,al
804
	jnz	@b
3853 GerdtR 805
 
4146 GerdtR 806
	mov	esi,[lpParams]
3853 GerdtR 807
    @@: lodsb
4146 GerdtR 808
	stosb
809
	test	al,al
810
	jnz	@b
3853 GerdtR 811
 
4146 GerdtR 812
	mov	esi,[lpIcon]
3853 GerdtR 813
    @@: lodsb
4146 GerdtR 814
	stosb
815
	test	al,al
816
	jnz	@b
3853 GerdtR 817
 
4146 GerdtR 818
	mov	eax,[x]
819
	mov	ebx,[y]
820
	shl	eax,16
821
	mov	ax,bx
822
	mov	dword[edi],eax
3853 GerdtR 823
 
4146 GerdtR 824
	stdcall FillIconsOffs
3853 GerdtR 825
 
4146 GerdtR 826
	pop	esi edi ebx
827
	ret
3853 GerdtR 828
endp
829
 
830
 
831
proc EditIcon stdcall,NumIcon,lpIcon,lpName,lpExeFile,lpParams
4146 GerdtR 832
	push	edi
833
	mov	eax,[NumIcon]
834
	mov	edi,[IconsOffs+eax*4]
835
	xor	al,al
836
	or	ecx,-1
837
	repne	scasb
838
	repne	scasb
839
	repne	scasb
840
	repne	scasb
841
	push	dword[edi]
842
	stdcall DelIcon,[NumIcon]
843
	pop	edx
844
	xor	eax,eax
845
	mov	ax,dx
846
	shr	edx,16
847
	stdcall AddIcon,edx,eax,DAreaIcon,DAreaName,DAreaPath,DAreaParams
848
	pop	edi
849
	ret
3853 GerdtR 850
endp
851
 
852
proc SetPosition stdcall,NumIcon,x,y
4146 GerdtR 853
	push	edi
854
	mov	eax,[NumIcon]
855
	mov	edi,[IconsOffs+eax*4]
856
	xor	al,al
857
	or	ecx,-1
858
	repne	scasb
859
	repne	scasb
860
	repne	scasb
861
	repne	scasb
862
	mov	eax,[x]
863
	shl	eax,16
864
	mov	ax,word[y]
865
	mov	dword[edi],eax
866
	pop	edi
867
	ret
3853 GerdtR 868
endp
869
 
870
proc GetNumIcon stdcall,x,y,NumIconI  ;номер иконки, который проверять не надо или -1
871
local posX:WORD,\
872
      posY:WORD
4146 GerdtR 873
	push	ebx edi
874
	mov	ecx,[MaxNumIcon]
875
	test	ecx,ecx
876
	jnz	@f
877
	or	eax,-1
878
	pop	edi ebx
879
	ret
3853 GerdtR 880
     @@:
881
 
4146 GerdtR 882
	mov	ebx,ecx
883
	dec	ebx
3853 GerdtR 884
   .TestIcon:
4146 GerdtR 885
	cmp	dword[NumIconI],-1
886
	je	@f
3853 GerdtR 887
 
4146 GerdtR 888
	cmp	ebx,[NumIconI]
889
	jne	@f
890
	dec	ebx
891
	dec	ecx
892
	test	ecx,ecx
893
	jz	.NoIcon
3853 GerdtR 894
     @@:
895
 
4146 GerdtR 896
	push	ecx
3853 GerdtR 897
 
4146 GerdtR 898
	or	ecx,-1
899
	xor	al,al
900
	mov	edi,[IconsOffs+ebx*4]
901
	repne	scasb
902
	repne	scasb
903
	repne	scasb
904
	repne	scasb
3853 GerdtR 905
 
4146 GerdtR 906
	mov	ax,[edi+2]
907
	test	ax,8000h
908
	jz	@f
909
	add	ax,[wsXe]
910
	jmp	.gni1
3853 GerdtR 911
      @@:
4146 GerdtR 912
	add	ax,[wsX]
913
     .gni1:
914
	mov	[posX],ax
3853 GerdtR 915
 
4146 GerdtR 916
	mov	ax,[edi]
917
	test	ax,8000h
918
	jz	@f
919
	add	ax,[wsYe]
920
	jmp	.gni2
3853 GerdtR 921
      @@:
4146 GerdtR 922
	add	ax,[wsY]
923
     .gni2:
3853 GerdtR 924
 
4146 GerdtR 925
	mov	[posY],ax
3853 GerdtR 926
 
4146 GerdtR 927
	mov	eax,[x]
928
	mov	edx,[y]
3853 GerdtR 929
 
4146 GerdtR 930
	cmp	ax,[posX]
931
	jb	@f
932
	add	word[posX],ICON_SIZE
933
	cmp	ax,[posX]
934
	ja	@f
3853 GerdtR 935
 
4146 GerdtR 936
	cmp	dx,[posY]
937
	jb	@f
938
	add	word[posY],ICON_SIZE
939
	cmp	dx,[posY]
940
	ja	@f
941
 
942
	jmp	.OkIcon
3853 GerdtR 943
     @@:
944
 
4146 GerdtR 945
	dec	ebx
946
	pop	ecx
3853 GerdtR 947
 
4146 GerdtR 948
	;loop    .TestIcon
949
	dec	ecx
950
	jnz	.TestIcon
951
	jmp	.NoIcon
3853 GerdtR 952
   .OkIcon:
4146 GerdtR 953
	mov	eax,ebx
954
	pop	edi ebx
955
	ret
3853 GerdtR 956
   .NoIcon:
4146 GerdtR 957
	or	eax,-1
958
	pop	edi ebx
959
	ret
3853 GerdtR 960
endp
961
 
962
proc DelIcon stdcall,NumIcon
4146 GerdtR 963
	push	ebx edi esi
3853 GerdtR 964
 
4146 GerdtR 965
	cmp	[MaxNumIcon],0
966
	je	.end
3853 GerdtR 967
 
4146 GerdtR 968
	cmp	[MaxNumIcon],1
969
	je	.OhneIco
3853 GerdtR 970
 
4146 GerdtR 971
	mov	ebx,[NumIcon]
3853 GerdtR 972
 
4146 GerdtR 973
	mov	eax,[MaxNumIcon]
974
	dec	eax
975
	mov	[MaxNumIcon],eax
976
	cmp	ebx,eax
977
	je	@f
3853 GerdtR 978
 
4146 GerdtR 979
	shl	ebx,2
3853 GerdtR 980
 
4146 GerdtR 981
	mov	ecx,dword[BegData]
982
	add	ecx,dword[SizeData]
983
	sub	ecx,[IconsOffs+4+ebx]
3853 GerdtR 984
 
4146 GerdtR 985
	mov	edx,[IconsOffs+4+ebx]
986
	sub	edx,[IconsOffs+ebx]
987
	sub	dword[SizeData],edx
3853 GerdtR 988
 
4146 GerdtR 989
	mov	esi,[IconsOffs+4+ebx]
990
	mov	edi,[IconsOffs+ebx]
991
	rep	movsb
992
	jmp	.endDel
3853 GerdtR 993
 
994
     @@:
4146 GerdtR 995
	mov	ecx,dword[BegData]
996
	add	ecx,dword[SizeData]
997
	sub	ecx,[IconsOffs+ebx*4]
998
	sub	dword[SizeData],ecx
3853 GerdtR 999
 
1000
  .endDel:
4146 GerdtR 1001
	stdcall FillIconsOffs
1002
	jmp	.end
3853 GerdtR 1003
 
1004
.OhneIco:
4146 GerdtR 1005
	mov	edi,[BegData]
1006
	mov	[SizeData],0
1007
	mov	dword[edi],0
1008
	mov	[MaxNumIcon],0
1009
	mov	dword[IconsOffs],0
3853 GerdtR 1010
   .end:
4146 GerdtR 1011
	mcall	15,3
1012
	pop	esi edi ebx
1013
	ret
3853 GerdtR 1014
endp
4146 GerdtR 1015
				 ;заполняет MaxNumIcon,IconsOffs
3853 GerdtR 1016
proc FillIconsOffs
4146 GerdtR 1017
	push	ebx edi
1018
	mov	edi,[BegData]
1019
	mov	dword[MaxNumIcon],0
1020
	cmp	dword[edi],0
1021
	jne	@f
1022
	mov	dword[IconsOffs],0
1023
	pop	edi ebx
1024
	ret
3853 GerdtR 1025
    @@:
1026
 
4146 GerdtR 1027
	mov	[IconsOffs],edi
1028
	xor	al,al
1029
	xor	edx,edx
1030
	mov	ebx,dword[SizeData]
1031
	add	ebx,dword[BegData]
1032
	or	ecx,-1
3853 GerdtR 1033
 .CalcNumIc:
4146 GerdtR 1034
	repne	scasb
1035
	repne	scasb
1036
	repne	scasb
1037
	repne	scasb
1038
	add	edi,4
1039
	mov	dword[IconsOffs+edx+4],edi
1040
	inc	dword[MaxNumIcon]
1041
	add	edx,4
3853 GerdtR 1042
 
4146 GerdtR 1043
	cmp	edi,ebx
1044
	jae	@f
1045
	jmp	.CalcNumIc
3853 GerdtR 1046
   @@:
1047
 
4146 GerdtR 1048
	mov	dword[IconsOffs+edx],0
1049
	pop	edi ebx
1050
	ret
3853 GerdtR 1051
endp
1052
 
1053
proc LoadIconsData stdcall,f_name,sec_name
4146 GerdtR 1054
	push	ebx esi edi
3853 GerdtR 1055
 
4146 GerdtR 1056
	mov	edi,secRButt
1057
	mov	esi,[sec_name]
3853 GerdtR 1058
    @@: lodsb
4146 GerdtR 1059
	scasb
1060
	jnz	.lid1
1061
	test	al,al
1062
	jnz	@b
3853 GerdtR 1063
 
4146 GerdtR 1064
	mov	eax,1
1065
	pop	edi esi ebx
1066
	ret
3853 GerdtR 1067
     .lid1:
1068
 
4146 GerdtR 1069
	mov	edi,[PIcoDB]
1070
	mov	esi,[sec_name]
3853 GerdtR 1071
    @@: lodsb
4146 GerdtR 1072
	stosb
1073
	test	al,al
1074
	jnz	@b
3853 GerdtR 1075
 
4146 GerdtR 1076
	stdcall [ini_get_str],[f_name],[sec_name],keyPath,edi,4096,0
1077
	test	eax,eax
1078
	jz	@f
1079
	xor	eax,eax
1080
	pop	edi esi ebx
1081
	ret
3853 GerdtR 1082
     @@:
4146 GerdtR 1083
	xor	al,al
1084
	or	ecx,-1
1085
	repne	scasb
3853 GerdtR 1086
 
4146 GerdtR 1087
	stdcall [ini_get_str],[f_name],[sec_name],keyParams,edi,4096,0
1088
	test	eax,eax
1089
	jz	@f
1090
	xor	eax,eax
1091
	pop	edi esi ebx
1092
	ret
3853 GerdtR 1093
     @@:
4146 GerdtR 1094
	xor	al,al
1095
	or	ecx,-1
1096
	repne	scasb
3853 GerdtR 1097
 
4146 GerdtR 1098
	stdcall [ini_get_str],[f_name],[sec_name],keyIco,edi,4096,0
1099
	test	eax,eax
1100
	jz	@f
1101
	xor	eax,eax
1102
	pop	edi esi ebx
1103
	ret
3853 GerdtR 1104
     @@:
4146 GerdtR 1105
	xor	al,al
1106
	or	ecx,-1
1107
	repne	scasb
3853 GerdtR 1108
 
4146 GerdtR 1109
	stdcall [ini_get_int],[f_name],[sec_name],keyX,80000000h
1110
	cmp	eax,80000000h
1111
	jne	@f
1112
	xor	eax,eax
1113
	pop	edi esi ebx
1114
	ret
3853 GerdtR 1115
     @@:
4146 GerdtR 1116
	mov	word[edi+2],ax
3853 GerdtR 1117
 
4146 GerdtR 1118
	stdcall [ini_get_int],[f_name],[sec_name],keyY,80000000h
1119
	cmp	eax,80000000h
1120
	jne	@f
1121
	xor	eax,eax
1122
	pop	edi esi ebx
1123
	ret
3853 GerdtR 1124
     @@:
4146 GerdtR 1125
	mov	word[edi],ax
1126
	add	edi,4
1127
	mov	[PIcoDB],edi
3853 GerdtR 1128
 
4146 GerdtR 1129
	mov	eax,1
1130
	pop	edi esi ebx
1131
	ret
3853 GerdtR 1132
endp
1133
 
4003 GerdtR 1134
include 'bgredraw.inc'
3853 GerdtR 1135
include 'RButton.inc'
1136
include 'DlgAdd.inc'
1137
include 'Moving.inc'
1138
 
1139
;'Eolite',0,'/sys/File managers/eolite',0,'/hd0/3/Muzik',0,'1',0,00010001h
1140
;-------------------------------------------------------------------------------
1141
;##### DATA ####################################################################
1142
;-------------------------------------------------------------------------------
1143
; not change this section!!!
1144
; start section
1145
;------------------------------------------------------------------------------
1146
align 4
1147
image_file     dd 0 ;+0
1148
raw_pointer    dd 0 ;+4
1149
return_code    dd 0 ;+8
1150
img_size       dd 0 ;+12
1151
deflate_unpack dd 0 ;+16        ; not use for scaling
1152
raw_pointer_2  dd 0 ;+20        ; not use for scaling
1153
;------------------------------------------------------------------------------
1154
; end section
1155
;------------------------------------------------------------------------------
1156
 
1157
 
1158
align 4
1159
fiStdIco:
4146 GerdtR 1160
	dd 5
1161
	dd 0
1162
	dd 0
1163
.size	dd 0
1164
.point	dd bufStdIco
1165
	db ICON_STRIP,0
3853 GerdtR 1166
 
1167
 
1168
align 4
4146 GerdtR 1169
fiRunProg:	      ;для запуска программ
1170
	dd 7
1171
	dd 0
1172
	dd 0
1173
	dd 0
1174
	dd ErrNotFoundIni
1175
	db 0
1176
	dd pthNotify
3853 GerdtR 1177
 
4146 GerdtR 1178
fiIni	dd 5	       ;для ini файла
1179
	dd 0
1180
	dd 0
1181
	dd 0
1182
	dd bufIni
1183
	db '/rd/1/settings/icon.ini',0
3853 GerdtR 1184
 
1185
 
4146 GerdtR 1186
IconsFile	db ICON_STRIP,0
1187
NameIconsDat	db ICONS_DAT,0
3853 GerdtR 1188
align 4
4146 GerdtR 1189
MaxNumIcon	dd 0	       ;количество иконок
1190
IconNoDraw	dd -1		;-1 либо номер иконки, которую не надо рисовать( когда её таскают :))
3853 GerdtR 1191
 
4146 GerdtR 1192
bFixIcons	dd 1
1193
bNotSave	dd 0
3853 GerdtR 1194
 
4146 GerdtR 1195
LButtonActiv	dd 0
1196
RButtonActiv	dd 0
1197
MovingActiv	dd 0
1198
DlgAddActiv	dd 0
3853 GerdtR 1199
 
4146 GerdtR 1200
IconIni 	db '/rd/1/settings/icon.ini',0
3853 GerdtR 1201
 
4146 GerdtR 1202
pthNotify	db '/rd/1/@notify',0
3853 GerdtR 1203
 
1204
;keyName         db 'name',0
4146 GerdtR 1205
keyPath 	db 'path',0
1206
keyParams	db 'param',0
1207
keyIco		db 'ico',0
1208
keyX		db 'x',0
1209
keyY		db 'y',0
3853 GerdtR 1210
 
1211
;-------------------------------------------------------------------------------
1212
IMPORTS:
1213
library cnv_png,'cnv_png.obj',\
4146 GerdtR 1214
	archiver,'archiver.obj',\
1215
	box_lib,'box_lib.obj',\
1216
	proc_lib,'proc_lib.obj',\
1217
	libini,'libini.obj'
3853 GerdtR 1218
 
4146 GerdtR 1219
import	cnv_png,\
1220
	cnv_png_import.Start,'START',\
1221
	cnv_png_import.Version,'version',\
1222
	cnv_png_import.Check,'Check_Header',\
1223
	cnv_png_import.Assoc,'Associations'
3853 GerdtR 1224
 
4146 GerdtR 1225
import	archiver,\
1226
	unpack_DeflateUnpack2,'deflate_unpack2'
3853 GerdtR 1227
 
4146 GerdtR 1228
import	box_lib,\
1229
	edit_box_draw,'edit_box',\
1230
	edit_box_key,'edit_box_key',\
1231
	edit_box_mouse,'edit_box_mouse',\
1232
	scrollbar_h_draw,'scrollbar_h_draw',\
1233
	scrollbar_h_mouse,'scrollbar_h_mouse'
3853 GerdtR 1234
 
4146 GerdtR 1235
import	proc_lib,\
1236
	OpenDialog_Init,'OpenDialog_init',\
1237
	OpenDialog_Start,'OpenDialog_start'
3853 GerdtR 1238
 
4146 GerdtR 1239
import	libini,\
1240
	ini_enum_sections,'ini_enum_sections',\
1241
	ini_enum_keys,'ini_enum_keys',\
1242
	ini_get_str,'ini_get_str',\
1243
	ini_set_str,'ini_set_str',\
1244
	ini_get_color,'ini_get_color',\
1245
	ini_get_int,'ini_get_int',\
1246
	ini_set_int,'ini_set_int',\
1247
	ini_del_section,'ini_del_section'
3853 GerdtR 1248
 
1249
 
1250
;ini.get_str (f_name, sec_name, key_name, buffer, buf_len, def_val)
1251
;ini.set_str (f_name, sec_name, key_name, buffer, buf_len)
1252
 
1253
 
1254
;-------------------------------------------------------------------------------
1255
;----- RButton.inc -------------------------------------------------------------
1256
;-------------------------------------------------------------------------------
4146 GerdtR 1257
secRButt	db 'rbmenu',0
3853 GerdtR 1258
 
4146 GerdtR 1259
PredItem	dd -1
4036 GerdtR 1260
 
3853 GerdtR 1261
if lang eq ru
4082 GerdtR 1262
 RMenuRedrawFon db 'Перерисовать',0
4146 GerdtR 1263
 RMenuAlign	db 'Выровнять по сетке',0
4036 GerdtR 1264
 RMenuOffMoving db 'Закрепить иконки',0
4146 GerdtR 1265
 RMenuOnMoving	db 'Открепить иконки',0
1266
 RMenuAdd	db 'Добавить',0
1267
 RMenuDel	db 'Удалить',0
1268
 RMenuProp	db 'Свойства',0
3853 GerdtR 1269
else
4091 GerdtR 1270
 RMenuRedrawFon db 'Redraw',0
4146 GerdtR 1271
 RMenuAlign	db 'Snap to Grid',0
4036 GerdtR 1272
 RMenuOffMoving db 'Fix the icons',0
4146 GerdtR 1273
 RMenuOnMoving	db 'Unfix the icons',0
1274
 RMenuAdd	db 'Add',0
1275
 RMenuDel	db 'Delete',0
1276
 RMenuProp	db 'Properties',0
3853 GerdtR 1277
end if
1278
 
1279
if lang eq ru
4146 GerdtR 1280
 ErrRunProg	db 'Ошибка запуска программы',0
1281
 WarningSave	db 'Не забудьте сохранить изменения, запустить RDSave',0
3853 GerdtR 1282
 ErrNotFoundIni db 'Не найден icon.ini',0
4146 GerdtR 1283
 ErrName	db 'Имя "rbmenu" зарезервировано',0
3853 GerdtR 1284
else
4146 GerdtR 1285
 ErrRunProg	db 'Error runing program',0
1286
 WarningSave	db 'Do not forget to save the changes, run the RDSave',0
3853 GerdtR 1287
 ErrNotFoundIni db 'icon.ini not found',0
4146 GerdtR 1288
 ErrName	db 'The name "rbmenu" reserved',0
3853 GerdtR 1289
end if
1290
 
1291
;-------------------------------------------------------------------------------
1292
;------- AddDlg.inc ---------------------------------------------------------------
1293
;-------------------------------------------------------------------------------
1294
if lang eq ru
4146 GerdtR 1295
DTitleAdd	db 'Добавить иконку',0
1296
DTitleProp	db 'Изменить иконку',0
3853 GerdtR 1297
 
4146 GerdtR 1298
DCaptName	db 'Имя',0
1299
DCaptPath	db 'Путь',0
1300
DCaptParams	db 'Параметры',0
1301
DCaptIcon	db 'Иконка',0
3962 GerdtR 1302
;DCaptChange     db '.',0
4146 GerdtR 1303
DCaptCreate	db 'Создать',0
3853 GerdtR 1304
DCaptProperties db 'Изменить',0
4146 GerdtR 1305
DCaptCancel	db 'Отменить',0
3853 GerdtR 1306
 
1307
else
4146 GerdtR 1308
DTitleAdd	db 'Add icon',0
1309
DTitleProp	db 'Change icon',0
3853 GerdtR 1310
 
4146 GerdtR 1311
DCaptName	db 'Name',0
1312
DCaptPath	db 'Path',0
1313
DCaptParams	db 'Parameters',0
1314
DCaptIcon	db 'Icon',0
1315
DCaptCreate	db 'Create',0
3853 GerdtR 1316
DCaptProperties db 'Change',0
4146 GerdtR 1317
DCaptCancel	db 'Cancel',0
3853 GerdtR 1318
end if
1319
 
1320
;/не менять положение
1321
edtName    edit_box NAME_LENGTH*6+4,70+20+IMG_SIZE,6,0FFFFFFh,06F9480h,0FFh,0h,0,NAME_LENGTH,\
4146 GerdtR 1322
		DAreaName,mouse_dd,0,0,0
3853 GerdtR 1323
edtExePath edit_box 281-3-20-IMG_SIZE,70+20+IMG_SIZE,26,0FFFFFFh,06F9480h,0FFh,0h,0,256,\
4146 GerdtR 1324
		DAreaPath,mouse_dd,0,0,0
3853 GerdtR 1325
edtParams  edit_box 295-20-IMG_SIZE,70+20+IMG_SIZE,46,0FFFFFFh,06F9480h,0FFh,0h,0,256,\
4146 GerdtR 1326
		DAreaParams,mouse_dd,0,0,0
3853 GerdtR 1327
edtIcon    edit_box 295-20-IMG_SIZE,70+20+IMG_SIZE,66,0FFFFFFh,06F9480h,0FFh,0h,0,256,\
4146 GerdtR 1328
		DAreaIcon,mouse_dd,0,0,0
3853 GerdtR 1329
endEdits:
1330
;\
1331
 
1332
sbIcons:
4146 GerdtR 1333
	     dw END_ICONS_AREAW-ICONSX
1334
	     dw ICONSX
1335
	     dw 15
1336
	     dw END_ICONS_AREAH+3
1337
	     dd 0
1338
	     dd 1
3853 GerdtR 1339
 .max_area   dd 0
1340
 .cur_area   dd ICONS_DRAW_COUNTW
1341
 .position   dd 0
1342
 .bckg_col   dd 0
1343
 .frnt_col   dd 0
1344
 .line_col   dd 0
1345
 .redraw     dd 0
1346
 .delta      dd 0
1347
 .delta2     dd 0
1348
 .r_size_x   dw 0
1349
 .r_start_x  dw 0
1350
 .r_size_y   dw 0
4091 GerdtR 1351
 
3853 GerdtR 1352
 .r_start_y  dw 0
1353
 .m_pos      dd 0
1354
 .m_pos2     dd 0
1355
 .m_keys     dd 0
1356
 .run_size   dd 0
1357
 .position2  dd 0
1358
 .work_size  dd 0
1359
 .all_redraw dd 0
1360
 .ar_offset  dd 0
1361
 
1362
;-------------------------------------------------------------------------------
1363
OpenDialog_data:
4146 GerdtR 1364
.type			dd 0
1365
.procinfo		dd RBProcInfo	    ;+4
1366
.com_area_name		dd communication_area_name	;+8
1367
.com_area		dd 0	;+12
1368
.opendir_pach		dd temp_dir_pach	;+16
1369
.dir_default_pach	dd communication_area_default_pach	;+20
1370
.start_path		dd open_dialog_path	;+24
1371
.draw_window		dd DRedrawWin;draw_window_for_OD   ;+28
1372
.status 		dd 0	;+32
1373
.openfile_pach		dd DAreaPath;fname_Info   ;+36
1374
.filename_area		dd 0;DAreaPath        ;+40
1375
.filter_area		dd Filter
3853 GerdtR 1376
.x:
4146 GerdtR 1377
.x_size 		dw 420 ;+48 ; Window X size
1378
.x_start		dw 100 ;+50 ; Window X position
3853 GerdtR 1379
.y:
4146 GerdtR 1380
.y_size 		dw 320 ;+52 ; Window y size
1381
.y_start		dw 100 ;+54 ; Window Y position
3853 GerdtR 1382
 
1383
communication_area_name:
4146 GerdtR 1384
	db 'FFFFFFFF_open_dialog',0
3853 GerdtR 1385
open_dialog_path:
4146 GerdtR 1386
	db '/sys/File managers/opendial',0
3853 GerdtR 1387
 
1388
communication_area_default_pach:
4146 GerdtR 1389
	db '/sys',0
3853 GerdtR 1390
 
4146 GerdtR 1391
Filter	dd 0
3853 GerdtR 1392
 
1393
;open_dialog     db 0
1394
;-------------------------------------------------------------------------------
1395
 
1396
;/не разделять
1397
align 4
4146 GerdtR 1398
IconAreaH	dd ICON_SIZE,ICON_SIZE
3853 GerdtR 1399
I_END:
1400
;##### UDATA ###################################################################
4146 GerdtR 1401
IconArea	rb 4*ICON_SIZE*ICON_SIZE
3853 GerdtR 1402
;\
1403
 
4146 GerdtR 1404
sc		system_colors
1405
sc.workL	rd 1
1406
sc.workH	rd 1
4007 GerdtR 1407
 
4027 GerdtR 1408
align 4
3853 GerdtR 1409
 
4146 GerdtR 1410
ScreenW 	rw 1
1411
ScreenH 	rw 1
1412
wsX		rw 1
1413
wsY		rw 1
1414
wsXe		rw 1
1415
wsYe		rw 1
1416
wsW		rw 1
1417
wsH		rw 1
3853 GerdtR 1418
 
1419
 
4146 GerdtR 1420
MouseX		rd 1
1421
MouseY		rd 1
3853 GerdtR 1422
 
4146 GerdtR 1423
RBSlot		rd 1
3853 GerdtR 1424
 
4146 GerdtR 1425
AddX		rd 1
1426
AddY		rd 1
3853 GerdtR 1427
 
4146 GerdtR 1428
SelIcon 	rd 1
1429
DlgSelIcon	rd 1
1430
slotDlgAdd	rd 1
1431
DlgBufImg	rb IMG_SIZE*IMG_SIZE*3
3853 GerdtR 1432
 
3962 GerdtR 1433
 
4146 GerdtR 1434
bufStdIco	rb 40
1435
IconsOffs	rd 100
1436
PIcoDB		rd 1
1437
 
1438
 
3853 GerdtR 1439
align 4
4146 GerdtR 1440
icon_count	rd 1
1441
strip_file	rd 1
3853 GerdtR 1442
strip_file_size rd 1
1443
 
1444
cur_band_compensation rd 1
1445
 
1446
;---- RButton -----------------------------------------------------------------------
4146 GerdtR 1447
MinRMenuW	rd 1
4082 GerdtR 1448
 
4146 GerdtR 1449
bufIni		rb 40
1450
NumMenuButt	rd 1
1451
RBMenuCP	rd MAX_USER_BUTTONS*2	      ;указатели на подпись и путь с прогой (Caption(dd), Path(dd)) и запасной (dd) для завершающего нуля
1452
RMenuW		rw 1
1453
RMenuH		rw 1
3853 GerdtR 1454
 
4146 GerdtR 1455
MaxPage 	rd 1
1456
mouse_dd	rd 1
3853 GerdtR 1457
 
4146 GerdtR 1458
DAreaName	rb NAME_LENGTH+1
1459
DAreaPath	rb 256+1
1460
DAreaParams	rb 256+1
1461
DAreaIcon	rb 256+1
3853 GerdtR 1462
 
1463
align 4
4146 GerdtR 1464
RBProcInfo	rb 1024
3962 GerdtR 1465
align 4
3853 GerdtR 1466
 
4036 GerdtR 1467
 
1468
;------ OpenDialog -------------------------------
4146 GerdtR 1469
temp_dir_pach	rb 1024
1470
fname_Info	rb 1024
4036 GerdtR 1471
 
3853 GerdtR 1472
;-------------------------------------------------------------------------------
4146 GerdtR 1473
		rb 512
1474
stack_mov:			;одновременно таскать и держать открытым менюшку невозможно
4036 GerdtR 1475
stack_rmenu:
4146 GerdtR 1476
		rb 512
3853 GerdtR 1477
stack_dlg:
4146 GerdtR 1478
		rb 512
3972 GerdtR 1479
stack_bredraw:
4146 GerdtR 1480
		rb 512
4036 GerdtR 1481
stack_main:
3853 GerdtR 1482
;------------------------------------------------------------------------------
1483
ENDMEM: