Topic: Why no response to mouse wheel?
Trying to interact with the mouse on graphics primitives. Program below recognizes Mouse-LB-down. But it cannot sense movement of the mouse wheel. Why?
program main
use appgraphics
implicit none
integer::screen
integer::x, y, r, i
logical::pt=.FALSE.,whL=.FALSE.
common whL, r
x=10
y=10
r=20
screen = initwindow(800, 600)
call registermousehandler(MOUSE_LB_DOWN,mcirc)
call registermousehandler(MOUSE_WHEEL,mcirc)
call settextstyle(1,0,20)
do while(x <= 800)
call clearviewport
call mcirc
IF (whL) THEN
y=y-40
ENDIF
call circle(x,y,r)
call outtextxy(x,y,char(r),pt)
i=0
do while(i < 20000000)
i=i+1
end do
x=x+5
y=y+5
r=r+1
end do
call delay(1)
call closewindow(screen)
end program main
subroutine mcirc
use appgraphics
implicit none
integer mx, my, r
logical whL
common whL, r
if (ismouseclick(MOUSE_WHEEL)) THEN
whL = .TRUE.
endif
if (ismouseclick(MOUSE_LB_DOWN)) then
mx = mousex()
my = mousey()
call circle(mx,my,2*r)
call clearmouseclick(MOUSE_LB_DOWN)
! call clearmouseclick(MOUSE_WHEEL)
endif
end subroutine mcirc