Subversion Repositories Kolibri OS

Rev

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
7012 leency 95
 
96
	mov	[DAreaIcon],'0'
97
	mov	dword[edtIcon.size],1
98
	mov	dword[edtIcon.pos],1
4146 GerdtR 99
 
100
	jmp	startDlg
3853 GerdtR 101
    ;--------
102
SetProp:
4146 GerdtR 103
	mov	esi,[IconsOffs+eax*4]
104
	mov	edi,DAreaName
105
	xor	ecx,ecx
3853 GerdtR 106
     @@:
4146 GerdtR 107
	lodsb
108
	stosb
109
	inc	ecx
110
	test	al,al
111
	jnz	@b
112
	dec	ecx
113
	mov	dword[edtName.size],ecx
114
	mov	dword[edtName.pos],ecx
3853 GerdtR 115
 
4146 GerdtR 116
	xor	ecx,ecx
117
	mov	edi,DAreaPath
3853 GerdtR 118
     @@:
4146 GerdtR 119
	lodsb
120
	stosb
121
	inc	ecx
122
	test	al,al
123
	jnz	@b
124
	dec	ecx
125
	mov	dword[edtExePath.size],ecx
126
	mov	dword[edtExePath.pos],ecx
3853 GerdtR 127
 
4146 GerdtR 128
	xor	ecx,ecx
129
	mov	edi,DAreaParams
3853 GerdtR 130
     @@:
4146 GerdtR 131
	lodsb
132
	stosb
133
	inc	ecx
134
	test	al,al
135
	jnz	@b
136
	dec	ecx
137
	mov	dword[edtParams.size],ecx
138
	mov	dword[edtParams.pos],ecx
3853 GerdtR 139
 
4146 GerdtR 140
	xor	ecx,ecx
141
	mov	edi,DAreaIcon
3853 GerdtR 142
     @@:
4146 GerdtR 143
	lodsb
144
	stosb
145
	inc	ecx
146
	test	al,al
147
	jnz	@b
148
	dec	ecx
149
	mov	dword[edtIcon.size],ecx
150
	mov	dword[edtIcon.pos],ecx
3853 GerdtR 151
 
152
 
153
startDlg:
4146 GerdtR 154
	mcall	9,RBProcInfo,-1
155
	mcall	18,21,dword[RBProcInfo+30]
156
	mov	[slotDlgAdd],eax
3921 mario79 157
 
4146 GerdtR 158
	or	[edtName.flags],ed_focus
3853 GerdtR 159
 
7016 leency 160
	mcall	40,EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER
4146 GerdtR 161
	xor	eax,eax
162
	mov	dword[MaxPage],0
3853 GerdtR 163
      @@:
4146 GerdtR 164
	add	eax,ICONS_DRAW_COUNTW
165
	inc	dword[MaxPage]
166
	cmp	eax,[icon_count]
167
	jb	@b
168
	dec	dword[MaxPage]
169
	cmp	dword[MaxPage],0
170
	jne	@f
171
	mov	dword[MaxPage],1
3853 GerdtR 172
      @@:
173
 
174
DReDraw:
4146 GerdtR 175
	mcall	48,3,sc,40
3853 GerdtR 176
 
4146 GerdtR 177
	mov	eax,[sc.work]
178
	rol	eax,16
179
	add	al,9
180
	jnc	@f
181
	mov	al,0FFh
3853 GerdtR 182
      @@:
4146 GerdtR 183
	rol	eax,16
184
	add	al,9
185
	jnc	@f
186
	mov	al,0FFh
3853 GerdtR 187
      @@:
4146 GerdtR 188
	add	ah,9
189
	jnc	@f
190
	mov	ah,0FFh
3853 GerdtR 191
      @@:
192
 
4146 GerdtR 193
	mov	[sbIcons.bckg_col],eax
194
	m2m	[sbIcons.frnt_col],[sc.work]
195
	m2m	[sbIcons.line_col],[sc.work_graph]
3853 GerdtR 196
 
4146 GerdtR 197
	;edit_boxes_set_sys_color edtIcon,endEdits,sc
5017 GerdtR 198
	edit_boxes_set_sys_color edtName,endEdits,sc
