Subversion Repositories Kolibri OS

Rev

Rev 4146 | Rev 5017 | 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]
4336 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
 
4336 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 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
4336 GerdtR 411
 
412
	stdcall EditIcon,[DlgSelIcon],DAreaIcon,DAreaName,DAreaPath,DAreaParams
4146 GerdtR 413
	mov	ebx,[DlgSelIcon]
4336 GerdtR 414
	mov	eax,[IconsID+ebx*4]
4146 GerdtR 415
	jmp	DExitAndSave
3853 GerdtR 416
     @@:
4336 GerdtR 417
 
418
	call	GenerateID
419
 
420
	mov	ebx,[MaxNumIcon]
421
	mov	[IconsID+ebx*4],eax
422
	push	eax
4146 GerdtR 423
	stdcall AddIcon,[AddX],[AddY],DAreaIcon,DAreaName,DAreaPath,DAreaParams
4336 GerdtR 424
	pop	eax
425
 
3853 GerdtR 426
;-------------------------------------------------------------------------------
427
DExitAndSave:
428
 
4336 GerdtR 429
	mov	dword[nameSection],eax
430
	stdcall [ini_set_str],IconIni,nameSection,keyName,DAreaName,dword[edtName.size]
431
	stdcall [ini_set_str],IconIni,nameSection,keyPath,DAreaPath,dword[edtExePath.size]
432
	stdcall [ini_set_str],IconIni,nameSection,keyParams,DAreaParams,dword[edtParams.size]
433
	stdcall [ini_set_str],IconIni,nameSection,keyIco,DAreaIcon,dword[edtIcon.size]
3853 GerdtR 434
 
4336 GerdtR 435
	cmp	[DlgSelIcon],-1
436
	jne	@f
437
	stdcall [ini_set_int],IconIni,nameSection,keyX,[MouseX]
438
	stdcall [ini_set_int],IconIni,nameSection,keyY,[MouseY]
439
      @@:
3853 GerdtR 440
DExit:
4146 GerdtR 441
	mov	[DlgAddActiv],0
442
	mov	[slotDlgAdd],0
443
	mcall	-1		;ExitThread
3853 GerdtR 444
 
445
;##################################################################
4007 GerdtR 446
proc DRedrawWin
4146 GerdtR 447
	mcall	12,1		;RedrawWinBeg
448
	mov	edx,[sc.work]
449
	or	edx,34000000h
450
	cmp	[DlgSelIcon],-1
451
	jne	 @f
452
	mov	edi,DTitleAdd
453
	jmp	.l1
3962 GerdtR 454
      @@:
4146 GerdtR 455
	mov	edi,DTitleProp
3962 GerdtR 456
      .l1:
4146 GerdtR 457
	mcall	0,<100,400>,<100,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH+165>,,,
3853 GerdtR 458
 
4146 GerdtR 459
	stdcall [edit_box_draw],edtName
460
	stdcall [edit_box_draw],edtExePath
461
	stdcall [edit_box_draw],edtParams
4003 GerdtR 462
;        stdcall [edit_box_draw],edtIcon
3853 GerdtR 463
 
4146 GerdtR 464
	call	DrawStdIcons
3853 GerdtR 465
 
466
 
4146 GerdtR 467
	stdcall [scrollbar_h_draw],sbIcons
468
	mcall	38,,\
469
		   ,\
470
		[sc.work_graph]
471
	mcall	  ,,\
472
		   ,\
473
		[sc.work_graph]
3853 GerdtR 474
 
4146 GerdtR 475
	mcall	  ,,\
476
		   ,\
477
		[sc.work_graph]
478
	mcall	  ,,\
479
		   ,\
480
		[sc.work_graph]
3853 GerdtR 481
 
4146 GerdtR 482
				  ;BUTTONS
483
	mcall	8,<250,49>,<30+END_ICONS_AREAH,16>,idbCreate,[sc.work_button]
484
	mcall	 ,<305,54>,			  ,idbCancel
485
	mcall	 ,<351,14>,<26,14>	       ,idbChange
3853 GerdtR 486
 
4146 GerdtR 487
				  ;CAPTIONS
488
	mov	ecx,[sc.work_text]
489
	or	ecx,80000000h
490
	mcall	4,<30+IMG_SIZE,10>,,DCaptName
491
	mcall	 ,<30+IMG_SIZE,30>,,DCaptPath
492
	mcall	 ,<30+IMG_SIZE,50>,,DCaptParams
493
	;mcall    ,<30+IMG_SIZE,70>,,DCaptIcon
3853 GerdtR 494
 
495
if lang eq ru
4146 GerdtR 496
	mov	ecx,[sc.work_button_text]
497
	or	ecx,80000000h
498
	mcall	 ,<309,35+END_ICONS_AREAH>,,DCaptCancel
