Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2703 → Rev 551

/programs/demos/cslide/trunk/cslide.asm
28,7 → 28,9
still:
call mouse_info
 
mcall 23, 2
mov eax,23
mov ebx,2
mcall
 
cmp eax,1 ; redraw request ?
je red
44,17 → 46,20
jmp still
 
key: ; key
mcall 2 ; just read it and ignore
mov eax,2 ; just read it and ignore
mcall
jmp still
 
button: ; button
mcall 17 ; get id
mov eax,17 ; get id
mcall
shr eax,8
 
cmp eax,1 ; button id=1 ?
jne noclose
mcall -1 ; close this program
mov eax,-1 ; close this program
mcall
noclose:
 
 
68,9 → 73,16
 
 
draw_window:
mcall 12, 1 ; 1, start of draw
mcall 0, <100,200>, <100,200>, 0x14ffffff, , title ; DRAW WINDOW
mcall 12,2 ; end WINDOW redraw
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+200 ; [x start] *65536 + [x size]
mov ecx,100*65536+200 ; [y start] *65536 + [y size]
mov edx,0x14ffffff ; color of work area RRGGBB,8->color gl
mov edi,title ; WINDOW LABEL
mcall
call draw_slider_info
 
84,6 → 96,11
jmp Draw_Controls_Loop
Draw_Controls_Done:
 
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
 
ret
 
 
95,10 → 112,14
mouseb dd 0
 
mouse_info:
mcall 37, 1 ;get mouse cordinates
mov eax, 37 ;get mouse cordinates
mov ebx, 1 ;
mcall ;
mov ecx, eax ;
push ecx ;
mcall 37, 2 ;get mouse buttons
mov eax, 37 ;get mouse buttons
mov ebx, 2 ;
mcall ;
cmp [mouseb], eax ;compare old mouse states to new states
jne redraw_mouse_info ;
cmp [mousey], cx ;
150,7 → 171,11
 
draw_slider_info:
;Repaint value background
mcall 13, 144*65536+36, 72*65536+9, 0x00ffffff
mov eax, 13
mov ebx, 0x00960028
mov ecx, 0x00240010
mov edx, 0x00ffffff
mcall
;Draw Color Box
xor edx, edx
movzx ecx,word [slider_1+12]
169,7 → 194,7
mov eax, 47
mov ebx, 0x00060100
mov esi, 0
mov edx, 144*65536+72
mov edx, 0x009A0029
mcall
ret
 
242,7 → 267,7
mov eax, 13 ;slider background
mov ebx, [ebp] ;x start/width
mov ecx, [ebp+4] ;y start/height
mov edx, 0x00EBEBEB ;color
mov edx, 0x002288DD ;color
mcall ;draw bar
;Draw line for slide rail
mov eax, 38 ;draw vertical slide line