Subversion Repositories Kolibri OS

Rev

Rev 4336 | Rev 5439 | 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]
5017 GerdtR 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
 
5017 GerdtR 44
	xor	edx,edx 	     ;преобразовываем в относительные
4146 GerdtR 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 edtIcon,endEdits,sc
5017 GerdtR 197
	edit_boxes_set_sys_color edtName,endEdits,sc
3853 GerdtR 198
 
4146 GerdtR 199
	call	DRedrawWin
3853 GerdtR 200
 
201
DMessages:
4146 GerdtR 202
	mcall	10		;WaitMessage
3853 GerdtR 203
 
4146 GerdtR 204
	dec	eax
205
	jz	DReDraw
206
	dec	eax
207
	jz	DKey
208
	dec	eax
209
	jz	DButton
210
	sub	eax,3
211
	jz	DMouse
3853 GerdtR 212
 
4146 GerdtR 213
	jmp  DMessages
3853 GerdtR 214
 
215
 
216
;---------------------------------------------------------------------
217
DKey:
4146 GerdtR 218
	mcall	2		;GetKeyPressed
219
	cmp	ah,1Bh
220
	je	DExit
221
	cmp	ah,9  ;Tab
222
	je	DNextEdit
223
	stdcall [edit_box_key],edtName
224
	stdcall [edit_box_key],edtExePath
225
	stdcall [edit_box_key],edtParams
226
	;stdcall [edit_box_key],edtIcon
3853 GerdtR 227
 
4146 GerdtR 228
	jmp	DMessages
3853 GerdtR 229
 
230
 
231
DNextEdit:
4146 GerdtR 232
	test	[edtName.flags],ed_focus
233
	jne	 .DNE1
234
	test	[edtExePath.flags],ed_focus
235
	jne	 .DNE2
236
	test	[edtParams.flags],ed_focus
237
	jne	 .DNE3
238
	;test    [edtIcon.flags],ed_focus
239
	;jne      .DNE4
240
	jmp	DMessages
3853 GerdtR 241
 
242
    .DNE1:
4146 GerdtR 243
	and	[edtName.flags],not ed_focus
244
	or	[edtExePath.flags],ed_focus
245
	stdcall [edit_box_draw],edtName
246
	stdcall [edit_box_draw],edtExePath
247
	jmp	DMessages
3853 GerdtR 248
 
249
    .DNE2:
4146 GerdtR 250
	and	[edtExePath.flags],not ed_focus
251
	or	[edtParams.flags],ed_focus
252
	stdcall [edit_box_draw],edtExePath
253
	stdcall [edit_box_draw],edtParams
254
	jmp	DMessages
3853 GerdtR 255
 
256
    .DNE3:
4146 GerdtR 257
	and	[edtParams.flags],not ed_focus
258
	or	[edtName.flags],ed_focus
259
	stdcall [edit_box_draw],edtParams
260
	stdcall [edit_box_draw],edtName
261
	jmp	DMessages
3853 GerdtR 262
 
4003 GerdtR 263
    ;.DNE4:
264
    ;    and     [edtIcon.flags],not ed_focus
265
    ;    or      [edtName.flags],ed_focus
266
    ;    stdcall [edit_box_draw],edtName
267
    ;    stdcall [edit_box_draw],edtIcon
268
    ;    jmp     DMessages
3853 GerdtR 269
;---------------------------------------------------------------------
270
DButton:
4146 GerdtR 271
	mcall	17		;GetButtonPressed
272
	cmp	ah, idbCancel
273
	je	DExit
274
	cmp	ah,idbChange
275
	je	DSetExePath
276
	cmp	ah,idbCreate
277
	je	DSaveIcon
3853 GerdtR 278
 
4146 GerdtR 279
	jmp	DMessages
3853 GerdtR 280
;-------------------------------------------------------------------------------
281
DMouse:
4146 GerdtR 282
	stdcall [edit_box_mouse],edtName
