Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 484 → Rev 485

/programs/develop/examples/example2/trunk/example2.asm
18,7 → 18,7
dd 0x0 , 0x0 ; I_Param , I_Icon
 
include 'lang.inc'
include 'macros.inc'
include '..\..\..\..\macros.inc'
include 'dialogs1.inc'
 
menu_history dd 0x0
25,13 → 25,13
 
START: ; start of execution
 
red:
call draw_window_main
 
still: ; wait here for event
 
mov eax,23
mov ebx,2
int 0x40
mov eax,10
mcall
 
cmp eax,1 ; process events
je red
52,7 → 52,7
mov ebx,220*65536+6*4
mov ecx,70*65536+8
mov edx,0xffffff
int 0x40
mcall
 
mov eax,4 ; show menu selections
mov ebx,220*65536+70
59,7 → 59,7
mov ecx,0x000000
mov edx,menu_action
mov esi,4
int 0x40
mcall
 
nodisplay:
 
66,28 → 66,24
cmp word [menu_action],word 'AD' ; user requests close
jne no_menu_close
mov eax,-1
int 0x40
mcall
no_menu_close:
 
jmp still
 
red: ; redraw
call draw_window_main
jmp still
 
key:
mov eax,2 ; key in buffer
int 0x40
mcall
jmp still
 
button: ; button in buffer
mov eax,17
int 0x40
mcall
 
cmp ah,1 ; close application
jne noclose
mov eax,-1
int 0x40
or eax,-1
mcall
noclose:
 
cmp ah,2
122,7 → 118,7
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
int 0x40
mcall
 
mov eax,0 ; open window
mov ebx,100*65536+300
130,7 → 126,7
mov edx,0x02ffffff
mov esi,0x805080d0
mov edi,0x005080d0
int 0x40
mcall
 
call draw_menu ; DRAW MENU
 
139,7 → 135,7
mov ecx,0x10ddeeff
mov edx,labelt
mov esi,labellen-labelt
int 0x40
mcall
 
mov eax,8 ; close button
mov ebx,(300-17)*65536+10
146,7 → 142,7
mov ecx,5*65536+10
mov edx,1
mov esi,0x4466bb
int 0x40
mcall
 
mov eax,8 ; button : OPEN ALERT BOX
mov ebx,25*65536+150
153,7 → 149,7
mov ecx,61*65536+14
mov edx,2
mov esi,0x4466aa
int 0x40
mcall
 
mov eax,8 ; button : OPEN CHOOSE BOX
mov ebx,25*65536+150
160,7 → 156,7
mov ecx,81*65536+14
mov edx,3
mov esi,0x4466aa
int 0x40
mcall
 
mov ebx,20*65536+55 ; draw info text with function 4
mov ecx,0xffffff
168,7 → 164,7
mov esi,40
newline:
mov eax,4
int 0x40
mcall
add ebx,10
add edx,40
cmp [edx],byte 'x'
176,7 → 172,7
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
mcall
 
ret