Subversion Repositories Kolibri OS

Rev

Rev 7012 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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