forked from KolibriOS/kolibrios
0311a61f7f
git-svn-id: svn://kolibrios.org@9568 a494cfbc-eb01-0410-851d-a64ba20cac60
194 lines
6.1 KiB
NASM
194 lines
6.1 KiB
NASM
;§ £®«®¢®ª ¯à¨«®¦¥¨ï
|
||
use32 ; âà á«ïâ®à, ¨á¯®«ì§ãî騩 32 à §àï¤ëå ª®¬ ¤ë
|
||
org 0 ; ¡ §®¢ë© ¤à¥á ª®¤ , ¢á¥£¤ 0
|
||
db 'MENUET01' ; ¨¤¥â¨ä¨ª â®à ¨á¯®«ï¥¬®£® ä ©« (8 ¡ ©â)
|
||
dd 1 ; ¢¥àá¨ï ä®à¬ â § £®«®¢ª ¨á¯®«ï¥¬®£® ä ©«
|
||
dd start ; ¤à¥á, ª®â®àë© á¨á⥬ ¯¥à¥¤ ñâ ã¯à ¢«¥¨¥
|
||
; ¯®á«¥ § £à㧪¨ ¯à¨«®¦¥¨ï ¢ ¯ ¬ïâì
|
||
dd i_end ; à §¬¥à ¯à¨«®¦¥¨ï
|
||
dd mem ; Ž¡ê¥¬ ¨á¯®«ì§ã¥¬®© ¯ ¬ïâ¨, ¤«ï á⥪ ®â¢¥¤¥¬ 0å100 ¡ ©â ¨ ¢ë஢¨¬ £à¨æã 4 ¡ ©â
|
||
dd mem ; à ᯮ«®¦¨¬ ¯®§¨æ¨î á⥪ ¢ ®¡« á⨠¯ ¬ïâ¨, áà §ã § ⥫®¬ ¯à®£à ¬¬ë. ‚¥àè¨ á⥪ ¢ ¤¨ ¯ §®¥ ¯ ¬ïâ¨, 㪠§ ®¬ ¢ëè¥
|
||
dd 0 ; 㪠§ ⥫ì áâபã á ¯ à ¬¥âà ¬¨.
|
||
dd cur_dir_path ; 㪠§ â¥«ì ¤à¥á, ªã¤ ¯®¬¥é ¥âáï áâப , ᮤ¥à¦ é ï ¯ãâì ¤® ¯à®£à ¬¬ë ¢ ¬®¬¥â § ¯ã᪠.
|
||
|
||
include '../../../../../macros.inc'
|
||
include '../../trunk/box_lib.mac'
|
||
include '../../../../../KOSfuncs.inc'
|
||
include '../../../../../load_lib.mac'
|
||
@use_library ;use load lib macros
|
||
start:
|
||
;universal load library/librarys
|
||
sys_load_library library_name, library_path, system_path, myimport
|
||
;if return code =-1 then exit, else nornary work
|
||
cmp eax,-1
|
||
jz exit
|
||
mcall SF_SET_EVENTS_MASK,0x80000027 ;ãáâ ®¢¨âì ¬ áªã ¤«ï ®¦¨¤ ¥¬ëå ᮡë⨩
|
||
|
||
push dword check1 ;¯®¤áçñâ ¤¨ë ⥪áâ ¤«ï Checkbox'®¢
|
||
call [init_checkbox]
|
||
|
||
push dword check2
|
||
call [init_checkbox]
|
||
|
||
red_win:
|
||
call draw_window ;¯¥à¢® ç «ì® ¥®¡å®¤¨¬® à¨á®¢ âì ®ª®
|
||
align 4
|
||
still: ;®á®¢®© ®¡à ¡®â稪
|
||
mcall SF_WAIT_EVENT
|
||
dec eax
|
||
jz red_win
|
||
dec eax
|
||
jz key
|
||
dec eax
|
||
jz button
|
||
|
||
push dword edit1
|
||
call [edit_box_mouse]
|
||
|
||
push dword edit2
|
||
call [edit_box_mouse]
|
||
|
||
push dword check1
|
||
call [check_box_mouse]
|
||
|
||
push dword check2
|
||
call [check_box_mouse]
|
||
|
||
push dword Option_boxs
|
||
call [option_box_mouse]
|
||
|
||
push dword Option_boxs2
|
||
call [option_box_mouse]
|
||
|
||
jmp still ;¥á«¨ ¨ç¥£® ¨§ ¯¥à¥ç¨á«¥®£® ⮠ᮢ ¢ 横«
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
button:
|
||
mcall SF_GET_BUTTON
|
||
test ah,ah ;¥á«¨ ¢ ah 0, â® ¯¥à¥©â¨ ®¡à ¡®â稪 ᮡë⨩ still
|
||
jz still
|
||
exit:
|
||
mcall SF_TERMINATE_PROCESS
|
||
key:
|
||
mcall SF_GET_KEY
|
||
|
||
push dword edit1
|
||
call [edit_box_key]
|
||
|
||
push dword edit2
|
||
call [edit_box_key]
|
||
|
||
jmp still
|
||
|
||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||
align 4
|
||
draw_window: ;à¨á®¢ ¨¥ ®ª ¯à¨«®¦¥¨ï
|
||
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
||
mcall SF_CREATE_WINDOW,(50*65536+390),(30*65536+200),0x33AABBCC,0x805080DD,hed
|
||
|
||
push dword edit1
|
||
call [edit_box_draw]
|
||
|
||
push dword edit2
|
||
call [edit_box_draw]
|
||
|
||
push dword check1
|
||
call [check_box_draw]
|
||
|
||
push dword check2
|
||
call [check_box_draw]
|
||
|
||
push dword Option_boxs
|
||
call [option_box_draw]
|
||
|
||
push dword Option_boxs2
|
||
call [option_box_draw]
|
||
|
||
mcall SF_REDRAW, SSF_END_DRAW
|
||
ret
|
||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||
;DATA ¤ ë¥
|
||
;‚ᥣ¤ ᮡ«î¤ âì ¯®á«¥¤®¢ ⥫ì®áâì ¢ ¨¬¥¨.
|
||
system_path db '/sys/lib/'
|
||
library_name db 'box_lib.obj',0
|
||
; …᫨ ¥áâì ¦¥« ¨¥ à §ê¥¤¨¨âì, ⮠㦮 ¨á¯®«ì§®¢ âì á«¥¤ãîé¨î ª®áâàãªæ¨î
|
||
;system_path db '/sys/lib/box_lib.obj',0
|
||
;... «î¡ ï ¯®á«¥¤®¢ ⥫ì®áâì ¤àã£¨å ª®¬ ¤ ¨ ®¯à¥¤¥«¥¨©.
|
||
;library_name db 'box_lib.obj',0
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
|
||
myimport:
|
||
|
||
edit_box_draw dd aEdit_box_draw
|
||
edit_box_key dd aEdit_box_key
|
||
edit_box_mouse dd aEdit_box_mouse
|
||
version_ed dd aVersion_ed
|
||
|
||
init_checkbox dd aInit_checkbox
|
||
check_box_draw dd aCheck_box_draw
|
||
check_box_mouse dd aCheck_box_mouse
|
||
version_ch dd aVersion_ch
|
||
|
||
option_box_draw dd aOption_box_draw
|
||
option_box_mouse dd aOption_box_mouse
|
||
version_op dd aVersion_op
|
||
|
||
dd 0,0
|
||
|
||
aEdit_box_draw db 'edit_box_draw',0
|
||
aEdit_box_key db 'edit_box_key',0
|
||
aEdit_box_mouse db 'edit_box_mouse',0
|
||
aVersion_ed db 'version_ed',0
|
||
|
||
aInit_checkbox db 'init_checkbox2',0
|
||
aCheck_box_draw db 'check_box_draw2',0
|
||
aCheck_box_mouse db 'check_box_mouse2',0
|
||
aVersion_ch db 'version_ch2',0
|
||
|
||
aOption_box_draw db 'option_box_draw',0
|
||
aOption_box_mouse db 'option_box_mouse',0
|
||
aVersion_op db 'version_op',0
|
||
|
||
|
||
check1 check_box2 (10 shl 16 + 12),(45 shl 16 + 12),5,0x80AABBCC,0,0,check_text1,ch_flag_en
|
||
check2 check_box2 (10 shl 16 + 12),(60 shl 16 + 12),6,0x80AABBCC,0,0,check_text2
|
||
|
||
edit1 edit_box 350,3,5,0xffffff,0x6f9480,0,0xAABBCC,0,308,hed,mouse_dd,ed_focus,hed_end-hed-1,hed_end-hed-1
|
||
edit2 edit_box 350,3,25,0xffffff,0x6a9480,0,0,0,99,ed_buffer,mouse_dd,ed_figure_only
|
||
|
||
op1 option_box option_group1,10,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
|
||
op2 option_box option_group1,10,105,6,12,0xFFFFFF,0,0,op_text.2,op_text.e2-op_text.2
|
||
op3 option_box option_group1,10,120,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
|
||
op11 option_box option_group2,120,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
|
||
op12 option_box option_group2,120,105,6,12,0xffffff,0,0,op_text.2,op_text.e2-op_text.2
|
||
op13 option_box option_group2,120,120,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
|
||
|
||
option_group1 dd op1 ;㪠§ ⥫¨, ®¨ ®â®¡à ¦ îâáï ¯® 㬮«ç ¨î, ª®£¤ ¢ë¢®¤¨âáï
|
||
option_group2 dd op12 ;¯à¨«®¦¥¨¥
|
||
Option_boxs dd op1,op2,op3,0
|
||
Option_boxs2 dd op11,op12,op13,0
|
||
|
||
hed db 'BOXs load from lib <Lrz> date 27.04.2009',0
|
||
hed_end:
|
||
|
||
rb 256
|
||
check_text1 db 'First checkbox',0
|
||
check_text2 db 'Second checkbox',0
|
||
|
||
op_text: ; ‘®¯à®¢®¦¤ î騩 ⥪áâ ¤«ï Optionbox'
|
||
.1 db 'Option_Box #1'
|
||
.e1:
|
||
.2 db 'Option_Box #2'
|
||
.e2:
|
||
.3 db 'Option_Box #3'
|
||
.e3:
|
||
ed_buffer rb 100
|
||
;-----------------------
|
||
;sc system_colors
|
||
|
||
mouse_dd rd 1
|
||
p_info process_information
|
||
cur_dir_path rb 4096
|
||
library_path rb 4096
|
||
i_end:
|
||
rb 1024
|
||
mem: |