kolibrios/programs/develop/libGUI/src/edit_box.inc
andrew_programmer 03ec9a762d Save of registers after an entrance in function libGUI is added.
git-svn-id: svn://kolibrios.org@706 a494cfbc-eb01-0410-851d-a64ba20cac60
2008-01-31 12:50:35 +00:00

268 lines
6.3 KiB
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

eb_control_data_size = 82
;****************************************************
;******************craete EditBox*********************
;****************************************************
;IN
;pointer to parend
;pointer to EditBox's structure
;OUT
;pointer to initialized control
align 4
craete_edit_box:
push ebx
push ecx
push edx
push esi
push edi
push ebp
mov ebx,[esp+24+4]
mov eax,[esp+24+8]
mov [PointerToStructureForEditBox],eax
mov eax,control_header_size+eb_control_data_size
call craete_control
;set all EditBox's parameters in control
mov [eax],dword edit_box
mov ecx,eb_control_data_size
mov esi,[PointerToStructureForEditBox]
mov edi,eax
add edi,control_header_size
rep movsb
call get_skin_height
mov ebx,[PointerToStructureForEditBox]
mov ecx,[ebx+4] ;x
mov edx,[ebx+8] ;y
mov esi,[ebx] ;size x
mov edi,[ebx+70] ;size y
add ecx,border_width
add edx,[skin_height]
;copy information to control
mov [eax+24],ecx
mov [eax+28],edx
mov [eax+32],esi
mov [eax+36],edi
pop ebp
pop edi
pop esi
pop edx
pop ecx
pop ebx
ret 8
;****************************************************
;******************Draw EditBox**********************
;****************************************************
;include 'editbox_mac.inc'
;IN
;pointer to control of EditBox
;message
;OUT
;not returned value
align 4
include 'editbox_mac.inc'
edit_box:
;;;;;;;;;;;;
;Structure from libGui  á®æ¨ æ¨ï áâàãªâãà
;;;;;;;;;;;;
;get message
mov eax,[esp+8]
;get pointer to control of button
mov esi,[esp+4]
mov [PointerForEditBox],esi
;copy control to local control
add esi,control_header_size
mov edi,dword EditBox
mov ecx,eb_control_data_size
rep movsb
;;;;;;;;;;;;
;Structure from libGui  á®æ¨ æ¨ï áâàãªâãà
;;;;;;;;;;;;
srt_ed_libgui
push eax
;load coordinats and size from control
mov eax,[PointerForEditBox]
mov ebx,[eax+24] ;x
mov ecx,[eax+28] ;y
mov edx,[eax+32] ;size x
mov esi,[eax+36] ;size y
;set current coordinats and sizes in EeditBox
mov [EditBox.ed_left],ebx
mov [EditBox.ed_top],ecx
mov [EditBox.ed_width],edx
mov [EditBox.ed_height],esi
pop eax
;events of redraw all EditBox
cmp [eax],dword 1
jne .no_redraw_all_edit_box
call .draw_border
.draw_bg_cursor_text:
call .check_offset
call .draw_bg
call .draw_shift
.draw_cursor_text:
test word[EditBox.ed_flags],ed_focus
je @f
call .draw_cursor
@@:
call .draw_text
jmp .editbox_exit;exit_edit_box
.no_redraw_all_edit_box:
;events of keys for EditBox
cmp [eax],dword 2
jne .no_keys_edit_box
mov ebx,[eax+4]
shl ebx,8
mov eax,ebx
test word [EditBox.ed_flags],ed_focus
je .editbox_exit;exit_edit_box;@b
call .check_shift
;----------------------------------------------------------
;--- ¯à®¢¥à塞, çâ® ­ ¦ â® --------------------------------
;----------------------------------------------------------
use_key_process backspase,delete,left,right,home,end,insert
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;‡ £«ã誠 ­  ®¡à ¡®âªã ª« ¢¨è ¢¢¥àå ¨ ¢­¨§ â.¥. ¯à¨
;®¡­ à㦥­¨¨ íâ¨å ª®¤®¢ ¯à®¨á室¨â ¢ë室 ¨§ ®¡à ¡®â稪 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
srt_ed_libgui
use_key_no_process up,down,esc
;--- ­ ¦ â  ¤àã£ ï ª« ¢¨è  ---
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<EFBFBD>஢¥àª  ãáâ ­®¢«¥­ «¨ ä« £ ¯à¨ ª®â®à®¬ ­ã¦­® ¢ë¢®¤¨âì
;⮫쪮 æ¨äàë ¢ ­ã¦­®¬ ¡®ªá¥ ¥á«¨ â ª®© ­¥®¡å®¤¨¬®á⨠­¥â
;­ã¦­® § ª®¬¥­â¨à®¢ âì ¬ ªà®á
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_key_figures_only
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;¯à®¢¥àª  ­  shift ¡ë« «¨ ­ ¦ â
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
are_key_shift_press
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ¯à®¢¥à塞, ­ å®¤¨âáï «¨ ªãàá®à ¢ ª®­æ¥ + ¤ «ì­¥©è ï ®¡à ¡®âª 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
are_key_cur_end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Ž¡à ¡®âª  ª« ¢¨è insert,delete.backspase,home,end,left,right
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_work_key
.no_keys_edit_box:
cmp [eax],dword 3
je exit_edit_box
;events of mouse for EditBox
cmp [eax],dword 6
jne .editbox_exit
mov esi,[eax+4]
mov edi,[eax+8]
mov ecx,[eax+12]
mov [EditBox.mouseX],esi
mov [EditBox.mouseY],edi
mov [ButtonsOfMouse],ecx
mov eax,ecx
test eax,1
jnz .mouse_left_button
and word [EditBox.ed_flags],ed_mouse_on_off
jmp .editbox_exit
.mouse_left_button:
mov eax,[EditBox.mouseX]
shl eax,16
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;”ã­ªæ¨ï ®¡à ¡®âª¨ ¬ë誨 ¯®«ã祭¨¥ ª®®à¤¨­ â ¨ ¯à®¢¥àª  ¨å + ¢ë¤¥«¥­¨ï
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_work_mouse ;scr_h,scr_w
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Ž¡é¨¥ ä㭪樨 ®¡à ¡®âª¨
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_general_func
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;”㭪樨 ¤«ï à ¡®âë á key
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_key_func
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;”㭪樨 ¤«ï à ¡®âë á mouse
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_mouse_func ;scr_w
;;;;;;;;;;;;;;;;;;;;;;;;;;
;Ž¡é¨© ¢ë室 ¨§ editbox ¤«ï ¢á¥å ä㭪権 ¨ ¯®áâ ®¡à ¡®â稪®¢
;;;;;;;;;;;;;;;;;;;;;;;;;;
.editbox_exit:
exit_edit_box:
;save resulatat of work in control
mov esi,dword EditBox
mov edi,[PointerForEditBox]
add edi,control_header_size
mov ecx,eb_control_data_size
rep movsb
ret 8