5439 leency 199
 
200
	m2m	[edtIcon.color],[sc.work]
201
	m2m	[edtIcon.blur_border_color],[sc.work]
3853 GerdtR 202
 
4146 GerdtR 203
	call	DRedrawWin
3853 GerdtR 204
 
205
DMessages:
4146 GerdtR 206
	mcall	10		;WaitMessage
3853 GerdtR 207
 
4146 GerdtR 208
	dec	eax
209
	jz	DReDraw
210
	dec	eax
211
	jz	DKey
212
	dec	eax
213
	jz	DButton
214
	sub	eax,3
215
	jz	DMouse
3853 GerdtR 216
 
4146 GerdtR 217
	jmp  DMessages
3853 GerdtR 218
 
219
 
220
;---------------------------------------------------------------------
221
DKey:
4146 GerdtR 222
	mcall	2		;GetKeyPressed
223
	cmp	ah,1Bh
224
	je	DExit
225
	cmp	ah,9  ;Tab
226
	je	DNextEdit
227
	stdcall [edit_box_key],edtName
228
	stdcall [edit_box_key],edtExePath
229
	stdcall [edit_box_key],edtParams
230
	;stdcall [edit_box_key],edtIcon
3853 GerdtR 231
 
4146 GerdtR 232
	jmp	DMessages
3853 GerdtR 233
 
234
 
235
DNextEdit:
4146 GerdtR 236
	test	[edtName.flags],ed_focus
237
	jne	 .DNE1
238
	test	[edtExePath.flags],ed_focus
239
	jne	 .DNE2
240
	test	[edtParams.flags],ed_focus
241
	jne	 .DNE3
242
	;test    [edtIcon.flags],ed_focus
243
	;jne      .DNE4
244
	jmp	DMessages
3853 GerdtR 245
 
246
    .DNE1:
4146 GerdtR 247
	and	[edtName.flags],not ed_focus
248
	or	[edtExePath.flags],ed_focus
249
	stdcall [edit_box_draw],edtName
250
	stdcall [edit_box_draw],edtExePath
251
	jmp	DMessages
3853 GerdtR 252
 
253
    .DNE2:
4146 GerdtR 254
	and	[edtExePath.flags],not ed_focus
255
	or	[edtParams.flags],ed_focus
256
	stdcall [edit_box_draw],edtExePath
257
	stdcall [edit_box_draw],edtParams
258
	jmp	DMessages
3853 GerdtR 259
 
260
    .DNE3:
4146 GerdtR 261
	and	[edtParams.flags],not ed_focus
262
	or	[edtName.flags],ed_focus
263
	stdcall [edit_box_draw],edtParams
264
	stdcall [edit_box_draw],edtName
265
	jmp	DMessages
3853 GerdtR 266
 
4003 GerdtR 267
    ;.DNE4:
268
    ;    and     [edtIcon.flags],not ed_focus
269
    ;    or      [edtName.flags],ed_focus
270
    ;    stdcall [edit_box_draw],edtName
271
    ;    stdcall [edit_box_draw],edtIcon
272
    ;    jmp     DMessages
3853 GerdtR 273
;---------------------------------------------------------------------
274
DButton:
4146 GerdtR 275
	mcall	17		;GetButtonPressed
276
	cmp	ah, idbCancel
277
	je	DExit
278
	cmp	ah,idbChange
279
	je	DSetExePath
280
	cmp	ah,idbCreate
281
	je	DSaveIcon
3853 GerdtR 282
 
4146 GerdtR 283
	jmp	DMessages
3853 GerdtR 284
;-------------------------------------------------------------------------------
285
DMouse:
4146 GerdtR 286
	stdcall [edit_box_mouse],edtName
287
	stdcall [edit_box_mouse],edtExePath
288
	stdcall [edit_box_mouse],edtParams
4003 GerdtR 289
;        stdcall [edit_box_mouse],edtIcon
3853 GerdtR 290
 
4146 GerdtR 291
	push	[sbIcons.position]
292
	stdcall [scrollbar_h_mouse],sbIcons
293
	pop	eax
294
	cmp	eax,[sbIcons.position]
295
	je	@f
296
	call	DrawStdIcons
