Subversion Repositories Kolibri OS

Rev

Rev 259 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
258 mikedld 1
;-----------------------------------------------------------------------------
2
func define_3d_button ;///////////////////////////////////////////////////////
3
;-----------------------------------------------------------------------------
4
; ebx = 
5
; ecx = 
6
; esp+4*3 = id
7
; esp+4*2 = text
8
; esp+4*1 = text length
9
;-----------------------------------------------------------------------------
10
	pushad
11
	mov	edx,[esp+4*8+4+4*2]
12
	or	edx,0x40000000
13
	mcall	8
14
	mov	eax,[esp+4*8+4*1]
15
	add	eax,2
16
	imul	eax,6
17
	pushad
18
	shr	ebx,16
19
	shr	ecx,16
20
	push	ebx ecx eax 15
21
	call	draw_3d_panel
22
	popad
23
	shr	ecx,16
24
	mov	bx,cx
25
	add	ebx,7*65536+4
26
	mcall	4,,[sc.work_text],[esp+4*8+4*2],[esp+4*8+4*1]
27
	popad
28
	ret	4*3
29
endf
30
 
31
finddlg_handler:
32
	cmp	al,1
33
	je	.draw
34
	cmp	al,2
35
	je	.key
36
	cmp	al,3
37
	je	botdlg.button
38
	ret
39
 
40
  .draw:
41
	mov	ebx,[bot_ofs]
42
	add	ebx,(1+3)*65536+6
43
	mcall	4,,[sc.work_text],s_2find,s_2find.size+1
44
	mov	ecx,[bot_ofs]
45
	shl	ecx,16
46
	add	ecx,(3+17)*65536+15
47
 
48
	push	ecx
49
	cmp	[bot_dlg_mode2],0
50
	je	@f
51
	add	ebx,18
52
	mcall	4,,[sc.work_text],s_2replace,s_2replace.size+1
53
	mov	ecx,[esp]
54
	add	ecx,18*65536
55
    @@:
56
 
57
	mov	ebx,[p_info.client_box.width]
58
	shl	ebx,16
59
 
60
	push	20003
61
	cmp	[bot_dlg_mode2],0
62
	jne	.draw.lp1
63
	add	ebx,-(2+6*(s_2find.size+2))*65536+6*(s_2find.size+2)
64
	push	s_2find s_2find.size
65
	jmp	@f
66
 
67
  .draw.lp1:
68
	add	ebx,-(2+6*(s_2replace.size+2))*65536+6*(s_2replace.size+2)
69
	push	s_2replace s_2replace.size
70
 
71
    @@: call	define_3d_button
72
	sub	ebx,(6*(s_2cancel.size+2)+3)*65536
73
	mov	bx,6*(s_2cancel.size+2)
74
	push	20001 s_2cancel s_2cancel.size
75
	call	define_3d_button
76
 
77
	mov	ecx,[esp]
78
 
79
	mov	ebp,tb_find
80
	mov	eax,[p_info.client_box.width]
81
	sub	eax,6*(s_2find.size+2)+1
82
	add	eax,6*(s_2find.size+2)*65536
83
	mov	dword[tbox.x],eax
84
	add	ecx,-18*65536+1
85
	mov	dword[tbox.y],ecx
86
	call	textbox.draw
87
 
88
	pop	ecx
89
 
90
	cmp	[bot_dlg_mode2],0
91
	je	@f
92
	mov	ebp,tb_replace
93
	mov	eax,[p_info.client_box.width]
94
	sub	eax,6*(s_2replace.size+2)+1
95
	add	eax,6*(s_2replace.size+2)*65536
96
	mov	dword[tbox.x],eax
97
	inc	ecx
98
	mov	dword[tbox.y],ecx
99
	call	textbox.draw
100
    @@:
101
 
102
	ret
103
 
104
  .key:
105
	cmp	ebx,KEY_ESCAPE
106
	je	btn.bot.cancel
107
	cmp	ebx,KEY_RETURN
108
	je	btn.bot.find
109
	cmp	ebx,KEY_NUMRETURN
110
	je	btn.bot.find
111
	cmp	ebx,KEY_TAB
112
	je	..tab
113
	call	textbox.key
114
	ret
115
 
116
  ..tab:
117
	cmp	[bot_dlg_mode2],0
118
	je	@f
119
	mov	eax,tb_replace
120
	cmp	eax,[focused_tb]
121
	jne	.key.lp1
122
	mov	eax,tb_find
123
  .key.lp1:
124
	mov	[focused_tb],eax
125
	call	.draw
126
    @@: ret
127
 
128
osdlg_handler:
129
	cmp	al,1
130
	je	.draw
131
	cmp	al,2
132
	je	.key
133
	cmp	al,3
134
	je	botdlg.button
135
	ret
136
 
137
  .draw:
138
	mov	ebx,[bot_ofs]
139
	add	ebx,(1+3)*65536+6
140
	mcall	4,,[sc.work_text],s_2filename,s_2filename.size
141
	mov	ebx,[p_info.client_box.width]
142
	shl	ebx,16
143
	mov	ecx,[bot_ofs]
144
	shl	ecx,16
145
	add	ecx,(2+18)*65536+15
146
 
147
	push	20002
148
	cmp	[bot_dlg_mode2],0
149
	jne	.draw.lp1
150
	add	ebx,-(2+6*(s_2open.size+2))*65536+6*(s_2open.size+2)
151
	push	s_2open s_2open.size
152
	jmp	@f
153
  .draw.lp1:
154
	add	ebx,-(2+6*(s_2save.size+2))*65536+6*(s_2save.size+2)
155
	push	s_2save s_2save.size
156
 
157
    @@: call	define_3d_button
158
	sub	ebx,(6*(s_2cancel.size+2)+3)*65536
