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_x=320
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'
meos_header par
use_edit_box
use_txt_button
app_start
cmp [par],byte 0
jne read_par
set_events_mask evm_mouse+evm_button+evm_key+evm_redraw
meos_app_start
use_edit_box procinfo,22,5
use_txt_button
code
cmp [par],byte 0
jne read_par
mcall 40,EVM_MOUSE+EVM_BUTTON+EVM_KEY+EVM_REDRAW
red:
get_sys_colors sc
set_sys_colors_txt_button run_but,sc
push dword [sc.work_graph]
pop [input_fn.focus_border_color]
call draw_window
mcall 48,3,sc,40
set_sys_colors_txt_button run_but,sc
push dword [sc.work_graph]
pop [input_fn.focus_border_color]
call draw_window
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:
get_key
cmp ah,13
je run
key_edit_box input_fn
jmp still
mcall 2
cmp ah,13
je run
key_edit_box input_fn
jmp still
button:
get_pressed_button
dec ah
jz close
dec ah
jz run
jmp still
mouse:
mouse_edit_box input_fn
jmp still
mcall 17
dec ah
jz close
dec ah
jz run
jmp still
read_par:
mov esi,par
mov edi,fn
mov ecx,256
rep movsb
mov esi,par
mov edi,fn
mov ecx,256
rep movsb
run:
xor eax,eax
mov edi,file_info.name
mov ecx,512
rep stosb
mov edi,run_par
mov ecx,256
rep stosb
xor eax,eax
mov edi,file_info.name
mov ecx,512
rep stosb
mov edi,run_par
mov ecx,256
rep stosb
mov esi,fn
mov edi,file_info.name
cmp [esi],byte '"'
je copy_fn_with_spaces
mov esi,fn
mov edi,file_info.name
cmp [esi],byte '"'
je copy_fn_with_spaces
copy_fn:
cmp [esi],byte ' '
je .stop
cmp [esi],byte 0
je .stop
mov al,[esi]
mov [edi],al
inc esi
inc edi
jmp copy_fn
cmp [esi],byte ' '
je .stop
cmp [esi],byte 0
je .stop
mov al,[esi]
mov [edi],al
inc esi
inc edi
jmp copy_fn
.stop:
jmp copy_par
jmp copy_par
copy_fn_with_spaces:
inc esi
inc esi
@@:
cmp [esi],byte '"'
je .stop
cmp [esi],byte 0
je .stop
mov al,[esi]
mov [edi],al
inc esi
inc edi
jmp @b
cmp [esi],byte '"'
je .stop
cmp [esi],byte 0
je .stop
mov al,[esi]
mov [edi],al
inc esi
inc edi
jmp @b
.stop:
copy_par:
@@:
inc esi
cmp [esi],byte ' '
je @b
mov edi,run_par
inc esi
cmp [esi],byte ' '
je @b
mov edi,run_par
@@:
cmp [esi],byte 0
je .stop
mov al,[esi]
mov [edi],al
inc esi
inc edi
jmp @b
cmp [esi],byte 0
je .stop
mov al,[esi]
mov [edi],al
inc esi
inc edi
jmp @b
.stop:
mcall 70,file_info
mov eax,70
mov ebx,file_info
int 0x40
cmp eax,0
jl error
mov [status],run_ok
call draw_status
jmp still
cmp eax,0
jl error
mov [status],run_ok
call draw_status
jmp still
close:
app_close
mcall -1
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
{
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
call draw_status
jmp still
draw_window:
push 48
pop eax
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
mcall 48,5
mov si,bx
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]
sub eax,20
mov [input_fn.width],eax
mov [run_but.width],ax
mcall 9,procinfo,-1
xor bx,bx
shl ebx,16
mov bx,ax
add bx,10
mov cx,45
push cx
shl ecx,16
pop cx
mov edx,[sc.work_graph]
mov eax,38
int 0x40
mov eax,[procinfo.box.width]
sub eax,20
mov [input_fn.width],eax
mov [run_but.width],ax
draw_edit_box input_fn
draw_txt_button run_but
xor bx,bx
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
draw_status:
mov ebx,[app.width]
sub bx,10
mov ecx,(50)*65536+12
mov edx,[sc.work]
mov eax,13
int 0x40
mov ebx,[procinfo.box.width]
sub bx,10
mov ecx,(50)*65536+12
mov edx,[sc.work]
mcall 13
draw_status_text:
mov edx,[status]
xor esi,esi
mov edx,[status]
xor esi,esi
@@:
cmp [edx+esi],byte 0
je @f
inc esi
jmp @b
cmp [edx+esi],byte 0
je @f
inc esi
jmp @b
@@:
mov ebx,5*65536+(50)
mov ecx,[sc.work_text]
mov eax,4
int 0x40
mov ecx,[sc.work_text]
mcall 4,5*65536+(50)
ret
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+\
ed_always_focus
input_fn edit_box 0,5,5,0xffffff,0x6a9480,0,0xaaaaaa,0,511,fn,ed_focus+ed_always_focus
mouse_flag: dd 0x0
if lang eq ru
hello db '‚¢¥¤¨â¥ ¯®«­ë© ¯ãâì ª ä ©«ã ¨ ­ ¦¬¨â¥ Enter',0
bad_file_sys db '<27>¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬ ',0 ; 3
file_not_find db '” ©« ­¥ ­ ©¤¥­',0 ; 5
bad_fat_table db '’ ¡«¨æ  FAT à §àã襭 ',0 ; 9
acces_denyied db '„®áâ㯠§ ¯à¥é¥­',0 ; 10
device_error db 'Žè¨¡ª  ãáâனá⢠',0 ; 11
out_of_memory db '<27>¥¤®áâ â®ç­® ¯ ¬ïâ¨',0 ; 30
file_not_find db '” ©« ­¥ ­ ©¤¥­',0 ; 5
bad_fat_table db '’ ¡«¨æ  FAT à §àã襭 ',0 ; 9
acces_denyied db '„®áâ㯠§ ¯à¥é¥­',0 ; 10
device_error db 'Žè¨¡ª  ãáâனá⢠',0 ; 11
out_of_memory db '<27>¥¤®áâ â®ç­® ¯ ¬ïâ¨',0 ; 30
file_not_executable db '” ©« ­¥ ï¥âáï ¨á¯®«­ï¥¬ë¬',0 ; 31
many_processes db '‘«¨èª®¬ ¬­®£® ¯à®æ¥áᮢ',0 ; 32
many_processes db '‘«¨èª®¬ ¬­®£® ¯à®æ¥áᮢ',0 ; 32
run_ok db '<27>ணࠬ¬  ãᯥ譮 § ¯ã饭 ',0
grab_text db '‡€<E280A1>Š <20><>Žƒ<C5BD>€ŒŒ',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
run_but_text db 'RUN',0
end if
mouse_flag: dd 0x0
status dd hello
file_info:
@ -266,13 +246,12 @@ dd 0,0
flags dw ?
structure_of_potock:
rb 100
sc system_colors
fn rb 512
procinfo process_information
sc sys_color_table
app procinfo
run_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-î äã­ªæ¨î.
‡ ¯ã᪠¯à®£à ¬¬
‡ ¯ã᪠¯à®£à ¬¬
‚¢¥¤¨â¥ ¯®«­ë© ¯ãâì ª ¨á¯®«­ï¥¬®¬ã ä ©«ã ¨ ­ ¦¬¨â¥ ª­®¯ªã "‡€<E280A1>ˆœ" ¨«¨
ª« ¢¨èã Enter.
‡ ¯ã᪠¯à®£à ¬¬ á ¯ à ¬¥âà ¬¨
‡ ¯ã᪠¯à®£à ¬¬ á ¯ à ¬¥âà ¬¨
<20>®á⠢⥠¯à®¡¥« ¯®á«¥ ¯ã⨠ª ä ©«ã ¨ ¢¢®¤¨â¥ ¯ à ¬¥âàë. …᫨ ¢ ¯ã⨠ª ä ©«ã
¥áâì ¯à®¡¥«ë, ¥£® ­¥®¡å®¤¨¬® ¢ë¤¥«¨âì ª ¢ë窠¬¨ (⮣¤  ¯à®¡¥«®¬ à §¤¥«ïâì
­¥®¡ï§ â¥«ì­®).
<20>ਬ¥àë
<20>ਬ¥àë
/rd/1/tinypad /rd/1/menu.dat
"/hd0/1/long name dir with spaces/tinypad" /rd/1/autorun.dat
@ -15,5 +17,5 @@
ˆ¬ï ä ©«  ¨«¨ ¯ ¯ª¨ ¬®¦¥â ᮤ¥à¦ âì ¤® 260 ᨬ¢®«®¢.
…᫨ ¯à®¨§®è«  ®è¨¡ª , ®­  ®â®¡à §¨âáï ¢­¨§ã.
…¢â¨å®¢ Œ ªá¨¬ (Maxxxx32)
mailto:maxxxxm@mail.ru
…¢â¨å®¢ Œ ªá¨¬ (Maxxxx32)
mailto:maxxxxm@mail.ru

View File

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