fix for calling tl_on_enter function, stack fix
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TreeList <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> box_lib.obj
|
||||
; <EFBFBD><EFBFBD> <20><><EFBFBD> <20>ਬ<EFBFBD><E0A8AC><EFBFBD><EFBFBD><EFBFBD> GPL2 <20><>業<EFBFBD><E6A5AD><EFBFBD>
|
||||
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> 12.01.2021 IgorA
|
||||
|
||||
; SPDX-License-Identifier: GPL-2.0-only
|
||||
; TreeList: used as a ListBox or Tree control (determined by settings)
|
||||
; Copyright (C) 2009-2025 IgorA <aie85playm@gmail.com>
|
||||
|
||||
struct TreeNode
|
||||
type dw ? ;+ 0 ⨯ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> 㧫<>
|
||||
@@ -14,6 +13,52 @@ struct TreeNode
|
||||
ends
|
||||
|
||||
|
||||
;input:
|
||||
; ecx - 0xXX...... font options
|
||||
;output:
|
||||
; eax - font height in pixels
|
||||
align 4
|
||||
proc get_font_h uses ebx
|
||||
mov eax,ecx
|
||||
shr eax,24
|
||||
bt eax,4
|
||||
jc @f
|
||||
bt eax,5
|
||||
jc @f
|
||||
mov ebx,9
|
||||
jmp .siz0
|
||||
@@:
|
||||
mov ebx,16
|
||||
.siz0:
|
||||
and eax,7
|
||||
inc eax
|
||||
imul eax,ebx
|
||||
ret
|
||||
endp
|
||||
|
||||
;input:
|
||||
; ecx - 0xXX...... font options
|
||||
;output:
|
||||
; eax - font width in pixels
|
||||
align 4
|
||||
proc get_font_w uses ebx
|
||||
mov eax,ecx
|
||||
shr eax,24
|
||||
bt eax,4
|
||||
jc @f
|
||||
bt eax,5
|
||||
jc @f
|
||||
mov ebx,6
|
||||
jmp .siz0
|
||||
@@:
|
||||
mov ebx,8
|
||||
.siz0:
|
||||
and eax,7
|
||||
inc eax
|
||||
imul eax,ebx
|
||||
ret
|
||||
endp
|
||||
|
||||
;<3B>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᯨ᪠ <20> <20>᭮<EFBFBD><E1ADAE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ଠ樨 (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
align 16
|
||||
proc tl_data_init uses eax ecx edi, tlist:dword
|
||||
@@ -125,6 +170,7 @@ proc tl_key uses ebx ecx edi, tlist:dword
|
||||
cmp tl_on_press,0
|
||||
je @f
|
||||
call tl_on_press
|
||||
jmp .no_edit
|
||||
@@:
|
||||
cmp ah,byte[ecx+1] ;Space
|
||||
jne @f
|
||||
@@ -463,34 +509,24 @@ proc tl_draw, tlist:dword
|
||||
|
||||
cmp tl_capt_cy,9 ;9 - minimum caption height
|
||||
jl @f
|
||||
mov ebx,edi ;calculate cursor position
|
||||
mov eax,tl_cur_pos
|
||||
inc eax
|
||||
lea edi,[txt_capt_cur.v]
|
||||
stdcall tl_convert_to_str, 5
|
||||
|
||||
mov edi,ebx
|
||||
call tl_draw_caption_cur_pos
|
||||
mov eax,tl_tim_undo
|
||||
or eax,eax
|
||||
jz @f
|
||||
mov ebx,edi ;save edi
|
||||
lea edi,[txt_capt_otm.v]
|
||||
stdcall tl_convert_to_str, 5
|
||||
mov edi,ebx ;restore edi
|
||||
|
||||
mov eax,SF_DRAW_TEXT ;captions
|
||||
mov ebx,tl_box_left
|
||||
shl ebx,16
|
||||
add ebx,5*65536+3
|
||||
add ebx,tl_box_top
|
||||
mov ecx,tl_col_txt
|
||||
or ecx,0x80000000
|
||||
lea edx,[txt_capt_cur]
|
||||
int 0x40
|
||||
|
||||
mov ebx,tl_box_left
|
||||
shl ebx,16
|
||||
add ebx,100*65536+3
|
||||
mov ecx,tl_col_txt
|
||||
and ecx,0x00ffffff
|
||||
or ecx,0x80000000
|
||||
add ebx,tl_box_top
|
||||
lea edx,[txt_capt_otm]
|
||||
int 0x40
|
||||
mcall SF_DRAW_TEXT ;undo
|
||||
@@:
|
||||
|
||||
;cycle to nodes
|
||||
@@ -1163,10 +1199,11 @@ proc tl_draw_node_caption uses ebx ecx edx esi
|
||||
ror ecx,16
|
||||
mov ebx,ecx
|
||||
add bx,tl_img_cy ;<3B><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
sub bx,9 ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
||||
mov ecx,tl_col_txt
|
||||
and ecx,0xffffff
|
||||
mcall SF_DRAW_TEXT
|
||||
call get_font_h
|
||||
sub bx,ax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
||||
and ecx,0x37ffffff
|
||||
mcall SF_DRAW_TEXT ;node text
|
||||
@@:
|
||||
ret
|
||||
endp
|
||||
@@ -1179,13 +1216,15 @@ endp
|
||||
align 4
|
||||
proc tl_get_draw_text_len uses eax ecx edx
|
||||
mov esi,eax ;<3B><>६ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
||||
mov ecx,tl_col_txt
|
||||
call get_font_w
|
||||
mov ecx,eax
|
||||
mov eax,tl_box_left
|
||||
add eax,tl_box_width
|
||||
cmp eax,ebx
|
||||
jle .text_null ;<3B> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><>࠭<EFBFBD><E0A0AD>
|
||||
sub eax,ebx
|
||||
xor edx,edx
|
||||
mov ecx,6 ;<3B><>ਭ<EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
div ecx ;ᬮ<>ਬ <>쪮 ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>࠭<EFBFBD>
|
||||
cmp esi,eax
|
||||
jl @f
|
||||
@@ -1858,10 +1897,8 @@ pushad
|
||||
.po8:
|
||||
call tl_node_move_po8 ;㧫<> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>塞 8 <20><>뫮<EFBFBD>
|
||||
.cur_mov:
|
||||
push dword edi
|
||||
call tl_cur_perv
|
||||
push dword edi
|
||||
call tl_draw
|
||||
stdcall tl_cur_perv, edi
|
||||
stdcall tl_draw, edi
|
||||
@@:
|
||||
popad
|
||||
ret
|
||||
@@ -1981,10 +2018,11 @@ tl_draw_caption_cur_pos:
|
||||
add ebx,5*65536+3
|
||||
add ebx,tl_box_top
|
||||
mov ecx,tl_col_txt
|
||||
and ecx,0x00ffffff
|
||||
or ecx,0xc0000000 ;0x40000000 <20><><EFBFBD><EFBFBD><EFBFBD>訢<EFBFBD><E8A8A2><EFBFBD> 䮭 梥⮬ edi
|
||||
lea edx,[txt_capt_cur]
|
||||
mov edi,tl_col_zag
|
||||
mcall SF_DRAW_TEXT ;captions
|
||||
mcall SF_DRAW_TEXT ;row number
|
||||
popad
|
||||
@@:
|
||||
ret
|
||||
@@ -2253,6 +2291,6 @@ align 4
|
||||
jge @f
|
||||
or al,0x30 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 ᨬ<><E1A8AC><EFBFBD> '0'
|
||||
stosb ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> al <20> <20>祪<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [edi]
|
||||
mov byte[edi],0
|
||||
mov word[edi],' ' ;add space symbol and 0
|
||||
@@:
|
||||
ret
|
||||
|
@@ -36,8 +36,8 @@ use32
|
||||
dd 1 ; header version
|
||||
dd start ; entry point
|
||||
dd i_end ; initialized size
|
||||
dd mem+0x1000 ; required memory
|
||||
dd mem+0x1000 ; stack pointer
|
||||
dd mem ; required memory
|
||||
dd stacktop ; stack pointer
|
||||
dd buf_cmd ; parameters
|
||||
dd path ; path
|
||||
|
||||
@@ -971,6 +971,7 @@ param_path rb 1024
|
||||
param_port rb 6
|
||||
|
||||
sc system_colors
|
||||
rb 2048
|
||||
|
||||
align 16
|
||||
rb 4096
|
||||
stacktop:
|
||||
mem:
|
||||
|
@@ -7,6 +7,7 @@ include '../../load_lib.mac'
|
||||
|
||||
icon_tl_sys dd 0
|
||||
icon_tl_nod dd 0
|
||||
lbl_after_enter dd 0
|
||||
show_log db 0 ; 0 - hide log, 1 - show log
|
||||
|
||||
TLIST_SZ = 325+16 ;=341. 16 is x-size of scroll bar
|
||||
@@ -266,8 +267,13 @@ gui: ;//////////////////////////////////////////////////////////////////////////
|
||||
jmp .still
|
||||
|
||||
.no_edit:
|
||||
mov [lbl_after_enter], 0
|
||||
stdcall [tl_mouse], tree1
|
||||
stdcall [tl_mouse], tree2
|
||||
cmp [lbl_after_enter], 0
|
||||
jz @f
|
||||
jmp [lbl_after_enter]
|
||||
@@:
|
||||
stdcall [edit_box_mouse], edit_mkd
|
||||
stdcall [edit_box_mouse], edit_volume
|
||||
stdcall [edit_box_mouse], edit_search
|
||||
@@ -276,8 +282,13 @@ gui: ;//////////////////////////////////////////////////////////////////////////
|
||||
align 16
|
||||
.key:
|
||||
mcall SF_GET_KEY
|
||||
mov [lbl_after_enter], 0
|
||||
stdcall [tl_key], tree1
|
||||
stdcall [tl_key], tree2
|
||||
cmp [lbl_after_enter], 0
|
||||
jz @f
|
||||
jmp [lbl_after_enter]
|
||||
@@:
|
||||
stdcall [edit_box_key], edit_mkd
|
||||
stdcall [edit_box_key], edit_volume
|
||||
stdcall [edit_box_key], edit_search
|
||||
@@ -610,7 +621,8 @@ fun_on_enter:
|
||||
cmp byte[esi], 0
|
||||
jne @b
|
||||
mov word[edi], 0x000a
|
||||
jmp cmd_stor
|
||||
mov [lbl_after_enter], cmd_stor
|
||||
ret
|
||||
|
||||
|
||||
; Function to call when you press [Enter]
|
||||
@@ -623,7 +635,8 @@ fun_on_enter2:
|
||||
cmp dword[esi], 0x2E2E
|
||||
jne @f
|
||||
mov [auto_list], 1
|
||||
jmp cmd_cdup
|
||||
mov [lbl_after_enter], cmd_cdup
|
||||
ret
|
||||
|
||||
@@:
|
||||
cmp word[eax], 'fo'
|
||||
@@ -642,12 +655,14 @@ fun_on_enter2:
|
||||
; newline in console code
|
||||
cmp word[eax], 'fo'
|
||||
je @f
|
||||
jmp cmd_retr
|
||||
mov [lbl_after_enter], cmd_retr
|
||||
ret
|
||||
|
||||
@@:
|
||||
stdcall [tl_info_clear], tree2
|
||||
mov [auto_list], 1
|
||||
jmp cmd_cwd
|
||||
mov [lbl_after_enter], cmd_cwd
|
||||
ret
|
||||
|
||||
|
||||
;;================================================================================================;;
|
||||
|
@@ -194,6 +194,7 @@ data_loop:
|
||||
test eax, eax
|
||||
jz @f
|
||||
call error_fs
|
||||
add esp, 4 ; fix stack
|
||||
jmp close_datacon
|
||||
@@:
|
||||
pop eax
|
||||
|
Reference in New Issue
Block a user