2009-02-13 10:04:33 +01:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use editbox ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2009-10-23 16:36:21 +02:00
macro use_editbox_draw
{
edit_box:
2009-02-13 10:04:33 +01:00
.draw:
pushad
2016-11-05 05:15:05 +01:00
mov edi,[esp+36]
and dword ed_text_color,17FFFFFFh
mov ecx,ed_text_color
mov ebx,ecx
shr ecx,28
shl ebx,4
shr ebx,28
inc ebx
mov eax,6
jecxz @f
mov al, 8
@@:
mul bl
mov ed_char_width,eax
mov al, 9
jecxz @f
mov al, 16
@@:
mul bl
add eax,4
mov ed_height,eax
2015-08-07 11:51:01 +02:00
call .draw_border
2009-02-13 10:04:33 +01:00
.draw_bg_cursor_text:
2015-08-07 11:51:01 +02:00
call .check_offset
call .draw_bg
2009-02-13 10:04:33 +01:00
call .draw_shift
.draw_cursor_text:
2015-08-07 11:51:01 +02:00
call .draw_text
2009-02-13 10:04:33 +01:00
test word ed_flags,ed_focus
2015-08-07 11:51:01 +02:00
jz .editbox_exit
2009-02-13 10:04:33 +01:00
call .draw_cursor
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<3B> <> 騩 <20> <> 室 <20> <> editbox <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> 㭪権 <20> <20> <> <EFBFBD> <EFBFBD> <20> <> ࠡ<EFBFBD> <E0A0A1> 稪<EFBFBD> <E7A8AA> ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.editbox_exit:
popad
ret 4
}
macro use_editbox_key
{
;==========================================================
;=== <20> <> ࠡ<EFBFBD> ⪠ <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> =================================
;==========================================================
edit_box_key:
2016-11-05 05:15:05 +01:00
pushad
mov edi,[esp+36]
2009-02-13 10:04:33 +01:00
test word ed_flags,ed_focus ; <20> <20> <> <20> 䮪<> <E4AEAA> <EFBFBD> , <20> <> 室<EFBFBD> <E5AEA4>
2015-08-05 11:34:02 +02:00
jz edit_box.editbox_exit
test word ed_flags,ed_mouse_on or ed_disabled
jnz edit_box.editbox_exit
2013-03-08 19:18:59 +01:00
;--------------------------------------
; this code for Win-keys, works with
; kernel SVN r.3356 or later
2015-08-05 11:34:02 +02:00
push eax
push ebx
mcall 66,3
test ax,0x200 ; LWin
jnz .win_key_pressed
test ax,0x400 ; RWin
jz @f
2013-03-08 19:18:59 +01:00
.win_key_pressed:
2015-08-05 11:34:02 +02:00
pop ebx
pop eax
jmp edit_box.editbox_exit
2016-11-05 05:15:05 +01:00
@@: pop ebx
2015-08-05 11:34:02 +02:00
pop eax
2013-03-08 19:18:59 +01:00
;--------------------------------------
2009-02-13 10:04:33 +01:00
;<3B> <EFBFBD> ઠ <20> <> <EFBFBD> <EFBFBD> <EFBFBD> shift ?
2014-03-01 20:33:34 +01:00
call edit_box_key.check_shift_ctrl_alt
2009-02-13 10:04:33 +01:00
;----------------------------------------------------------
;--- <20> <EFBFBD> <E0AEA2> 塞, <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> --------------------------------
;----------------------------------------------------------
2012-12-21 19:57:14 +01:00
cmp ah,8
jz edit_box_key.backspace
cmp ah,0xb6
jz edit_box_key.delete
cmp ah,176
jz edit_box_key.left
cmp ah,179
jz edit_box_key.right
cmp ah,180
jz edit_box_key.home
cmp ah,181
jz edit_box_key.end
cmp ah,185 ;insert
jz edit_box_key.insert
2014-03-01 20:33:34 +01:00
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 樨 Ctrl + <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
test word ed_flags,ed_ctrl_on
2015-08-05 11:34:02 +02:00
jz @f
2014-03-01 20:33:34 +01:00
; <20> <EFBFBD> ઠ ᪠<> <E1AAA0> <EFBFBD> <EFBFBD> <EFBFBD>
ror eax,8
cmp ah,46 ; Ctrl + C
je edit_box_key.ctrl_c
cmp ah,47 ; Ctrl + V
je edit_box_key.ctrl_v
2015-08-05 11:34:02 +02:00
rol eax,8
2014-03-01 20:33:34 +01:00
@@:
2009-02-13 10:04:33 +01:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<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,enter,tab,numl,capsl,scrolll
;--- <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> 㣠<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ---
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2011-02-09 02:01:22 +01:00
;<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> <20> <> <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>
2009-02-13 10:04:33 +01:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_key_figures_only
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2011-02-09 02:01:22 +01:00
;<3B> <EFBFBD> ઠ <20> <> shift, <20> <> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
2009-02-13 10:04:33 +01:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
are_key_shift_press
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; <20> <EFBFBD> <E0AEA2> 塞, <20> <> 室<EFBFBD> <E5AEA4> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> + <20> <> <EFBFBD> 쭥<EFBFBD> <ECADA5> <EFBFBD> <EFBFBD> <20> <> ࠡ<EFBFBD> ⪠
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
are_key_cur_end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2011-02-09 02:01:22 +01:00
;<3B> <> ࠡ<EFBFBD> ⪠ <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> insert,delete.backspace,home,end,left,right
2009-02-13 10:04:33 +01:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_work_key
}
macro use_editbox_mouse
{
;==========================================================
;=== <20> <> ࠡ<EFBFBD> ⪠ <20> <> <EFBFBD> <EFBFBD> =======================================
;==========================================================
;save for stdcall ebx,esi,edi,ebp
edit_box_mouse:
2016-11-05 05:15:05 +01:00
pushad
mov edi,[esp+36]
2015-08-05 11:34:02 +02:00
test word ed_flags,ed_disabled
jnz edit_box.editbox_exit
2009-02-13 10:04:33 +01:00
;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 edit_box_mouse.mouse_left_button
and word ed_flags,ed_mouse_on_off
2016-11-05 05:15:05 +01:00
mov ebx,ed_mouse_variable
2015-08-05 11:34:02 +02:00
push 0
pop dword [ebx]
2009-02-13 10:04:33 +01:00
jmp edit_box.editbox_exit
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
.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>
;----------------------------------------------------------
2016-11-05 05:15:05 +01:00
mov eax,ed_mouse_variable
2015-08-05 11:34:02 +02:00
push dword [eax]
pop eax
2009-02-13 10:04:33 +01:00
test eax,eax
jz @f
cmp eax,edi
je @f
jmp edit_box_mouse._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,1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<3B> 㭪<EFBFBD> <E3ADAA> <EFBFBD> <20> <> ࠡ<EFBFBD> ⪨ <20> <> 誨 <20> <> <EFBFBD> <EFBFBD> 祭<EFBFBD> <E7A5AD> <20> <> <EFBFBD> न<EFBFBD> <E0A4A8> <EFBFBD> <20> <20> <EFBFBD> ઠ <20> <> + <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_work_mouse
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<3B> <> 騥 <20> 㭪樨 <20> <> ࠡ<EFBFBD> ⪨
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_general_func
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<3B> 㭪樨 <20> <> <EFBFBD> ࠡ<> <E0A0A1> <EFBFBD> <20> key
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_key_func
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<3B> 㭪樨 <20> <> <EFBFBD> ࠡ<> <E0A0A1> <EFBFBD> <20> mouse
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2011-02-09 02:01:22 +01:00
use_mouse_func
2009-02-13 10:04:33 +01:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Bit mask from editbox
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
}
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;<3B> <> <EFBFBD> <EFBFBD> <20> <> ᯮ<EFBFBD> <E1AFAE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> 㭪樨 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 묨 ॠ<> <E0A5A0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2011-02-09 02:01:22 +01:00
;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> 뢮<EFBFBD> <EBA2AE> <20> ᭮<EFBFBD> <E1ADAE> <EFBFBD> <EFBFBD> <20> 㭪権 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> ᯮ<EFBFBD> <E1AFAE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> ᮬ
2009-02-13 10:04:33 +01:00
macro use_general_func
{
;debug_func
;----------------------------------------------------------
2015-08-07 11:51:01 +02:00
;--- <20> <> <EFBFBD> 楤<EFBFBD> <E6A5A4> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ᮢ<EFBFBD> <E1AEA2> <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ----------------
2009-02-13 10:04:33 +01:00
;----------------------------------------------------------
edit_box.draw_shift:
test word ed_flags,ed_shift_bac ;<3B> <> ⠭<EFBFBD> <E2A0AD> <EFBFBD> <EFBFBD> 䫠<> <E4ABA0> , <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
jz @f
mov ebp,shift_color
2016-11-05 05:15:05 +01:00
mov ebx,ed_shift_pos
2009-02-13 10:04:33 +01:00
call edit_box_key.sh_cl_
@@: ret
;----------------------------------------------------------
;--- <20> <> <EFBFBD> 楤<EFBFBD> <E6A5A4> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ᮢ<EFBFBD> <E1AEA2> ⥪<> <E2A5AA> <EFBFBD> --------------------------
;----------------------------------------------------------
edit_box.draw_text:
call edit_box.get_n
mov esi,ed_size
2016-11-05 05:15:05 +01:00
sub esi,ed_offset
2009-02-13 10:04:33 +01:00
cmp eax,esi
2016-11-05 05:15:05 +01:00
jae @f
2015-08-07 11:51:01 +02:00
mov esi,eax
2016-11-05 05:15:05 +01:00
@@:
test esi,esi
jz @f
mov eax,4
2009-02-13 10:04:33 +01:00
mov ebx,ed_left
add ebx,2
shl ebx,16
add ebx,ed_top
2016-11-05 05:15:05 +01:00
add ebx,2
2009-02-13 10:04:33 +01:00
mov ecx,ed_text_color
2016-11-05 05:15:05 +01:00
test dword ed_flags,ed_pass
jnz .password
mov edx,ed_text
add edx,ed_offset
2009-02-13 10:04:33 +01:00
mcall
2016-11-05 05:15:05 +01:00
@@:
2015-08-07 11:51:01 +02:00
ret
2016-11-05 05:15:05 +01:00
.password:
mov ebp,esi
mov esi,1
mov edx,txt_pass
2012-12-07 18:35:50 +01:00
@@:
2015-08-05 11:34:02 +02:00
mcall
2016-11-05 05:15:05 +01:00
rol ebx,16
add ebx,ed_char_width
rol ebx,16
dec ebp
jnz @b
2015-08-07 11:51:01 +02:00
ret
2016-11-05 05:15:05 +01:00
txt_pass db '*'
2009-02-13 10:04:33 +01:00
;----------------------------------------------------------
;--- <20> <> <EFBFBD> 楤<EFBFBD> <E6A5A4> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ᮢ<EFBFBD> <E1AEA2> 䮭<> ----------------------------
;----------------------------------------------------------
edit_box.draw_bg:
mov ebx,ed_left
2016-11-05 05:15:05 +01:00
inc ebx
2009-02-13 10:04:33 +01:00
shl ebx,16
add ebx,ed_width
2016-11-05 05:15:05 +01:00
dec ebx
mov edx,ed_color
test word ed_flags, ed_disabled
jz edit_box.draw_bg_eax
mov edx, 0xCACACA ; TODO: add disabled_color field to editbox struct
2009-02-13 10:04:33 +01:00
edit_box.draw_bg_eax:
mov ecx,ed_top
2016-11-05 05:15:05 +01:00
inc ecx
2009-02-13 10:04:33 +01:00
shl ecx,16
add ecx,ed_height
dec ecx
2016-11-05 05:15:05 +01:00
mcall 13
ret
2009-02-13 10:04:33 +01:00
;----------------------------------------------------------
2011-02-09 02:01:22 +01:00
;--- <20> <> <EFBFBD> 楤<EFBFBD> <E6A5A4> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> 祭<EFBFBD> <E7A5AD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ⢠ ᨬ<> <E1A8AC> <EFBFBD> <EFBFBD> <EFBFBD> <20> ⥪<> 饩 <20> <> ਭ<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2009-02-13 10:04:33 +01:00
;----------------------------------------------------------
edit_box.get_n:
2016-11-05 05:15:05 +01:00
mov eax,ed_width
sub eax,4
xor edx,edx
div word ed_char_width
ret
2009-02-13 10:04:33 +01:00
;----------------------------------------------------------
;--- <20> <> <EFBFBD> 楤<EFBFBD> <E6A5A4> <EFBFBD> <20> <> ᮢ<EFBFBD> <E1AEA2> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> --------------------------
;----------------------------------------------------------
;<3B> 室<EFBFBD> <E5AEA4> <EFBFBD> ebp- 梥<>
edit_box.clear_cursor:
mov edx,ebp
mov ebx,cl_curs_x
mov ecx,cl_curs_y
jmp edit_box.draw_curs
2016-11-05 05:15:05 +01:00
edit_box.draw_cursor:
mov eax,ed_pos
sub eax,ed_offset
mul dword ed_char_width
mov ebx,eax
2009-02-13 10:04:33 +01:00
add ebx,ed_left
inc ebx
2016-11-05 05:15:05 +01:00
mov edx,ebx
2009-02-13 10:04:33 +01:00
shl ebx,16
2016-11-05 05:15:05 +01:00
add ebx,edx
mov ecx,ed_top
add ecx,2
mov edx,ecx
2009-02-13 10:04:33 +01:00
shl ecx,16
2016-11-05 05:15:05 +01:00
add ecx,edx
add ecx,ed_height
sub ecx,4
2009-02-13 10:04:33 +01:00
mov cl_curs_x,ebx
mov cl_curs_y,ecx
2016-11-05 05:15:05 +01:00
mov edx,ed_text_color
2011-02-09 02:01:22 +01:00
edit_box.draw_curs:
2009-02-13 10:04:33 +01:00
mcall 38
2016-11-05 05:15:05 +01:00
ret
2009-02-13 10:04:33 +01:00
;----------------------------------------------------------
;--- <20> <> <EFBFBD> 楤<EFBFBD> <E6A5A4> <EFBFBD> <20> <> ᮢ<EFBFBD> <E1AEA2> <EFBFBD> <EFBFBD> ࠬ<> <E0A0AC> ----------------------------
;----------------------------------------------------------
edit_box.draw_border:
;--- 梥<> ࠬ<> <E0A0AC> ---
test word ed_flags,ed_focus
mov edx,ed_focus_border_color
jne @f
mov edx,ed_blur_border_color
@@:
;--- ᢥ<> <E1A2A5> <EFBFBD> ---
mov eax,38
mov ebx,ed_left
mov ecx,ebx
shl ebx,16
mov bx,cx
add ebx,ed_width
mov ecx,ed_top
mov esi,ecx
shl ecx,16
mov cx,si
mcall
;--- ᭨<> <E1ADA8> ---
mov esi,ecx
add ecx,ed_height
mov ebp,ecx
shl ecx,16
mov cx,bp
mcall
;--- <> <E1ABA5> ---
mov cx,si
mov ebp,ebx
sub ebx,ed_width
mcall
;--- <20> <> ࠢ<EFBFBD> ---
mov ebx,ebp
shl ebx,16
mov bx,bp
mcall
2016-11-05 05:15:05 +01:00
ret
2009-02-13 10:04:33 +01:00
;----------------------------------------------------------
;--- <20> <EFBFBD> ઠ, <20> <> 襫 <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> ࠭<EFBFBD> <E0A0AD> <EFBFBD> <20> , <20> <20> <> <EFBFBD> <EFBFBD> , ---
;--- <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 塞 ᬥ饭<E1ACA5> <E9A5AD> ------------------------------------
2011-02-09 02:01:22 +01:00
;--- <20> ᬥ饭<E1ACA5> <E9A5AD> <20> 뫮, <20> <> ⠭<EFBFBD> <E2A0AD> <EFBFBD> <EFBFBD> 䫠<> <E4ABA0> ed_offset_cl, <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ,
; <20> <20> <> 祣<EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <20> <> <EFBFBD> ⠢<EFBFBD> <E2A0A2> <EFBFBD> <EFBFBD> <EFBFBD> ed_offset_fl
2010-09-17 18:05:21 +02:00
; <20> <20> <> 饩 <20> <> ⮢<EFBFBD> <E2AEA2> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ﭨ<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ⮢ word ed_flags
2009-02-13 10:04:33 +01:00
;----------------------------------------------------------
edit_box.check_offset:
2016-11-05 05:15:05 +01:00
pushad
2009-02-13 10:04:33 +01:00
mov ecx,ed_pos
mov ebx,ed_offset
cmp ebx,ecx
ja edit_box.sub_8
push ebx
2016-11-05 05:15:05 +01:00
call edit_box.get_n
2009-02-13 10:04:33 +01:00
pop ebx
mov edx,ebx
2016-11-05 05:15:05 +01:00
add edx,eax
inc edx ;<3B> <> <EFBFBD> <EFBFBD> 室<EFBFBD> <E5AEA4> <EFBFBD> <20> <> <EFBFBD> <20> <> ଠ <EFBFBD> 쭮<EFBFBD> <ECADAE> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> ࠩ<EFBFBD> <E0A0A9> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> 樨
2009-02-13 10:04:33 +01:00
cmp edx,ecx
ja @f
mov edx,ed_size
cmp edx,ecx
je edit_box.add_end
sub edx,ecx
cmp edx,8
jbe edit_box.add_8
add ebx,8
jmp edit_box.chk_d
2016-11-05 05:15:05 +01:00
@@: or word ed_flags,ed_offset_fl
popad
ret
2009-10-16 03:13:34 +02:00
edit_box.sub_8:
2015-08-05 11:34:02 +02:00
test ecx,ecx
2016-11-05 05:15:05 +01:00
jz @f
2009-02-13 10:04:33 +01:00
sub ebx,8 ;ebx=ed_offset
2016-11-05 05:15:05 +01:00
ja edit_box.chk_d
@@:
2009-02-13 10:04:33 +01:00
xor ebx,ebx
jmp edit_box.chk_d
2016-11-05 05:15:05 +01:00
edit_box.add_end:
sub edx,eax
2009-02-13 10:04:33 +01:00
mov ebx,edx
jmp edit_box.chk_d
2016-11-05 05:15:05 +01:00
edit_box.add_8:
add ebx,edx
edit_box.chk_d:
mov ed_offset,ebx
2009-02-13 10:04:33 +01:00
call edit_box.draw_bg
and word ed_flags,ed_offset_cl
2016-11-05 05:15:05 +01:00
popad
ret
2010-09-17 18:05:21 +02:00
proc edit_box_set_text, edit:dword, text:dword
2016-11-05 05:15:05 +01:00
pushad
mov edi,[edit]
mov ecx,ed_max
inc ecx
mov edi,[text]
xor al,al
2015-08-05 11:34:02 +02:00
cld
2016-11-05 05:15:05 +01:00
repne scasb
mov ecx,edi
mov edi,[edit]
mov esi,[text]
sub ecx,esi
dec ecx
mov ed_size,ecx
mov ed_pos,ecx
and word ed_flags,ed_shift_cl
mov edi,ed_text
repne movsb
mov byte[edi],0
popad
ret
2010-09-17 18:05:21 +02:00
endp
2009-02-13 10:04:33 +01:00
}
macro use_key_func
{
;<3B> <> ࠡ<EFBFBD> ⪠ Shift <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ⭮<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2016-11-05 05:15:05 +01:00
edit_box_key.shift:
2015-08-07 11:51:01 +02:00
call edit_box.draw_bg
2009-02-13 10:04:33 +01:00
test word ed_flags,ed_shift
je edit_box_key.f_exit
2015-08-07 11:51:01 +02:00
mov ebp,shift_color
2009-02-13 10:04:33 +01:00
or word ed_flags,ed_shift_bac ;<3B> <> ⠭<EFBFBD> <E2A0AD> <EFBFBD> <EFBFBD> 䫠<> <E4ABA0> , <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2016-11-05 05:15:05 +01:00
mov ebx,ed_shift_pos
2009-02-13 10:04:33 +01:00
call edit_box_key.sh_cl_
jmp edit_box.draw_cursor_text
2016-11-05 05:15:05 +01:00
2011-02-09 02:01:22 +01:00
edit_box_key.f_exit:
2015-08-05 11:34:02 +02:00
call edit_box.check_offset
2009-02-13 10:04:33 +01:00
and word ed_flags,ed_shift_cl
call edit_box_key.enable_null
jmp edit_box.draw_cursor_text
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
edit_box_key.sh_cl_:
;<3B> <> ࠡ<EFBFBD> ⪠ <20> <> <EFBFBD> <EFBFBD> ⪨, <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> - <20> ࠢ<EFBFBD> <E0A0A2> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD>
;<3B> <> <EFBFBD> <20> <> ࠡ<EFBFBD> ⪨ <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD>
;<3B> 室<EFBFBD> <E5AEA4> <EFBFBD> <20> <> ࠬ<EFBFBD> <E0A0AC> <EFBFBD> <EFBFBD> ebp=color ebx=ed_shift_pos
2016-11-05 05:15:05 +01:00
mov eax,ed_pos
2009-02-13 10:04:33 +01:00
cmp eax,ebx
jae edit_box_key.sh_n
push eax ;<3B> <> <EFBFBD> <EFBFBD> 襥 <20> eax
push ebx ;<3B> <> <EFBFBD> <EFBFBD> 襥
jmp edit_box_key.sh_n1
2016-11-05 05:15:05 +01:00
2009-10-13 20:29:41 +02:00
edit_box_key.sh_n:
2015-08-05 11:34:02 +02:00
push ebx
2009-02-13 10:04:33 +01:00
push eax
2011-02-09 02:01:22 +01:00
edit_box_key.sh_n1:
2009-02-13 10:04:33 +01:00
call edit_box.check_offset
call edit_box.get_n
mov edx,eax ;size of ed_box
mov ecx,ed_offset
add eax,ecx ;eax = w_off= ed_offset+width
mov edx,eax ;save
pop ebx ;<3B> <> <EFBFBD> <EFBFBD> 襥
pop eax ;<3B> <> <EFBFBD> <EFBFBD> 襥
2011-02-09 02:01:22 +01:00
cmp eax,ecx ;<3B> ࠢ<EFBFBD> <E0A0A2> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> 襣<EFBFBD> <20> offset.
2009-02-13 10:04:33 +01:00
jae edit_box_key.f_f ;<3B> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
xor eax,eax
cmp edx,ebx ;cࠢ<63> <E0A0A2> <EFBFBD> ࠧ<> <E0A0A7> <EFBFBD> w_off <20> <20> <> <EFBFBD> <EFBFBD> 訬
2016-11-05 05:15:05 +01:00
jnb @f
mov ebx,edx
@@:
2011-02-09 02:01:22 +01:00
sub ebx,ecx
2009-02-13 10:04:33 +01:00
jmp edit_box_key.nxt_f
2016-11-05 05:15:05 +01:00
2011-02-09 02:01:22 +01:00
edit_box_key.f_f:
2009-02-13 10:04:33 +01:00
sub eax,ecx
cmp edx,ebx ;cࠢ<63> <E0A0A2> <EFBFBD> ࠧ<> <E0A0A7> <EFBFBD> w_off <20> <20> <> <EFBFBD> <EFBFBD> 訬
jle @f
sub ebx,ecx
sub ebx,eax
jmp edit_box_key.nxt_f
2016-11-05 05:15:05 +01:00
@@: mov ebx,edx
2009-02-13 10:04:33 +01:00
sub ebx,ecx
sub ebx,eax
edit_box_key.nxt_f:
2016-11-05 05:15:05 +01:00
mul dword ed_char_width
xchg eax,ebx
mul dword ed_char_width
2009-02-13 10:04:33 +01:00
add ebx,ed_left
inc ebx
shl ebx,16
2016-11-05 05:15:05 +01:00
inc eax
mov bx, ax
mov edx,ebp ;shift_color
2009-02-13 10:04:33 +01:00
call edit_box.draw_bg_eax
2016-11-05 05:15:05 +01:00
jmp edit_box_key.enable_null
2009-02-13 10:04:33 +01:00
;<3B> <> ⠭<EFBFBD> <E2A0AD> <EFBFBD> <EFBFBD> - <20> <> <EFBFBD> ⨥ <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> ᨬ<> <E1A8AC> <EFBFBD>
edit_box_key.drw_sim:
2016-11-05 05:15:05 +01:00
mov eax,ed_pos
call edit_box_key.draw_rectangle
jmp edit_box_key.enable_null
2011-02-09 02:01:22 +01:00
;<3B> 㭪<EFBFBD> <E3ADAA> <EFBFBD> <20> <> ⠭<EFBFBD> <E2A0AD> <EFBFBD> <EFBFBD> <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> ࠢ<EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> ⨨ shift
2009-02-13 10:04:33 +01:00
edit_box_key.draw_wigwag:
mov ebp,shift_color
call edit_box.clear_cursor
2011-02-09 02:01:22 +01:00
or word ed_flags,ed_shift_bac ;<3B> <> ⠭<EFBFBD> <E2A0AD> <EFBFBD> <EFBFBD> 䫠<> <E4ABA0> <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2009-02-13 10:04:33 +01:00
mov ebp,shift_color
2016-11-05 05:15:05 +01:00
mov eax,ed_pos
2009-02-13 10:04:33 +01:00
test word ed_flags,ed_left_fl
2016-11-05 05:15:05 +01:00
jnz edit_box_key.draw_rectangle
dec eax
jmp edit_box_key.draw_rectangle
2011-02-09 02:01:22 +01:00
;<3B> 㭪<EFBFBD> <E3ADAA> <EFBFBD> 㤠<> <E3A4A0> <EFBFBD> <EFBFBD> <EFBFBD> <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> ࠢ<EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> ⨨ shift
2009-02-13 10:04:33 +01:00
edit_box_key.draw_wigwag_cl:
mov ebp,ed_color
call edit_box.clear_cursor
mov ebp,ed_color
2016-11-05 05:15:05 +01:00
mov eax,ed_pos
2009-02-13 10:04:33 +01:00
test word ed_flags,ed_left_fl
2016-11-05 05:15:05 +01:00
jnz edit_box_key.draw_rectangle
dec eax
jmp edit_box_key.draw_rectangle
2009-02-13 10:04:33 +01:00
;<3B> 室<EFBFBD> <E5AEA4> <EFBFBD> <20> <> ࠬ<EFBFBD> <E0A0AC> <EFBFBD> ebx - ed_pos
edit_box_key.sh_first_sh:
test word ed_flags,ed_shift
je @f
2016-11-05 05:15:05 +01:00
mov ed_shift_pos_old,ebx
2009-02-13 10:04:33 +01:00
test word ed_flags,ed_shift_on
jne @f
2016-11-05 05:15:05 +01:00
mov ed_shift_pos,ebx
2009-02-13 10:04:33 +01:00
or word ed_flags,ed_shift_on
@@: ret
;<3B> <> ࠡ<EFBFBD> ⪠ <20> ࠩ<EFBFBD> <E0A0A9> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> editbox <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ⮬ shift
2011-02-09 02:01:22 +01:00
;<3B> ந<EFBFBD> <E0AEA8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> ⨥ <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <20> <> <EFBFBD> shift
2009-02-13 10:04:33 +01:00
;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> 室<EFBFBD> <E5AEA4>
edit_box_key.sh_st_of:
test word ed_flags,ed_shift
jne @f
test word ed_flags,ed_shift_bac
je @f
2015-08-07 11:51:01 +02:00
call edit_box.draw_bg
2009-02-13 10:04:33 +01:00
mov ebp,ed_color
2016-11-05 05:15:05 +01:00
mov ebx,ed_shift_pos
2009-02-13 10:04:33 +01:00
call edit_box_key.sh_cl_ ;<3B> <> <EFBFBD> <EFBFBD> ⪠ <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> ࠣ<EFBFBD> <E0A0A3> <EFBFBD> <EFBFBD> <EFBFBD>
2011-02-09 02:01:22 +01:00
and word ed_flags,ed_shift_cl ; <20> <> <EFBFBD> <EFBFBD> ⪠ <20> <> ⮣<> , <20> <> <EFBFBD> <20> <> ࠫ<EFBFBD> <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD>
2009-02-13 10:04:33 +01:00
jmp edit_box.draw_cursor_text
2016-11-05 05:15:05 +01:00
@@: and word ed_flags,ed_shift_off
2009-06-12 23:36:05 +02:00
popad
ret 4
2011-02-09 02:01:22 +01:00
;<3B> <EFBFBD> ઠ <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ﭨ<EFBFBD> shift, <20> <> <EFBFBD> <20> <> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ࠭<> <E0A0AD> <EFBFBD> ?
2009-02-13 10:04:33 +01:00
edit_box_key.sh_enable:
test word ed_flags,ed_shift
2011-02-09 02:01:22 +01:00
jne edit_box_key.sh_ext_en ;<3B> <> <EFBFBD> <EFBFBD> ᮢ<EFBFBD> <E1AEA2> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 襭<EFBFBD> <E8A5AD> <EFBFBD> <20> <> אַ㣮<EFACAE> 쭨<EFBFBD>
2009-02-13 10:04:33 +01:00
test word ed_flags,ed_shift_bac
je @f
call edit_box.check_offset
mov ebp,ed_color
2016-11-05 05:15:05 +01:00
mov ebx,ed_shift_pos
2011-02-09 02:01:22 +01:00
call edit_box_key.sh_cl_ ;<3B> <> <EFBFBD> <EFBFBD> ⪠ <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> ࠣ<EFBFBD> <E0A0A3> <EFBFBD> <EFBFBD> <EFBFBD>
call edit_box_key.draw_wigwag_cl
and word ed_flags,ed_shift_cl ; 1<> <31> <EFBFBD> <20> <> <20> 㦭<EFBFBD>
2009-02-13 10:04:33 +01:00
ret
@@: mov ebp,ed_color
call edit_box.clear_cursor
2016-11-05 05:15:05 +01:00
jmp edit_box.check_offset
2011-02-09 02:01:22 +01:00
edit_box_key.sh_ext_en:
2009-02-13 10:04:33 +01:00
call edit_box.check_offset
test word ed_flags,ed_offset_fl
je @f
2011-02-09 02:01:22 +01:00
;<3B> <> ᮢ<EFBFBD> <E1AEA2> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 襭<EFBFBD> <E8A5AD> <EFBFBD> <20> <> אַ㣮<EFACAE> 쭨<EFBFBD> <ECADA8> <EFBFBD> <20> <20> <> <20> <> <EFBFBD> <EFBFBD> ⪠
2016-11-05 05:15:05 +01:00
mov eax,ed_shift_pos
mov ebx,ed_pos
mov ecx,ed_shift_pos_old
2011-02-09 02:01:22 +01:00
;<3B> <EFBFBD> ઠ <20> <20> <> ᮢ<EFBFBD> <E1AEA2> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 襭<EFBFBD> <E8A5AD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ⥩
2009-02-13 10:04:33 +01:00
cmp eax,ecx
je edit_box_key.1_shem
jb edit_box_key.smaller
cmp ecx,ebx
ja edit_box_key.1_shem
call edit_box_key.draw_wigwag_cl ;clear
jmp edit_box_key.sh_e_end
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
edit_box_key.smaller:
cmp ecx,ebx
jb edit_box_key.1_shem
call edit_box_key.draw_wigwag_cl ;clear
jmp edit_box_key.sh_e_end
2016-11-05 05:15:05 +01:00
edit_box_key.1_shem:
call edit_box_key.draw_wigwag
edit_box_key.sh_e_end:
and word ed_flags,ed_shift_off
2009-02-13 10:04:33 +01:00
ret
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
@@: mov ebp,shift_color
2016-11-05 05:15:05 +01:00
mov ebx,ed_shift_pos
2009-02-13 10:04:33 +01:00
call edit_box_key.sh_cl_
jmp edit_box_key.sh_e_end
;<3B> 㭪<EFBFBD> <E3ADAA> <EFBFBD> <20> <> <EFBFBD> <20> <> ࠡ<EFBFBD> ⪨ shift <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ⨨ home and end
edit_box_key.sh_home_end:
mov ebp,ed_color
call edit_box.clear_cursor
test word ed_flags,ed_shift_bac
je @f
mov ebp,ed_color
2016-11-05 05:15:05 +01:00
mov ebx,ed_shift_pos_old
2009-02-13 10:04:33 +01:00
call edit_box_key.sh_cl_
2016-11-05 05:15:05 +01:00
@@:
test word ed_flags,ed_shift
2009-02-13 10:04:33 +01:00
je edit_box_key.sh_exit_ ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD>
mov ebp,shift_color
2016-11-05 05:15:05 +01:00
mov ebx,ed_shift_pos
2009-02-13 10:04:33 +01:00
call edit_box_key.sh_cl_
or word ed_flags,ed_shift_bac ;<3B> <> ⠭<EFBFBD> <E2A0AD> <EFBFBD> <EFBFBD> 䫠<> <E4ABA0> , <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
jmp edit_box_key.sh_e_end
2016-11-05 05:15:05 +01:00
2011-02-09 02:01:22 +01:00
edit_box_key.sh_exit_:
2010-08-28 15:45:50 +02:00
call edit_box.draw_bg
2016-11-05 05:15:05 +01:00
jmp edit_box.check_offset
2009-02-13 10:04:33 +01:00
;<3B> 㭪<EFBFBD> <E3ADAA> <EFBFBD> <20> <> <EFBFBD> ᥭ<EFBFBD> <E1A5AD> 0 <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ed_size+1
edit_box_key.enable_null:
pusha
mov eax,ed_size
mov ebx,ed_text
test eax,eax
add eax,ebx
jne @f
inc eax
@@: xor ebx,ebx
mov [eax],bl
2016-11-05 05:15:05 +01:00
popad
ret
2009-02-13 10:04:33 +01:00
;- 㤠<> <E3A4A0> <EFBFBD> <EFBFBD> <EFBFBD> ᨬ<> <E1A8AC> <EFBFBD> <EFBFBD>
;<3B> 室<EFBFBD> <E5AEA4> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> edx=ed_size;ecx=ed_pos
edit_box_key.del_char:
mov esi,ed_text
test word ed_flags,ed_shift_on
je @f
2016-11-05 05:15:05 +01:00
mov eax,ed_shift_pos
2009-02-13 10:04:33 +01:00
mov ebx,esi
cmp eax,ecx
jae edit_box_key.dh_n
2011-02-09 02:01:22 +01:00
mov ed_pos,eax ;<3B> ⮡<EFBFBD> <20> <> <20> 뫮 㡥<> <E3A1A5> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2009-02-13 10:04:33 +01:00
mov ebp,ecx
sub ebp,eax
2011-02-09 02:01:22 +01:00
add ebx,eax ;eax <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2009-02-13 10:04:33 +01:00
sub edx,ecx
add esi,ecx
2016-11-05 05:15:05 +01:00
mov ed_shift_pos,ebp
2009-02-13 10:04:33 +01:00
jmp edit_box_key.del_ch_sh
2016-11-05 05:15:05 +01:00
2011-02-09 02:01:22 +01:00
edit_box_key.dh_n:
2009-02-13 10:04:33 +01:00
mov ebp,eax
sub ebp,ecx
add ebx,ecx
sub edx,eax
add esi,eax
2016-11-05 05:15:05 +01:00
mov ed_shift_pos,ebp
2009-02-13 10:04:33 +01:00
jmp edit_box_key.del_ch_sh
2011-02-09 02:01:22 +01:00
@@: add esi,ecx ;㪠<> <E3AAA0> ⥫<EFBFBD> + ᬥ饭<E1ACA5> <E9A5AD> <20> ॠ<> 쭮<EFBFBD> <ECADAE> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2009-02-13 10:04:33 +01:00
mov ebx,esi
inc esi
cld
sub edx,ecx
edit_box_key.del_ch_sh:
push edi
mov edi,ebx
@@:
lodsb
stosb
2016-11-05 05:15:05 +01:00
dec edx
jns @b
pop edi
2009-02-13 10:04:33 +01:00
ret
;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <E1ABA8> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 訢<EFBFBD> <E8A8A2> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
;ᮣ<> <E1AEA3> 襭<EFBFBD> <E8A5AD> <20> ebp - <20> <> ।<EFBFBD> <E0A5A4> <EFBFBD> <EFBFBD> <EFBFBD> ed_size
edit_box_key.clear_bg:
call edit_box.get_n ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ࠧ<> <E0A0A7> <EFBFBD> <20> ᨬ<> <E1A8AC> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> ਭ<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
push eax
mov ebx,ed_offset
add eax,ebx ;eax = w_off= ed_offset+width
mov ebx,ebp ;ed_size
cmp eax,ebx
jb @f
mov eax,ed_pos
sub ebx,eax
mov ecx,ed_offset
sub eax,ecx
jmp edit_box_key.nxt
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
@@: mov ebx,ed_pos
push ebx
sub eax,ebx
2011-02-09 02:01:22 +01:00
mov ebx,eax ;It is not optimal
2009-02-13 10:04:33 +01:00
pop eax ;ed_pos
mov ecx,ed_offset
sub eax,ecx
edit_box_key.nxt:
mov ebp,eax ;<3B> <EFBFBD> ઠ <20> <> <20> <> 室 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 訢<EFBFBD> <E8A8A2> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> ।<EFBFBD> <E0A5A4> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
add ebp,ebx
pop edx
cmp ebp,edx
je @f
inc ebx
2016-11-05 05:15:05 +01:00
@@:
mul dword ed_char_width
xchg eax,ebx
mul dword ed_char_width
2009-02-13 10:04:33 +01:00
add ebx,ed_left
inc ebx
shl ebx,16
2016-11-05 05:15:05 +01:00
inc eax
mov bx, ax
2009-02-13 10:04:33 +01:00
mov edx,ed_color
2016-11-05 05:15:05 +01:00
jmp edit_box.draw_bg_eax
2009-02-13 10:04:33 +01:00
;;;;;;;;;;;;;;;;;;;
;;; <20> <> ࠡ<EFBFBD> ⪠ <20> ਬ<EFBFBD> ⨢<EFBFBD> <E2A8A2>
;;;;;;;;;;;;;;;;;;;;
;<3B> <> <EFBFBD> <EFBFBD> ᮢ<EFBFBD> <E1AEA2> <EFBFBD> <20> <> אַ㣮<EFACAE> 쭨<EFBFBD> , 梥<> <20> <> ।<EFBFBD> <E0A5A4> <EFBFBD> <EFBFBD> <EFBFBD> <20> ebp
;<3B> 室<EFBFBD> <E5AEA4> <EFBFBD> <20> <> ࠬ<EFBFBD> <E0A0AC> <EFBFBD> <EFBFBD> :
;eax=dword ed_pos
2011-02-09 02:01:22 +01:00
;ebp=-梥<> ed_color or shift_color
2009-02-13 10:04:33 +01:00
edit_box_key.draw_rectangle:
2016-11-05 05:15:05 +01:00
sub eax,ed_offset
mul dword ed_char_width
add eax,ed_left
inc eax
shl eax,16
add eax,ed_char_width
mov ebx,eax
2009-02-13 10:04:33 +01:00
mov edx,ebp
2016-11-05 05:15:05 +01:00
jmp edit_box.draw_bg_eax
2009-02-13 10:04:33 +01:00
;;;;;;;;;;;;;;;;;;
;;<3B> <EFBFBD> ઠ <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> shift
;;;;;;;;;;;;;;;;;;
2014-03-01 20:33:34 +01:00
edit_box_key.check_shift_ctrl_alt:
2016-11-05 05:15:05 +01:00
pusha
2009-02-13 11:52:40 +01:00
mcall 66,3
2014-03-01 20:33:34 +01:00
test al,11b
2009-02-13 10:04:33 +01:00
je @f
2014-03-01 20:33:34 +01:00
or word ed_flags,ed_shift ;<3B> <> ⠭<EFBFBD> <E2A0AD> <EFBFBD> <EFBFBD> 䫠<> Shift
@@:
and word ed_flags,ed_ctrl_off ; <20> <> <EFBFBD> <EFBFBD> ⨬ 䫠<> Ctrl
2015-08-05 11:34:02 +02:00
test al,1100b
2014-03-01 20:33:34 +01:00
je @f
or word ed_flags,ed_ctrl_on ;<3B> <> ⠭<EFBFBD> <E2A0AD> <EFBFBD> <EFBFBD> 䫠<> Ctrl
@@:
and word ed_flags,ed_alt_off ; <20> <> <EFBFBD> <EFBFBD> ⨬ 䫠<> Alt
2015-08-05 11:34:02 +02:00
test al,110000b
2014-03-01 20:33:34 +01:00
je @f
or word ed_flags,ed_alt_on ;<3B> <> ⠭<EFBFBD> <E2A0AD> <EFBFBD> <EFBFBD> 䫠<> Alt
2016-11-05 05:15:05 +01:00
@@:
popad
ret
2009-02-13 10:04:33 +01:00
}
macro use_key_no_process up,down,esc,enter,tab,numl,capsl,scrolll
{
2011-02-09 02:01:22 +01:00
if up eq
2009-02-13 10:04:33 +01:00
else
cmp ah,177
jz edit_box.editbox_exit
end if
2011-02-09 02:01:22 +01:00
if down eq
2009-02-13 10:04:33 +01:00
else
cmp ah,178
jz edit_box.editbox_exit
end if
2011-02-09 02:01:22 +01:00
if esc eq
2009-02-13 10:04:33 +01:00
else
cmp ah,27 ;ESC - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ))
jz edit_box.editbox_exit
end if
2011-02-09 02:01:22 +01:00
if enter eq
2009-02-13 10:04:33 +01:00
else
cmp ah,13 ;ENTER - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ))
jz edit_box.editbox_exit
end if
2011-02-09 02:01:22 +01:00
if tab eq
2009-02-13 10:04:33 +01:00
else
cmp ah,9 ;TAB - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ))
jz edit_box.editbox_exit
end if
2011-02-09 02:01:22 +01:00
if numl eq
2009-02-13 10:04:33 +01:00
else
cmp ah,4 ;Num Lock - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ))
jz edit_box.editbox_exit
end if
2011-02-09 02:01:22 +01:00
if capsl eq
2009-02-13 10:04:33 +01:00
else
cmp ah,2 ;Caps Lock - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ))
jz edit_box.editbox_exit
end if
2011-02-09 02:01:22 +01:00
if scrolll eq
2009-02-13 10:04:33 +01:00
else
cmp ah,1 ;Scroll Lock - <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ))
jz edit_box.editbox_exit
end if
}
macro use_key_figures_only
{
2011-02-09 02:01:22 +01:00
test word ed_flags,ed_figure_only ; ⮫쪮 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ?
2009-02-13 10:04:33 +01:00
jz @f
cmp ah,'0'
jb edit_box.editbox_exit
cmp ah,'9'
ja edit_box.editbox_exit
@@:
}
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
macro are_key_shift_press
{
test word ed_flags,ed_shift_on
je @f
2016-11-05 05:15:05 +01:00
; edx = ed_size, ecx = ed_pos
2009-02-13 10:04:33 +01:00
push eax
mov edx,ed_size
mov ecx, ed_pos
pusha
2016-11-05 05:15:05 +01:00
; clear input area
2009-02-13 10:04:33 +01:00
mov ebp,ed_color
2016-11-05 05:15:05 +01:00
mov ebx,ed_shift_pos
2009-02-13 10:04:33 +01:00
call edit_box_key.sh_cl_
mov ebp,ed_size
call edit_box_key.clear_bg
2011-02-09 02:01:22 +01:00
popa
2009-02-13 10:04:33 +01:00
call edit_box_key.del_char
mov ebx,ed_size
2016-11-05 05:15:05 +01:00
sub ebx,ed_shift_pos
2009-02-13 10:04:33 +01:00
mov ed_size,ebx
pop eax
@@:
}
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
macro are_key_cur_end
{
mov ecx,ed_size
mov edx, ed_max
test word ed_flags,ed_insert
jne @f
cmp ecx,edx
jae edit_box.editbox_exit
@@: mov ebx, ed_pos
cmp ebx,edx
2016-11-05 05:15:05 +01:00
jnl edit_box.editbox_exit
2009-02-13 10:04:33 +01:00
mov ecx,ed_size
push edi eax
mov ebp,edi
2016-11-05 05:15:05 +01:00
mov esi,ed_text
add esi,ecx
2009-02-13 10:04:33 +01:00
mov edi,esi
2016-11-05 05:15:05 +01:00
cmp ecx,ebx
2009-02-13 10:04:33 +01:00
je edit_box_key.In_k
2016-11-05 05:15:05 +01:00
test dword bp_flags,ed_insert
2009-02-13 10:04:33 +01:00
jne edit_box_key.ins_v
2016-11-05 05:15:05 +01:00
pusha
2009-02-13 10:04:33 +01:00
mov edi,ebp
mov ebp,ed_size
call edit_box_key.clear_bg
2016-11-05 05:15:05 +01:00
popa
sub ecx,ebx
inc edi
2009-02-13 10:04:33 +01:00
std
inc ecx
2016-11-05 05:15:05 +01:00
@@:
2009-02-13 10:04:33 +01:00
lodsb
stosb
loop @b
2011-02-09 02:01:22 +01:00
edit_box_key.In_k:
2015-08-05 11:34:02 +02:00
cld
2016-11-05 05:15:05 +01:00
pop eax
mov al,ah
2009-02-13 10:04:33 +01:00
stosb
2016-11-05 05:15:05 +01:00
pop edi
inc dword ed_size
inc dword ed_pos
2009-02-13 10:04:33 +01:00
call edit_box_key.draw_all2
jmp edit_box_key.shift
}
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
macro use_work_key
{
2016-11-05 05:15:05 +01:00
edit_box_key.insert:
test word ed_flags,ed_insert
je @f
and word ed_flags,ed_insert_cl
2009-02-13 10:04:33 +01:00
jmp edit_box.editbox_exit
2016-11-05 05:15:05 +01:00
@@: or word ed_flags,ed_insert
2009-02-13 10:04:33 +01:00
jmp edit_box.editbox_exit
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
edit_box_key.ins_v:
2015-08-05 11:34:02 +02:00
dec dword bp_size
2009-02-13 10:04:33 +01:00
sub esi,ecx
add esi,ebx
mov edi,esi
2016-11-05 05:15:05 +01:00
pusha
2009-02-13 10:04:33 +01:00
mov edi,ebp
mov ebp,ed_pos
call edit_box_key.clear_bg
2016-11-05 05:15:05 +01:00
popa
2009-02-13 10:04:33 +01:00
jmp edit_box_key.In_k
2016-11-05 05:15:05 +01:00
2011-02-09 02:01:22 +01:00
edit_box_key.delete:
2009-02-13 10:04:33 +01:00
mov edx,ed_size
mov ecx,ed_pos
cmp edx,ecx
jg edit_box_key.bac_del
test word ed_flags,ed_shift_on
jne edit_box_key.del_bac
2009-06-12 23:36:05 +02:00
popad
ret 4
2016-11-05 05:15:05 +01:00
2011-02-09 02:01:22 +01:00
edit_box_key.bac_del:
2009-02-13 10:04:33 +01:00
call edit_box_key.del_char
jmp edit_box_key.draw_all
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
edit_box_key.backspace:
2011-02-09 02:01:22 +01:00
test word ed_flags,ed_shift_on
jne edit_box_key.delete
2009-02-13 10:04:33 +01:00
mov ecx,ed_pos
test ecx,ecx
jnz edit_box_key.del_bac
2009-06-12 23:36:05 +02:00
popad
ret 4
2009-02-13 10:04:33 +01:00
edit_box_key.del_bac:
mov edx,ed_size
cmp edx,ecx ;if ed_pos=ed_size
je @f
dec ecx
call edit_box_key.del_char
@@: test word ed_flags,ed_shift_on
jne edit_box_key.bac_del
2016-11-05 05:15:05 +01:00
dec dword ed_pos
2009-02-13 10:04:33 +01:00
edit_box_key.draw_all:
2016-11-05 05:15:05 +01:00
push edit_box_key.shift
2009-02-13 10:04:33 +01:00
test word ed_flags,ed_shift_on
je @f
2016-11-05 05:15:05 +01:00
mov eax,ed_shift_pos
2009-02-13 10:04:33 +01:00
mov ebx,ed_size
sub ebx,eax
mov ed_size,ebx
mov ebp,ed_color
call edit_box.clear_cursor
call edit_box.check_offset
2016-11-05 05:15:05 +01:00
jmp edit_box.draw_bg
2009-02-13 10:04:33 +01:00
2016-11-05 05:15:05 +01:00
@@: dec dword ed_size
2009-02-13 10:04:33 +01:00
edit_box_key.draw_all2:
2016-11-05 05:15:05 +01:00
and word ed_flags,ed_shift_cl
2009-02-13 10:04:33 +01:00
mov ebp,ed_color
call edit_box.clear_cursor
call edit_box.check_offset
mov ebp,ed_size
2016-11-05 05:15:05 +01:00
jmp edit_box_key.clear_bg
2009-02-13 10:04:33 +01:00
;--- <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> left ---
2011-02-09 02:01:22 +01:00
edit_box_key.left:
2015-08-05 11:34:02 +02:00
mov ebx,ed_pos
2009-02-13 10:04:33 +01:00
test ebx,ebx
jz edit_box_key.sh_st_of
or word ed_flags,ed_left_fl
call edit_box_key.sh_first_sh
2016-11-05 05:15:05 +01:00
dec dword ed_pos
2015-08-07 11:51:01 +02:00
call edit_box.draw_bg
call edit_box.draw_shift
2009-02-13 10:04:33 +01:00
call edit_box_key.sh_enable
jmp edit_box.draw_cursor_text
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
;--- <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> right ---
2011-02-09 02:01:22 +01:00
edit_box_key.right:
2015-08-05 11:34:02 +02:00
mov ebx,ed_pos
2009-02-13 10:04:33 +01:00
cmp ebx,ed_size
je edit_box_key.sh_st_of
and word ed_flags,ed_right_fl
call edit_box_key.sh_first_sh
2016-11-05 05:15:05 +01:00
inc dword ed_pos
2015-08-07 11:51:01 +02:00
call edit_box.draw_bg
call edit_box.draw_shift
2009-02-13 10:04:33 +01:00
call edit_box_key.sh_enable
jmp edit_box.draw_cursor_text
2016-11-05 05:15:05 +01:00
2011-02-09 02:01:22 +01:00
edit_box_key.home:
2009-02-13 10:04:33 +01:00
mov ebx,ed_pos
test ebx,ebx
jz edit_box_key.sh_st_of
call edit_box_key.sh_first_sh
xor eax,eax
mov ed_pos,eax
2015-08-07 11:51:01 +02:00
call edit_box.draw_bg
call edit_box.draw_shift
2009-02-13 10:04:33 +01:00
call edit_box_key.sh_home_end
jmp edit_box.draw_cursor_text
2016-11-05 05:15:05 +01:00
;--- <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> end ---
2011-02-09 02:01:22 +01:00
edit_box_key.end:
2009-02-13 10:04:33 +01:00
mov ebx,ed_pos
2016-11-05 05:15:05 +01:00
cmp ebx,ed_size
2009-02-13 10:04:33 +01:00
je edit_box_key.sh_st_of
call edit_box_key.sh_first_sh
mov eax,ed_size
mov ed_pos,eax
2015-08-07 11:51:01 +02:00
call edit_box.draw_bg
call edit_box.draw_shift
2009-02-13 10:04:33 +01:00
call edit_box_key.sh_home_end
jmp edit_box.draw_cursor_text
2016-11-05 05:15:05 +01:00
2014-03-01 20:33:34 +01:00
edit_box_key.ctrl_c:
; add memory area
2015-08-05 11:34:02 +02:00
mov ecx,ed_size
add ecx,3*4
mcall 68,12
2014-03-01 20:33:34 +01:00
; building the clipboard slot header
2015-08-05 11:34:02 +02:00
xor ecx,ecx
mov [eax+4],ecx ; type 'text'
inc ecx
mov [eax+8],ecx ; cp866 text encoding
mov ecx,ed_size
add ecx,3*4
mov [eax],ecx
sub ecx,3*4
2014-03-01 20:33:34 +01:00
; copy data
2015-08-05 11:34:02 +02:00
mov esi,ed_text
push edi
mov edi,eax
add edi,3*4
cld
rep movsb
pop edi
2014-03-01 20:33:34 +01:00
; put slot to the kernel clipboard
2015-08-05 11:34:02 +02:00
mov edx,eax
mov ecx,[edx]
push eax
mcall 54,2
pop ecx
2014-03-01 20:33:34 +01:00
; remove unnecessary memory area
2015-08-05 11:34:02 +02:00
mcall 68,13
2014-03-01 20:33:34 +01:00
.exit:
jmp edit_box.editbox_exit
2016-11-05 05:15:05 +01:00
2014-03-01 20:33:34 +01:00
edit_box_key.ctrl_v:
2015-08-05 11:34:02 +02:00
mcall 54,0
2014-03-01 20:33:34 +01:00
; no slots of clipboard ?
2015-08-05 11:34:02 +02:00
test eax,eax
jz .exit
2016-11-05 05:15:05 +01:00
; main list area not found ?
2015-08-05 11:34:02 +02:00
inc eax
test eax,eax
jz .exit
sub eax,2
mov ecx,eax
mcall 54,1
2014-03-01 20:33:34 +01:00
; main list area not found ?
2015-08-05 11:34:02 +02:00
inc eax
test eax,eax
jz .exit
2014-03-01 20:33:34 +01:00
; error ?
2015-08-05 11:34:02 +02:00
sub eax,2
test eax,eax
jz .exit
inc eax
2014-03-01 20:33:34 +01:00
; check contents of container
2015-08-05 11:34:02 +02:00
mov ebx,[eax+4]
2014-03-01 20:33:34 +01:00
; check for text
2015-08-05 11:34:02 +02:00
test ebx,ebx
jnz .no_valid_text
mov ebx,[eax+8]
2014-03-01 20:33:34 +01:00
; check for cp866
2015-08-05 11:34:02 +02:00
cmp bl,1
jnz .no_valid_text
mov ecx,[eax]
sub ecx,3*4
cmp ecx,ed_max
jb @f
mov ecx,ed_max
2014-03-01 20:33:34 +01:00
@@:
2015-08-05 11:34:02 +02:00
mov esi,eax
add esi,3*4
mov ed_size,ecx
mov ed_pos,ecx
push eax edi
mov edi,ed_text
cld
2014-03-01 20:33:34 +01:00
@@:
2015-08-05 11:34:02 +02:00
lodsb
cmp al,0x0d ; EOS (end of string)
2016-11-05 05:15:05 +01:00
je .replace
2015-08-05 11:34:02 +02:00
cmp al,0x0a ; EOS (end of string)
jne .continue
2014-03-01 20:33:34 +01:00
.replace:
2015-08-05 11:34:02 +02:00
mov al,0x20 ; space
2016-11-05 05:15:05 +01:00
.continue:
2015-08-05 11:34:02 +02:00
stosb
dec ecx
jnz @b
pop edi eax
2014-03-01 20:33:34 +01:00
.no_valid_text:
; remove unnecessary memory area
2015-08-05 11:34:02 +02:00
mov ecx,eax
mcall 68,13
2014-03-01 20:33:34 +01:00
.exit:
2016-11-05 05:15:05 +01:00
jmp edit_box.draw_bg_cursor_text
2009-02-13 10:04:33 +01:00
}
macro use_mouse_func
{
edit_box_mouse.mouse_wigwag:
2015-08-07 11:51:01 +02:00
push eax
call edit_box.draw_bg
call edit_box.draw_shift
pop eax
2009-02-13 10:04:33 +01:00
or word ed_flags,ed_shift_bac+ed_shift_on+ed_shift
2016-11-05 05:15:05 +01:00
;<3B> <> ࠡ<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
test eax,eax
js edit_box_mouse.mleft
shr eax,16
sub eax,ed_left
jc edit_box_mouse.mleft
cmp ed_width,eax
jc edit_box_mouse.mright
2009-02-13 10:04:33 +01:00
xor edx,edx
2016-11-05 05:15:05 +01:00
div word ed_char_width
;<3B> <> ࠡ<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
2009-02-13 10:04:33 +01:00
;<3B> <> <EFBFBD> <EFBFBD> 稫<EFBFBD> <20> <> <EFBFBD> न<EFBFBD> <E0A4A8> <EFBFBD> <EFBFBD> <20> eax <20> <> 誨, <20> .<2E> . <20> 㤠 <20> <> <EFBFBD> <20> <> ६<EFBFBD> <E0A5AC> ⨫<EFBFBD> <E2A8AB> <EFBFBD>
2011-02-09 02:01:22 +01:00
;<3B> <> ᮢ<EFBFBD> <E1AEA2> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 襭<EFBFBD> <E8A5AD> <EFBFBD> <20> <> אַ㣮<EFACAE> 쭨<EFBFBD> <ECADA8> <EFBFBD> <20> <20> <> <20> <> <EFBFBD> <EFBFBD> ⪠
2016-11-05 05:15:05 +01:00
add eax,ed_offset
cmp eax,ed_size
2009-02-13 10:04:33 +01:00
ja edit_box_mouse.mwigvag
2011-02-09 02:01:22 +01:00
edit_box_mouse.mdraw:
2016-11-05 05:15:05 +01:00
mov ed_pos,eax
2011-02-09 02:01:22 +01:00
;<3B> <> ᮢ<EFBFBD> <E1AEA2> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 襭<EFBFBD> <E8A5AD> <EFBFBD> <20> <> אַ㣮<EFACAE> 쭨<EFBFBD> <ECADA8> <EFBFBD> <20> <20> <> <20> <> <EFBFBD> <EFBFBD> ⪠
2016-11-05 05:15:05 +01:00
mov ecx,ed_shift_pos
mov ebx,ed_shift_pos_old
mov ed_shift_pos_old,eax
2011-02-09 02:01:22 +01:00
;<3B> <EFBFBD> ઠ <20> <20> <> ᮢ<EFBFBD> <E1AEA2> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 襭<EFBFBD> <E8A5AD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ⥩
2016-11-05 05:15:05 +01:00
cmp ecx,ebx
je edit_box_mouse.m1_shem ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> 뫮 ࠭<> <E0A0AD>
jb edit_box_mouse.msmaller ;<3B> 뫮 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ->
cmp ebx,eax
ja edit_box_mouse.m1_shem ;<3B> 뫮 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <-
je edit_box_mouse.mwigvag
mov ebp,ed_color
call edit_box_key.sh_cl_ ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> c ed_pos ed_shift_pos_old
2009-02-13 10:04:33 +01:00
jmp edit_box_mouse.mwigvag
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
edit_box_mouse.msmaller:
cmp ebx,eax
jb edit_box_mouse.m1_shem
mov ebp,ed_color
call edit_box_key.sh_cl_
jmp edit_box_mouse.mwigvag
2016-11-05 05:15:05 +01:00
2011-02-09 02:01:22 +01:00
edit_box_mouse.m1_shem:
2009-02-13 10:04:33 +01:00
mov ebp,shift_color
mov ebx,ecx
call edit_box_key.sh_cl_
edit_box_mouse.mwigvag:
and word ed_flags,ed_shift_mcl
jmp edit_box.draw_cursor_text
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
edit_box_mouse.mleft:
mov eax,ed_pos
2011-02-09 02:01:22 +01:00
cmp eax,0
2016-11-05 05:15:05 +01:00
jbe edit_box_mouse.mwigvag
2009-02-13 10:04:33 +01:00
dec eax
call edit_box.check_offset
push eax
mov ebx,ed_shift_pos
mov ebp,shift_color
call edit_box_key.sh_cl_
pop eax
jmp edit_box_mouse.mdraw
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
edit_box_mouse.mright:
mov eax,ed_pos
mov ebx,ed_size
cmp eax,ebx
jae edit_box_mouse.mwigvag
inc eax
call edit_box.check_offset
mov ebx,ed_shift_pos
mov ebp,shift_color
push eax
call edit_box_key.sh_cl_
pop eax
2011-02-09 02:01:22 +01:00
jmp edit_box_mouse.mdraw
2009-02-13 10:04:33 +01:00
}
macro use_work_mouse
2016-11-05 05:15:05 +01:00
; <20> <> 㤥ন<E3A4A5> <E0A6A8> <EFBFBD> <EFBFBD> <20> <> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> 誨, <20> <> ६<EFBFBD> <E0A5AC> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ?
2009-02-13 10:04:33 +01:00
{
test word ed_flags,ed_mouse_on
jne edit_box_mouse.mouse_wigwag
2016-11-05 05:15:05 +01:00
; <20> <EFBFBD> <E0AEA2> 塞, <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> edit box
2009-02-13 10:04:33 +01:00
mov ebx,ed_top
cmp ax,bx
2016-11-05 05:15:05 +01:00
jl edit_box_mouse._blur
2009-02-13 10:04:33 +01:00
add ebx,ed_height
cmp ax,bx
2016-11-05 05:15:05 +01:00
jg edit_box_mouse._blur
2009-02-13 10:04:33 +01:00
shr eax,16
mov ebx,ed_left
cmp ax,bx
2016-11-05 05:15:05 +01:00
jl edit_box_mouse._blur
2009-02-13 10:04:33 +01:00
add ebx,ed_width
cmp ax,bx
2016-11-05 05:15:05 +01:00
jg edit_box_mouse._blur
; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 塞 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2009-02-13 10:04:33 +01:00
push eax
mov ebp,ed_color
call edit_box.clear_cursor
pop eax
edit_box_mouse._mvpos:
xor edx,edx
sub eax,ed_left
2016-11-05 05:15:05 +01:00
div word ed_char_width
2009-02-13 10:04:33 +01:00
add eax,ed_offset
cmp eax,ed_size
jna edit_box_mouse._mshift
mov eax,ed_size
edit_box_mouse._mshift:
2016-11-05 05:15:05 +01:00
; ᥪ<> <E1A5AA> <EFBFBD> <20> <> ࠡ<EFBFBD> ⪨ shift <20> <20> 뤥<EFBFBD> <EBA4A5> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> shift
2009-02-13 10:04:33 +01:00
test word ed_flags,ed_shift_bac
je @f
2016-11-05 05:15:05 +01:00
mov ebp,ed_color
mov ebx,ed_shift_pos
2009-02-13 10:04:33 +01:00
push eax
call edit_box_key.sh_cl_
and word ed_flags,ed_shift_bac_cl
pop eax
2011-02-09 02:01:22 +01:00
@@:
2009-02-13 10:04:33 +01:00
test word ed_flags,ed_mouse_on
jne @f
2016-11-05 05:15:05 +01:00
mov ed_shift_pos,eax
2009-02-13 10:04:33 +01:00
or word ed_flags,ed_mouse_on
2016-11-05 05:15:05 +01:00
mov ed_pos,eax
mov ebx,ed_mouse_variable
2015-08-05 11:34:02 +02:00
push edi
pop dword [ebx]
2016-11-05 05:15:05 +01:00
bts word ed_flags,1
2015-08-07 11:51:01 +02:00
call edit_box.draw_bg
2009-02-13 10:04:33 +01:00
jmp edit_box_mouse.m_sh
2016-11-05 05:15:05 +01:00
@@: cmp eax,ed_shift_pos
2009-02-13 10:04:33 +01:00
je edit_box.editbox_exit
mov ed_pos,eax
2015-08-07 11:51:01 +02:00
call edit_box.draw_bg
2016-11-05 05:15:05 +01:00
mov ebp,shift_color
mov ebx,ed_shift_pos
2009-02-13 10:04:33 +01:00
call edit_box_key.sh_cl_
2016-11-05 05:15:05 +01:00
or word ed_flags,ed_mous_adn_b
2011-02-09 02:01:22 +01:00
edit_box_mouse.m_sh:
2015-08-05 11:34:02 +02:00
call edit_box.draw_text
2009-02-13 10:04:33 +01:00
call edit_box.draw_cursor
2016-11-05 05:15:05 +01:00
; <20> <> <EFBFBD> 楤<EFBFBD> <E6A5A4> <EFBFBD> <20> <> ⠭<EFBFBD> <E2A0AD> <EFBFBD> <EFBFBD> 䮪<> <E4AEAA> <EFBFBD>
2009-02-13 10:04:33 +01:00
jmp edit_box_mouse.drc
2016-11-05 05:15:05 +01:00
2009-02-13 10:04:33 +01:00
edit_box_mouse._blur:
test word ed_flags,ed_always_focus
jne edit_box.editbox_exit
btr word ed_flags,1 ; <20> <20> <> <20> 䮪<> <E4AEAA> <EFBFBD> , <20> <> 室<EFBFBD> <E5AEA4>
jnc edit_box.editbox_exit
mov ebp,ed_color
call edit_box.clear_cursor
2016-11-05 05:15:05 +01:00
edit_box_mouse.drc:
call edit_box.draw_border
2009-02-13 10:04:33 +01:00
jmp edit_box.editbox_exit
}
macro debug
{
;----------- <20> ⫠<EFBFBD> <E2ABA0> <EFBFBD>
pushad
mov eax,dword [ed_buffer.2]
mov edi,ed_buffer.3
call .str
;<3B> <> ᮢ<EFBFBD> <E1AEA2> <EFBFBD> <EFBFBD> 䮭<>
mov eax,13
mov ebx,178*65536+70
mov ecx,28*65536+10
xor edx,edx
int 0x40
;<3B> 뢮<EFBFBD> <20> <> <EFBFBD> 祭<EFBFBD> <E7A5AD> <20> <> <20> <> ࠭
mov eax,4
mov ebx,180*65536+30
mov ecx,0x10DDBBCC
mov edx,ed_buffer.3
mov esi,8
int 0x40
popad
;----------- <20> ⫠<EFBFBD> <E2ABA0> <EFBFBD>
}
macro debug_func
{
.str:
2011-02-09 02:01:22 +01:00
mov ecx,0x0a ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> ⥬<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <E1ABA5> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ॣ<> <E0A5A3> <EFBFBD> <EFBFBD> <EFBFBD> ebx,eax,ecx,edx, <20> 室<EFBFBD> <E5AEA4> <EFBFBD> <20> <> ࠬ<EFBFBD> <E0A0AC> <EFBFBD> <EFBFBD> eax - <20> <>
;<3B> <> ॢ<EFBFBD> <E0A5A2> <20> <> <20> ASCII <20> <> ப<EFBFBD> , <20> 室<EFBFBD> <E5AEA4> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ecx=<3D> <> <EFBFBD> ⥬<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <E1ABA5> <EFBFBD> , edi <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> 㤠 <20> 㤥<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 뢠<EFBFBD> <EBA2A0> <20> <> ப<EFBFBD> , <20> <> <EFBFBD> 祬 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> ६<EFBFBD> <E0A5AC> <EFBFBD> <EFBFBD> <EFBFBD>
cmp eax,ecx ;<3B> ࠢ<EFBFBD> <E0A0A2> <EFBFBD> <EFBFBD> , <20> <20> eax <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , 祬 <20> ecx, <20> <> <20> <> ३<EFBFBD> <E0A5A9> <20> <> @@-1 <20> .<2E> . <20> <> pop eax
2009-02-13 10:04:33 +01:00
jb @f
xor edx,edx ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> edx
div ecx ;ࠧ<> <E0A0A7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> - <20> <> <EFBFBD> <EFBFBD> ⮪ <20> edx
push edx ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> ⥪
;dec edi ;ᬥ饭<E1ACA5> <E9A5AD> <20> <> <EFBFBD> <EFBFBD> 室<EFBFBD> <E5AEA4> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> ப<EFBFBD>
2011-02-09 02:01:22 +01:00
call .str ;<3B> <> ३<EFBFBD> <E0A5A9> <20> <> ᠬ<> ᥡ<> <20> .<2E> . <20> 맢<EFBFBD> <EBA7A2> <EFBFBD> ᠬ<> ᥡ<> <20> ⠪ <20> <> ⮣<> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <20> eax <20> <> <20> ⠭<EFBFBD> <E2A0AD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 祬 <20> ecx
2009-02-13 10:04:33 +01:00
pop eax
2011-02-09 02:01:22 +01:00
@@: ;cmp al,10 ;<3B> <EFBFBD> <E0AEA2> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> 祭<EFBFBD> <E7A5AD> <20> al, 祬 10 (<28> <> <EFBFBD> <20> <> <EFBFBD> ⥬<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <E1ABA5> <EFBFBD> 10 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> - <20> <> 譠<EFBFBD> ))
;sbb al,$69 ;- <20> <> <EFBFBD> ⭮, <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> ⠢<EFBFBD> <E2A0A2> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> 㬠<EFBFBD> <E3ACA0> <EFBFBD> <EFBFBD> <20> .<2E> . <20> <20> <> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> ࠡ<> ⠥<EFBFBD>
2009-02-13 10:04:33 +01:00
;das ;<3B> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <20> ந<EFBFBD> 室<EFBFBD> <E5AEA4> 㬥<> <E3ACA5> 襭<EFBFBD> <E8A5AD> al <20> <> 66h (<28> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ᠭ<EFBFBD> <20> <> 㣮<EFBFBD> )
2011-02-09 02:01:22 +01:00
or al,0x30 ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> , 祬 <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
stosb ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> ॣ<> <E0A5A3> <EFBFBD> <EFBFBD> <EFBFBD> al <20> <20> 祩<EFBFBD> <E7A5A9> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> es:edi
ret ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> 祭<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 室, <20> .<2E> . <20> <> <EFBFBD> <EFBFBD> <20> <20> ⥪<EFBFBD> <20> ࠭<EFBFBD> <E0A0AD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> -<2D> <> <20> 맮<EFBFBD> <EBA7AE> <EFBFBD> , <20> <> <20> ⮫쪮 ࠧ <20> <> <20> <20> 㤥<EFBFBD> <20> <> <EFBFBD> 뢠<EFBFBD> <EBA2A0> <EFBFBD> <EFBFBD>
2009-02-13 10:04:33 +01:00
}
2016-11-05 05:15:05 +01:00
ed_struc_size=84