Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
4146 GerdtR 1
idbChange	equ 2
2
idbCreate	equ 3
3
idbLeft 	equ 4
4
idbRight	equ 5
5
idbCancel	equ 1
3853 GerdtR 6
 
7
DlgAdd:
8
DlgProp:
3921 mario79 9
 
4146 GerdtR 10
	mov	eax,[SelIcon]
11
	mov	[DlgSelIcon],eax
12
	cmp	eax,-1
13
	jne	SetProp
3853 GerdtR 14
 
4146 GerdtR 15
    ;-----------
16
	mov	eax,[MouseX]
17
	mov	ebx,[MouseY]
3853 GerdtR 18
 
4146 GerdtR 19
	cmp	ax,[wsX]
20
	jae	@f
21
	mov	ax,[wsX]
22
      @@:
3853 GerdtR 23
 
4146 GerdtR 24
	cmp	bx,[wsY]
25
	jae	@f
26
	mov	bx,[wsY]
27
      @@:			    ;eax,ebx - реальная координата. Все координаты в проге относительно левого верхнего угла рабочей области
3853 GerdtR 28
 
4146 GerdtR 29
	xor	edx,edx
30
	mov	dx,[wsXe]
31
	sub	edx,ICON_SIZE
32
	cmp	eax,edx
33
	jbe	@f
34
	mov	eax,edx
35
      @@:
3853 GerdtR 36
 
4146 GerdtR 37
	mov	dx,[wsYe]
38
	sub	edx,ICON_SIZE
39
	cmp	ebx,edx
40
	jbe	@f
41
	mov	ebx,edx
42
      @@:
3853 GerdtR 43
 
4146 GerdtR 44
	xor	edx,edx 	     ;преобразовываем в относительные
45
	mov	dx,[wsW]
46
	shr	edx,1
47
	add	dx,[wsX]
48
	cmp	eax,edx
49
	jbe	@f
50
	sub	ax,[wsXe]
51
	inc	ax
52
	jmp	.dlg1
53
      @@:
54
	sub	ax,[wsX]
55
    .dlg1:
56
 
57
	xor	edx,edx
58
	mov	dx,[wsH]
59
	shr	edx,1
60
	add	dx,[wsY]
61
	cmp	ebx,edx
62
	jbe	@f
63
	sub	bx,[wsYe]
64
	inc	bx
65
	jmp	.dlg2
66
      @@:
67
	sub	bx,[wsY]
68
    .dlg2:
69
 
70
	mov	[AddX],eax
71
	mov	[AddY],ebx
72
    ;-----------
73
 
74
	mov	ecx,NAME_LENGTH
75
	mov	edi,DAreaName
76
	xor	al,al
77
	rep	stosb
78
	mov	dword[edtName.size],0
79
	mov	dword[edtName.pos],0
80
 
81
	mov	ecx,256
82
	mov	edi,DAreaPath
83
	rep	stosb
84
	mov	dword[edtExePath.size],0
85
	mov	dword[edtExePath.pos],0
86
 
87
	mov	ecx,256
88
	mov	edi,DAreaParams
89
	rep	stosb
90
	mov	dword[edtParams.size],0
91
	mov	dword[edtParams.pos],0
92
 
93
	mov	ecx,256
94
	mov	edi,DAreaIcon
95
	rep	stosb
96
	mov	dword[edtIcon.size],0
97
	mov	dword[edtIcon.pos],0
98
 
99
	jmp	startDlg
3853 GerdtR 100
    ;--------
101
SetProp:
4146 GerdtR 102
	mov	esi,[IconsOffs+eax*4]
103
	mov	edi,DAreaName
104
	xor	ecx,ecx
3853 GerdtR 105
     @@:
4146 GerdtR 106
	lodsb
107
	stosb
108
	inc	ecx
109
	test	al,al
110
	jnz	@b
111
	dec	ecx
112
	mov	dword[edtName.size],ecx
113
	mov	dword[edtName.pos],ecx
3853 GerdtR 114
 
4146 GerdtR 115
	xor	ecx,ecx
116
	mov	edi,DAreaPath
3853 GerdtR 117
     @@:
4146 GerdtR 118
	lodsb
119
	stosb
120
	inc	ecx
121
	test	al,al
122
	jnz	@b
123
	dec	ecx
