forked from KolibriOS/kolibrios
modify run, add new version editbox
git-svn-id: svn://kolibrios.org@493 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
a6764896b9
commit
ed1742523e
@ -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,10 +110,7 @@ copy_par:
|
||||
inc edi
|
||||
jmp @b
|
||||
.stop:
|
||||
|
||||
mov eax,70
|
||||
mov ebx,file_info
|
||||
int 0x40
|
||||
mcall 70,file_info
|
||||
|
||||
cmp eax,0
|
||||
jl error
|
||||
@ -110,49 +118,30 @@ copy_par:
|
||||
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 @@ draw_window:
|
||||
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 @@ draw_window:
|
||||
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 @@ draw_status_text:
|
||||
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 @@ 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
|
||||
|
7
programs/system/run/trunk/run.mac
Normal file
7
programs/system/run/trunk/run.mac
Normal file
@ -0,0 +1,7 @@
|
||||
macro cmp_err code,text_ptr
|
||||
{
|
||||
cmp al,code
|
||||
jne @f
|
||||
mov [status],text_ptr
|
||||
@@:
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
MODIFY 15.05.2007 Kolibri team
|
||||
„®¡ ¢«¥® ¯®¤¤¥à¦ª ¬ ªà®á®¢, ¨§ ¥¤¨®© ¡¨¡«¨®â¥ª¨ ¬ ªà®á®¢, ¬®¤¥à¨§¨à®¢ ë© Editbox
|
||||
RUN - § ¯ã᪠«ª ¯à®£à ¬¬ ¢ Š®«¨¡à¨Ž‘ ç¥à¥§ 70-î äãªæ¨î.
|
||||
|
||||
‡ ¯ã᪠¯à®£à ¬¬
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user