change cursor in t_edit

git-svn-id: svn://kolibrios.org@8532 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2021-01-10 19:33:26 +00:00
parent 762358225b
commit 57d4f63fb8
3 changed files with 82 additions and 103 deletions

View File

@ -1230,16 +1230,16 @@ proc ted_text_add, edit:dword, text:dword, t_len:dword, add_opt:dword
add edx,sizeof.symbol
cmp edx,ted_tex_end
jge @f ;out of memory
cmp ebx,0
jne .beg_cycle
or ebx,ebx
jnz .beg_cycle
mov ted_ptr_free_symb,edx ;¬¥­ï¥¬ 㪠§ â¥«ì ­  ᢮¡®¤­ë© ᨬ¢®«, ¤«ï ¡®«¥¥ ¡ëáâண® ¯®¨áª  ¯ ¬ïâ¨
jmp .add_all
@@:
cmp ted_increase_size,0
je .add_all
call ted_memory_increase
cmp ebx,0
jne .beg_cycle
or ebx,ebx
jnz .beg_cycle
.add_all: ;¢á¥ ᨬ¢®«ë ¤®¡ ¢«¥­ë
call ted_text_colored
@ -1954,27 +1954,27 @@ ted_strlen:
; ebx = symbol position in line
align 16
ted_get_text_coords:
push edx
xor eax,eax
xor ebx,ebx
@@:
call ted_iterat_perv
push edx
xor eax,eax
xor ebx,ebx
@@:
call ted_iterat_perv
cmp eax,0
jne .no_col_mov
inc ebx
.no_col_mov:
or eax,eax
jnz .no_col_mov
inc ebx
.no_col_mov:
cmp edx,ted_tex_1
jle @f
cmp byte [edx],13
jne @b
inc eax
jmp @b
@@:
dec ebx
pop edx
ret
cmp edx,ted_tex_1
jle @f
cmp byte [edx],13
jne @b
inc eax
jmp @b
@@:
dec ebx
pop edx
ret
;input:
; edi = pointer to tedit struct
@ -3596,19 +3596,8 @@ pushad
imul edx,ted_rec_h
add ecx,edx
cmp ted_cur_ins,1 ;¯à®¢¥àª  ०¨¬  à ¡®âë ªãàá®à  (®¡ëç­ë© ¨«¨ ¢áâ ¢ª )
jne @f
mov edx,ted_rec_h
inc edx ;1->1, 3->2, 5->3, ...
shr edx,1 ;edx = ¢ëá®â  áâப¨ ¤¥«¥­­ ï ­  2 (ª®£¤  ªãàá®à ­¥ ¯®«­ë©)
add ecx,edx
@@:
shl ecx,16
add ecx,ted_rec_h
cmp ted_cur_ins,1
jne @f
shr cx,1 ;¤¥«¨¬ ¢ëá®âã ªãàá®à  ­  2
@@:
mov ebx,ted_wnd_l ;calc rect -> x0,x1
add ebx,ted_rec_l
@ -3617,6 +3606,10 @@ pushad
add ebx,edx
shl ebx,16
add ebx,ted_rec_w
cmp ted_cur_ins,1 ;¯à®¢¥àª  ०¨¬  à ¡®âë ªãàá®à  (®¡ëç­ë© ¨«¨ ¢áâ ¢ª )
jne @f
shr bx,2 ;㬥­ìè ¥¬ è¨à¨­ã ªãàá®à 
@@:
mov edx,ted_color_cursor
int 0x40 ;¢ë¢®¤ ªãàá®à 
@ -3628,13 +3621,6 @@ pushad
ror ecx,16
mov bx,cx
add ebx,0x10001
cmp ted_cur_ins,1
jne .no_up_tetx
mov ecx,ted_rec_h
inc cx ; 1->1, 3->2, 5->3, ...
shr cx,1
sub bx,cx
.no_up_tetx:
mov ecx,ted_color_cur_text
or ecx,ted_font_size
call ted_convert_invis_symb
@ -4362,6 +4348,20 @@ ted_wnd_main_mouse_scroll:
shr ebx,1
cmp eax,ebx
jae .no_scroll
mov ebx,ted_cur_y ;¯®§¨æ¨ï ªãàá®à 
sub ebx,eax ;- ­®¢ ï ¯®§¨æ¨ï áªà®««¨­£ 
add ebx,[ecx+sb_offs_position] ;+ áâ à ï ¯®§¨æ¨ï áªà®««¨­£ 
bt ebx,31
jnc @f
xor ebx,ebx ;¥á«¨ ªãàá®à áâ « ¢ëè¥ ®ª­ , â® áâ ¢¨¬ ­  ¢¥àå­îî áâபã
@@:
inc ebx
cmp ebx,[ecx+sb_offs_cur_area]
jle @f
mov ebx,[ecx+sb_offs_cur_area] ;¥á«¨ ªãàá®à áâ « ­¨¦¥ ®ª­ , â® áâ ¢¨¬ ­  ­¨¦­îî áâபã
@@:
dec ebx
mov ted_cur_y,ebx
mov [ecx+sb_offs_position],eax
stdcall ted_draw,edi
.no_scroll:

