Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 294 → Rev 295

/programs/develop/examples/editbox/trunk/EDITBOX.INC
1,4 → 1,5
; <Lrz> 23.01.2007 ¯®ä¨ªá¥« ¡ £¨ ¢ë§¢ ­ë¥ ­¥ ¯à ¢¨«ì­ë¬ ª®¤®¬ )).
; <Lrz> 26.01.2007 ­®à¬ «ì­ ï à ¡®â  ª®¬¯ ­¥­â  ¨á¯à ¢¨« äãªæ¨î .check_offset
; <Lrz> 24.01.2007 ¯®ä¨ªá¥« ¡ £¨ ¢ë§¢ ­ë¥ ­¥ ¯à ¢¨«ì­ë¬ ª®¤®¬ )).
; <Lrz> 22.01.2007 ¨§¡ ¢¨«áï ®â £«îª®¢ ¯à¨ à ¡®â¥ á ¢ë¤¥«¥­¨¥¬ ¨ 㤠«¥­¨¥, ª®à४⭠ï à ¡®â  ª« ¢¨è¥© del & backspase
; <Lrz> 20.01.2007 ॠ«¨§®¢ « ¢ë¤¥«¥­¨¥ ⥪áâ  ¯® shift
; <Lrz> 12.12.2006 ॠ«¨§®¢ « ¯®¤¤¥à¦ªã ª­®¯ª¨ insert ¨ ᥣ®¤ï ª®¬¯®­¥­â ¯®ç⨠ࠡ®â ¥â!!!!
281,40 → 282,42
;----------------------------------------------------------
.check_offset:
pushad
push dword ed_offset ;á®åà ­¨¬ ᬥ饭¨¥
mov ecx,ed_pos
mov ebx,ed_offset
cmp ebx,ecx
ja .sub_8
 
push ebx
call .get_n ;¯®«ã稬 ª®«-¢® ᨬ¢®«®¢ ¢ ¯ à¥ ॣ¨áâ஢ edx:eax
mov ebx,eax
mov eax,ed_pos
xor edx,edx
idiv ebx
xor edx,edx
imul eax,ebx
mov ed_offset,eax
pop ebx
cmp ax,bx
je @f
;;;;;;;; ¤ ­­ë¥ ¤«ï § ªà è¨¢ ­¨ï ¢á¥© ¯®«®áë ¯àאַ㣮«ì­¨ª 
mov ebx,ed_left
inc ebx
shl ebx,16
mov bx,ed_width
dec ebx
mov edx,ed_color
call .draw_bg_eax
mov dword [esp+28],0
@@: popad
ret
;==========================================================
;=== ®¡à ¡®âª  ª« ¢¨ âãàë =================================
;==========================================================
.key:
pusha
test word ed_flags,ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je .no_figure ;@f
mov edx,ebx
add edx,eax ;ed_offset+width editbox
cmp edx,ecx
ja @f
 
mov edx,ed_size
sub edx,eax
cmp edx,8
jbe .add_8
mov ebx,edx
; add ebx,8
jmp .chk_d
 
.sub_8: cmp ecx,0
je .sub_min
cmp ebx,8
jbe .sub_min
sub ebx,8 ;ebx=ed_offset
jmp .chk_d
.sub_min:
xor ebx,ebx
jmp .chk_d
 
.add_8: mov ebx,edx
; ;----------- ®â« ¤ª 
; pushad
; mov [data_of_code],0
; mov eax,edi;word ed_flags
; mov eax,ebx;ed_offset
; mov edi,data_of_code
; call .str
; ;à¨á®¢ ­¨¥ ä®­ 
333,6 → 336,49
; popad
; ;----------- ®â« ¤ª 
 
.chk_d: mov ed_offset,ebx
 
call .draw_bg
mov dword [esp+28],-1
popad
ret
 
@@:
mov dword [esp+28],0
popad
ret
 
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; mov ebx,eax
; mov eax,ed_pos
; xor edx,edx
; idiv ebx
; xor edx,edx
; imul eax,ebx
; mov ed_offset,eax
; pop ebx
; cmp ax,bx
; je @f
;;;;;;;; ¤ ­­ë¥ ¤«ï § ªà è¨¢ ­¨ï ¢á¥© ¯®«®áë ¯àאַ㣮«ì­¨ª 
; mov ebx,ed_left
; inc ebx
; shl ebx,16
; mov bx,ed_width
; dec ebx
; mov edx,ed_color
; call .draw_bg_eax
; mov dword [esp+28],0
;@@: popad
; ret
;==========================================================
;=== ®¡à ¡®âª  ª« ¢¨ âãàë =================================
;==========================================================
.key:
pusha
test word ed_flags,ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je .no_figure ;@f
 
xor ecx,ecx
push eax
inc ecx
453,8 → 499,8
; ¢áâ ¢«ï¥¬ ª®¤ ª« ¢¨è¨ â㤠, £¤¥ ªãàá®à
; 㢥«¨ç¨¢ ¥¬ §­ ç¥­¨¥ à §¬¥à  ¨ ¯®§¨æ¨¨
inc dword ed_size
inc dword ed_pos
call .draw_all2
inc dword ed_pos
jmp .shift;.draw_cursor_text
.delete:
mov edx,ed_size
509,7 → 555,13
and word ed_flags,ed_shift_cl
call .clear_cursor
call .check_offset
call .get_n
;;;;;;;;;;;;;;;
cmp eax,0
je @f
call .draw_bg
ret
;;;;;;;;;;;;;;;
@@: call .get_n
push eax
mov ebx,ed_offset
add eax,ebx ;eax = w_off= ed_offset+width
591,7 → 643,7
 
.shift: ;;;;;;;SHIFT
call .draw_bg
call .draw_bg ;­¥ ®¯â¨¬ «ì­®
test word ed_flags,ed_shift
je .f_exit
;;;;;;SHIFT end