3853 GerdtR 499
 
4146 GerdtR 500
	cmp	[DlgSelIcon],-1
501
	jne	@f
502
	mpack	ebx,255,35+END_ICONS_AREAH
503
	mov	edx,DCaptCreate
504
	jmp	.DRD1
3853 GerdtR 505
      @@:
4146 GerdtR 506
	mpack	ebx,252,35+END_ICONS_AREAH
507
	mov	edx,DCaptProperties
3853 GerdtR 508
     .DRD1:
509
else
4146 GerdtR 510
	mov	ecx,[sc.work_button_text]
511
	or	ecx,80000000h
512
	mcall	 ,<315,35+END_ICONS_AREAH>,,DCaptCancel
3853 GerdtR 513
 
514
 
4146 GerdtR 515
	cmp	[DlgSelIcon],-1
516
	jne	@f
517
	mpack	ebx,257,35+END_ICONS_AREAH
518
	mov	edx,DCaptCreate
519
	jmp	.DRD1
3853 GerdtR 520
      @@:
4146 GerdtR 521
	mpack	ebx,257,35+END_ICONS_AREAH
522
	mov	edx,DCaptProperties
3853 GerdtR 523
     .DRD1:
524
end if
4146 GerdtR 525
	mcall
3853 GerdtR 526
 
4146 GerdtR 527
	mcall	1,351+4  ,26+10,[sc.work_button_text]
528
	mcall	 ,351+4+3,26+10,
529
	mcall	 ,351+4+6,26+10,
3853 GerdtR 530
 
4146 GerdtR 531
	call DrawSelIcon
3853 GerdtR 532
 
4146 GerdtR 533
	mcall	12,2		;RedrawWinEnd
534
	ret
3853 GerdtR 535
endp
536
 
537
 
538
proc DrawStdIcons
539
local IcoX:DWORD,\
540
      IcoY:DWORD,\
541
      iIcon:DWORD
542
 
4146 GerdtR 543
	mov	ecx,[sbIcons.position]
544
	xor	eax,eax
545
	m2m	dword[iIcon],0
3853 GerdtR 546
 
4146 GerdtR 547
	test	ecx,ecx
548
	jz	.DST1
3853 GerdtR 549
     @@:
4146 GerdtR 550
	add	[iIcon],ICONS_DRAW_COUNTH
551
	add	eax,IMG_SIZE*IMG_SIZE*4*ICONS_DRAW_COUNTH
552
	loop	@b
3853 GerdtR 553
   .DST1:
554
 
4146 GerdtR 555
	lea	esi,[eax+44]
556
	add	esi,[raw_pointer]
3853 GerdtR 557
 
4146 GerdtR 558
	mov	[IcoX],ICONSX
3853 GerdtR 559
 
4146 GerdtR 560
	mov	ecx,ICONS_DRAW_COUNTW
3853 GerdtR 561
  .DrawIcons:
4146 GerdtR 562
	push	ecx
3853 GerdtR 563
 
4146 GerdtR 564
	mov	[IcoY],ICONSY
3853 GerdtR 565
 
4146 GerdtR 566
	mov	ecx,ICONS_DRAW_COUNTH
3853 GerdtR 567
  .DrawIcoStolb:
4146 GerdtR 568
	push	ecx
3853 GerdtR 569
 
4146 GerdtR 570
	mov	edi,DlgBufImg
571
	mov	edx,IMG_SIZE
3853 GerdtR 572
 
573
    .DrawLine:
574
 
575
 
4146 GerdtR 576
	mov	ecx,IMG_SIZE
3853 GerdtR 577
     .DrawPix:
578
 
4146 GerdtR 579
	lodsd
580
	test	eax,0FF000000h
581
	jnz	@f
582
	mov	eax,[sc.work]
3853 GerdtR 583
     @@:
584
 
4146 GerdtR 585
	mov	[edi],ax
586
	shr	eax,16
587
	mov	[edi+2],al
588
	add	edi,3
3853 GerdtR 589
 
4146 GerdtR 590
	loop	.DrawPix
3853 GerdtR 591
 
4146 GerdtR 592
	dec	edx
593
	jnz    .DrawLine
3853 GerdtR 594
 
4146 GerdtR 595
	mov	edx,[IcoX]
596
	shl	edx,16
597
	mov	dx,word[IcoY]
598
	mcall	7,DlgBufImg,
3853 GerdtR 599
 
4146 GerdtR 600
	inc	[iIcon]
601
	mov	eax,[iIcon]
602
	cmp	eax,[icon_count]
603
	jae	.endDrawIcon
3853 GerdtR 604
 
4146 GerdtR 605
	add	dword[IcoY],IMG_SIZE+SPCH
606
	pop	ecx
607
	loop	.DrawIcoStolb
