Subversion Repositories Kolibri OS

Rev

Rev 297 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 297 Rev 617
Line 4... Line 4...
4
 
4
 
5
tb.pos.x	db ?
5
tb.pos.x	db ?
6
tb.sel.x	db ?
6
tb.sel.x	db ?
Line 7... Line 7...
7
tb.sel.selected db ?
7
tb.sel.selected db ?
8
 
8
 
9
func textbox.get_width
9
proc textbox.get_width
10
	push	ebx edx
10
	push	ebx edx
11
	movzx	eax,[tbox.width]
11
	movzx	eax,[tbox.width]
12
	add	eax,-6
12
	add	eax,-6
Line 17... Line 17...
17
	cmp	eax,ebx
17
	cmp	eax,ebx
18
	jle	@f
18
	jle	@f
19
	mov	eax,ebx
19
	mov	eax,ebx
20
    @@: pop	edx ebx
20
    @@: pop	edx ebx
21
	ret
21
	ret
22
endf
22
endp
Line 23... Line 23...
23
 
23
 
24
func textbox.delete_selection
24
proc textbox.delete_selection
25
	cmp	[tb.sel.selected],0
25
	cmp	[tb.sel.selected],0
26
	je	.exit.2
26
	je	.exit.2
27
	pushad
27
	pushad
28
	movzx	ecx,[tbox.length]
28
	movzx	ecx,[tbox.length]
Line 47... Line 47...
47
	ret
47
	ret
Line 48... Line 48...
48
 
48
 
49
  .exit.2:
49
  .exit.2:
50
	stc
50
	stc
51
	ret
51
	ret
Line 52... Line 52...
52
endf
52
endp
53
 
53
 
54
func textbox.draw ; TBOX* ebp
54
proc textbox.draw ; TBOX* ebp
55
	call	textbox.get_width
55
	call	textbox.get_width
56
	movzx	ebx,[tbox.pos.x]
56
	movzx	ebx,[tbox.pos.x]
57
	sub	bl,[tbox.ofs.x]
57
	sub	bl,[tbox.ofs.x]
Line 194... Line 194...
194
	add	ecx,-5*65536+4
194
	add	ecx,-5*65536+4
195
	mcall	38,,,0x01000000
195
	mcall	38,,,0x01000000
196
	add	ebx,0x00010001
196
	add	ebx,0x00010001
197
	mcall
197
	mcall
198
	ret
198
	ret
199
endf
199
endp
Line 200... Line 200...
200
 
200
 
201
func textbox.key
201
proc textbox.key
202
	mov	ebp,[focused_tb]
202
	mov	ebp,[focused_tb]
203
	mov	esi,accel_table_textbox
203
	mov	esi,accel_table_textbox
204
  .acc: cmp	ebx,[esi]
204
  .acc: cmp	ebx,[esi]
205
	jne	@f
205
	jne	@f
Line 241... Line 241...
241
 
241
 
242
  .exit.2:
242
  .exit.2:
243
	call	textbox.draw
243
	call	textbox.draw
244
  .exit:
244
  .exit:
245
	ret
245
	ret
Line 246... Line 246...
246
endf
246
endp
247
 
247
 
Line 248... Line 248...
248
textbox.mouse:
248
textbox.mouse:
249
	ret
249
	ret
250
 
250
 
Line 251... Line 251...
251
func key.tb.bkspace
251
proc key.tb.bkspace
252
	call	textbox.delete_selection
252
	call	textbox.delete_selection
253
	jnc	@f
253
	jnc	@f
254
 
254
 
Line 255... Line 255...
255
	cmp	[tbox.pos.x],0
255
	cmp	[tbox.pos.x],0
256
	je	@f
256
	je	@f
Line 257... Line 257...
257
	call	key.tb.left
257
	call	key.tb.left
258
	jmp	key.tb.del.direct
258
	jmp	key.tb.del.direct
259
 
259
 
260
    @@: ret
260
    @@: ret
261
endf
261
endp
262
 
262
 
263
func key.tb.home
263
proc key.tb.home
Line 264... Line 264...
264
	xor	al,al
264
	xor	al,al
265
	mov	[tbox.pos.x],al
265
	mov	[tbox.pos.x],al
266
	mov	[tbox.sel.x],al
266
	mov	[tbox.sel.x],al
267
	mov	[tbox.ofs.x],al
267
	mov	[tbox.ofs.x],al
268
	ret
268
	ret
269
endf
269
endp
Line 279... Line 279...
279
	jl	@f
279
	jl	@f
280
	sub	[tbox.ofs.x],8
280
	sub	[tbox.ofs.x],8
281
	jge	@f
281
	jge	@f
282
	mov	[tbox.ofs.x],0
282
	mov	[tbox.ofs.x],0
