kolibrios/programs/develop/examples/editbox/trunk/EDITBOX.INC

650 lines
20 KiB
Plaintext
Raw Normal View History

; SEE YOU File FAQ.txt and HISTORY. Good Like!
;;;;;;;;;;;;;;;;;;
include 'editbox.mac' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> :) ᯥ樠<E1AFA5><20><><EFBFBD> editbox
;;;;;;;;;;;;;;;;;;
macro use_edit_box procinfo,scr_h,scr_w
{
edit_box:
ed_width equ [edi] ;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_left equ [edi+4] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20>
ed_top equ [edi+8] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20>
ed_color equ [edi+12] ;梥<><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
shift_color equ [edi+16] ;=0x6a9480
ed_focus_border_color equ [edi+20] ;梥<><><E0A0AC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_blur_border_color equ [edi+24] ;梥<> <20><> <20><><EFBFBD><E2A8A2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_text_color equ [edi+28] ;梥<><><E2A5AA><EFBFBD>
ed_max equ [edi+32] ;<3B><><EFBFBD>-<2D><><><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E1A8AC><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_text equ [edi+36] ;㪠<><E3AAA0><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
ed_flags equ [edi+40] ;䫠<><E4ABA0>
ed_size equ [edi+42] ;<3B><><EFBFBD>-<2D><><><E1A8AC><EFBFBD><EFBFBD><EFBFBD>
ed_pos equ [edi+46] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_offset equ [edi+50] ;ᬥ饭<E1ACA5><E9A5AD>
cl_curs_x equ [edi+54] ;<3B><EFBFBD><E0A5A4><EFBFBD><20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>
cl_curs_y equ [edi+58] ;<3B><EFBFBD><E0A5A4><EFBFBD><20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>
ed_shift_pos equ [edi+62] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_shift_pos_old equ [edi+66] ;<3B><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;==========================================================
;=== <20><><EFBFBD><EFBFBD><E6A5A4><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2> =================================
;==========================================================
.draw:
pusha
;--- <20><><EFBFBD>㥬 ࠬ<><E0A0AC> ---
call .draw_border ; <20><EFBFBD><E3ADAA><EFBFBD> <20><EFBFBD><E2A0A1>
.draw_bg_cursor_text:
;--- <20><><EFBFBD><EFBFBD><EFBFBD>塞 ᬥ饭<E1ACA5><E9A5AD>, <20><20><><EFBFBD><EFBFBD> ---
call .check_offset ;<3B><><EFBFBD><EFBFBD><EFBFBD><E1ABA5><EFBFBD> <20><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E2A0A1>
;--- <20><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><E0A5AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ---
call .draw_bg ;<3B><><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><>אַ㣮<EFACAE><EFBFBD><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;---- <20><><EFBFBD><20><EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD>, <20><> shift <20><20><><EFBFBD><EFBFBD>
call .draw_shift
.draw_cursor_text:
;--- <20><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ---
;--- <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><E1AEA2><EFBFBD> ----
test word ed_flags,ed_focus
je @f
call .draw_cursor
@@:
call .draw_text
edit_ex
;==========================================================
;=== <20><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> =================================
;==========================================================
.key:
pusha
test word ed_flags,ed_focus ; <20><20><> <20><><E4AEAA><EFBFBD>, <20><><EFBFBD><E5AEA4>
je .no_figure
;<3B><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD> shift ?
call .check_shift
;----------------------------------------------------------
;--- <20><EFBFBD><E0AEA2>塞, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> --------------------------------
;----------------------------------------------------------
use_key_process backspase,delete,left,right,home,end,insert
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<3B><><EFBFBD><EFBFBD><EFBFBD><20><> <20><><EFBFBD><E0A0A1><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20>.<2E>. <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E3A6A5><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><E5AEA4> <20><><20><> <20><><EFBFBD><E0A0A1><EFBFBD>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_key_no_process up,down,esc
;--- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ---
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<3B><EFBFBD><20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> <20><><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><20><EFBFBD> <20><EFBFBD><EBA2AE><EFBFBD><EFBFBD> ⮫쪮 <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><EFBFBD><E3A6AD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>᫨ ⠪<><E2A0AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E5AEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_key_figures_only
;<3B><EFBFBD><20><> shift
@@: test word ed_flags,ed_shift_on
je @f
;<3B><EFBFBD><E5AEA4><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> edx=ed_size;ecx=ed_pos
push eax
mov edx,ed_size
mov ecx,ed_pos
pusha
;clear
; mov ebp,edx ;ed_size
; call .clear_bg
mov ebp,ed_color
mov ebx,dword ed_shift_pos
call .sh_cl_
.sh_nxt:popa
call .del_char
;;;;
mov eax,dword ed_shift_pos
mov ebx,ed_size
sub ebx,eax
mov ed_size,ebx
pop eax
; <20><EFBFBD><E0AEA2>塞, <20><><EFBFBD><E5AEA4><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>
@@: mov ecx,ed_size
mov edx, ed_max
test word ed_flags,ed_insert
jne @f
cmp ecx,edx
jae .no_figure
@@: mov ebx, ed_pos
cmp ebx,edx
jl @f ; <20><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><><E0A0A2>
.no_figure:
edit_ex
.insert: test word ed_flags,ed_insert ;not word ed_insert
je .insert_1
and word ed_flags,ed_insert_cl
jmp .no_figure
.insert_1:
or word ed_flags,ed_insert
jmp .no_figure
.ins_v:
dec dword [ebp+42];ed_size ;processing is insert
sub esi,ecx
add esi,ebx
mov edi,esi
;clear
pusha
mov edi,ebp
mov ebp,ed_pos
call .clear_bg
popa
jmp .In_k
@@: ; ᤢ<><E1A4A2><EFBFBD><EFBFBD><EFBFBD><><E1A8AC><EFBFBD><EFBFBD> <20><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
mov ecx,ed_size
push edi eax
mov ebp,edi
mov esi,ed_text ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
;<3B><EFBFBD><><E0A0A1><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><E0AEAA>
add esi,ecx ;add ed_size <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> max size
mov edi,esi
cmp ecx,ebx ;<3B><20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = ⥪<><EFBFBD><><E0A0A7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E2A0AD><EFBFBD><><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20>.<2E>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>
je .In_k
test word [ebp+40],ed_insert ;IF insert is enable <20>.<2E>. edi <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><20><>१ ebp
jne .ins_v
;clear
pusha
mov edi,ebp
mov ebp,ed_size
call .clear_bg
popa
sub ecx,ebx ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>-<2D><><><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
inc edi ;<3B><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><><E1A8AC><EFBFBD><EFBFBD> <20> <20><EFBFBD>
std
inc ecx
@@:
;--------
lodsb
stosb
;--------
loop @b
.In_k: cld
pop eax
mov al,ah
stosb
pop edi
; <20><><EFBFBD><20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>㤠, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
; 㢥<><E3A2A5><EFBFBD><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD><><E0A0A7><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
inc dword ed_size
inc dword ed_pos
call .draw_all2
jmp .shift;.draw_cursor_text
.delete:
mov edx,ed_size
mov ecx,ed_pos
cmp edx,ecx
jg .bac_del
test word ed_flags,ed_shift_on
jne .del_bac
edit_ex
.bac_del:
call .del_char
jmp .draw_all
;--- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> backspace ---
.backspace:
; <20><EFBFBD><E0AEA2>塞, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ?
mov ecx,ed_pos
test ecx,ecx
jnz .del_bac
test word ed_flags,ed_shift_on
jne .bac_del
edit_ex
.del_bac:
mov edx,ed_size
cmp edx,ecx ;if ed_pos=ed_size
je @f
dec ecx
call .del_char
@@: test word ed_flags,ed_shift_on
jne .bac_del
dec dword ed_pos
.draw_all:
push .shift;.draw_cursor_text;eax
test word ed_flags,ed_shift_on
je @f
mov eax,dword ed_shift_pos
mov ebx,ed_size
sub ebx,eax
mov ed_size,ebx
mov ebp,ed_color
call .clear_cursor
call .check_offset
call .draw_bg
ret
@@: dec dword ed_size
.draw_all2:
and word ed_flags,ed_shift_cl
mov ebp,ed_color
call .clear_cursor
call .check_offset
mov ebp,ed_size
call .clear_bg
ret
;--- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> left ---
.left: mov ebx,ed_pos
test ebx,ebx
jz .sh_st_of
or word ed_flags,ed_left_fl
call .sh_first_sh
dec dword ed_pos
call .sh_enable
jmp .draw_cursor_text
;--- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> right ---
.right: mov ebx,ed_pos
cmp ebx,ed_size
je .sh_st_of
and word ed_flags,ed_right_fl
call .sh_first_sh
inc dword ed_pos
call .sh_enable
jmp .draw_cursor_text
.home:
mov ebx,ed_pos
test ebx,ebx
jz .sh_st_of
call .sh_first_sh
xor eax,eax
mov ed_pos,eax
call .sh_home_end
jmp .draw_cursor_text
.end:
mov ebx,ed_pos
cmp ebx,dword ed_size
je .sh_st_of
call .sh_first_sh
mov eax,ed_size
mov ed_pos,eax
call .sh_home_end
jmp .draw_cursor_text
;==========================================================
;=== <20><><EFBFBD><20><><EFBFBD><EFBFBD> =======================================
;==========================================================
.mouse:
pusha
;debug
;----------------------------------------------------------
;--- <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> -----------------------
;----------------------------------------------------------
mcall 37,2
;----------------------------------------------------------
;--- <20><EFBFBD><E0AEA2><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----------------------------------
;----------------------------------------------------------
test eax,1
jnz .mouse_left_button
and word ed_flags,ed_mouse_on_off
xor ebx,ebx
mov dword [mouse_flag],ebx
edit_ex
.mouse_left_button:
;----------------------------------------------------------
;--- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2> <20><><><E4AEAA><EFBFBD><EFBFBD><E0AEA2> <20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;----------------------------------------------------------
mov eax,dword [mouse_flag]
test eax,eax
jz @f
cmp eax,edi
je @f
jmp ._blur
;----------------------------------------------------------
;--- <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><E2ADAE>⥫쭮 0 <20>.<2E> <20><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
;----------------------------------------------------------
@@: mcall 37,0
;----------------------------------------------------------
;--- <20> <20><> 㤥ন<E3A4A5><E0A6A8><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>誨, <20><><EFBFBD><E0A5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD>?
;----------------------------------------------------------
test word ed_flags,ed_mouse_on
jne .mouse_wigwag
;----------------------------------------------------------
;--- <20><EFBFBD><E0AEA2>塞, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> edit box -------------
;----------------------------------------------------------
mov ebx,[procinfo.box.top]
add ebx,ed_top
if scr_h eq
else
add ebx,scr_h
end if
cmp ax,bx
jl ._blur;.mouse_end_no_focus
add ebx,ed_height
cmp ax,bx
jg ._blur;.mouse_end_no_focus
shr eax,16
mov ebx,[procinfo.box.left]
add ebx,ed_left
if scr_w eq
else
add ebx,scr_w
end if
cmp ax,bx
jl ._blur;.mouse_end_no_focus
add ebx,ed_width
cmp ax,bx
jg ._blur;.mouse_end_no_focus
;--- <20><><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ---
push eax
mov ebp,ed_color
call .clear_cursor
pop eax
._mvpos:
mov ebx,dword [procinfo.box.left]
xor edx,edx
sub eax,ed_left
sub eax,ebx
if scr_w eq
else
add ebx,scr_w
sub eax,2
end if
mov ebx,6
div bx
add eax,ed_offset
cmp eax,ed_size
jna ._mshift
mov eax,ed_size
._mshift:
;;;;;;;
;;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⪨ shift <20> <20><EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20><> shift
;;;;;;;
test word ed_flags,ed_shift_bac
je @f
mov ebp,dword ed_color
mov ebx,dword ed_shift_pos
push eax
call .sh_cl_
and word ed_flags,ed_shift_bac_cl
pop eax
@@:
test word ed_flags,ed_mouse_on
jne @f
mov dword ed_shift_pos,eax
or word ed_flags,ed_mouse_on
mov dword ed_pos,eax
mov dword [mouse_flag],edi ;<3B><><EFBFBD><E2A0AD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4A8AA><EFBFBD><EFBFBD>
bts word ed_flags,1 ;<3B><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><><E4AEAA><EFBFBD>
jmp .m_sh
@@:
cmp eax,dword ed_shift_pos ;<3B><20><><EFBFBD><EFBFBD><20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
je .mouse_ex
mov ed_pos,eax
mov ebp,dword shift_color
mov ebx,dword ed_shift_pos
call .sh_cl_
or word ed_flags,ed_mous_adn_b ;<3B><><EFBFBD><E2A0AD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20><> <20><EFBFBD><EBA4A5><EFBFBD><EFBFBD> +shift_on +
.m_sh: call .draw_text
call .draw_cursor
;----------------------------------------------------------
;--- <20><><EFBFBD><EFBFBD><E6A5A4><EFBFBD> <20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><><E4AEAA><EFBFBD> ---------------------------
;----------------------------------------------------------
jmp .drc
._blur:
test word ed_flags,ed_always_focus
jne .mouse_ex
btr word ed_flags,1 ; <20><20><> <20><><E4AEAA><EFBFBD>, <20><><EFBFBD><E5AEA4>
jnc .mouse_ex
mov ebp,ed_color
call .clear_cursor
.drc: call .draw_border
.mouse_ex:
edit_ex
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<3B><><20>㭪樨 <20><><EFBFBD>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_general_func
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<3B>㭪樨 <20><><EFBFBD><><E0A0A1><EFBFBD> <20> key
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_key_func
;----------------------------------------------------------
;--- <20><><EFBFBD><EFBFBD><E6A5A4><EFBFBD><><EFBFBD><EBA2A0><EFBFBD><><E4AEAA><EFBFBD> --------------------------
;----------------------------------------------------------
;.blur:
;pusha
;._blur:
;btr ed_flags,1
;jnc @f
;call .draw_border
;call .clear_cursor
;@@:
;edit_ex
;----------------------------------------------------------
;--- <20><><EFBFBD>⪠ .mouse_wigwag
;----------------------------------------------------------
.mouse_wigwag:
shr eax,16
or word ed_flags,ed_shift_bac+ed_shift_on+ed_shift
;;;;;;;;;;;;;;;;;;
;;<3B><><EFBFBD><EFBFBD><E6A5A4><EFBFBD> <20><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E2A5AA><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><E5AEA4> <20><><20><> <20><EFBFBD><E0A5A4><EFBFBD> editbox
;;;;;;;;;;;;;;;;;;
mov ebx,[procinfo.box.left]
add ebx,ed_left
if scr_w eq
else
add ebx,scr_w
end if
cmp eax,ebx
jb .mleft
add ebx,ed_width
cmp eax,ebx
ja .mright
sub ebx,ed_width
xor edx,edx
sub eax,ebx ; <20><><EFBFBD><20><> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD> <20><><20><> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> editbox <20><> <20><><EFBFBD> <20>
mov ebx,6
div ebx
;;;;;;;;;;;;;;;;;;
;;<3B><><EFBFBD><EFBFBD><E6A5A4><EFBFBD> <20><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E2A5AA><EFBFBD>, <20> <20><EFBFBD><E0A5A4><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> editbox
;;;;;;;;;;;;;;;;;;
;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20> eax <20><>誨, <20>.<2E>. <20><20><><EFBFBD> <20><><EFBFBD><E0A5AC><EFBFBD><E2A8AB><EFBFBD>
;<3B><><EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A5AD> <20><>אַ㣮<EFACAE><EFBFBD><ECADA8><EFBFBD> <20> <20><><EFBFBD><EFBFBD><20><>
add eax,ed_offset ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᬥ饭<E1ACA5><E9A5AD>
cmp eax,dword ed_size ;<3B><20><><20><> <20><EFBFBD><E0A5A4><EFBFBD>, <20><> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ja .mwigvag
.mdraw:
mov dword ed_pos,eax ;<3B><><EFBFBD><EFBFBD><E0A0AD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD>
;<3B><><EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A5AD> <20><>אַ㣮<EFACAE><EFBFBD><ECADA8><EFBFBD> <20> <20><><EFBFBD><EFBFBD><20><>
mov ecx,dword ed_shift_pos
mov ebx,dword ed_shift_pos_old
mov dword ed_shift_pos_old,eax ;<3B><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD> <20><><EFBFBD><20><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;<3B><EFBFBD><20> <20><><EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A5AD> <20><><EFBFBD><EFBFBD><EFBFBD>
cmp ecx,ebx ;<3B><><EFBFBD><EFBFBD><EFBFBD><20><20><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD>
je .m1_shem ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>뫮 ࠭<><E0A0AD>
jb .msmaller ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>뫮 ->
cmp ebx,eax ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><20><> <20><EFBFBD> <- <20> <20><><EFBFBD> <20><> <20><EFBFBD><E0AEA2>塞 ᥩ<><E1A5A9><EFBFBD> <20><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><E5AEA4>
ja .m1_shem ;<3B><20><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <- <20><> <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
je .mwigvag ;<3B><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>뫮, <20><> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov ebp,ed_color ;<3B><><EFBFBD> <20><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> c ed_pos ed_shift_pos_old
;<3B><EFBFBD><E5AEA4><EFBFBD> <20><><EFBFBD><E0A0AC><EFBFBD><EFBFBD> ebp=color ebx=ed_shift_pos
call .sh_cl_
jmp .mwigvag
.msmaller:
cmp ebx,eax
jb .m1_shem
mov ebp,ed_color
;<3B><EFBFBD><E5AEA4><EFBFBD> <20><><EFBFBD><E0A0AC><EFBFBD><EFBFBD> ebp=color ebx=ed_shift_pos
call .sh_cl_
jmp .mwigvag
;alike =
.m1_shem:
mov ebp,shift_color
;<3B><EFBFBD><E5AEA4><EFBFBD> <20><><EFBFBD><E0A0AC><EFBFBD><EFBFBD> ebp=color ebx=ed_shift_pos
mov ebx,ecx
call .sh_cl_
jmp .mwigvag
.mwigvag:
and word ed_flags,ed_shift_mcl
jmp .draw_cursor_text
; popa
; ret
.mleft:
mov eax,ed_pos
cmp eax,0
jbe .mwigvag
dec eax
call .check_offset
push eax
mov ebx,ed_shift_pos
mov ebp,shift_color
call .sh_cl_
pop eax
jmp .mdraw
.mright:
mov eax,ed_pos
mov ebx,ed_size
cmp eax,ebx
jae .mwigvag
inc eax
call .check_offset
mov ebx,ed_shift_pos
mov ebp,shift_color
push eax
call .sh_cl_
pop eax
jmp .mdraw
}
ed_figure_only= 1000000000000000b ;<3B><><EFBFBD><EFBFBD><><E1A8AC><EFBFBD><EFBFBD>
ed_always_focus= 100000000000000b
ed_focus= 10b ;䮪<><E4AEAA> <20><EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_shift_on= 1000b ;<3B><20><> <20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> -<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> shift,<2C><20><><EFBFBD> <20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><20><><EFBFBD> - <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㤥ন<E3A4A5><E0A6A8><EFBFBD> shift
ed_shift_on_off=1111111111110111b
ed_shift= 100b ;<3B><><EFBFBD><EFBFBD><EFBFBD><E7A0A5><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><20><> shift <20>.<2E>. <20><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_shift_off= 1111111111111011b
ed_shift_bac= 10000b ;<3B><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><20><EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> shift <20>.<2E>. <20><><EFBFBD> <20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD>
ed_shift_bac_cl=1111111111101111b ;<3B><><EFBFBD><EFBFBD><20><><EFBFBD><><E3A4A0><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD>
ed_shift_cl= 1111111111100011b
ed_shift_mcl= 1111111111111011b
ed_left_fl= 100000b
ed_right_fl= 1111111111011111b
ed_offset_fl= 1000000b
ed_offset_cl= 1111111110111111b
ed_insert= 10000000b
ed_insert_cl= 1111111101111111b
ed_mouse_on = 100000000b
ed_mous_adn_b= 100011000b
ed_mouse_on_off=1111111011111111b
ed_height=14 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
macro draw_edit_boxes start,_end,use_f9,procinfo
{
if use_f9 eq
else
mcall 9,procinfo,-1
end if
mov edi,start
mov ecx,((_end-start)/ed_struc_size)
@@:
call edit_box.draw
add edi,ed_struc_size
loop @b
}
macro mouse_edit_boxes start,_end
{
mov edi,start
mov ecx,((_end-start)/ed_struc_size)
@@:
call edit_box.mouse
add edi,ed_struc_size
loop @b
}
macro key_edit_boxes start,end
{
mov edi,start
mov ecx,((end-start)/ed_struc_size)
@@:
call edit_box.key
add edi,ed_struc_size
loop @b
}
ed_struc_size=70
struc edit_box width,left,top,color,shift_color,focus_border_color,\
blur_border_color,text_color,max,text,flags,size,pos
{
.width dd width
.left dd left
.top dd top
.color dd color
.shift_color dd shift_color
.focus_border_color dd focus_border_color
.blur_border_color dd blur_border_color
.text_color dd text_color
.max dd max
.text dd text
.flags dw flags+0
.size dd size+0
.pos dd pos+0
.offset dd 0
.cl_curs_x dd 0
.cl_curs_y dd 0
.shift dd 0
.shift_old dd 0
}
macro edit_boxes_set_sys_color start,end,color_table
{
mov edi,start
mov ecx,((end-start)/ed_struc_size)
mov esi,color_table
@@:
mov eax,[esi+36]
mov ebx,[esi+20]
mov ed_focus_border_color,eax
shr bh,1
shr bl,1
shr ah,1
shr al,1
add ah,bh
add al,bl
ror eax,16
ror ebx,16
shr bl,1
shr al,1
add al,bl
ror eax,16
mov ed_blur_border_color,eax
add edi,ed_struc_size
loop @b
}
macro draw_edit_box ed_ptr,use_f9,procinfo
{
if use_f9 eq
else
mcall 9,procinfo,-1
end if
mov edi,ed_ptr
call edit_box.draw
}
macro mouse_edit_box ed_ptr
{
mov edi,ed_ptr
call edit_box.mouse
}
macro key_edit_box ed_ptr
{
mov edi,ed_ptr
call edit_box.key
}
macro default_box ed_ptr
{
pusha
; xor eax,eax
; mov ed_shift_pos,eax
; mov ed_shift_pos_old,eax
and word ed_flags,ed_shift_cl
; mov ed_offset,eax
popa
}