283
	stdcall [edit_box_mouse],edtExePath
284
	stdcall [edit_box_mouse],edtParams
4003 GerdtR 285
;        stdcall [edit_box_mouse],edtIcon
3853 GerdtR 286
 
4146 GerdtR 287
	push	[sbIcons.position]
288
	stdcall [scrollbar_h_mouse],sbIcons
289
	pop	eax
290
	cmp	eax,[sbIcons.position]
291
	je	@f
292
	call	DrawStdIcons
3853 GerdtR 293
      @@:
294
 
4146 GerdtR 295
	mcall	37,2		;GetMouseKey
296
	test	eax,1
297
	jz	DMessages
298
	mcall	37,1		;GetMouseWinPos
3853 GerdtR 299
 
4146 GerdtR 300
	test	eax,10001000h
301
	jne	DMessages
302
	xor	edx,edx
303
	mov	dx,ax	  ;y
304
	shr	eax,16	  ;x
3853 GerdtR 305
 
4146 GerdtR 306
	sub	eax,ICONSX
307
	js	DMessages
308
	sub	edx,ICONSY
309
	js	DMessages
3853 GerdtR 310
 
4146 GerdtR 311
	cmp	eax,(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW
312
	ja	DMessages
313
	cmp	edx,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH-SPCH
314
	ja	DMessages
3853 GerdtR 315
 
4146 GerdtR 316
	xor	ebx,ebx
317
	mov	ecx,[sbIcons.position]
318
	test	ecx,ecx
319
	jz	.DM
3853 GerdtR 320
     @@:
4146 GerdtR 321
	add	ebx,ICONS_DRAW_COUNTH
322
	loop	@b
3853 GerdtR 323
     .DM:
324
 
4146 GerdtR 325
	sub	eax,IMG_SIZE+SPCW
326
	js     .DM1
3853 GerdtR 327
     @@:
4146 GerdtR 328
	add	ebx,ICONS_DRAW_COUNTH
329
	sub	eax,IMG_SIZE+SPCW
330
	jns	@b
3853 GerdtR 331
     .DM1:
332
 
333
 
4146 GerdtR 334
	sub	edx,IMG_SIZE+SPCH
335
	js     .DM2
3853 GerdtR 336
     @@:
4146 GerdtR 337
	inc	ebx
338
	sub	edx,IMG_SIZE+SPCH
339
	jns	@b
3853 GerdtR 340
     .DM2:
341
 
4146 GerdtR 342
	mov	eax,ebx
3853 GerdtR 343
 
4146 GerdtR 344
	cmp	eax,[icon_count]
345
	jae	DMessages
3853 GerdtR 346
 
4146 GerdtR 347
	mov	bl,10
348
	div	bl
3853 GerdtR 349
 
4146 GerdtR 350
	add	ah,30h
351
	test	al,al
352
	jz	@f
3853 GerdtR 353
 
4146 GerdtR 354
	add	al,30h
355
	mov	byte[DAreaIcon],al
356
	mov	byte[DAreaIcon+1],ah
357
	mov	byte[DAreaIcon+2],0
358
	mov	dword[edtIcon.size],2
359
	jmp	.RedrawNum
3853 GerdtR 360
 
361
      @@:
4146 GerdtR 362
	mov	byte[DAreaIcon],ah
363
	mov	byte[DAreaIcon+1],0
364
	mov	dword[edtIcon.size],1
365
	jmp	.RedrawNum
3853 GerdtR 366
    .RedrawNum:
367
 
368
 
4007 GerdtR 369
      ;  stdcall [edit_box_draw],edtIcon
3853 GerdtR 370
 
371
 
4146 GerdtR 372
	call	DrawSelIcon
373
	jmp	DReDraw;DMessages;
3853 GerdtR 374
;-------------------------------------------------------------------------------
375
DSetExePath:
4146 GerdtR 376
	stdcall [OpenDialog_Start],OpenDialog_data
377
	mov	edi,DAreaPath
378
	xor	al,al
379
	or	ecx,-1
380
	repne	scasb
381
	sub	edi,DAreaPath
382
	dec	edi
383
	mov	dword[edtExePath+12*4],edi
3853 GerdtR 384
 
4146 GerdtR 385
	jmp	DMessages;DReDraw;
3853 GerdtR 386
 
387
DSaveIcon:
4146 GerdtR 388
	mov	edi,DAreaName
389
	mov	esi,secRButt
4003 GerdtR 390
    @@: lodsb
4146 GerdtR 391
	scasb
392
	jne	@f
393
	test	al,al
394
	jnz	@b
4003 GerdtR 395
 
4146 GerdtR 396
	mov	dword[fiRunProg+8],ErrName
397
	mov	dword[fiRunProg+21],pthNotify
398
	mcall	70,fiRunProg
4003 GerdtR 399
 
4146 GerdtR 400
	jmp	DMessages
4003 GerdtR 401
    @@:
4146 GerdtR 402
	mov	dword[fiRunProg+8],WarningSave
403
	mov	dword[fiRunProg+21],pthNotify
404
	mcall	70,fiRunProg
3853 GerdtR 405
 
406
 
4146 GerdtR 407
	cmp	[DlgSelIcon],-1
408
	je	@f
5017 GerdtR 409
 
4336 GerdtR 410
	stdcall EditIcon,[DlgSelIcon],DAreaIcon,DAreaName,DAreaPath,DAreaParams
4146 GerdtR 411
	mov	ebx,[DlgSelIcon]
4336 GerdtR 412
	mov	eax,[IconsID+ebx*4]
4146 GerdtR 413
	jmp	DExitAndSave
3853 GerdtR 414
     @@:
4336 GerdtR 415
 
416
	call	GenerateID
417
 
418
	mov	ebx,[MaxNumIcon]
419
	mov	[IconsID+ebx*4],eax
420
	push	eax
4146 GerdtR 421
	stdcall AddIcon,[AddX],[AddY],DAreaIcon,DAreaName,DAreaPath,DAreaParams
4336 GerdtR 422
	pop	eax
423
 
3853 GerdtR 424
;-------------------------------------------------------------------------------
425
DExitAndSave:
426
 
4336 GerdtR 427
	mov	dword[nameSection],eax
428
	stdcall [ini_set_str],IconIni,nameSection,keyName,DAreaName,dword[edtName.size]
429
	stdcall [ini_set_str],IconIni,nameSection,keyPath,DAreaPath,dword[edtExePath.size]
430
	stdcall [ini_set_str],IconIni,nameSection,keyParams,DAreaParams,dword[edtParams.size]
431
	stdcall [ini_set_str],IconIni,nameSection,keyIco,DAreaIcon,dword[edtIcon.size]
3853 GerdtR 432
 
4336 GerdtR 433
	cmp	[DlgSelIcon],-1
434
	jne	@f
435
	stdcall [ini_set_int],IconIni,nameSection,keyX,[MouseX]
436
	stdcall [ini_set_int],IconIni,nameSection,keyY,[MouseY]
437
      @@:
3853 GerdtR 438
DExit:
4146 GerdtR 439
	mov	[DlgAddActiv],0
440
	mov	[slotDlgAdd],0
441
	mcall	-1		;ExitThread
3853 GerdtR 442
 
443
;##################################################################
4007 GerdtR 444
proc DRedrawWin
4146 GerdtR 445
	mcall	12,1		;RedrawWinBeg
446
	mov	edx,[sc.work]
447
	or	edx,34000000h
448
	cmp	[DlgSelIcon],-1
449
	jne	 @f
450
	mov	edi,DTitleAdd
451
	jmp	.l1
3962 GerdtR 452
      @@:
4146 GerdtR 453
	mov	edi,DTitleProp
3962 GerdtR 454
      .l1:
4146 GerdtR 455
	mcall	0,<100,400>,<100,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH+165>,,,
3853 GerdtR 456
 
4146 GerdtR 457
	stdcall [edit_box_draw],edtName
458
	stdcall [edit_box_draw],edtExePath
459
	stdcall [edit_box_draw],edtParams
4003 GerdtR 460
;        stdcall [edit_box_draw],edtIcon
3853 GerdtR 461
 
4146 GerdtR 462
	call	DrawStdIcons
3853 GerdtR 463
 
464
 
4146 GerdtR 465
	stdcall [scrollbar_h_draw],sbIcons
466
	mcall	38,,\
467
		   ,\
468
		[sc.work_graph]
469
	mcall	  ,,\
470
		   ,\
471
		[sc.work_graph]
3853 GerdtR 472
 
4146 GerdtR 473
	mcall	  ,,\
474
		   ,\
475
		[sc.work_graph]
476
	mcall	  ,,\
477
		   ,\
478
		[sc.work_graph]
3853 GerdtR 479
 
4146 GerdtR 480
				  ;BUTTONS
481
	mcall	8,<250,49>,<30+END_ICONS_AREAH,16>,idbCreate,[sc.work_button]
482
	mcall	 ,<305,54>,			  ,idbCancel
483
	mcall	 ,<351,14>,<26,14>	       ,idbChange
3853 GerdtR 484
 
4146 GerdtR 485
				  ;CAPTIONS
486
	mov	ecx,[sc.work_text]
487
	or	ecx,80000000h
488
	mcall	4,<30+IMG_SIZE,10>,,DCaptName
489
	mcall	 ,<30+IMG_SIZE,30>,,DCaptPath
490
	mcall	 ,<30+IMG_SIZE,50>,,DCaptParams
491
	;mcall    ,<30+IMG_SIZE,70>,,DCaptIcon
3853 GerdtR 492
 
493
if lang eq ru
4146 GerdtR 494
	mov	ecx,[sc.work_button_text]
495
	or	ecx,80000000h
496
	mcall	 ,<309,35+END_ICONS_AREAH>,,DCaptCancel
3853 GerdtR 497
 
4146 GerdtR 498
	cmp	[DlgSelIcon],-1
499
	jne	@f
500
	mpack	ebx,255,35+END_ICONS_AREAH
501
	mov	edx,DCaptCreate
502
	jmp	.DRD1
3853 GerdtR 503
      @@:
4146 GerdtR 504
	mpack	ebx,252,35+END_ICONS_AREAH
505
	mov	edx,DCaptProperties
3853 GerdtR 506
     .DRD1:
507
else
4146 GerdtR 508
	mov	ecx,[sc.work_button_text]
509
	or	ecx,80000000h
510
	mcall	 ,<315,35+END_ICONS_AREAH>,,DCaptCancel
3853 GerdtR 511
 
512
 
4146 GerdtR 513
	cmp	[DlgSelIcon],-1
514
	jne	@f
515
	mpack	ebx,257,35+END_ICONS_AREAH
516
	mov	edx,DCaptCreate
517
	jmp	.DRD1
3853 GerdtR 518
      @@:
4146 GerdtR 519
	mpack	ebx,257,35+END_ICONS_AREAH
520
	mov	edx,DCaptProperties
3853 GerdtR 521
     .DRD1:
522
end if
4146 GerdtR 523
	mcall
3853 GerdtR 524
 
4146 GerdtR 525
	mcall	1,351+4  ,26+10,[sc.work_button_text]
526
	mcall	 ,351+4+3,26+10,
527
	mcall	 ,351+4+6,26+10,
3853 GerdtR 528
 
4146 GerdtR 529
	call DrawSelIcon
3853 GerdtR 530
 
4146 GerdtR 531
	mcall	12,2		;RedrawWinEnd
532
	ret
3853 GerdtR 533
endp
534
 
535
 
536
proc DrawStdIcons
537
local IcoX:DWORD,\
538
      IcoY:DWORD,\
539
      iIcon:DWORD
540
 
4146 GerdtR 541
	mov	ecx,[sbIcons.position]
542
	xor	eax,eax
543
	m2m	dword[iIcon],0
3853 GerdtR 544
 
4146 GerdtR 545
	test	ecx,ecx
546
	jz	.DST1
3853 GerdtR 547
     @@:
4146 GerdtR 548
	add	[iIcon],ICONS_DRAW_COUNTH
549
	add	eax,IMG_SIZE*IMG_SIZE*4*ICONS_DRAW_COUNTH
550
	loop	@b
3853 GerdtR 551
   .DST1:
552
 
4146 GerdtR 553
	lea	esi,[eax+44]
554
	add	esi,[raw_pointer]
3853 GerdtR 555
 
4146 GerdtR 556
	mov	[IcoX],ICONSX
3853 GerdtR 557
 
4146 GerdtR 558
	mov	ecx,ICONS_DRAW_COUNTW
3853 GerdtR 559
  .DrawIcons:
4146 GerdtR 560
	push	ecx
3853 GerdtR 561
 
4146 GerdtR 562
	mov	[IcoY],ICONSY
3853 GerdtR 563
 
4146 GerdtR 564
	mov	ecx,ICONS_DRAW_COUNTH
3853 GerdtR 565
  .DrawIcoStolb:
4146 GerdtR 566
	push	ecx
3853 GerdtR 567
 
4146 GerdtR 568
	mov	edi,DlgBufImg
569
	mov	edx,IMG_SIZE
3853 GerdtR 570
 
571
    .DrawLine:
572
 
573
 
4146 GerdtR 574
	mov	ecx,IMG_SIZE
3853 GerdtR 575
     .DrawPix:
576
 
4146 GerdtR 577
	lodsd
578
	test	eax,0FF000000h
579
	jnz	@f
580
	mov	eax,[sc.work]
3853 GerdtR 581
     @@:
582
 
4146 GerdtR 583
	mov	[edi],ax
584
	shr	eax,16
585
	mov	[edi+2],al
586
	add	edi,3
3853 GerdtR 587
 
4146 GerdtR 588
	loop	.DrawPix
3853 GerdtR 589
 
4146 GerdtR 590
	dec	edx
591
	jnz    .DrawLine
3853 GerdtR 592
 
4146 GerdtR 593
	mov	edx,[IcoX]
594
	shl	edx,16
595
	mov	dx,word[IcoY]
596
	mcall	7,DlgBufImg,
3853 GerdtR 597
 
4146 GerdtR 598
	inc	[iIcon]
599
	mov	eax,[iIcon]
600
	cmp	eax,[icon_count]
601
	jae	.endDrawIcon
3853 GerdtR 602
 
4146 GerdtR 603
	add	dword[IcoY],IMG_SIZE+SPCH
604
	pop	ecx
605
	loop	.DrawIcoStolb
3853 GerdtR 606
 
4146 GerdtR 607
	add	dword[IcoX],IMG_SIZE+SPCW
608
	pop	ecx
609
	loop	.DrawIcons
610
	jmp	.endProc
3853 GerdtR 611
 
612
    .endDrawIcon:
613
 
4146 GerdtR 614
	mov	ecx,IMG_SIZE*IMG_SIZE
615
	mov	edi,DlgBufImg
616
	mov	eax,[sc.work]
617
	mov	ebx,eax
618
	shr	ebx,16
3853 GerdtR 619
     @@:
4146 GerdtR 620
	mov	word[edi],ax
621
	mov	[edi+2],bl
622
	add	edi,3
623
	loop	@b
3853 GerdtR 624
 
5017 GerdtR 625
				     ;затирание не использованых мест
4146 GerdtR 626
	jmp	.Dalee
3853 GerdtR 627
 
628
  .DrawIcons2:
4146 GerdtR 629
	push	ecx
3853 GerdtR 630
 
4146 GerdtR 631
	mov	[IcoY],ICONSY
632
	mov	ecx,ICONS_DRAW_COUNTH
3853 GerdtR 633
  .DrawIcoStolb2:
4146 GerdtR 634
	push	ecx
3853 GerdtR 635
 
4146 GerdtR 636
	mov	edx,[IcoX]
637
	shl	edx,16
638
	mov	dx,word[IcoY]
639
	mcall	7,DlgBufImg,
3853 GerdtR 640
 
641
     .Dalee:
4146 GerdtR 642
	add	dword[IcoY],IMG_SIZE+SPCH
643
	pop	ecx
644
	loop	.DrawIcoStolb2
3853 GerdtR 645
 
4146 GerdtR 646
	add	dword[IcoX],IMG_SIZE+SPCW
647
	pop	ecx
648
	loop	.DrawIcons2
3853 GerdtR 649
 
650
   .endProc:
4007 GerdtR 651
 
4146 GerdtR 652
	ret
3853 GerdtR 653
endp
654
 
655
proc DrawSelIcon
4146 GerdtR 656
	mov	edi,DAreaIcon
657
	cmp	byte[edi],0
658
	jne	@f
659
	ret
3853 GerdtR 660
      @@:
661
 
4146 GerdtR 662
	mov	al,[edi]
663
	cmp	al,'9'
664
	ja	.PathToIcon
665
	cmp	al,'/'
666
	jne	.GetIconInd
3853 GerdtR 667
   .PathToIcon:
5017 GerdtR 668
	mov	al,30h		 ;заглушка!!!!!!!!!!!!!
4146 GerdtR 669
	mov	byte[edi+1],0
3853 GerdtR 670
   .GetIconInd:
671
;int3
4146 GerdtR 672
	sub	al,30h
673
	cmp	byte[edi+1],0
674
	je	@f
675
	shl	eax,1
676
	lea	eax,[eax*4+eax]
677
	xor	edx,edx
678
	mov	dl,[edi+1]
679
	sub	dl,30h
680
	add	eax,edx
681
     @@:	     ;eax=num icon
682
	cmp	eax,[icon_count]
683
	jb	@f
684
	xor	eax,eax
3853 GerdtR 685
     @@:
4146 GerdtR 686
	test	eax,eax
687
	je	.DI1
688
	mov	ecx,eax
689
	xor	eax,eax
3853 GerdtR 690
      @@:
4146 GerdtR 691
	add	eax,IMG_SIZE*IMG_SIZE*4
692
	loop	@b
3853 GerdtR 693
     .DI1:
4146 GerdtR 694
	mov	esi,eax
695
	add	esi,[raw_pointer]
696
	add	esi,44
3853 GerdtR 697
 
4146 GerdtR 698
	mov	edi,DlgBufImg
699
	mov	edx,IMG_SIZE
3853 GerdtR 700
    .DrawLine:
701
 
4146 GerdtR 702
	mov	ecx,IMG_SIZE
3853 GerdtR 703
     .DrawPix:
704
 
4146 GerdtR 705
	lodsd
706
	test	eax,0FF000000h
707
	jnz	@f
708
	mov	eax,[sc.work]
3853 GerdtR 709
     @@:
710
 
4146 GerdtR 711
	mov	word[edi],ax
712
	shr	eax,16
713
	mov	[edi+2],al
714
	add	edi,3
3853 GerdtR 715
 
4146 GerdtR 716
	loop	.DrawPix
3853 GerdtR 717
 
4146 GerdtR 718
	dec	edx
719
	jnz	.DrawLine
3853 GerdtR 720
 
4146 GerdtR 721
	mcall	7,DlgBufImg,,<15,15>
3853 GerdtR 722
 
4146 GerdtR 723
	ret
3853 GerdtR 724
endp