Subversion Repositories Kolibri OS

Compare Revisions

Ignore whitespace Rev 6704 → Rev 6705

/programs/develop/libraries/box_lib/trunk/box_lib.mac
1,31 → 1,31
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; basic macros for EditBox ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ed_width equ [edi] ; field width
ed_left equ [edi+4] ; left border X
ed_top equ [edi+8] ; top border Y
ed_color equ [edi+12] ; field color
shift_color equ [edi+16] ; select color
ed_focus_border_color equ [edi+20] ; border color active
ed_blur_border_color equ [edi+24] ; border color inactive
ed_text_color equ [edi+28] ; color and font (as in sysfunc 4)
ed_max equ [edi+32] ; chars max
ed_text equ [edi+36] ; buffer pointer
ed_mouse_variable equ [edi+40] ; pointer
ed_flags equ [edi+44]
bp_flags equ [ebp+44]
ed_size equ [edi+48] ; chars currently
bp_size equ [ebp+48]
ed_pos equ [edi+52] ; carret current position
ed_offset equ [edi+56]
cl_curs_x equ [edi+60] ; previous cursor X
cl_curs_y equ [edi+64] ; previous cursor Y
ed_shift_pos equ [edi+68] ; selection current position
ed_shift_pos_old equ [edi+72] ; selection previous position
ed_height equ [edi+76]
ed_char_width equ [edi+80]
ed_width equ [edi] ; field width
ed_left equ [edi + 4] ; left border X
ed_top equ [edi + 8] ; top border Y
ed_color equ [edi + 12] ; field color
shift_color equ [edi + 16] ; select color
ed_focus_border_color equ [edi + 20] ; border color active
ed_blur_border_color equ [edi + 24] ; border color inactive
ed_text_color equ [edi + 28] ; color and font (as in sysfunc 4)
ed_max equ [edi + 32] ; chars max
ed_text equ [edi + 36] ; buffer pointer
ed_mouse_variable equ [edi + 40] ; pointer
ed_flags equ [edi + 44]
bp_flags equ [ebp + 44]
ed_size equ [edi + 48] ; chars currently
bp_size equ [ebp + 48]
ed_pos equ [edi + 52] ; carret current position
ed_offset equ [edi + 56]
cl_curs_x equ [edi + 60] ; previous cursor X
cl_curs_y equ [edi + 62] ; previous cursor Y
ed_shift_pos equ [edi + 64] ; selection current position
ed_shift_pos_old equ [edi + 66] ; selection previous position
ed_height equ [edi + 68]
ed_char_width equ [edi + 72]
 
ed_struc_size = 84
ed_struc_size = 76
 
;;;;;;;;;;;;;;;;;;;;;;;
;; flags for EditBox ;;
60,27 → 60,27
struc edit_box width,left,top,color,shift_color,focus_border_color,\
blur_border_color,text_color,max,text,mouse_variable,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
.mouse_variable dd mouse_variable
.flags dd 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
.height dd 0
.char_width dd 0
.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
.mouse_variable dd mouse_variable
.flags dd flags+0
.size dd size+0
.pos dd pos+0
.offset dd 0
.cl_curs_x dw 0
.cl_curs_y dw 0
.shift dw 0
.shift_old dw 0
.height dd 0
.char_width dd 0
}
 
macro edit_boxes_set_sys_color start,end,color_table
/programs/develop/libraries/box_lib/trunk/editbox.mac
207,7 → 207,7
test word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
jz @f
mov ebp,shift_color
mov ebx,ed_shift_pos
movzx ebx, word ed_shift_pos
call edit_box_key.sh_cl_
@@: ret
;----------------------------------------------------------
284,36 → 284,36
ret
 
;----------------------------------------------------------
;--- ¯à®æ¥¤ãà  à¨á®¢ ­¨ï ªãàá®à  --------------------------
;------------------ Draw Cursor Procedure -----------------
;----------------------------------------------------------
;¢å®¤­ë¥ ebp- 梥â
; in: ebp = Color
edit_box.clear_cursor:
mov edx,ebp
mov ebx,cl_curs_x
mov ecx,cl_curs_y
mov edx, ebp
movzx ebx, word cl_curs_x
movzx ecx, word cl_curs_y
jmp edit_box.draw_curs
 
