kolibrios-gitea/programs/develop/examples/radiobutton/trunk/optionbox.asm
heavyiron 4daae89053 *kernel - fixes in 15.2 by Mario79 and 67 by mike.dld
updated sysfunc.txt
*programs 
         new icons and logo for CPUID and ICON
         added new version of @ICON and ICONMNGR
         fixes in iconedit and calendar from DedOK
         new algoritm of fill background in pic4
         all apps (fasm-writen only) rewriten to use common macros.inc for easy recompile in fastcall mode (there is a bug in https; run need rewrite to use common macros.inc)
         small fixes in build_all.bat script
         

git-svn-id: svn://kolibrios.org@485 a494cfbc-eb01-0410-851d-a64ba20cac60
2007-05-10 13:48:35 +00:00

130 lines
5.5 KiB
NASM
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;ª®¬¯®­¥­â OptionBox (®á­®¢ ­ ­  Checkbox)
;Ž£à®¬­ ï ¡« £®¤ à­®áâì Maxxxx32, Diamond, Heavyiron ¨ ¤à㣨¬ ¯à®£à ¬¬¨áâ ¬, ¨ ¨å ¯à®£à ¬¬ ¬, ¡¥§
;ª®â®àëå ï ­¥ ᬮ£ ¡ë ­ ¯¨á âì íâ®â ª®¬¯®­¥­â.
;21.02.2007 ¬®¤¥à­¨§ æ¨ï ¨ ¯®¤¤¥à¦ª  ¤¢ãå à §­ëå ¢ à¨ ­â®¢ á ¨á¯®«ì§®¢ ­¨¥¬ á¨á 梥⮢ ¨ áâ à®© á奬®©
;19.02.2007 ®¡é¥¥ ã«ãç襭¨¥ ª®¤ , 㬥­ì襭¨¥ à §¬¥à  ¨ ¨á¯®«ì§®¢ ­¨¥ á¨á⥬­ëå 梥⮢ ¤«ï ®â®¡à ¦¥­¨ï optionkbox
;16.02.2007 ¤ â  ᮧ¤ ­¨ï ª®¬¯®­¥­â 
;<Lrz> - ’¥¯«®¢ €«¥ªá¥© www.lrz.land.ru
;§ £®«®¢®ª ¯à¨«®¦¥­¨ï
use32 ; âà ­á«ïâ®à, ¨á¯®«ì§ãî騩 32 à §à來ëå ª®¬ ­¤ë
org 0x0 ; ¡ §®¢ë©  ¤à¥á ª®¤ , ¢á¥£¤  0x0
db 'MENUET01' ; ¨¤¥­â¨ä¨ª â®à ¨á¯®«­ï¥¬®£® ä ©«  (8 ¡ ©â)
dd 0x1 ; ¢¥àá¨ï ä®à¬ â  § £®«®¢ª  ¨á¯®«­ï¥¬®£® ä ©« 
dd start ;  ¤à¥á, ­  ª®â®àë© á¨á⥬  ¯¥à¥¤ ñâ ã¯à ¢«¥­¨¥
; ¯®á«¥ § £à㧪¨ ¯à¨«®¦¥­¨ï ¢ ¯ ¬ïâì
dd i_end ; à §¬¥à ¯à¨«®¦¥­¨ï
dd (i_end+0x100) and not 3 ; Ž¡ê¥¬ ¨á¯®«ì§ã¥¬®© ¯ ¬ïâ¨, ¤«ï á⥪  ®â¢¥¤¥¬ 0å100 ¡ ©â ¨ ¢ë஢­¨¬ ­  £à­¨æã 4 ¡ ©â 
dd (i_end+0x100) and not 3 ; à á¯®«®¦¨¬ ¯®§¨æ¨î á⥪  ¢ ®¡« á⨠¯ ¬ïâ¨, áࠧ㠧  ⥫®¬ ¯à®£à ¬¬ë. ‚¥à設  á⥪  ¢ ¤¨ ¯ §®­¥ ¯ ¬ïâ¨, 㪠§ ­­®¬ ¢ëè¥
dd 0x0,0x0 ; 㪠§ â¥«ì ­  áâபã á ¯ à ¬¥âà ¬¨.
; ¥á«¨ ¯®á«¥ § ¯ã᪠ ­¥ à ¢­® ­ã«î, ¯à¨«®¦¥­¨¥ ¡ë«®
; § ¯ã饭® á ¯ à ¬¥âà ¬¨ ¨§ ª®¬ ­¤­®© áâப¨
; 㪠§ â¥«ì ­  áâபã, ¢ ª®â®àãî § ¯¨á ­ ¯ãâì,
; ®âªã¤  § ¯ã饭® ¯à¨«®¦¥­¨¥
;------------------
include '..\..\..\..\macros.inc'
include 'optionbox.inc' ;¢ª«îç¨âì ä ©« opeck.inc
version_op ;¢ à¨ ­â, ¯à¨ ª®â®à®¬ ¨á¯®«ì§ãîâáï 梥â , ª®â®àë¥ § ¤ ¥â ¯®«ì§®¢ â¥«ì
; version_op1 ;æ¢¥â  ¡¥àãâáï ¨§ á¨á⥬ë
use_option_box ;¨á¯®«ì§ãï ¬ ªà®áë,¢­¥á⨠¯à®æ¥¤ãàë ¤«ï à¨á®¢ ­¨ï optionbox
align 16
;Ž¡« áâì ª®¤ 
start: ;’®çª  ¢å®¤  ¢ ¯à®£à ¬¬ã
mov eax,48 ;¯®«ãç¨âì á¨á⥬­ë¥ 梥â 
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
mcall
mov eax,40 ;ãáâ ­®¢¨âì ¬ áªã ¤«ï ®¦¨¤ ¥¬ëå ᮡë⨩
mov ebx,0x25 ;á¨á⥬  ¡ã¤¥â ॠ£¨à®¢ âì ⮫쪮 ­  á®®¡é¥­¨¥ ® ¯¥à¥à¨á®¢ª¥,­ ¦ â  ª­®¯ª , ®¯à¥¤¥«ñ­­ ï à ­¥¥, ᮡë⨥ ®â ¬ëè¨ (çâ®-â® á«ã稫®áì - ­ ¦ â¨¥ ­  ª­®¯ªã ¬ëè¨ ¨«¨ ¯¥à¥¬¥é¥­¨¥; á¡à á뢠¥âáï ¯à¨ ¯à®ç⥭¨¨)
mcall
red_win:
call draw_window ;¯¥à¢®­ ç «ì­® ­¥®¡å®¤¨¬® ­ à¨á®¢ âì ®ª­®
still: ;®á­®¢­®© ®¡à ¡®â稪
mov eax,10 ;Ž¦¨¤ âì ᮡëâ¨ï
mcall ;®¦¨¤ âì ᮡë⨥ ¢ â¥ç¥­¨¥ 2 ¬¨««¨á¥ªã­¤
cmp al,0x1 ;¥á«¨ ¨§¬¥­¨«®áì ¯®«®¦¥­¨¥ ®ª­ 
jz red_win
cmp al,0x3 ;¥á«¨ ­ ¦ â  ª­®¯ª  â® ¯¥à¥©â¨
jz button
mouse_option_boxes option_boxes,option_boxes_end ;¯à®¢¥àª  祪 ¡®ªá 
jmp still ;¥á«¨ ­¨ç¥£® ¨§ ¯¥à¥ç¨á«¥­­®£® â® á­®¢  ¢ 横«
button:
; mov eax,17 ;¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª« ¢¨è¨
; mcall
; test ah,ah ;¥á«¨ ¢ ah 0, â® ¯¥à¥©â¨ ­  ®¡à ¡®â稪 ᮡë⨩ still
; jz still
or eax,-1 ;¢ eax,-1 - 5 ,¡ ©â®¢ ã ­ á ¦¥ ⮫쪮 3 ¢ë©â¨
mcall ;¤ «¥¥ ¢ë¯®«­ï¥âáï ¢ë室 ¨§ ¯à®£à ¬¬ë
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
draw_window: ;à¨á®¢ ­¨¥ ®ª­  ¯à¨«®¦¥­¨ï
mov eax,12 ;¢ ॣ¨áâà ¢­¥á⨠§­ ç¥­¨¥ = 12
mov ebx,1 ;¯à¨á¢®¨âì 1
mcall
xor eax,eax ;®¡­ã«¨âì eax
mov ebx,50*65536+180 ;[ª®®à¤¨­ â  ¯® ®á¨ x]*65536 + [à §¬¥à ¯® ®á¨ x]
mov ecx,30*65536+200 ;[ª®®à¤¨­ â  ¯® ®á¨ y]*65536 + [à §¬¥à ¯® ®á¨ y]
mov edx,[sc.work] ; color of work area RRGGBB,8->color gl
or edx,0xb3000000
mov edi,hed
mcall ;­ à¨á®¢ âì ®ª­® ¯à¨«®¦¥­¨ï
draw_option_boxes option_boxes,option_boxes_end ;à¨á®¢ ­¨¥ 祪¡®ªá®¢
mov eax,12 ;”ã­ªæ¨ï 12 - ­ ç âì/§ ª®­ç¨âì ¯¥à¥à¨á®¢ªã ®ª­ .
mov ebx,2 ;<3B>®¤äã­ªæ¨ï 2 - § ª®­ç¨âì ¯¥à¥à¨á®¢ªã ®ª­ .
mcall
ret
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;DATA ¤ ­­ë¥
;”®à¬ â ¤ ­­ëå 祪 ¡®ªá :
;10 - ª®®à¤¨­ â  祪 ¡®ªá  ¯® å
;30 - ª®®à¤¨­ â  祪 ¡®ªá  ¯® ã
;0
;0 - 梥â à ¬ª¨ 祪 ¡®ªá 
;0 - 梥â ⥪áâ  ­ ¤¯¨á¨
;op_text.1 - 㪠§ â¥«ì ­  ­ ç «® áâப¨
;option_group1 - íâ® ¯à¨§­ ª £à㯯ë, â.¥. íâ®â ª®¤ ¬®¦¥â ®¡à ¡ â뢠âì ¬­®£® £à㯯 ¨§ optibox
;op_text.e1-op_text.1 - ¤«¨­  áâப¨
;
align 16
option_boxes:
;op1 option_box1 option_group1,10,15,op_text.1,op_text.e1-op_text.1
;op2 option_box1 option_group1,10,30,op_text.2,op_text.e2-op_text.2
;op3 option_box1 option_group1,10,45,op_text.3,op_text.e3-op_text.3
;op11 option_box1 option_group2,10,80,op_text.1,op_text.e1-op_text.1
;op12 option_box1 option_group2,10,95,op_text.2,op_text.e2-op_text.2
;op13 option_box1 option_group2,10,110,op_text.3,op_text.e3-op_text.3
;
;struc option_box point_gr,left,top,color,border_color,text_color,text,text_length
op1 option_box option_group1,10,15,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
op2 option_box option_group1,10,30,0xFFFFFF,0,0,op_text.2,op_text.e2-op_text.2
op3 option_box option_group1,10,45,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
op11 option_box option_group2,10,80,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
op12 option_box option_group2,10,95,0xffffff,0,0,op_text.2,op_text.e2-op_text.2
op13 option_box option_group2,10,110,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
option_boxes_end:
op_text: ; ‘®¯à®¢®¦¤ î騩 ⥪áâ ¤«ï 祪 ¡®ªá®¢
.1 db 'Option_Box #1'
.e1:
.2 db 'Option_Box #2'
.e2:
.3 db 'Option_Box #3'
.e3:
option_group1 dd op1 ;㪠§ â¥«¨, ®­¨ ®â®¡à ¦ îâáï ¯® 㬮«ç ­¨î, ª®£¤  ¢ë¢®¤¨âáï
option_group2 dd op11 ;¯à¨«®¦¥­¨¥
hed db 'Optionbox [21.02.2007]',0 ;§ £®«®¢®ª ¯à¨«®¦¥­¨ï
sc system_colors
i_end: ;ª®­¥æ ª®¤