Subversion Repositories Kolibri OS

Rev

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