3853 GerdtR 297
      @@:
298
 
4146 GerdtR 299
	mcall	37,2		;GetMouseKey
300
	test	eax,1
301
	jz	DMessages
302
	mcall	37,1		;GetMouseWinPos
3853 GerdtR 303
 
4146 GerdtR 304
	test	eax,10001000h
305
	jne	DMessages
306
	xor	edx,edx
307
	mov	dx,ax	  ;y
308
	shr	eax,16	  ;x
3853 GerdtR 309
 
4146 GerdtR 310
	sub	eax,ICONSX
311
	js	DMessages
312
	sub	edx,ICONSY
313
	js	DMessages
3853 GerdtR 314
 
4146 GerdtR 315
	cmp	eax,(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW
316
	ja	DMessages
317
	cmp	edx,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH-SPCH
318
	ja	DMessages
3853 GerdtR 319
 
4146 GerdtR 320
	xor	ebx,ebx
321
	mov	ecx,[sbIcons.position]
322
	test	ecx,ecx
323
	jz	.DM
3853 GerdtR 324
     @@:
4146 GerdtR 325
	add	ebx,ICONS_DRAW_COUNTH
326
	loop	@b
3853 GerdtR 327
     .DM:
328
 
4146 GerdtR 329
	sub	eax,IMG_SIZE+SPCW
330
	js     .DM1
3853 GerdtR 331
     @@:
4146 GerdtR 332
	add	ebx,ICONS_DRAW_COUNTH
333
	sub	eax,IMG_SIZE+SPCW
334
	jns	@b
3853 GerdtR 335
     .DM1:
336
 
337
 
4146 GerdtR 338
	sub	edx,IMG_SIZE+SPCH
339
	js     .DM2
3853 GerdtR 340
     @@:
4146 GerdtR 341
	inc	ebx
342
	sub	edx,IMG_SIZE+SPCH
343
	jns	@b
3853 GerdtR 344
     .DM2:
345
 
4146 GerdtR 346
	mov	eax,ebx
3853 GerdtR 347
 
4146 GerdtR 348
	cmp	eax,[icon_count]
349
	jae	DMessages
3853 GerdtR 350
 
4146 GerdtR 351
	mov	bl,10
352
	div	bl
3853 GerdtR 353
 
4146 GerdtR 354
	add	ah,30h
355
	test	al,al
356
	jz	@f
3853 GerdtR 357
 
4146 GerdtR 358
	add	al,30h
359
	mov	byte[DAreaIcon],al
360
	mov	byte[DAreaIcon+1],ah
361
	mov	byte[DAreaIcon+2],0
362
	mov	dword[edtIcon.size],2
363
	jmp	.RedrawNum
3853 GerdtR 364
 
365
      @@:
4146 GerdtR 366
	mov	byte[DAreaIcon],ah
367
	mov	byte[DAreaIcon+1],0
368
	mov	dword[edtIcon.size],1
369
	jmp	.RedrawNum
3853 GerdtR 370
    .RedrawNum:
5439 leency 371
 
372
    ; stdcall [edit_box_draw],edtIcon
3853 GerdtR 373
 
7012 leency 374
	call DrawSelIcon
375
	jmp	 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
5017 GerdtR 411
 
4336 GerdtR 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:
7012 leency 457
	mcall	0,<100,END_ICONS_AREAW+ICONSX+10>,<100,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH+178>,,,
3853 GerdtR 458
 
4146 GerdtR 459
	stdcall [edit_box_draw],edtName
460
	stdcall [edit_box_draw],edtExePath
461
	stdcall [edit_box_draw],edtParams
3853 GerdtR 462
 
4146 GerdtR 463
	call	DrawStdIcons
3853 GerdtR 464
 
465
 
4146 GerdtR 466
	stdcall [scrollbar_h_draw],sbIcons
7012 leency 467
	mcall 38,,,[sc.work_graph]
468
	mcall   ,,,[sc.work_graph]
3853 GerdtR 469
 
7012 leency 470
	mcall   ,,,[sc.work_graph]
471
	mcall   ,,,		[sc.work_graph]
3853 GerdtR 472
 
7012 leency 473
	;BUTTONS
474
	mcall	8,<265,75>,<30+END_ICONS_AREAH,24>,idbCreate,[sc.work_button]
475
	mcall	 ,<360,77>,	                      ,idbCancel
476
	mcall	 ,,<30,20> ,idbChange
3853 GerdtR 477
 
7012 leency 478
	;CAPTIONS
4146 GerdtR 479
	mov	ecx,[sc.work_text]
7012 leency 480
	or	ecx,90000000h
4146 GerdtR 481
	mcall	4,<30+IMG_SIZE,10>,,DCaptName
7012 leency 482
	mcall	 ,<30+IMG_SIZE,35>,,DCaptPath
483
	mcall	 ,<30+IMG_SIZE,59>,,DCaptParams
3853 GerdtR 484
 
485
if lang eq ru
4146 GerdtR 486
	mov	ecx,[sc.work_button_text]
7012 leency 487
	or	ecx,90000000h
488
	mcall	 ,<369,35+END_ICONS_AREAH>,,DCaptCancel
3853 GerdtR 489
 
4146 GerdtR 490
	cmp	[DlgSelIcon],-1
491
	jne	@f
7012 leency 492
	mpack	ebx,275,35+END_ICONS_AREAH
4146 GerdtR 493
	mov	edx,DCaptCreate
494
	jmp	.DRD1
3853 GerdtR 495
      @@:
7012 leency 496
	mpack	ebx,272,35+END_ICONS_AREAH
4146 GerdtR 497
	mov	edx,DCaptProperties
3853 GerdtR 498
     .DRD1:
499
else
4146 GerdtR 500
	mov	ecx,[sc.work_button_text]
7012 leency 501
	or	ecx,90000000h
502
	mcall	 ,<372,35+END_ICONS_AREAH>,,DCaptCancel
3853 GerdtR 503
 
504
 
4146 GerdtR 505
	cmp	[DlgSelIcon],-1
506
	jne	@f
7012 leency 507
	mpack	ebx,277,35+END_ICONS_AREAH
4146 GerdtR 508
	mov	edx,DCaptCreate
509
	jmp	.DRD1
3853 GerdtR 510
      @@:
7012 leency 511
	mpack	ebx,277,35+END_ICONS_AREAH
4146 GerdtR 512
	mov	edx,DCaptProperties
3853 GerdtR 513
     .DRD1:
514
end if
4146 GerdtR 515
	mcall
3853 GerdtR 516
 
7012 leency 517
	pusha
518
	mov	ecx,[sc.work_button_text]
519
	or	ecx,90000000h
520
	mcall 4,,,DCaptDots
521
	popa
3853 GerdtR 522
 
4146 GerdtR 523
	call DrawSelIcon
3853 GerdtR 524
 
4146 GerdtR 525
	mcall	12,2		;RedrawWinEnd
526
	ret
3853 GerdtR 527
endp
528
 
529
 
530
proc DrawStdIcons
531
local IcoX:DWORD,\
532
      IcoY:DWORD,\
533
      iIcon:DWORD
534
 
4146 GerdtR 535
	mov	ecx,[sbIcons.position]
536
	xor	eax,eax
537
	m2m	dword[iIcon],0
3853 GerdtR 538
 
4146 GerdtR 539
	test	ecx,ecx
540
	jz	.DST1
3853 GerdtR 541
     @@:
4146 GerdtR 542
	add	[iIcon],ICONS_DRAW_COUNTH
543
	add	eax,IMG_SIZE*IMG_SIZE*4*ICONS_DRAW_COUNTH
544
	loop	@b
3853 GerdtR 545
   .DST1:
546
 
4146 GerdtR 547
	lea	esi,[eax+44]
548
	add	esi,[raw_pointer]
3853 GerdtR 549
 
4146 GerdtR 550
	mov	[IcoX],ICONSX
3853 GerdtR 551
 
4146 GerdtR 552
	mov	ecx,ICONS_DRAW_COUNTW
3853 GerdtR 553
  .DrawIcons:
4146 GerdtR 554
	push	ecx
3853 GerdtR 555
 
4146 GerdtR 556
	mov	[IcoY],ICONSY
3853 GerdtR 557
 
4146 GerdtR 558
	mov	ecx,ICONS_DRAW_COUNTH
3853 GerdtR 559
  .DrawIcoStolb:
4146 GerdtR 560
	push	ecx
3853 GerdtR 561
 
4146 GerdtR 562
	mov	edi,DlgBufImg
563
	mov	edx,IMG_SIZE
3853 GerdtR 564
 
565
    .DrawLine:
566
 
567
 
4146 GerdtR 568
	mov	ecx,IMG_SIZE
3853 GerdtR 569
     .DrawPix:
570
 
4146 GerdtR 571
	lodsd
572
	test	eax,0FF000000h
573
	jnz	@f
574
	mov	eax,[sc.work]
3853 GerdtR 575
     @@:
576
 
4146 GerdtR 577
	mov	[edi],ax
578
	shr	eax,16
579
	mov	[edi+2],al
580
	add	edi,3
3853 GerdtR 581
 
4146 GerdtR 582
	loop	.DrawPix
3853 GerdtR 583
 
4146 GerdtR 584
	dec	edx
585
	jnz    .DrawLine
3853 GerdtR 586
 
4146 GerdtR 587
	mov	edx,[IcoX]
588
	shl	edx,16
589
	mov	dx,word[IcoY]
590
	mcall	7,DlgBufImg,
3853 GerdtR 591
 
4146 GerdtR 592
	inc	[iIcon]
593
	mov	eax,[iIcon]
594
	cmp	eax,[icon_count]
595
	jae	.endDrawIcon
3853 GerdtR 596
 
4146 GerdtR 597
	add	dword[IcoY],IMG_SIZE+SPCH
598
	pop	ecx
599
	loop	.DrawIcoStolb
3853 GerdtR 600
 
4146 GerdtR 601
	add	dword[IcoX],IMG_SIZE+SPCW
602
	pop	ecx
603
	loop	.DrawIcons
604
	jmp	.endProc
3853 GerdtR 605
 
606
    .endDrawIcon:
607
 
4146 GerdtR 608
	mov	ecx,IMG_SIZE*IMG_SIZE
609
	mov	edi,DlgBufImg
610
	mov	eax,[sc.work]
611
	mov	ebx,eax
612
	shr	ebx,16
3853 GerdtR 613
     @@:
4146 GerdtR 614
	mov	word[edi],ax
615
	mov	[edi+2],bl
616
	add	edi,3
617
	loop	@b
3853 GerdtR 618
 
5017 GerdtR 619
				     ;затирание не использованых мест
4146 GerdtR 620
	jmp	.Dalee
3853 GerdtR 621
 
622
  .DrawIcons2:
4146 GerdtR 623
	push	ecx
3853 GerdtR 624
 
4146 GerdtR 625
	mov	[IcoY],ICONSY
626
	mov	ecx,ICONS_DRAW_COUNTH
3853 GerdtR 627
  .DrawIcoStolb2:
4146 GerdtR 628
	push	ecx
3853 GerdtR 629
 
4146 GerdtR 630
	mov	edx,[IcoX]
631
	shl	edx,16
632
	mov	dx,word[IcoY]
633
	mcall	7,DlgBufImg,
3853 GerdtR 634
 
635
     .Dalee:
4146 GerdtR 636
	add	dword[IcoY],IMG_SIZE+SPCH
637
	pop	ecx
638
	loop	.DrawIcoStolb2
3853 GerdtR 639
 
4146 GerdtR 640
	add	dword[IcoX],IMG_SIZE+SPCW
641
	pop	ecx
642
	loop	.DrawIcons2
3853 GerdtR 643
 
644
   .endProc:
4007 GerdtR 645
 
4146 GerdtR 646
	ret
3853 GerdtR 647
endp
648
 
649
proc DrawSelIcon
7012 leency 650
 
651
 
652
	mov	edx,[sc.work]
653
	mcall 13,,<59,12>
654
 
655
	mov	ecx,[sc.work_text]
656
	or	ecx,90000000h
657
	mcall 4,,,DAreaIcon
658
 
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
 
7012 leency 724
	mcall	7,DlgBufImg,,<30,15>
3853 GerdtR 725
 
4146 GerdtR 726
	ret
3853 GerdtR 727
endp