3853 GerdtR 608
 
4146 GerdtR 609
	add	dword[IcoX],IMG_SIZE+SPCW
610
	pop	ecx
611
	loop	.DrawIcons
612
	jmp	.endProc
3853 GerdtR 613
 
614
    .endDrawIcon:
615
 
4146 GerdtR 616
	mov	ecx,IMG_SIZE*IMG_SIZE
617
	mov	edi,DlgBufImg
618
	mov	eax,[sc.work]
619
	mov	ebx,eax
620
	shr	ebx,16
3853 GerdtR 621
     @@:
4146 GerdtR 622
	mov	word[edi],ax
623
	mov	[edi+2],bl
624
	add	edi,3
625
	loop	@b
3853 GerdtR 626
 
4336 GerdtR 627
				     ;затирание не использованых мест
4146 GerdtR 628
	jmp	.Dalee
3853 GerdtR 629
 
630
  .DrawIcons2:
4146 GerdtR 631
	push	ecx
3853 GerdtR 632
 
4146 GerdtR 633
	mov	[IcoY],ICONSY
634
	mov	ecx,ICONS_DRAW_COUNTH
3853 GerdtR 635
  .DrawIcoStolb2:
4146 GerdtR 636
	push	ecx
3853 GerdtR 637
 
4146 GerdtR 638
	mov	edx,[IcoX]
639
	shl	edx,16
640
	mov	dx,word[IcoY]
641
	mcall	7,DlgBufImg,
3853 GerdtR 642
 
643
     .Dalee:
4146 GerdtR 644
	add	dword[IcoY],IMG_SIZE+SPCH
645
	pop	ecx
646
	loop	.DrawIcoStolb2
3853 GerdtR 647
 
4146 GerdtR 648
	add	dword[IcoX],IMG_SIZE+SPCW
649
	pop	ecx
650
	loop	.DrawIcons2
3853 GerdtR 651
 
652
   .endProc:
4007 GerdtR 653
 
4146 GerdtR 654
	ret
3853 GerdtR 655
endp
656
 
657
proc DrawSelIcon
4146 GerdtR 658
	mov	edi,DAreaIcon
659
	cmp	byte[edi],0
660
	jne	@f
661
	ret
3853 GerdtR 662
      @@:
663
 
4146 GerdtR 664
	mov	al,[edi]
665
	cmp	al,'9'
666
	ja	.PathToIcon
667
	cmp	al,'/'
668
	jne	.GetIconInd
3853 GerdtR 669
   .PathToIcon:
4336 GerdtR 670
	mov	al,30h		 ;заглушка!!!!!!!!!!!!!
4146 GerdtR 671
	mov	byte[edi+1],0
3853 GerdtR 672
   .GetIconInd:
673
;int3
4146 GerdtR 674
	sub	al,30h
675
	cmp	byte[edi+1],0
676
	je	@f
677
	shl	eax,1
678
	lea	eax,[eax*4+eax]
679
	xor	edx,edx
680
	mov	dl,[edi+1]
681
	sub	dl,30h
682
	add	eax,edx
683
     @@:	     ;eax=num icon
684
	cmp	eax,[icon_count]
685
	jb	@f
686
	xor	eax,eax
3853 GerdtR 687
     @@:
4146 GerdtR 688
	test	eax,eax
689
	je	.DI1
690
	mov	ecx,eax
691
	xor	eax,eax
3853 GerdtR 692
      @@:
4146 GerdtR 693
	add	eax,IMG_SIZE*IMG_SIZE*4
694
	loop	@b
3853 GerdtR 695
     .DI1:
4146 GerdtR 696
	mov	esi,eax
697
	add	esi,[raw_pointer]
698
	add	esi,44
3853 GerdtR 699
 
4146 GerdtR 700
	mov	edi,DlgBufImg
701
	mov	edx,IMG_SIZE
3853 GerdtR 702
    .DrawLine:
703
 
4146 GerdtR 704
	mov	ecx,IMG_SIZE
3853 GerdtR 705
     .DrawPix:
706
 
4146 GerdtR 707
	lodsd
708
	test	eax,0FF000000h
709
	jnz	@f
710
	mov	eax,[sc.work]
3853 GerdtR 711
     @@:
712
 
4146 GerdtR 713
	mov	word[edi],ax
714
	shr	eax,16
715
	mov	[edi+2],al
716
	add	edi,3
3853 GerdtR 717
 
4146 GerdtR 718
	loop	.DrawPix
3853 GerdtR 719
 
4146 GerdtR 720
	dec	edx
721
	jnz	.DrawLine
3853 GerdtR 722
 
4146 GerdtR 723
	mcall	7,DlgBufImg,,<15,15>
3853 GerdtR 724
 
4146 GerdtR 725
	ret
3853 GerdtR 726
endp