View File

@ -37,44 +37,30 @@ else
end if
rdsave:
dd 7,0,hide,0,0
dd SSF_START_APP,0,hide,0,0
db '/sys/rdsave',0
;---------------------------------------------------------------------
;Lib_DATA
;‚ᥣ¤  ᮡ«î¤ âì ¯®á«¥¤®¢ â¥«ì­®áâì ¢ ¨¬¥­¨.
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
system_dir_libini db '/sys/lib/libini.obj',0
;---------------------------------------------------------------------
head_f_i:
head_f_l db 'System error',0
err_message_found_lib1 db 'box_lib.obj - Not found!',0
err_message_found_lib2 db 'libini.obj - Not found!',0
err_message_import1 db 'box_lib.obj - Wrong import!',0
err_message_import2 db 'libini.obj - Wrong import!',0
;---------------------------------------------------------------------
l_libs_start:
library01 l_libs system_dir_Boxlib+9, cur_dir_path, library_path, system_dir_Boxlib, \
err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i
library02 l_libs system_dir_libini+9, cur_dir_path, library_path, system_dir_libini, \
err_message_found_lib2, head_f_l, libini_import, err_message_import2, head_f_i
library01 l_libs system_dir_Boxlib+9, library_path, system_dir_Boxlib, Box_lib_import
library02 l_libs system_dir_libini+9, library_path, system_dir_libini, libini_import
end_l_libs:
;---------------------------------------------------------------------
align 4
Box_lib_import:
init_checkbox2 dd aInit_checkbox2
check_box_draw2 dd aCheck_box_draw2
check_box_mouse2 dd aCheck_box_mouse2
init_checkbox dd aInit_checkbox
check_box_draw dd aCheck_box_draw
check_box_mouse dd aCheck_box_mouse
;version_ch2 dd aVersion_ch2
dd 0
dd 0
aInit_checkbox2 db 'init_checkbox2',0
aCheck_box_draw2 db 'check_box_draw2',0
aCheck_box_mouse2 db 'check_box_mouse2',0
dd 0,0
aInit_checkbox db 'init_checkbox2',0
aCheck_box_draw db 'check_box_draw2',0
aCheck_box_mouse db 'check_box_mouse2',0
;aVersion_ch2 db 'version_ch2',0
;---------------------------------------------------------------------
align 4
@ -82,8 +68,7 @@ libini_import:
init_lib dd a_init
ini_get_int dd aini_get_int
ini_set_int dd aini_set_int
dd 0
dd 0
dd 0,0
a_init db 'lib_init',0
aini_get_int db 'ini_get_int',0
aini_set_int db 'ini_set_int',0

View File

