From d394246f2da9dab8ed9c08949e26dbbf73661b58 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Tue, 23 Aug 2011 21:09:30 +0000 Subject: [PATCH] test: skinned window git-svn-id: svn://kolibrios.org@2108 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/test/trunk/test.asm | 107 +++++++++++----------------- 1 file changed, 40 insertions(+), 67 deletions(-) diff --git a/programs/system/test/trunk/test.asm b/programs/system/test/trunk/test.asm index abc82ea1a7..97e81622fc 100644 --- a/programs/system/test/trunk/test.asm +++ b/programs/system/test/trunk/test.asm @@ -4,54 +4,53 @@ use32 - org 0x0 + org 0x0 - db 'MENUET01' ; 8 byte id - dd 0x01 ; header version - dd START ; start of code - dd I_END ; size of image - dd 0x10000 ; memory for app - dd 0xfff0 ; esp - dd 0x0 , 0x0 ; I_Param , I_Icon + db 'MENUET01' ; 8 byte id + dd 0x01 ; header version + dd START ; start of code + dd I_END ; size of image + dd 0x10000 ; memory for app + dd 0xfff0 ; esp + dd 0x0 , 0x0 ; I_Param , I_Icon 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: - mov eax,10 ; wait here for event - int 0x40 + mcall 10 ; wait here for event - cmp eax,1 ; redraw request ? - jz red - cmp eax,2 ; key in buffer ? - jz key - cmp eax,3 ; button in buffer ? - jz button + cmp eax,1 ; redraw request ? + jz red + cmp eax,2 ; key in buffer ? + jz key + cmp eax,3 ; button in buffer ? + jz button jmp still - red: ; redraw + red: ; redraw call draw_window jmp still - key: ; key - mov eax,2 ; just read it and ignore + key: ; key + mov eax,2 ; just read it and ignore int 0x40 jmp still - button: ; button + button: ; button mov eax,17 int 0x40 - cmp ah,1 ; button id=1 ? + cmp ah,1 ; button id=1 ? jnz noclose - mov eax,0xffffffff ; close this program + mov eax,-1 ; close this program int 0x40 noclose: @@ -83,7 +82,7 @@ still: cmp ah,7 jnz notest7 - in al,0x60 + in al,0x60 notest7: cmp ah,8 @@ -104,50 +103,26 @@ still: draw_window: - mov eax,12 ; function 12:tell os about windowdraw - mov ebx,1 ; 1, start of draw - int 0x40 + ;mcall 48, 3, sys_colors, 40 - ; DRAW WINDOW - 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 + mcall 12, 1 - ; WINDOW LABEL - 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 + mcall 0, <200,292>, <200,230>, 0x14FFFFFF,,tlabel - ; CLOSE BUTTON - mov eax,8 ; function 8 : define and draw button - mov ebx,(300-19)*65536+12 ; [x start] *65536 + [x size] - mov ecx,5*65536+12 ; [y start] *65536 + [y size] - mov edx,1 ; button id - 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 + mov eax,8 ; function 8 : define and draw button + mov ebx,32*65536+10 ; [x start] *65536 + [x size] + mov ecx,75*65536+10 ; [y start] *65536 + [y size] + mov edx,2 ; button id + mov esi,0x6888B8 ; button color RRGGBB newb: int 0x40 add ecx,20*65536 inc edx cmp edx,9 - jb newb + jb newb 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 edx,text mov esi,40 @@ -160,21 +135,19 @@ draw_window: jnz newline - mov eax,12 ; function 12:tell os about windowdraw - mov ebx,2 ; 2, end of draw - int 0x40 + mcall 12, 2 ; function 12:tell os about windowdraw + ret - ; DATA AREA text: - db 'APPLICATION USES 0x10000 BYTES OF MEMORY' + db 'Application uses 0x10000 bytes of memory' db ' ' - db 'OPEN DEBUG BOARD FOR PARAMETERS ' + db 'Open debug board for rezult information ' db ' ' db ' CLI ' db ' ' @@ -194,7 +167,7 @@ text: tlabel: - db 'MENUET PROTECTION TEST' -labellen: + db 'Kolibri protection test',0 + I_END: