forked from KolibriOS/kolibrios
test: skinned window
git-svn-id: svn://kolibrios.org@2108 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
0c6766a030
commit
d394246f2d
@ -4,54 +4,53 @@
|
|||||||
|
|
||||||
use32
|
use32
|
||||||
|
|
||||||
org 0x0
|
org 0x0
|
||||||
|
|
||||||
db 'MENUET01' ; 8 byte id
|
db 'MENUET01' ; 8 byte id
|
||||||
dd 0x01 ; header version
|
dd 0x01 ; header version
|
||||||
dd START ; start of code
|
dd START ; start of code
|
||||||
dd I_END ; size of image
|
dd I_END ; size of image
|
||||||
dd 0x10000 ; memory for app
|
dd 0x10000 ; memory for app
|
||||||
dd 0xfff0 ; esp
|
dd 0xfff0 ; esp
|
||||||
dd 0x0 , 0x0 ; I_Param , I_Icon
|
dd 0x0 , 0x0 ; I_Param , I_Icon
|
||||||
|
|
||||||
include '../../../macros.inc'
|
include '../../../macros.inc'
|
||||||
|
|
||||||
START: ; start of execution
|
START: ; start of execution
|
||||||
|
|
||||||
call draw_window ; at first, draw the window
|
call draw_window ; at first, draw the window
|
||||||
|
|
||||||
still:
|
still:
|
||||||
|
|
||||||
mov eax,10 ; wait here for event
|
mcall 10 ; wait here for event
|
||||||
int 0x40
|
|
||||||
|
|
||||||
cmp eax,1 ; redraw request ?
|
cmp eax,1 ; redraw request ?
|
||||||
jz red
|
jz red
|
||||||
cmp eax,2 ; key in buffer ?
|
cmp eax,2 ; key in buffer ?
|
||||||
jz key
|
jz key
|
||||||
cmp eax,3 ; button in buffer ?
|
cmp eax,3 ; button in buffer ?
|
||||||
jz button
|
jz button
|
||||||
|
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
red: ; redraw
|
red: ; redraw
|
||||||
call draw_window
|
call draw_window
|
||||||
|
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
key: ; key
|
key: ; key
|
||||||
mov eax,2 ; just read it and ignore
|
mov eax,2 ; just read it and ignore
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
button: ; button
|
button: ; button
|
||||||
mov eax,17
|
mov eax,17
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
cmp ah,1 ; button id=1 ?
|
cmp ah,1 ; button id=1 ?
|
||||||
jnz noclose
|
jnz noclose
|
||||||
mov eax,0xffffffff ; close this program
|
mov eax,-1 ; close this program
|
||||||
int 0x40
|
int 0x40
|
||||||
noclose:
|
noclose:
|
||||||
|
|
||||||
@ -83,7 +82,7 @@ still:
|
|||||||
|
|
||||||
cmp ah,7
|
cmp ah,7
|
||||||
jnz notest7
|
jnz notest7
|
||||||
in al,0x60
|
in al,0x60
|
||||||
notest7:
|
notest7:
|
||||||
|
|
||||||
cmp ah,8
|
cmp ah,8
|
||||||
@ -104,50 +103,26 @@ still:
|
|||||||
|
|
||||||
draw_window:
|
draw_window:
|
||||||
|
|
||||||
mov eax,12 ; function 12:tell os about windowdraw
|
;mcall 48, 3, sys_colors, 40
|
||||||
mov ebx,1 ; 1, start of draw
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
; DRAW WINDOW
|
mcall 12, 1
|
||||||
mov eax,0 ; function 0 : define and draw window
|
|
||||||
mov ebx,100*65536+300 ; [x start] *65536 + [x size]
|
|
||||||
mov ecx,100*65536+240 ; [y start] *65536 + [y size]
|
|
||||||
mov edx,0x02ffffff ; color of work area RRGGBB
|
|
||||||
mov esi,0x80597799 ; color of grab bar RRGGBB,8->color glide
|
|
||||||
mov edi,0x00597799 ; color of frames RRGGBB
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
; WINDOW LABEL
|
mcall 0, <200,292>, <200,230>, 0x14FFFFFF,,tlabel
|
||||||
mov eax,4 ; function 4 : write text to window
|
|
||||||
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
|
|
||||||
mov ecx,0x00ffffff ; color of text RRGGBB
|
|
||||||
mov edx,tlabel ; pointer to text beginning
|
|
||||||
mov esi,labellen-tlabel ; text length
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
; CLOSE BUTTON
|
mov eax,8 ; function 8 : define and draw button
|
||||||
mov eax,8 ; function 8 : define and draw button
|
mov ebx,32*65536+10 ; [x start] *65536 + [x size]
|
||||||
mov ebx,(300-19)*65536+12 ; [x start] *65536 + [x size]
|
mov ecx,75*65536+10 ; [y start] *65536 + [y size]
|
||||||
mov ecx,5*65536+12 ; [y start] *65536 + [y size]
|
mov edx,2 ; button id
|
||||||
mov edx,1 ; button id
|
mov esi,0x6888B8 ; button color RRGGBB
|
||||||
mov esi,0x5977bb ; button color RRGGBB
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
|
|
||||||
mov eax,8 ; function 8 : define and draw button
|
|
||||||
mov ebx,25*65536+9 ; [x start] *65536 + [x size]
|
|
||||||
mov ecx,74*65536+9 ; [y start] *65536 + [y size]
|
|
||||||
mov edx,2 ; button id
|
|
||||||
mov esi,0x5977bb ; button color RRGGBB
|
|
||||||
newb:
|
newb:
|
||||||
int 0x40
|
int 0x40
|
||||||
add ecx,20*65536
|
add ecx,20*65536
|
||||||
inc edx
|
inc edx
|
||||||
cmp edx,9
|
cmp edx,9
|
||||||
jb newb
|
jb newb
|
||||||
|
|
||||||
cld
|
cld
|
||||||
mov ebx,25*65536+36 ; draw info text with function 4
|
mov ebx,26*65536+37 ; draw info text with function 4
|
||||||
mov ecx,0x000000
|
mov ecx,0x000000
|
||||||
mov edx,text
|
mov edx,text
|
||||||
mov esi,40
|
mov esi,40
|
||||||
@ -160,21 +135,19 @@ draw_window:
|
|||||||
jnz newline
|
jnz newline
|
||||||
|
|
||||||
|
|
||||||
mov eax,12 ; function 12:tell os about windowdraw
|
mcall 12, 2 ; function 12:tell os about windowdraw
|
||||||
mov ebx,2 ; 2, end of draw
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
; DATA AREA
|
; DATA AREA
|
||||||
|
|
||||||
|
|
||||||
text:
|
text:
|
||||||
|
|
||||||
db 'APPLICATION USES 0x10000 BYTES OF MEMORY'
|
db 'Application uses 0x10000 bytes of memory'
|
||||||
db ' '
|
db ' '
|
||||||
db 'OPEN DEBUG BOARD FOR PARAMETERS '
|
db 'Open debug board for rezult information '
|
||||||
db ' '
|
db ' '
|
||||||
db ' CLI '
|
db ' CLI '
|
||||||
db ' '
|
db ' '
|
||||||
@ -194,7 +167,7 @@ text:
|
|||||||
|
|
||||||
|
|
||||||
tlabel:
|
tlabel:
|
||||||
db 'MENUET PROTECTION TEST'
|
db 'Kolibri protection test',0
|
||||||
labellen:
|
|
||||||
|
|
||||||
I_END:
|
I_END:
|
||||||
|
Loading…
Reference in New Issue
Block a user