Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 492 → Rev 493

/programs/system/run/trunk/run.asm
4,39 → 4,50
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
meos_app_start
use_edit_box procinfo,22,5
use_txt_button
app_start
code
cmp [par],byte 0
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:
get_sys_colors sc
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
mcall 2
cmp ah,13
je run
key_edit_box input_fn
jmp still
button:
get_pressed_button
mcall 17
dec ah
jz close
dec ah
jz run
jmp still
mouse:
mouse_edit_box input_fn
jmp still
 
read_par:
mov esi,par
99,11 → 110,8
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
110,49 → 118,30
call draw_status
jmp still
close:
app_close
mcall -1
 
error:
 
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
 
draw_window:
push 48
pop eax
mov ebx,5
int 0x40
mcall 48,5
mov si,bx
start_draw_window
get_skin_height
 
mcall 12,1
mcall 48,4
mov dx,ax
get_screen_size
mcall 14
xor ecx,ecx
sub cx,window_y+2
sub cx,dx
167,14 → 156,13
mov bx,window_x
mov edx,[sc.work]
or edx,0x33000000
xor eax,eax
xor esi,esi
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
mov [input_fn.width],eax
mov [run_but.width],ax
188,24 → 176,21
shl ecx,16
pop cx
mov edx,[sc.work_graph]
mov eax,38
int 0x40
 
mcall 38
draw_edit_box input_fn
draw_txt_button run_but
 
call draw_status_text
 
stop_draw_window
mcall 12,2
ret
 
draw_status:
mov ebx,[app.width]
mov ebx,[procinfo.box.width]
sub bx,10
mov ecx,(50)*65536+12
mov edx,[sc.work]
mov eax,13
int 0x40
mcall 13
draw_status_text:
mov edx,[status]
xor esi,esi
215,15 → 200,13
inc esi
jmp @b
@@:
mov ebx,5*65536+(50)
mov ecx,[sc.work_text]
mov eax,4
int 0x40
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
252,9 → 235,6
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
 
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