124
	mov	dword[edtExePath.size],ecx
125
	mov	dword[edtExePath.pos],ecx
3853 GerdtR 126
 
4146 GerdtR 127
	xor	ecx,ecx
128
	mov	edi,DAreaParams
3853 GerdtR 129
     @@:
4146 GerdtR 130
	lodsb
131
	stosb
132
	inc	ecx
133
	test	al,al
134
	jnz	@b
135
	dec	ecx
136
	mov	dword[edtParams.size],ecx
137
	mov	dword[edtParams.pos],ecx
3853 GerdtR 138
 
4146 GerdtR 139
	xor	ecx,ecx
140
	mov	edi,DAreaIcon
3853 GerdtR 141
     @@:
4146 GerdtR 142
	lodsb
143
	stosb
144
	inc	ecx
145
	test	al,al
146
	jnz	@b
147
	dec	ecx
148
	mov	dword[edtIcon.size],ecx
149
	mov	dword[edtIcon.pos],ecx
3853 GerdtR 150
 
151
 
152
startDlg:
4146 GerdtR 153
	mcall	9,RBProcInfo,-1
154
	mcall	18,21,dword[RBProcInfo+30]
155
	mov	[slotDlgAdd],eax
3921 mario79 156
 
4146 GerdtR 157
	or	[edtName.flags],ed_focus
3853 GerdtR 158
 
4146 GerdtR 159
	mcall	40,100111b	;SetMaskMessage 100111b
160
	xor	eax,eax
161
	mov	dword[MaxPage],0
3853 GerdtR 162
      @@:
4146 GerdtR 163
	add	eax,ICONS_DRAW_COUNTW
164
	inc	dword[MaxPage]
165
	cmp	eax,[icon_count]
166
	jb	@b
167
	dec	dword[MaxPage]
168
	cmp	dword[MaxPage],0
169
	jne	@f
170
	mov	dword[MaxPage],1
3853 GerdtR 171
      @@:
172
 
173
DReDraw:
4146 GerdtR 174
	mcall	48,3,sc,40
3853 GerdtR 175
 
4146 GerdtR 176
	mov	eax,[sc.work]
177
	rol	eax,16
178
	add	al,9
179
	jnc	@f
180
	mov	al,0FFh
3853 GerdtR 181
      @@:
4146 GerdtR 182
	rol	eax,16
183
	add	al,9
184
	jnc	@f
185
	mov	al,0FFh
3853 GerdtR 186
      @@:
4146 GerdtR 187
	add	ah,9
188
	jnc	@f
189
	mov	ah,0FFh
3853 GerdtR 190
      @@:
191
 
4146 GerdtR 192
	mov	[sbIcons.bckg_col],eax
193
	m2m	[sbIcons.frnt_col],[sc.work]
194
	m2m	[sbIcons.line_col],[sc.work_graph]
3853 GerdtR 195
 
4146 GerdtR 196
	edit_boxes_set_sys_color edtName,edtExePath,sc
197
	edit_boxes_set_sys_color edtExePath,edtParams,sc
198
	edit_boxes_set_sys_color edtParams,edtIcon,sc
199
	;edit_boxes_set_sys_color edtIcon,endEdits,sc
3853 GerdtR 200
 
4146 GerdtR 201
	call	DRedrawWin
3853 GerdtR 202
 
203
DMessages:
4146 GerdtR 204
	mcall	10		;WaitMessage
3853 GerdtR 205
 
4146 GerdtR 206
	dec	eax
207
	jz	DReDraw
208
	dec	eax
209
	jz	DKey
210
	dec	eax
211
	jz	DButton
212
	sub	eax,3
213
	jz	DMouse
3853 GerdtR 214
 
4146 GerdtR 215
	jmp  DMessages
3853 GerdtR 216
 
217
 
218
;---------------------------------------------------------------------
219
DKey:
4146 GerdtR 220
	mcall	2		;GetKeyPressed
221
	cmp	ah,1Bh
222
	je	DExit
223
	cmp	ah,9  ;Tab
224
	je	DNextEdit
225
	stdcall [edit_box_key],edtName
226
	stdcall [edit_box_key],edtExePath
227
	stdcall [edit_box_key],edtParams
228
	;stdcall [edit_box_key],edtIcon
3853 GerdtR 229
 
