forked from KolibriOS/kolibrios
cslide: code update
git-svn-id: svn://kolibrios.org@2703 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
36672a1952
commit
65a65712e4
@ -28,9 +28,7 @@ START: ; start of execution
|
|||||||
still:
|
still:
|
||||||
call mouse_info
|
call mouse_info
|
||||||
|
|
||||||
mov eax,23
|
mcall 23, 2
|
||||||
mov ebx,2
|
|
||||||
mcall
|
|
||||||
|
|
||||||
cmp eax,1 ; redraw request ?
|
cmp eax,1 ; redraw request ?
|
||||||
je red
|
je red
|
||||||
@ -46,20 +44,17 @@ still:
|
|||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
key: ; key
|
key: ; key
|
||||||
mov eax,2 ; just read it and ignore
|
mcall 2 ; just read it and ignore
|
||||||
mcall
|
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
button: ; button
|
button: ; button
|
||||||
mov eax,17 ; get id
|
mcall 17 ; get id
|
||||||
mcall
|
|
||||||
|
|
||||||
shr eax,8
|
shr eax,8
|
||||||
|
|
||||||
cmp eax,1 ; button id=1 ?
|
cmp eax,1 ; button id=1 ?
|
||||||
jne noclose
|
jne noclose
|
||||||
mov eax,-1 ; close this program
|
mcall -1 ; close this program
|
||||||
mcall
|
|
||||||
noclose:
|
noclose:
|
||||||
|
|
||||||
|
|
||||||
@ -73,17 +68,10 @@ still:
|
|||||||
|
|
||||||
|
|
||||||
draw_window:
|
draw_window:
|
||||||
mov eax,12 ; function 12:tell os about windowdraw
|
mcall 12, 1 ; 1, start of draw
|
||||||
mov ebx,1 ; 1, start of draw
|
mcall 0, <100,200>, <100,200>, 0x14ffffff, , title ; DRAW WINDOW
|
||||||
mcall
|
mcall 12,2 ; end WINDOW redraw
|
||||||
; 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
|
call draw_slider_info
|
||||||
|
|
||||||
xor ecx,ecx
|
xor ecx,ecx
|
||||||
@ -96,11 +84,6 @@ Draw_Controls_Loop:
|
|||||||
jmp Draw_Controls_Loop
|
jmp Draw_Controls_Loop
|
||||||
Draw_Controls_Done:
|
Draw_Controls_Done:
|
||||||
|
|
||||||
|
|
||||||
mov eax,12 ; function 12:tell os about windowdraw
|
|
||||||
mov ebx,2 ; 2, end of draw
|
|
||||||
mcall
|
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
@ -112,14 +95,10 @@ mousex dw 0
|
|||||||
mouseb dd 0
|
mouseb dd 0
|
||||||
|
|
||||||
mouse_info:
|
mouse_info:
|
||||||
mov eax, 37 ;get mouse cordinates
|
mcall 37, 1 ;get mouse cordinates
|
||||||
mov ebx, 1 ;
|
|
||||||
mcall ;
|
|
||||||
mov ecx, eax ;
|
mov ecx, eax ;
|
||||||
push ecx ;
|
push ecx ;
|
||||||
mov eax, 37 ;get mouse buttons
|
mcall 37, 2 ;get mouse buttons
|
||||||
mov ebx, 2 ;
|
|
||||||
mcall ;
|
|
||||||
cmp [mouseb], eax ;compare old mouse states to new states
|
cmp [mouseb], eax ;compare old mouse states to new states
|
||||||
jne redraw_mouse_info ;
|
jne redraw_mouse_info ;
|
||||||
cmp [mousey], cx ;
|
cmp [mousey], cx ;
|
||||||
@ -171,11 +150,7 @@ ret
|
|||||||
|
|
||||||
draw_slider_info:
|
draw_slider_info:
|
||||||
;Repaint value background
|
;Repaint value background
|
||||||
mov eax, 13
|
mcall 13, 144*65536+36, 72*65536+9, 0x00ffffff
|
||||||
mov ebx, 0x00960028
|
|
||||||
mov ecx, 0x00240010
|
|
||||||
mov edx, 0x00ffffff
|
|
||||||
mcall
|
|
||||||
;Draw Color Box
|
;Draw Color Box
|
||||||
xor edx, edx
|
xor edx, edx
|
||||||
movzx ecx,word [slider_1+12]
|
movzx ecx,word [slider_1+12]
|
||||||
@ -188,13 +163,13 @@ draw_slider_info:
|
|||||||
mov ebx, 0x00860035
|
mov ebx, 0x00860035
|
||||||
mov ecx, 0x00590040
|
mov ecx, 0x00590040
|
||||||
mov eax, 13
|
mov eax, 13
|
||||||
mcall
|
mcall
|
||||||
;draw current value of slider
|
;draw current value of slider
|
||||||
mov ecx, edx
|
mov ecx, edx
|
||||||
mov eax, 47
|
mov eax, 47
|
||||||
mov ebx, 0x00060100
|
mov ebx, 0x00060100
|
||||||
mov esi, 0
|
mov esi, 0
|
||||||
mov edx, 0x009A0029
|
mov edx, 144*65536+72
|
||||||
mcall
|
mcall
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -267,7 +242,7 @@ draw_slider:
|
|||||||
mov eax, 13 ;slider background
|
mov eax, 13 ;slider background
|
||||||
mov ebx, [ebp] ;x start/width
|
mov ebx, [ebp] ;x start/width
|
||||||
mov ecx, [ebp+4] ;y start/height
|
mov ecx, [ebp+4] ;y start/height
|
||||||
mov edx, 0x002288DD ;color
|
mov edx, 0x00EBEBEB ;color
|
||||||
mcall ;draw bar
|
mcall ;draw bar
|
||||||
;Draw line for slide rail
|
;Draw line for slide rail
|
||||||
mov eax, 38 ;draw vertical slide line
|
mov eax, 38 ;draw vertical slide line
|
||||||
|
Loading…
Reference in New Issue
Block a user