283
    @@: ret
283
    @@: ret
284
endf
284
endp
Line 285... Line 285...
285
 
285
 
286
func key.tb.right
286
proc key.tb.right
287
	call	textbox.get_width
287
	call	textbox.get_width
288
	mov	bl,[tbox.pos.x]
288
	mov	bl,[tbox.pos.x]
289
	mov	[tbox.sel.x],bl
289
	mov	[tbox.sel.x],bl
290
	inc	bl
290
	inc	bl
Line 295... Line 295...
295
	sub	bl,[tbox.ofs.x]
295
	sub	bl,[tbox.ofs.x]
296
	cmp	bl,al
296
	cmp	bl,al
297
	jbe	@f
297
	jbe	@f
298
	inc	[tbox.ofs.x]
298
	inc	[tbox.ofs.x]
299
    @@: ret
299
    @@: ret
300
endf
300
endp
Line 301... Line 301...
301
 
301
 
302
func key.tb.end
302
proc key.tb.end
303
	call	textbox.get_width
303
	call	textbox.get_width
304
	movzx	ebx,[tbox.length]
304
	movzx	ebx,[tbox.length]
305
	mov	[tbox.pos.x],bl
305
	mov	[tbox.pos.x],bl
306
	mov	[tbox.sel.x],bl
306
	mov	[tbox.sel.x],bl
307
	sub	ebx,eax
307
	sub	ebx,eax
308
	jge	@f
308
	jge	@f
309
	xor	bl,bl
309
	xor	bl,bl
310
    @@: mov	[tbox.ofs.x],bl
310
    @@: mov	[tbox.ofs.x],bl
311
	ret
311
	ret
Line 312... Line 312...
312
endf
312
endp
313
 
313
 
314
func key.tb.del
314
proc key.tb.del
315
	call	textbox.delete_selection
315
	call	textbox.delete_selection
316
	jnc	@f
316
	jnc	@f
317
  .direct:
317
  .direct:
Line 325... Line 325...
325
	dec	[tbox.length]
325
	dec	[tbox.length]
326
	cld
326
	cld
327
	rep	movsb
327
	rep	movsb
Line 328... Line 328...
328
 
328
 
329
    @@: ret
329
    @@: ret
Line 330... Line 330...
330
endf
330
endp
331
 
331
 
332
func key.tb.shift_home
332
proc key.tb.shift_home
333
	xor	al,al
333
	xor	al,al
334
	mov	[tbox.pos.x],al
334
	mov	[tbox.pos.x],al
335
	mov	[tbox.ofs.x],al
335
	mov	[tbox.ofs.x],al
Line 336... Line 336...
336
	ret
336
	ret
337
endf
337
endp
338
 
338
 
339
func key.tb.shift_left
339
proc key.tb.shift_left
340
	mov	al,[tbox.pos.x]
340
	mov	al,[tbox.pos.x]
341
	dec	al
341
	dec	al
342
	js	@f
342
	js	@f
343
	mov	[tbox.pos.x],al
343
	mov	[tbox.pos.x],al
344
	cmp	[tbox.ofs.x],al
344
	cmp	[tbox.ofs.x],al
345
	jl	@f
345
	jl	@f
346
	sub	[tbox.ofs.x],8
346
	sub	[tbox.ofs.x],8
347
	jge	@f
347
	jge	@f
Line 348... Line 348...
348
	mov	[tbox.ofs.x],0
348
	mov	[tbox.ofs.x],0
349
    @@: ret
349
    @@: ret
350
endf
350
endp
351
 
351
 
352
func key.tb.shift_right
352
proc key.tb.shift_right
353
	call	textbox.get_width
353
	call	textbox.get_width
Line 359... Line 359...
359
	sub	bl,[tbox.ofs.x]
359
	sub	bl,[tbox.ofs.x]
360
	cmp	bl,al
360
	cmp	bl,al
361
	jbe	@f
361
	jbe	@f
362
	inc	[tbox.ofs.x]
362
	inc	[tbox.ofs.x]
363
    @@: ret
363
    @@: ret
364
endf
364
endp
Line 365... Line 365...
365
 
365
 
366
func key.tb.shift_end
366
proc key.tb.shift_end
367
	call	textbox.get_width
367
	call	textbox.get_width
368
	movzx	ebx,[tbox.length]
368
	movzx	ebx,[tbox.length]
369
	mov	[tbox.pos.x],bl
369
	mov	[tbox.pos.x],bl
370
	sub	ebx,eax
370
	sub	ebx,eax
371
	jge	@f
371
	jge	@f
372
	xor	bl,bl
372
	xor	bl,bl
373
    @@: mov	[tbox.ofs.x],bl
373
    @@: mov	[tbox.ofs.x],bl
374
	ret
374
	ret