edit_box.draw_cursor:
mov eax,ed_pos
sub eax,ed_offset
mul dword ed_char_width
mov ebx,eax
add ebx,ed_left
inc ebx
mov edx,ebx
shl ebx,16
add ebx,edx
mov ecx,ed_top
add ecx,2
mov edx,ecx
shl ecx,16
add ecx,edx
add ecx,ed_height
sub ecx,3
mov cl_curs_x,ebx
mov cl_curs_y,ecx
mov edx,ed_text_color
edit_box.draw_curs:
mov edx, ed_text_color
mov eax, ed_pos
sub eax, ed_offset
mul dword ed_char_width
mov ebx, eax
add ebx, ed_left
inc ebx
mov ecx, ed_top
add ecx, 2
mov cl_curs_x, bx
mov cl_curs_y, cx
edit_box.draw_curs:
mov eax, ebx
shl ebx, 16
or ebx, eax
mov eax, ecx
shl ecx, 16
or ecx, eax
add ecx, ed_height
sub ecx, 3
mcall 38
ret
 
444,7 → 444,7
je edit_box_key.f_exit
mov ebp,shift_color
or word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
mov ebx,ed_shift_pos
movzx ebx, word ed_shift_pos
call edit_box_key.sh_cl_
jmp edit_box.draw_cursor_text
 
544,10 → 544,10
edit_box_key.sh_first_sh:
test word ed_flags,ed_shift
je @f
mov ed_shift_pos_old,ebx
mov ed_shift_pos_old,bx
test word ed_flags,ed_shift_on
jne @f
mov ed_shift_pos,ebx
mov ed_shift_pos,bx
or word ed_flags,ed_shift_on
@@: ret
;Ž¡à ¡®âª  ªà ©­¨å ¯®«®¦¥­¨© ¢ editbox ¯à¨ ­ ¦ â®¬ shift
560,7 → 560,7
je @f
call edit_box.draw_bg
mov ebp,ed_color
mov ebx,ed_shift_pos
movzx ebx, word ed_shift_pos
call edit_box_key.sh_cl_ ;®ç¨á⪠ ¢ë¤¥«¥­®£® äà £¬¥­â 
and word ed_flags,ed_shift_cl ; ®ç¨á⪠ ®â ⮣®, çâ® ã¡à «¨ ¢ë¤¥«¥­¨¥
jmp edit_box.draw_cursor_text
576,7 → 576,7
je @f
call edit_box.check_offset
mov ebp,ed_color
mov ebx,ed_shift_pos
movzx ebx, word ed_shift_pos
call edit_box_key.sh_cl_ ;®ç¨á⪠ ¢ë¤¥«¥­­®£® äà £¬¥­â 
call edit_box_key.draw_wigwag_cl
and word ed_flags,ed_shift_cl ; 1¢ à ­¥ ­ã¦­®
591,9 → 591,9
test word ed_flags,ed_offset_fl
je @f
;¨á®¢ ­¨¥ § ªà è¥­­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ¨å ®ç¨á⪠
mov eax,ed_shift_pos
movzx eax, word ed_shift_pos
mov ebx,ed_pos
mov ecx,ed_shift_pos_old
movzx ecx, word ed_shift_pos_old
;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­­ëå ®¡« á⥩
cmp eax,ecx
je edit_box_key.1_shem
616,7 → 616,7
ret
 