159
	mov	bx,6*(s_2cancel.size+2)
160
	push	20001 s_2cancel s_2cancel.size
161
	call	define_3d_button
162
 
163
	mov	ebp,tb_opensave
164
	mov	eax,[p_info.client_box.width]
165
	sub	eax,6*(s_2filename.size+1)+1
166
	add	eax,6*(s_2filename.size+1)*65536
167
	mov	dword[tbox.x],eax
168
	add	ecx,-18*65536+1
169
	mov	dword[tbox.y],ecx
170
	call	textbox.draw
171
 
172
	ret
173
 
174
  .key:
175
	cmp	ebx,KEY_ESCAPE
176
	je	btn.bot.cancel
177
	cmp	ebx,KEY_RETURN
178
	je	btn.bot.opensave
179
	cmp	ebx,KEY_NUMRETURN
180
	je	btn.bot.opensave
181
	call	textbox.key
182
	ret
183
 
184
gotodlg_handler:
185
	cmp	al,1
186
	je	.draw
187
	cmp	al,2
188
	je	.key
189
	cmp	al,3
190
	je	botdlg.button
191
	ret
192
 
193
  .draw:
194
	mov	ebx,[bot_ofs]
195
	add	ebx,(1+3)*65536+6
196
	mcall	4,,[sc.work_text],s_2filename,s_2filename.size
197
	mov	ebx,[p_info.box.width]
198
	shl	ebx,16
199
	mov	ecx,[bot_ofs]
200
	shl	ecx,16
201
	add	ecx,(2+18)*65536+15
202
 
203
	push	20002
204
	cmp	[bot_dlg_mode2],0
205
	jne	.draw.lp1
206
	add	ebx,-(2+6*(s_2open.size+2))*65536+6*(s_2open.size+2)
207
	push	s_2open s_2open.size
208
	jmp	@f
209
  .draw.lp1:
210
	add	ebx,-(2+6*(s_2save.size+2))*65536+6*(s_2save.size+2)
211
	push	s_2save s_2save.size
212
 
213
    @@: call	define_3d_button
214
	sub	ebx,(6*(s_2cancel.size+2)+3)*65536
215
	mov	bx,6*(s_2cancel.size+2)
216
	push	20001 s_2cancel s_2cancel.size
217
	call	define_3d_button
218
 
219
	mov	ebp,tb_opensave
220
	mov	eax,[p_info.box.width]
221
	sub	eax,6*(s_2filename.size+3)
222
	add	eax,6*(s_2filename.size+2)*65536
223
	mov	dword[tbox.x],eax
224
	add	ecx,-18*65536+1
225
	mov	dword[tbox.y],ecx
226
	call	textbox.draw
227
 
228
	ret
229
 
230
  .key:
231
	cmp	ebx,KEY_ESCAPE
232
	je	btn.bot.cancel
233
	cmp	ebx,KEY_RETURN
234
	je	btn.bot.opensave
235
	cmp	ebx,KEY_NUMRETURN
236
	je	btn.bot.opensave
237
	call	textbox.key
238
	ret
239
 
240
botdlg.button:
241
	mov	esi,accel_table2_botdlg
242
  .acc: cmp	ebx,[esi]
243
	jne	@f
244
	call	dword[esi+4]
245
	ret
246
    @@: add	esi,8
247
	cmp	byte[esi],0
248
	jne	.acc
249
	ret
250
 
251
  btn.bot.cancel:
252
	xor	eax,eax
253
	mov	[bot_mode],al
254
	mov	[bot_dlg_height],eax
255
	mov	[s_status],eax
256
	call	drawwindow
257
	ret
258
 
259
  btn.bot.opensave:
260
	cmp	[bot_dlg_mode2],0
261
	je	.lp1
262
	call	save_file
263
	jnc	@f
264
	jmp	.lp2
265
  .lp1: call	btn.load_file
266
	jnc	@f
267
  .lp2:
268
	ret
269
    @@: call	update_caption
270
	xor	eax,eax
271
	mov	[bot_mode],al
272
	mov	[bot_dlg_height],eax
273
	call	drawwindow
274
	ret
275
 
276
  btn.bot.find:
277
	movzx	ecx,[tb_find.length]
278
	mov	[s_search.size],ecx
279
	mov	esi,tb_find.text
280
	mov	edi,s_search
281
	cld
282
	rep	movsb
283
 
284
	cmp	[bot_dlg_mode2],0
285
	je	@f
286
	call	search
287
	jnc	.found
288
	call	check_inv_all
289
	ret
290
 
291
  .found:
292
;---------------------------------------
293
	push	[copy_size] [copy_count]
294
 
295
	mov	esi,AREA_CBUF
296
	mov	edi,AREA_CBUF-304
297
	mov	ecx,300/4
298
	rep	movsd
299
 
300
	movzx	eax,[tb_replace.length]
301
	mov	esi,tb_replace.text
302
	mov	edi,AREA_CBUF
303
	stosd
304
	mov	ecx,eax
305
	jecxz	.lp1
306
	rep	movsb
307
  .lp1: add	eax,4
308
	mov	[copy_size],eax
309
	mov	[copy_count],1
310
 
311
	push	[sel.x]
312
	call	init_sel_vars
313
	call	key.ctrl_v
314
	pop	[sel.x]
315
 
316
	mov	esi,AREA_CBUF-304
317
	mov	edi,AREA_CBUF
318
	mov	ecx,300/4
319
	rep	movsd
320
 
321
	pop	[copy_count] [copy_size]
322
;---------------------------------------
323
 
324
	call	check_inv_all
325
	ret
326
    @@: xor	eax,eax
327
	mov	[bot_mode],al
328
	mov	[bot_dlg_height],eax
329
	call	btn.search
330
	call	drawwindow
331
	ret