@ -1,6 +1,6 @@
; END
; KolibriOS Team 2005-2016
; KolibriOS Team 2005-2021
fade equ 0
@ -20,7 +20,8 @@ include 'lang.inc'
include '../../../macros.inc'
include '../../../proc32.inc'
include '../../../dll.inc'
include '../../../develop/libraries/box_lib/load_lib.mac'
include '../../../KOSfuncs.inc'
include '../../../load_lib.mac'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../../gui_patterns.inc'
include "../../../string.inc"
@ -46,8 +47,7 @@ load_libraries l_libs_start,end_l_libs
test eax,eax
jz close
push dword check1
call [init_checkbox2]
stdcall [init_checkbox], check1
stdcall dll.Init,[init_lib]
@ -57,11 +57,11 @@ invoke ini_get_int,ini_file,asettings,aautosave,0
jnz @f
bts dword [check1.flags],1
@@:
mcall 40,0x80000027
mcall SF_SET_EVENTS_MASK,0x80000027
redraw:
call draw_window
still:
mov al,10
mov al,SF_WAIT_EVENT
mcall ;wait here for event
dec eax
jz redraw
@ -70,8 +70,7 @@ still:
dec eax
jz button
push dword check1
call [check_box_mouse2]
stdcall [check_box_mouse], check1
bt dword [check1.flags],1
jnc @f
mov [autosave],1
@ -81,8 +80,8 @@ still:
jmp still
key:
mov al,2
mcall ;eax=2 - get key code
mov al,SF_GET_KEY
mcall ;get key code
mov al,ah
cmp al,13
je restart
@ -96,10 +95,10 @@ key:
jne still
close:
mcall -1
mcall SF_TERMINATE_PROCESS
button:
mcall 17 ;eax=17 - get pressed button id
mcall SF_GET_BUTTON ;get pressed button id
xchg al,ah
dec eax
jz close
@ -140,32 +139,32 @@ end if
jne no_save
if fade=0
mov al,4
mcall ,<50,120> ,0x800000cc,label7 ;eax=4 - write text
mov al,SF_DRAW_TEXT
mcall ,<50,120> ,0x800000cc,label7
end if
mcall 70,rdsave
mcall SF_FILE,rdsave
test eax,eax
js no_save
mov ecx,eax
mcall 18,21
mcall SF_SYSTEM,SSF_GET_THREAD_SLOT
mov ecx,eax
@@:
push ecx
mcall 23,100
mcall SF_WAIT_EVENT_TIMEOUT,100
dec eax
jnz no_red
call draw_window
no_red:
pop ecx
mcall 9,proc_info
mcall SF_THREAD_INFO,proc_info
cmp [proc_info+50],9
je no_save
jmp @b
no_save:
pop ecx
mcall 18,9
mcall -1
mcall SF_SYSTEM,SSF_SHUTDOWN
mcall SF_TERMINATE_PROCESS
ret
checkbox:
@ -176,15 +175,14 @@ checkbox:
.1:
mov [autosave],0
.draw:
push dword check1
call [check_box_draw2]
stdcall [check_box_draw], check1
jmp still
draw_window:
mcall 12,1
mcall SF_REDRAW,SSF_BEGIN_DRAW
mov al,14
mcall ;eax=14 - get screen max x & max y
mov al,SF_GET_SCREEN_SIZE
mcall ;get screen max x & max y
movzx ecx,ax
shr eax,17
shl eax,16
@ -207,8 +205,7 @@ draw_window:
DefineButton WIN_W-33, 2, 32, 20, CANCEL_BUTTON_ID, 0
WriteText WIN_W-23, 5, 10000001b, 0xFFFfff, TEXT_CANCEL
push dword check1
call [check_box_draw2]
stdcall [check_box_draw], check1
macro EndButton x, bgcol, id, but_text, hotkey_text
{
@ -226,7 +223,7 @@ macro EndButton x, bgcol, id, but_text, hotkey_text
add ebx,butw / 2 + x
shl ebx,16
add ebx,buty+8
mcall 4, , 10010000b shl 24 + 0xFFFfff, but_text
mcall SF_DRAW_TEXT, , 10010000b shl 24 + 0xFFFfff, but_text
add ebx,1 shl 16
mcall
stdcall string.length, hotkey_text
@ -236,15 +233,15 @@ macro EndButton x, bgcol, id, but_text, hotkey_text
add ebx,butw / 2 + x
shl ebx,16
add ebx,buty+26
mcall 4, , 10000000b shl 24 + 0xFFFfff, hotkey_text
mcall SF_DRAW_TEXT, , 10000000b shl 24 + 0xFFFfff, hotkey_text
}
EndButton 20, 0x4E91C5, HOME_BUTTON_ID, TEXT_KERNEL, TEXT_HOME
EndButton 160, 0x55C891, REBOOT_BUTTON_ID, TEXT_REBOOT, TEXT_ENTER
EndButton 300, 0xC75C54, POWEROFF_BUTTON_ID, TEXT_OFF, TEXT_END
mov al,12
mcall ,2
mov al,SF_REDRAW
mcall ,SSF_END_DRAW
ret
;---------------------------------------------------------------------
;data
@ -258,11 +255,8 @@ proc_info rb 1024
autosave rd 1
;---------------------------------------------------------------------
cur_dir_path:
rb 4096
;---------------------------------------------------------------------
library_path:
rb 4096
cur_dir_path rb 4096
library_path rb 4096
;---------------------------------------------------------------------
align 32
rb 4096