4146 GerdtR 230
	jmp	DMessages
3853 GerdtR 231
 
232
 
233
DNextEdit:
4146 GerdtR 234
	test	[edtName.flags],ed_focus
235
	jne	 .DNE1
236
	test	[edtExePath.flags],ed_focus
237
	jne	 .DNE2
238
	test	[edtParams.flags],ed_focus
239
	jne	 .DNE3
240
	;test    [edtIcon.flags],ed_focus
241
	;jne      .DNE4
242
	jmp	DMessages
3853 GerdtR 243
 
244
    .DNE1:
4146 GerdtR 245
	and	[edtName.flags],not ed_focus
246
	or	[edtExePath.flags],ed_focus
247
	stdcall [edit_box_draw],edtName
248
	stdcall [edit_box_draw],edtExePath
249
	jmp	DMessages
3853 GerdtR 250
 
251
    .DNE2:
4146 GerdtR 252
	and	[edtExePath.flags],not ed_focus
253
	or	[edtParams.flags],ed_focus
254
	stdcall [edit_box_draw],edtExePath
255
	stdcall [edit_box_draw],edtParams
256
	jmp	DMessages
3853 GerdtR 257
 
258
    .DNE3:
4146 GerdtR 259
	and	[edtParams.flags],not ed_focus
260
	or	[edtName.flags],ed_focus
261
	stdcall [edit_box_draw],edtParams
262
	stdcall [edit_box_draw],edtName
263
	jmp	DMessages
3853 GerdtR 264
 
4003 GerdtR 265
    ;.DNE4:
266
    ;    and     [edtIcon.flags],not ed_focus
267
    ;    or      [edtName.flags],ed_focus
268
    ;    stdcall [edit_box_draw],edtName
269
    ;    stdcall [edit_box_draw],edtIcon
270
    ;    jmp     DMessages
3853 GerdtR 271
;---------------------------------------------------------------------
272
DButton:
4146 GerdtR 273
	mcall	17		;GetButtonPressed
274
	cmp	ah, idbCancel
275
	je	DExit
276
	cmp	ah,idbChange
277
	je	DSetExePath
278
	cmp	ah,idbCreate
279
	je	DSaveIcon
3853 GerdtR 280
 
4146 GerdtR 281
	jmp	DMessages
3853 GerdtR 282
;-------------------------------------------------------------------------------
283
DMouse:
4146 GerdtR 284
	stdcall [edit_box_mouse],edtName
285
	stdcall [edit_box_mouse],edtExePath
286
	stdcall [edit_box_mouse],edtParams
4003 GerdtR 287
;        stdcall [edit_box_mouse],edtIcon
3853 GerdtR 288
 
4146 GerdtR 289
	push	[sbIcons.position]
290
	stdcall [scrollbar_h_mouse],sbIcons
291
	pop	eax
292
	cmp	eax,[sbIcons.position]
293
	je	@f
294
	call	DrawStdIcons
3853 GerdtR 295
      @@:
296
 
4146 GerdtR 297
	mcall	37,2		;GetMouseKey
298
	test	eax,1
299
	jz	DMessages
300
	mcall	37,1		;GetMouseWinPos
3853 GerdtR 301
 
4146 GerdtR 302
	test	eax,10001000h
303
	jne	DMessages
304
	xor	edx,edx
305
	mov	dx,ax	  ;y
306
	shr	eax,16	  ;x
3853 GerdtR 307
 
4146 GerdtR 308
	sub	eax,ICONSX
309
	js	DMessages
310
	sub	edx,ICONSY
311
	js	DMessages
3853 GerdtR 312
 
