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,237 +4,220 @@
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
mov edi,fn mov edi,fn
mov ecx,256 mov ecx,256
rep movsb rep movsb
run: run:
xor eax,eax xor eax,eax
mov edi,file_info.name mov edi,file_info.name
mov ecx,512 mov ecx,512
rep stosb rep stosb
mov edi,run_par mov edi,run_par
mov ecx,256 mov ecx,256
rep stosb rep stosb
mov esi,fn mov esi,fn
mov edi,file_info.name mov edi,file_info.name
cmp [esi],byte '"' cmp [esi],byte '"'
je copy_fn_with_spaces je copy_fn_with_spaces
copy_fn: copy_fn:
cmp [esi],byte ' ' cmp [esi],byte ' '
je .stop je .stop
cmp [esi],byte 0 cmp [esi],byte 0
je .stop je .stop
mov al,[esi] mov al,[esi]
mov [edi],al mov [edi],al
inc esi inc esi
inc edi inc edi
jmp copy_fn jmp copy_fn
.stop: .stop:
jmp copy_par jmp copy_par
copy_fn_with_spaces: copy_fn_with_spaces:
inc esi inc esi
@@: @@:
cmp [esi],byte '"' cmp [esi],byte '"'
je .stop je .stop
cmp [esi],byte 0 cmp [esi],byte 0
je .stop je .stop
mov al,[esi] mov al,[esi]
mov [edi],al mov [edi],al
inc esi inc esi
inc edi inc edi
jmp @b jmp @b
.stop: .stop:
copy_par: copy_par:
@@: @@:
inc esi inc esi
cmp [esi],byte ' ' cmp [esi],byte ' '
je @b je @b
mov edi,run_par mov edi,run_par
@@: @@:
cmp [esi],byte 0 cmp [esi],byte 0
je .stop je .stop
mov al,[esi] mov al,[esi]
mov [edi],al mov [edi],al
inc esi inc esi
inc edi inc edi
jmp @b jmp @b
.stop: .stop:
mcall 70,file_info
mov eax,70 cmp eax,0
mov ebx,file_info jl error
int 0x40 mov [status],run_ok
call draw_status
cmp eax,0 jmp still
jl error
mov [status],run_ok
call draw_status
jmp still
close: close:
app_close mcall -1
error: error:
neg eax
cmp_err 3,bad_file_sys
cmp_err 5,file_not_find
cmp_err 9,bad_fat_table
cmp_err 10,acces_denyied
cmp_err 11,device_error
cmp_err 30,out_of_memory
cmp_err 31,file_not_executable
cmp_err 32,many_processes
macro cmp_err code,text_ptr call draw_status
{ jmp still
cmp al,code
jne @f
mov [status],text_ptr
@@:
}
neg eax
cmp_err 3,bad_file_sys
cmp_err 5,file_not_find
cmp_err 9,bad_fat_table
cmp_err 10,acces_denyied
cmp_err 11,device_error
cmp_err 30,out_of_memory
cmp_err 31,file_not_executable
cmp_err 32,many_processes
call draw_status
jmp still
draw_window: draw_window:
push 48 mcall 48,5
pop eax mov si,bx
mov ebx,5
int 0x40
mov si,bx
start_draw_window
get_skin_height
mov dx,ax
get_screen_size
xor ecx,ecx
sub cx,window_y+2
sub cx,dx
add cx,si
shl ecx,16
mov cx,dx
add cx,window_y
shr eax,16
mov bx,ax
sub bx,window_x
shl ebx,15
mov bx,window_x
mov edx,[sc.work]
or edx,0x33000000
xor eax,eax
xor esi,esi
mov edi,grab_text
int 0x40
get_procinfo app mcall 12,1
mcall 48,4
mov dx,ax
mcall 14
xor ecx,ecx
sub cx,window_y+2
sub cx,dx
add cx,si
shl ecx,16
mov cx,dx
add cx,window_y
shr eax,16
mov bx,ax
sub bx,window_x
shl ebx,15
mov bx,window_x
mov edx,[sc.work]
or edx,0x33000000
xor esi,esi
mov edi,grab_text
mcall 0
mov eax,[app.width] mcall 9,procinfo,-1
sub eax,20
mov [input_fn.width],eax
mov [run_but.width],ax
xor bx,bx mov eax,[procinfo.box.width]
shl ebx,16 sub eax,20
mov bx,ax mov [input_fn.width],eax
add bx,10 mov [run_but.width],ax
mov cx,45
push cx
shl ecx,16
pop cx
mov edx,[sc.work_graph]
mov eax,38
int 0x40
draw_edit_box input_fn xor bx,bx
draw_txt_button run_but shl ebx,16
mov bx,ax
add bx,10
mov cx,45
push cx
shl ecx,16
pop cx
mov edx,[sc.work_graph]
mcall 38
draw_edit_box input_fn
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
@@: @@:
cmp [edx+esi],byte 0 cmp [edx+esi],byte 0
je @f je @f
inc esi inc esi
jmp @b jmp @b
@@: @@:
mov ebx,5*65536+(50) mov ecx,[sc.work_text]
mov ecx,[sc.work_text] mcall 4,5*65536+(50)
mov eax,4
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
bad_file_sys db '<27>¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬ ',0 ; 3 bad_file_sys db '<27>¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬ ',0 ; 3
file_not_find db '” ©« ­¥ ­ ©¤¥­',0 ; 5 file_not_find db '” ©« ­¥ ­ ©¤¥­',0 ; 5
bad_fat_table db '’ ¡«¨æ  FAT à §àã襭 ',0 ; 9 bad_fat_table db '’ ¡«¨æ  FAT à §àã襭 ',0 ; 9
acces_denyied db '„®áâ㯠§ ¯à¥é¥­',0 ; 10 acces_denyied db '„®áâ㯠§ ¯à¥é¥­',0 ; 10
device_error db 'Žè¨¡ª  ãáâனá⢠',0 ; 11 device_error db 'Žè¨¡ª  ãáâனá⢠',0 ; 11
out_of_memory db '<27>¥¤®áâ â®ç­® ¯ ¬ïâ¨',0 ; 30 out_of_memory db '<27>¥¤®áâ â®ç­® ¯ ¬ïâ¨',0 ; 30
file_not_executable db '” ©« ­¥ ï¥âáï ¨á¯®«­ï¥¬ë¬',0 ; 31 file_not_executable db '” ©« ­¥ ï¥âáï ¨á¯®«­ï¥¬ë¬',0 ; 31
many_processes db '‘«¨èª®¬ ¬­®£® ¯à®æ¥áᮢ',0 ; 32 many_processes db '‘«¨èª®¬ ¬­®£® ¯à®æ¥áᮢ',0 ; 32
run_ok db '<27>ணࠬ¬  ãᯥ譮 § ¯ã饭 ',0 run_ok db '<27>ணࠬ¬  ãᯥ譮 § ¯ã饭 ',0
grab_text db '‡€<E280A1>Š <20><>Žƒ<C5BD>€ŒŒ',0 grab_text db '‡€<E280A1>Š <20><>Žƒ<C5BD>€ŒŒ',0
run_but_text db '‡€<E280A1>ˆœ',0 run_but_text db '‡€<E280A1>ˆœ',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,13 +1,15 @@
MODIFY 15.05.2007 Kolibri team
„®¡ ¢«¥­­® ¯®¤¤¥à¦ª  ¬ ªà®á®¢, ¨§ ¥¤¨­®© ¡¨¡«¨®â¥ª¨ ¬ ªà®á®¢, ¬®¤¥à­¨§¨à®¢ ­­ë© Editbox
RUN - § ¯ã᪠«ª  ¯à®£à ¬¬ ¢ Š®«¨¡à¨Ž‘ ç¥à¥§ 70-î äã­ªæ¨î. RUN - § ¯ã᪠«ª  ¯à®£à ¬¬ ¢ Š®«¨¡à¨Ž‘ ç¥à¥§ 70-î äã­ªæ¨î.
‡ ¯ã᪠¯à®£à ¬¬ ‡ ¯ã᪠¯à®£à ¬¬
‚¢¥¤¨â¥ ¯®«­ë© ¯ãâì ª ¨á¯®«­ï¥¬®¬ã ä ©«ã ¨ ­ ¦¬¨â¥ ª­®¯ªã "‡€<E280A1>ˆœ" ¨«¨ ‚¢¥¤¨â¥ ¯®«­ë© ¯ãâì ª ¨á¯®«­ï¥¬®¬ã ä ©«ã ¨ ­ ¦¬¨â¥ ª­®¯ªã "‡€<E280A1>ˆœ" ¨«¨
ª« ¢¨èã Enter. ª« ¢¨èã Enter.
‡ ¯ã᪠¯à®£à ¬¬ á ¯ à ¬¥âà ¬¨ ‡ ¯ã᪠¯à®£à ¬¬ á ¯ à ¬¥âà ¬¨
<20>®á⠢⥠¯à®¡¥« ¯®á«¥ ¯ã⨠ª ä ©«ã ¨ ¢¢®¤¨â¥ ¯ à ¬¥âàë. …᫨ ¢ ¯ã⨠ª ä ©«ã <20>®á⠢⥠¯à®¡¥« ¯®á«¥ ¯ã⨠ª ä ©«ã ¨ ¢¢®¤¨â¥ ¯ à ¬¥âàë. …᫨ ¢ ¯ã⨠ª ä ©«ã
¥áâì ¯à®¡¥«ë, ¥£® ­¥®¡å®¤¨¬® ¢ë¤¥«¨âì ª ¢ë窠¬¨ (⮣¤  ¯à®¡¥«®¬ à §¤¥«ïâì ¥áâì ¯à®¡¥«ë, ¥£® ­¥®¡å®¤¨¬® ¢ë¤¥«¨âì ª ¢ë窠¬¨ (⮣¤  ¯à®¡¥«®¬ à §¤¥«ïâì
­¥®¡ï§ â¥«ì­®). ­¥®¡ï§ â¥«ì­®).
<20>ਬ¥àë <20>ਬ¥àë
/rd/1/tinypad /rd/1/menu.dat /rd/1/tinypad /rd/1/menu.dat
"/hd0/1/long name dir with spaces/tinypad" /rd/1/autorun.dat "/hd0/1/long name dir with spaces/tinypad" /rd/1/autorun.dat
@ -15,5 +17,5 @@
ˆ¬ï ä ©«  ¨«¨ ¯ ¯ª¨ ¬®¦¥â ᮤ¥à¦ âì ¤® 260 ᨬ¢®«®¢. ˆ¬ï ä ©«  ¨«¨ ¯ ¯ª¨ ¬®¦¥â ᮤ¥à¦ âì ¤® 260 ᨬ¢®«®¢.
…᫨ ¯à®¨§®è«  ®è¨¡ª , ®­  ®â®¡à §¨âáï ¢­¨§ã. …᫨ ¯à®¨§®è«  ®è¨¡ª , ®­  ®â®¡à §¨âáï ¢­¨§ã.
…¢â¨å®¢ Œ ªá¨¬ (Maxxxx32) …¢â¨å®¢ Œ ªá¨¬ (Maxxxx32)
mailto:maxxxxm@mail.ru mailto:maxxxxm@mail.ru

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
} }