Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team
Code: Select all
v_hide_c hide the mouse
;do a window content refresh
v_show_c #0 show the mouse
Cyprian wrote:Try this one:Code: Select all
v_hide_c hide the mouse
;do a window content refresh
v_show_c #0 show the mouse
Code: Select all
* this draws the picture in the window
* which is an oval on top of a rectangle
* before drawing anywhere you have to hide the mouse
drawwindow
v_hide_c hide the mouse
vsf_interior #2 pattern
movem.w xstart,d0-d3 AES rectangle
add.w d0,d2
subq.w #1,d2
add.w d1,d3
subq.w #1,d3 convert to VDI
vr_recfl d0,d1,d2,d3 filled rectangle
* the oval has to be drawn in the user defined pattern
vsf_interior #4
movem.w xstart,d0-d3
asr.w #1,d2 half width
asr.w #1,d3 half height
add.w d2,d0 x centre
add.w d3,d1 y centre
v_ellipse d0,d1,d2,d3
* we have finished drawing so get the mouse back
v_show_c #0 show the mouse
rts
Cyprian wrote:Mike my example was taken from Devpac 3.1 sample GEM application "gemtest.s":
But would be cool to know a better way to turn the mouse off/on.
Code: Select all
graf_mouse( M_OFF, 0L );
wind_update( BEG_UPDATE)
wind_get( WF_CURRXYWH, *windrect );
wind_get( WF_FIRSTXYWH, *redrawrect )
intersectionRect = intersection of redrawrect & windrect
while( intersectionRect ->width > 0 && intersectionRect ->height > 0 )
{
v_set_clip( intersectionRect );
draw_window_contents()
v_set_clip( reset )
wind_get( WF_NEXTXYWH, *redrawrect)
intersectionRect = intersection of redrawrect & windrect
}
wind_update(END_UPDATE);
graf_mouse( M_ON, 0L );
Code: Select all
* set the mouse to an arrow
graf_mouse #0
Code: Select all
SUB xxxx
Open window .....
close window...
END SUB
Code: Select all
SUB xxxx
graf_mouse 256,0
Open window .....
close window...
END SUB
Code: Select all
SUB xxxx
Open window .....
graf_mouse 256,0
close window...
END SUB
Code: Select all
SUB xxxx
v_hide_c
Open window .....
close window...
END SUB
Code: Select all
SUB xxxx
Open window .....
v_hide_c
close window...
END SUB
exxos wrote:As I said before the graf_mouse didnt seem to work totally. When I used v_hide_c, that turned off the mouse but only after I called it after a GEM window was opened.
In some code there is literally only open window and close it, cant exactly go wrong.
In relating to other issues, when scrolling text on the screen , the mouse pointed gets copied upwards on the screen causing a bit of a mess on the screen, so it needs to be turned off. I only want the mouse visible on the main option screen for clicking options and menus, but hidden all other times.
Dialog boxes don't seem to make the re-appear, but each time I call a window open , it turns the mouse on again. Maybe its some "feature" in hisoft basic itself, I have no idea.
exxos wrote:Code: Select all
SUB xxxx
Open window .....
close window...
END SUB
Where I then hadCode: Select all
SUB xxxx
graf_mouse 256,0
Open window .....
close window...
END SUB
Which didn't work.Code: Select all
SUB xxxx
Open window .....
graf_mouse 256,0
close window...
END SUB
Then which didnt work.Code: Select all
SUB xxxx
v_hide_c
Open window .....
close window...
END SUB
Then this worked.Code: Select all
SUB xxxx
Open window .....
v_hide_c
close window...
END SUB
In some code there is literally only open window and close it, cant exactly go wrong.
exxos wrote:Here is a video of one issue , which is why I need to turn the mouse off. All these routines worked fine in Previous versions of Gembench, so its tried and tested stuff. Though I can't work out how the mouse was actually hidden in that code.
I don't really see the problem of turning off the mouse and turning it on again after the test anyway. My problem initially was graf_mouse did not seem to work.
Mikefulton wrote:The video didn't wanna play on my system. Do you know what codec it needs?
Mikefulton wrote:I think what's happening here is that the mouse visibility is getting out of sync. That is, you're calling graf_mouse(M_ON) more times than graf_mouse(M_OFF). They need to be in sync. Normally, if you change mouse visibility in just one place, like the block of code I showed you, that's not a problem, since there's no way for the program flow to avoid one of the calls.
If you wanna post the program source code, i'll have a look at it to see if anything else pops out.
Code: Select all
LIBRARY "gemaes","gemvdi","bios","gemdos","xbios"
'$option k150
'$option g,y+,v-,u+,#,[,]
'$option fE:\GB6\graf.PRG
DEFINT a-z
'crappy pause for now
while inkey$=""
wend
graf_mouse 256,0
'crappy pause for now
while inkey$=""
wend
WINDOW OPEN 5,"A GEM Window",0,0,639,199,&hfef
'crappy pause for now
while inkey$=""
wend
WINDOW CLOSE 5
'crappy pause for now
while inkey$=""
wend
graf_mouse 257,0
'crappy pause for now
while inkey$=""
wend
Code: Select all
'WINDOW OPEN 5,"A GEM Window",0,0,639,199,&hfef
id=wind_create(4,0,20,600,180)
junk=wind_open(id,0,20,600,180)
'vr_recfl 0,0,638,199
'crappy pause for now
while inkey$=""
wend
'WINDOW CLOSE mywind_id
junk=wind_close(id)
junk=wind_delete(id)
Mikefulton wrote:You're turning the mouse off then doing something that causes AES to draw stuff. Namely, the window you're opening.
Don't do that. Those graf_mouse calls don't belong there. You don't need or want to turn off the mouse to open a window. You only need to do it when drawing the window contents, as in the sample code I posted earlier.
Users browsing this forum: No registered users and 2 guests