4146 GerdtR 313
	cmp	eax,(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW
314
	ja	DMessages
315
	cmp	edx,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH-SPCH
316
	ja	DMessages
3853 GerdtR 317
 
4146 GerdtR 318
	xor	ebx,ebx
319
	mov	ecx,[sbIcons.position]
320
	test	ecx,ecx
321
	jz	.DM
3853 GerdtR 322
     @@:
4146 GerdtR 323
	add	ebx,ICONS_DRAW_COUNTH
324
	loop	@b
3853 GerdtR 325
     .DM:
326
 
4146 GerdtR 327
	sub	eax,IMG_SIZE+SPCW
328
	js     .DM1
3853 GerdtR 329
     @@:
4146 GerdtR 330
	add	ebx,ICONS_DRAW_COUNTH
331
	sub	eax,IMG_SIZE+SPCW
332
	jns	@b
3853 GerdtR 333
     .DM1:
334
 
335
 
4146 GerdtR 336
	sub	edx,IMG_SIZE+SPCH
337
	js     .DM2
3853 GerdtR 338
     @@:
4146 GerdtR 339
	inc	ebx
340
	sub	edx,IMG_SIZE+SPCH
341
	jns	@b
3853 GerdtR 342
     .DM2:
343
 
4146 GerdtR 344
	mov	eax,ebx
3853 GerdtR 345
 
4146 GerdtR 346
	cmp	eax,[icon_count]
347
	jae	DMessages
3853 GerdtR 348
 
4146 GerdtR 349
	mov	bl,10
350
	div	bl
3853 GerdtR 351
 
4146 GerdtR 352
	add	ah,30h
353
	test	al,al
354
	jz	@f
3853 GerdtR 355
 
4146 GerdtR 356
	add	al,30h
357
	mov	byte[DAreaIcon],al
358
	mov	byte[DAreaIcon+1],ah
359
	mov	byte[DAreaIcon+2],0
360
	mov	dword[edtIcon.size],2
361
	jmp	.RedrawNum
3853 GerdtR 362
 
363
      @@:
4146 GerdtR 364
	mov	byte[DAreaIcon],ah
365
	mov	byte[DAreaIcon+1],0
366
	mov	dword[edtIcon.size],1
367
	jmp	.RedrawNum
3853 GerdtR 368
    .RedrawNum:
369
 
370
 
4007 GerdtR 371
      ;  stdcall [edit_box_draw],edtIcon
3853 GerdtR 372
 
373
 
4146 GerdtR 374
	call	DrawSelIcon
375
	jmp	DReDraw;DMessages;
3853 GerdtR 376
;-------------------------------------------------------------------------------
377
DSetExePath:
4146 GerdtR 378
	stdcall [OpenDialog_Start],OpenDialog_data
379
	mov	edi,DAreaPath
380
	xor	al,al
381
	or	ecx,-1
382
	repne	scasb
383
	sub	edi,DAreaPath
384
	dec	edi
385
	mov	dword[edtExePath+12*4],edi
3853 GerdtR 386
 
4146 GerdtR 387
	jmp	DMessages;DReDraw;
3853 GerdtR 388
 
389
DSaveIcon:
4146 GerdtR 390
	mov	edi,DAreaName
391
	mov	esi,secRButt
4003 GerdtR 392
    @@: lodsb
4146 GerdtR 393
	scasb
394
	jne	@f
395
	test	al,al
396
	jnz	@b
4003 GerdtR 397
 
4146 GerdtR 398
	mov	dword[fiRunProg+8],ErrName
399
	mov	dword[fiRunProg+21],pthNotify
400
	mcall	70,fiRunProg
4003 GerdtR 401
 
4146 GerdtR 402
	jmp	DMessages
4003 GerdtR 403
    @@:
4146 GerdtR 404
	mov	dword[fiRunProg+8],WarningSave
405
	mov	dword[fiRunProg+21],pthNotify
406
	mcall	70,fiRunProg
3853 GerdtR 407
 
408
 
4146 GerdtR 409
	cmp	[DlgSelIcon],-1
410
	je	@f
411
		       ;удаляем из ini старую иконку
412
	mov	ebx,[DlgSelIcon]
413
	mov	eax,[IconsOffs+ebx*4]
414
	stdcall [ini_del_section],IconIni,eax
3853 GerdtR 415
 
4146 GerdtR 416
	stdcall EditIcon,[DlgSelIcon],DAreaIcon,DAreaName,DAreaPath,DAreaParams
417
	jmp	DExitAndSave
3853 GerdtR 418
     @@:
4146 GerdtR 419
	stdcall AddIcon,[AddX],[AddY],DAreaIcon,DAreaName,DAreaPath,DAreaParams
420
	;jmp     DExitAndSave
3853 GerdtR 421
;-------------------------------------------------------------------------------
422
DExitAndSave:
423
 
4146 GerdtR 424
	 stdcall [ini_set_str],IconIni,DAreaName,keyPath,DAreaPath,dword[edtExePath.size]
425
	 stdcall [ini_set_str],IconIni,DAreaName,keyParams,DAreaParams,dword[edtParams.size]
426
	 stdcall [ini_set_str],IconIni,DAreaName,keyIco,DAreaIcon,dword[edtIcon.size]
427
	 stdcall [ini_set_int],IconIni,DAreaName,keyX,[MouseX]
428
	 stdcall [ini_set_int],IconIni,DAreaName,keyY,[MouseY]
3853 GerdtR 429
 
430
DExit:
4146 GerdtR 431
	mov	[DlgAddActiv],0
432
	mov	[slotDlgAdd],0
433
	mcall	-1		;ExitThread
3853 GerdtR 434
 
435
;##################################################################
4007 GerdtR 436
proc DRedrawWin
4146 GerdtR 437
	mcall	12,1		;RedrawWinBeg
438
	mov	edx,[sc.work]
439
	or	edx,34000000h
440
	cmp	[DlgSelIcon],-1
441
	jne	 @f
442
	mov	edi,DTitleAdd
443
	jmp	.l1
3962 GerdtR 444
      @@:
4146 GerdtR 445
	mov	edi,DTitleProp
3962 GerdtR 446
      .l1:
4146 GerdtR 447
	mcall	0,<100,400>,<100,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH+165>,,,
3853 GerdtR 448
 
4146 GerdtR 449
	stdcall [edit_box_draw],edtName
450
	stdcall [edit_box_draw],edtExePath
451
	stdcall [edit_box_draw],edtParams
4003 GerdtR 452
;        stdcall [edit_box_draw],edtIcon
3853 GerdtR 453
 
4146 GerdtR 454
	call	DrawStdIcons
3853 GerdtR 455
 
456
 
4146 GerdtR 457
	stdcall [scrollbar_h_draw],sbIcons
458
	mcall	38,,\
459
		   ,\
460
		[sc.work_graph]
461
	mcall	  ,,\
462
		   ,\
463
		[sc.work_graph]
3853 GerdtR 464
 
4146 GerdtR 465
	mcall	  ,,\
466
		   ,\
467
		[sc.work_graph]
468
	mcall	  ,,\
469
		   ,\
470
		[sc.work_graph]
3853 GerdtR 471
 
4146 GerdtR 472
				  ;BUTTONS
473
	mcall	8,<250,49>,<30+END_ICONS_AREAH,16>,idbCreate,[sc.work_button]
474
	mcall	 ,<305,54>,			  ,idbCancel
475
	mcall	 ,<351,14>,<26,14>	       ,idbChange
3853 GerdtR 476
 
4146 GerdtR 477
				  ;CAPTIONS
478
	mov	ecx,[sc.work_text]
479
	or	ecx,80000000h
480
	mcall	4,<30+IMG_SIZE,10>,,DCaptName
481
	mcall	 ,<30+IMG_SIZE,30>,,DCaptPath
482
	mcall	 ,<30+IMG_SIZE,50>,,DCaptParams
483
	;mcall    ,<30+IMG_SIZE,70>,,DCaptIcon
3853 GerdtR 484
 
485
if lang eq ru
4146 GerdtR 486
	mov	ecx,[sc.work_button_text]
487
	or	ecx,80000000h
488
	mcall	 ,<309,35+END_ICONS_AREAH>,,DCaptCancel
3853 GerdtR 489
 
4146 GerdtR 490
	cmp	[DlgSelIcon],-1
491
	jne	@f
492
	mpack	ebx,255,35+END_ICONS_AREAH
493
	mov	edx,DCaptCreate
494
	jmp	.DRD1
3853 GerdtR 495
      @@:
4146 GerdtR 496
	mpack	ebx,252,35+END_ICONS_AREAH
497
	mov	edx,DCaptProperties
3853 GerdtR 498
     .DRD1:
499
else
4146 GerdtR 500
	mov	ecx,[sc.work_button_text]
501
	or	ecx,80000000h
502
	mcall	 ,<315,35+END_ICONS_AREAH>,,DCaptCancel
3853 GerdtR 503
 
504
 
4146 GerdtR 505
	cmp	[DlgSelIcon],-1
506
	jne	@f
507
	mpack	ebx,257,35+END_ICONS_AREAH
508
	mov	edx,DCaptCreate
509
	jmp	.DRD1
3853 GerdtR 510
      @@:
4146 GerdtR 511
	mpack	ebx,257,35+END_ICONS_AREAH
512
	mov	edx,DCaptProperties
3853 GerdtR 513
     .DRD1:
514
end if
4146 GerdtR 515
	mcall
3853 GerdtR 516
 
4146 GerdtR 517
	mcall	1,351+4  ,26+10,[sc.work_button_text]
518
	mcall	 ,351+4+3,26+10,
519
	mcall	 ,351+4+6,26+10,
3853 GerdtR 520
 
4146 GerdtR 521
	call DrawSelIcon
3853 GerdtR 522
 
4146 GerdtR 523
	mcall	12,2		;RedrawWinEnd
524
	ret
3853 GerdtR 525
endp
526
 
527
 
528
proc DrawStdIcons
529
local IcoX:DWORD,\
530
      IcoY:DWORD,\
531
      iIcon:DWORD
532
 
4146 GerdtR 533
	mov	ecx,[sbIcons.position]
534
	xor	eax,eax
535
	m2m	dword[iIcon],0
3853 GerdtR 536
 
4146 GerdtR 537
	test	ecx,ecx
538
	jz	.DST1
3853 GerdtR 539
     @@:
4146 GerdtR 540
	add	[iIcon],ICONS_DRAW_COUNTH
541
	add	eax,IMG_SIZE*IMG_SIZE*4*ICONS_DRAW_COUNTH
542
	loop	@b
3853 GerdtR 543
   .DST1:
544
 
4146 GerdtR 545
	lea	esi,[eax+44]
546
	add	esi,[raw_pointer]
3853 GerdtR 547
 
4146 GerdtR 548
	mov	[IcoX],ICONSX
3853 GerdtR 549
 
4146 GerdtR 550
	mov	ecx,ICONS_DRAW_COUNTW
3853 GerdtR 551
  .DrawIcons:
4146 GerdtR 552
	push	ecx
3853 GerdtR 553
 
4146 GerdtR 554
	mov	[IcoY],ICONSY
3853 GerdtR 555
 
4146 GerdtR 556
	mov	ecx,ICONS_DRAW_COUNTH
3853 GerdtR 557
  .DrawIcoStolb:
4146 GerdtR 558
	push	ecx
3853 GerdtR 559
 
4146 GerdtR 560
	mov	edi,DlgBufImg
561
	mov	edx,IMG_SIZE
3853 GerdtR 562
 
563
    .DrawLine:
564
 
565
 
4146 GerdtR 566
	mov	ecx,IMG_SIZE
3853 GerdtR 567
     .DrawPix:
568
 
4146 GerdtR 569
	lodsd
570
	test	eax,0FF000000h
571
	jnz	@f
572
	mov	eax,[sc.work]
3853 GerdtR 573
     @@:
574
 
4146 GerdtR 575
	mov	[edi],ax
576
	shr	eax,16
577
	mov	[edi+2],al
578
	add	edi,3
3853 GerdtR 579
 
4146 GerdtR 580
	loop	.DrawPix
3853 GerdtR 581
 
4146 GerdtR 582
	dec	edx
583
	jnz    .DrawLine
3853 GerdtR 584
 
4146 GerdtR 585
	mov	edx,[IcoX]
586
	shl	edx,16
587
	mov	dx,word[IcoY]
588
	mcall	7,DlgBufImg,
3853 GerdtR 589
 
4146 GerdtR 590
	inc	[iIcon]
591
	mov	eax,[iIcon]
592
	cmp	eax,[icon_count]
593
	jae	.endDrawIcon
3853 GerdtR 594
 
4146 GerdtR 595
	add	dword[IcoY],IMG_SIZE+SPCH
596
	pop	ecx
597
	loop	.DrawIcoStolb
3853 GerdtR 598
 
4146 GerdtR 599
	add	dword[IcoX],IMG_SIZE+SPCW
600
	pop	ecx
601
	loop	.DrawIcons
602
	jmp	.endProc
3853 GerdtR 603
 
604
    .endDrawIcon:
605
 
4146 GerdtR 606
	mov	ecx,IMG_SIZE*IMG_SIZE
607
	mov	edi,DlgBufImg
608
	mov	eax,[sc.work]
609
	mov	ebx,eax
610
	shr	ebx,16
3853 GerdtR 611
     @@:
4146 GerdtR 612
	mov	word[edi],ax
613
	mov	[edi+2],bl
614
	add	edi,3
615
	loop	@b
3853 GerdtR 616
 
4146 GerdtR 617
				     ;затирание не использованых мест
618
	jmp	.Dalee
3853 GerdtR 619
 
620
  .DrawIcons2:
4146 GerdtR 621
	push	ecx
3853 GerdtR 622
 
4146 GerdtR 623
	mov	[IcoY],ICONSY
624
	mov	ecx,ICONS_DRAW_COUNTH
3853 GerdtR 625
  .DrawIcoStolb2:
4146 GerdtR 626
	push	ecx
3853 GerdtR 627
 
4146 GerdtR 628
	mov	edx,[IcoX]
629
	shl	edx,16
630
	mov	dx,word[IcoY]
631
	mcall	7,DlgBufImg,
3853 GerdtR 632
 
633
     .Dalee:
4146 GerdtR 634
	add	dword[IcoY],IMG_SIZE+SPCH
635
	pop	ecx
636
	loop	.DrawIcoStolb2
3853 GerdtR 637
 
4146 GerdtR 638
	add	dword[IcoX],IMG_SIZE+SPCW
639
	pop	ecx
640
	loop	.DrawIcons2
3853 GerdtR 641
 
642
   .endProc:
4007 GerdtR 643
 
4146 GerdtR 644
	ret
3853 GerdtR 645
endp
646
 
647
proc DrawSelIcon
4146 GerdtR 648
	mov	edi,DAreaIcon
649
	cmp	byte[edi],0
650
	jne	@f
651
	ret
3853 GerdtR 652
      @@:
653
 
4146 GerdtR 654
	mov	al,[edi]
655
	cmp	al,'9'
656
	ja	.PathToIcon
657
	cmp	al,'/'
658
	jne	.GetIconInd
3853 GerdtR 659
   .PathToIcon:
4146 GerdtR 660
	mov	al,30h		 ;заглушка!!!!!!!!!!!!!
661
	mov	byte[edi+1],0
3853 GerdtR 662
   .GetIconInd:
663
;int3
4146 GerdtR 664
	sub	al,30h
665
	cmp	byte[edi+1],0
666
	je	@f
667
	shl	eax,1
668
	lea	eax,[eax*4+eax]
669
	xor	edx,edx
670
	mov	dl,[edi+1]
671
	sub	dl,30h
672
	add	eax,edx
673
     @@:	     ;eax=num icon
674
	cmp	eax,[icon_count]
675
	jb	@f
676
	xor	eax,eax
3853 GerdtR 677
     @@:
4146 GerdtR 678
	test	eax,eax
679
	je	.DI1
680
	mov	ecx,eax
681
	xor	eax,eax
3853 GerdtR 682
      @@:
4146 GerdtR 683
	add	eax,IMG_SIZE*IMG_SIZE*4
684
	loop	@b
3853 GerdtR 685
     .DI1:
4146 GerdtR 686
	mov	esi,eax
687
	add	esi,[raw_pointer]
688
	add	esi,44
3853 GerdtR 689
 
4146 GerdtR 690
	mov	edi,DlgBufImg
691
	mov	edx,IMG_SIZE
3853 GerdtR 692
    .DrawLine:
693
 
4146 GerdtR 694
	mov	ecx,IMG_SIZE
3853 GerdtR 695
     .DrawPix:
696
 
4146 GerdtR 697
	lodsd
698
	test	eax,0FF000000h
699
	jnz	@f
700
	mov	eax,[sc.work]
3853 GerdtR 701
     @@:
702
 
4146 GerdtR 703
	mov	word[edi],ax
704
	shr	eax,16
705
	mov	[edi+2],al
706
	add	edi,3
3853 GerdtR 707
 
4146 GerdtR 708
	loop	.DrawPix
3853 GerdtR 709
 
4146 GerdtR 710
	dec	edx
711
	jnz	.DrawLine
3853 GerdtR 712
 
4146 GerdtR 713
	mcall	7,DlgBufImg,,<15,15>
3853 GerdtR 714
 
4146 GerdtR 715
	ret
3853 GerdtR 716
endp