Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 616 → Rev 617

/programs/develop/tinypad/trunk/tp-tbox.asm
6,7 → 6,7
tb.sel.x db ?
tb.sel.selected db ?
 
func textbox.get_width
proc textbox.get_width
push ebx edx
movzx eax,[tbox.width]
add eax,-6
19,9 → 19,9
mov eax,ebx
@@: pop edx ebx
ret
endf
endp
 
func textbox.delete_selection
proc textbox.delete_selection
cmp [tb.sel.selected],0
je .exit.2
pushad
49,9 → 49,9
.exit.2:
stc
ret
endf
endp
 
func textbox.draw ; TBOX* ebp
proc textbox.draw ; TBOX* ebp
call textbox.get_width
movzx ebx,[tbox.pos.x]
sub bl,[tbox.ofs.x]
196,9 → 196,9
add ebx,0x00010001
mcall
ret
endf
endp
 
func textbox.key
proc textbox.key
mov ebp,[focused_tb]
mov esi,accel_table_textbox
.acc: cmp ebx,[esi]
243,12 → 243,12
call textbox.draw
.exit:
ret
endf
endp
 
textbox.mouse:
ret
 
func key.tb.bkspace
proc key.tb.bkspace
call textbox.delete_selection
jnc @f
 
258,17 → 258,17
jmp key.tb.del.direct
 
@@: ret
endf
endp
 
func key.tb.home
proc key.tb.home
xor al,al
mov [tbox.pos.x],al
mov [tbox.sel.x],al
mov [tbox.ofs.x],al
ret
endf
endp
 
func key.tb.left
proc key.tb.left
mov al,[tbox.pos.x]
mov [tbox.sel.x],al
dec al
281,9 → 281,9
jge @f
mov [tbox.ofs.x],0
@@: ret
endf
endp
 
func key.tb.right
proc key.tb.right
call textbox.get_width
mov bl,[tbox.pos.x]
mov [tbox.sel.x],bl
297,9 → 297,9
jbe @f
inc [tbox.ofs.x]
@@: ret
endf
endp
 
func key.tb.end
proc key.tb.end
call textbox.get_width
movzx ebx,[tbox.length]
mov [tbox.pos.x],bl
309,9 → 309,9
xor bl,bl
@@: mov [tbox.ofs.x],bl
ret
endf
endp
 
func key.tb.del
proc key.tb.del
call textbox.delete_selection
jnc @f
.direct:
327,16 → 327,16
rep movsb
 
@@: ret
endf
endp
 
func key.tb.shift_home
proc key.tb.shift_home
xor al,al
mov [tbox.pos.x],al
mov [tbox.ofs.x],al
ret
endf
endp
 
func key.tb.shift_left
proc key.tb.shift_left
mov al,[tbox.pos.x]
dec al
js @f
347,9 → 347,9
jge @f
mov [tbox.ofs.x],0
@@: ret
endf
endp
 
func key.tb.shift_right
proc key.tb.shift_right
call textbox.get_width
mov bl,[tbox.pos.x]
inc bl
361,9 → 361,9
jbe @f
inc [tbox.ofs.x]
@@: ret
endf
endp
 
func key.tb.shift_end
proc key.tb.shift_end
call textbox.get_width
movzx ebx,[tbox.length]
mov [tbox.pos.x],bl
372,4 → 372,4
xor bl,bl
@@: mov [tbox.ofs.x],bl
ret
endf
endp