@@: mov ebp,shift_color
mov ebx,ed_shift_pos
movzx ebx, word ed_shift_pos
call edit_box_key.sh_cl_
jmp edit_box_key.sh_e_end
;äã­ªæ¨ï ¤«ï ®¡à ¡®âª¨ shift ¯à¨ ­ ¦ â¨¨ home and end
626,13 → 626,13
test word ed_flags,ed_shift_bac
je @f
mov ebp,ed_color
mov ebx,ed_shift_pos_old
movzx ebx, word ed_shift_pos_old
call edit_box_key.sh_cl_
@@:
test word ed_flags,ed_shift
je edit_box_key.sh_exit_ ;¢ë©â¨
mov ebp,shift_color
mov ebx,ed_shift_pos
movzx ebx, word ed_shift_pos
call edit_box_key.sh_cl_
or word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
jmp edit_box_key.sh_e_end
661,7 → 661,7
mov esi,ed_text
test word ed_flags,ed_shift_on
je @f
mov eax,ed_shift_pos
movzx eax, word ed_shift_pos
mov ebx,esi
cmp eax,ecx
jae edit_box_key.dh_n
671,7 → 671,7
add ebx,eax ;eax ¬¥­ìè¥
sub edx,ecx
add esi,ecx
mov ed_shift_pos,ebp
mov ed_shift_pos,bp
jmp edit_box_key.del_ch_sh
 
edit_box_key.dh_n:
680,7 → 680,7
add ebx,ecx
sub edx,eax
add esi,eax
mov ed_shift_pos,ebp
mov ed_shift_pos,bp
jmp edit_box_key.del_ch_sh
 
@@: add esi,ecx ;㪠§ â¥«ì + ᬥ饭¨¥ ª ॠ«ì­®¬ã ¡ãä¥àã
848,7 → 848,7
pusha
; clear input area
mov ebp,ed_color
mov ebx,ed_shift_pos
movzx ebx, word ed_shift_pos
call edit_box_key.sh_cl_
mov ebp,ed_size
call edit_box_key.clear_bg
855,7 → 855,7
popa
call edit_box_key.del_char
mov ebx,ed_size
sub ebx,ed_shift_pos
sub bx,ed_shift_pos
mov ed_size,ebx
pop eax
@@:
966,7 → 966,7
push edit_box_key.shift
test word ed_flags,ed_shift_on
je @f
mov eax,ed_shift_pos
movzx eax, word ed_shift_pos
mov ebx,ed_size
sub ebx,eax
mov ed_size,ebx
1159,9 → 1159,9
edit_box_mouse.mdraw:
mov ed_pos,eax
;¨á®¢ ­¨¥ § ªà è¥­­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ¨å ®ç¨á⪠
mov ecx,ed_shift_pos
mov ebx,ed_shift_pos_old
mov ed_shift_pos_old,eax
movzx ecx, word ed_shift_pos
movzx ebx, word ed_shift_pos_old
mov ed_shift_pos_old,ax
;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­­ëå ®¡« á⥩
cmp ecx,ebx
je edit_box_mouse.m1_shem ;¤¢¨¦¥­¨ï ­¥ ¡ë«® à ­¥¥
1195,7 → 1195,7
dec eax
call edit_box.check_offset
push eax
mov ebx,ed_shift_pos
movzx ebx, word ed_shift_pos
mov ebp,shift_color
call edit_box_key.sh_cl_
pop eax
1208,7 → 1208,7
jae edit_box_mouse.mwigvag
inc eax
call edit_box.check_offset
mov ebx,ed_shift_pos
movzx ebx, word ed_shift_pos
mov ebp,shift_color
push eax
call edit_box_key.sh_cl_
1253,7 → 1253,7
test word ed_flags,ed_shift_bac
je @f
mov ebp,ed_color
mov ebx,ed_shift_pos
movzx ebx, word ed_shift_pos
push eax
call edit_box_key.sh_cl_
and word ed_flags,ed_shift_bac_cl
1261,7 → 1261,7
@@:
test word ed_flags,ed_mouse_on
jne @f
mov ed_shift_pos,eax
mov ed_shift_pos,ax
or word ed_flags,ed_mouse_on
mov ed_pos,eax
mov ebx,ed_mouse_variable
1271,12 → 1271,12
call edit_box.draw_bg
jmp edit_box_mouse.m_sh
 
@@: cmp eax,ed_shift_pos
@@: cmp ax,ed_shift_pos
je edit_box.editbox_exit
mov ed_pos,eax
call edit_box.draw_bg
mov ebp,shift_color
mov ebx,ed_shift_pos
movzx ebx, word ed_shift_pos
call edit_box_key.sh_cl_
or word ed_flags,ed_mous_adn_b
edit_box_mouse.m_sh: