modify run, add new version editbox

git-svn-id: svn://kolibrios.org@493 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2007-05-15 04:27:32 +00:00
parent a6764896b9
commit ed1742523e
4 changed files with 187 additions and 199 deletions

View File

@ -4,39 +4,50 @@
window_y=67 window_y=67
;window_x=320 ;window_x=320
window_x=640 window_x=640
include 'macros.inc' ;--- ¤à㣨¥ ¬ ªà®áë ---
include '../../../develop/examples/editbox/trunk/editbox.inc'
;include 'editbox.inc'
include 'txtbut.inc'
include '../../../macros.inc'
;include 'macros.inc'
include 'run.mac'
include 'lang.inc' include 'lang.inc'
meos_header par meos_app_start
use_edit_box use_edit_box procinfo,22,5
use_txt_button use_txt_button
app_start code
cmp [par],byte 0 cmp [par],byte 0
jne read_par jne read_par
set_events_mask evm_mouse+evm_button+evm_key+evm_redraw mcall 40,EVM_MOUSE+EVM_BUTTON+EVM_KEY+EVM_REDRAW
red: red:
get_sys_colors sc mcall 48,3,sc,40
set_sys_colors_txt_button run_but,sc set_sys_colors_txt_button run_but,sc
push dword [sc.work_graph] push dword [sc.work_graph]
pop [input_fn.focus_border_color] pop [input_fn.focus_border_color]
call draw_window call draw_window
still: still:
wait_event red,key,button,mouse,,still mcall 10
cmp al,0x1 ;¥á«¨ ¨§¬¥­¨«®áì ¯®«®¦¥­¨¥ ®ª­ 
jz red
cmp al,0x2 ;¥á«¨ ­ ¦ â  ª« ¢¨è  â® ¯¥à¥©â¨
jz key
cmp al,0x3 ;¥á«¨ ­ ¦ â  ª­®¯ª  â® ¯¥à¥©â¨
jz button
mouse_edit_box input_fn
jmp still ;¥á«¨ ­¨ç¥£® ¨§ ¯¥à¥ç¨á«¥­­®£® â® á­®¢  ¢ 横«
key: key:
get_key mcall 2
cmp ah,13 cmp ah,13
je run je run
key_edit_box input_fn key_edit_box input_fn
jmp still jmp still
button: button:
get_pressed_button mcall 17
dec ah dec ah
jz close jz close
dec ah dec ah
jz run jz run
jmp still jmp still
mouse:
mouse_edit_box input_fn
jmp still
read_par: read_par:
mov esi,par mov esi,par
@ -99,10 +110,7 @@ copy_par:
inc edi inc edi
jmp @b jmp @b
.stop: .stop:
mcall 70,file_info
mov eax,70
mov ebx,file_info
int 0x40
cmp eax,0 cmp eax,0
jl error jl error
@ -110,49 +118,30 @@ copy_par:
call draw_status call draw_status
jmp still jmp still
close: close:
app_close mcall -1
error: error:
macro cmp_err code,text_ptr
{
cmp al,code
jne @f
mov [status],text_ptr
@@:
}
neg eax neg eax
cmp_err 3,bad_file_sys cmp_err 3,bad_file_sys
cmp_err 5,file_not_find cmp_err 5,file_not_find
cmp_err 9,bad_fat_table cmp_err 9,bad_fat_table
cmp_err 10,acces_denyied cmp_err 10,acces_denyied
cmp_err 11,device_error cmp_err 11,device_error
cmp_err 30,out_of_memory cmp_err 30,out_of_memory
cmp_err 31,file_not_executable cmp_err 31,file_not_executable
cmp_err 32,many_processes cmp_err 32,many_processes
call draw_status call draw_status
jmp still jmp still
draw_window: draw_window:
push 48 mcall 48,5
pop eax
mov ebx,5
int 0x40
mov si,bx mov si,bx
start_draw_window
get_skin_height mcall 12,1
mcall 48,4
mov dx,ax mov dx,ax
get_screen_size mcall 14
xor ecx,ecx xor ecx,ecx
sub cx,window_y+2 sub cx,window_y+2
sub cx,dx sub cx,dx
@ -167,14 +156,13 @@ draw_window:
mov bx,window_x mov bx,window_x
mov edx,[sc.work] mov edx,[sc.work]
or edx,0x33000000 or edx,0x33000000
xor eax,eax
xor esi,esi xor esi,esi
mov edi,grab_text mov edi,grab_text
int 0x40 mcall 0
get_procinfo app mcall 9,procinfo,-1
mov eax,[app.width] mov eax,[procinfo.box.width]
sub eax,20 sub eax,20
mov [input_fn.width],eax mov [input_fn.width],eax
mov [run_but.width],ax mov [run_but.width],ax
@ -188,24 +176,21 @@ draw_window:
shl ecx,16 shl ecx,16
pop cx pop cx
mov edx,[sc.work_graph] mov edx,[sc.work_graph]
mov eax,38 mcall 38
int 0x40
draw_edit_box input_fn draw_edit_box input_fn
draw_txt_button run_but draw_txt_button run_but
call draw_status_text call draw_status_text
stop_draw_window mcall 12,2
ret ret
draw_status: draw_status:
mov ebx,[app.width] mov ebx,[procinfo.box.width]
sub bx,10 sub bx,10
mov ecx,(50)*65536+12 mov ecx,(50)*65536+12
mov edx,[sc.work] mov edx,[sc.work]
mov eax,13 mcall 13
int 0x40
draw_status_text: draw_status_text:
mov edx,[status] mov edx,[status]
xor esi,esi xor esi,esi
@ -215,15 +200,13 @@ draw_status_text:
inc esi inc esi
jmp @b jmp @b
@@: @@:
mov ebx,5*65536+(50)
mov ecx,[sc.work_text] mov ecx,[sc.work_text]
mov eax,4 mcall 4,5*65536+(50)
int 0x40
ret ret
run_but txt_button 0,5,15,25,2,0,0,run_but_text, run_but txt_button 0,5,15,25,2,0,0,run_but_text,
input_fn edit_box 0,5,5,0xffffff,0,0xaaaaaa,0,511,fn,ed_focus+\ input_fn edit_box 0,5,5,0xffffff,0x6a9480,0,0xaaaaaa,0,511,fn,ed_focus+ed_always_focus
ed_always_focus mouse_flag: dd 0x0
if lang eq ru if lang eq ru
hello db '‚¢¥¤¨â¥ ¯®«­ë© ¯ãâì ª ä ©«ã ¨ ­ ¦¬¨â¥ Enter',0 hello db '‚¢¥¤¨â¥ ¯®«­ë© ¯ãâì ª ä ©«ã ¨ ­ ¦¬¨â¥ Enter',0
@ -252,9 +235,6 @@ run_ok db 'The program was started successfully',0
grab_text db 'RUN',0 grab_text db 'RUN',0
run_but_text db 'RUN',0 run_but_text db 'RUN',0
end if end if
mouse_flag: dd 0x0
status dd hello status dd hello
file_info: file_info:
@ -266,13 +246,12 @@ dd 0,0
flags dw ? flags dw ?
structure_of_potock: sc system_colors
rb 100
fn rb 512 procinfo process_information
sc sys_color_table
app procinfo
run_par rb 256 run_par rb 256
par rb 256 par rb 256
app_end fn rb 512
meos_app_end
udata

View File

@ -0,0 +1,7 @@
macro cmp_err code,text_ptr
{
cmp al,code
jne @f
mov [status],text_ptr
@@:
}

View File

@ -1,3 +1,5 @@
MODIFY 15.05.2007 Kolibri team
„®¡ ¢«¥­­® ¯®¤¤¥à¦ª  ¬ ªà®á®¢, ¨§ ¥¤¨­®© ¡¨¡«¨®â¥ª¨ ¬ ªà®á®¢, ¬®¤¥à­¨§¨à®¢ ­­ë© Editbox
RUN - § ¯ã᪠«ª  ¯à®£à ¬¬ ¢ Š®«¨¡à¨Ž‘ ç¥à¥§ 70-î äã­ªæ¨î. RUN - § ¯ã᪠«ª  ¯à®£à ¬¬ ¢ Š®«¨¡à¨Ž‘ ç¥à¥§ 70-î äã­ªæ¨î.
‡ ¯ã᪠¯à®£à ¬¬ ‡ ¯ã᪠¯à®£à ¬¬

View File

@ -12,7 +12,7 @@ pusha
mov ecx,[edi+4] ;[but.height] mov ecx,[edi+4] ;[but.height]
mov edx,[edi+8];[but.id] mov edx,[edi+8];[but.id]
mov esi,[edi+12];[but.color] mov esi,[edi+12];[but.color]
int 0x40 mcall
;--- ⥪áâ ­  ­¥© --- ;--- ⥪áâ ­  ­¥© ---
; áç¨â ¥¬ ª®«¨ç¥á⢮ ᨬ¢®«®¢ ; áç¨â ¥¬ ª®«¨ç¥á⢮ ᨬ¢®«®¢
mov edx,[edi+20] mov edx,[edi+20]
@ -45,7 +45,7 @@ pusha
; à¨á㥬 áâபã ⥪áâ  ; à¨á㥬 áâபã ⥪áâ 
mov ecx,[edi+16] ;[but.text_color] mov ecx,[edi+16] ;[but.text_color]
shr eax,1 shr eax,1
int 0x40 mcall
popa popa
ret ret
} }