MouseMove, MouseLeft

Discuss GUI programming with the RapaGUI plugin here
bitRocky
Posts: 148
Joined: Fri Nov 14, 2014 6:01 pm

Re: MouseMove, MouseLeft

Post by bitRocky »

This is only if mouse button is down, right?
I need it without a mouse button pressed.
plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: MouseMove, MouseLeft

Post by plouf »

Nope its mousemove only
Christos
bitRocky
Posts: 148
Joined: Fri Nov 14, 2014 6:01 pm

Re: MouseMove, MouseLeft

Post by bitRocky »

Hmm, I have to test this tonight, thanks.
I thought it would only trigger if I press the mouse down over an object and release it outside of the object.
bitRocky
Posts: 148
Joined: Fri Nov 14, 2014 6:01 pm

Re: MouseMove, MouseLeft

Post by bitRocky »

Its as I thought, setting MouseCapture to True, still reports MouseMove events if you pressed the mouse button and then move the mouse outside of the pressed object.

I extended the test program, there are now 4 images, the upper have MouseCapture set to True the 2 images at the bottom not.
I also added some buttons.

If you press the left mousebutton over the upper images and the move the mouse over the buttons, I still get MouseMove events.
If you press the left mousebutton over the bottom images and the move the mouse over the buttons, you don't get MouseMove events.

What I wanted is to get MouseMove events if I leave a MouseMove object but without pressing a mouse button before!
Maybe this could be achieved if I could set the MouseMove Notify also for groups?

Setting if for Buttons of VSpace objects is possible but has no effect!
bitRocky
Posts: 148
Joined: Fri Nov 14, 2014 6:01 pm

Re: MouseMove, MouseLeft

Post by bitRocky »

I forgot to add the testprogram

Code: Select all

@REQUIRE "RapaGUI",{link=True}
CreateBrush(1,200,200,#RED)
CreateBrush(2,200,200,#TEAL)
CreateBrush(3,200,200,#OLIVE)
CreateBrush(4,200,200,#FUCHSIA)

Function p_EventFunc(msg)
	Switch(msg.attribute)
		Case "MouseMove"
			moai.Set("result","text","id "..msg.id.." X="..msg.x.." Y="..msg.y.." TrigVal = "..msg.TriggerValue)
		Case "MouseLeft"
			moai.Set("result","text","MouseLeft, id = "..msg.id.." TrigVal = "..msg.TriggerValue)
	EndSwitch
EndFunction

moai.CreateApp([[
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
	<window title="Image">
		<vgroup>
			<colgroup columns="2" >
						<image id="image" brush="1" Notify="mouseleft;mousemove" MouseCapture="True"/>
						<image id="image2" brush="2" Notify="mouseleft;mousemove" MouseCapture="True"/>
						<button Notify="MouseMove" >Button1</button>
						<button>Button2</button>
						<image id="image3" brush="3" Notify="mouseleft;mousemove" MouseCapture="False"/>
						<image id="image4" brush="4" Notify="mouseleft;mousemove" MouseCapture="False"/>
						<VSpace Notify="MouseMove" height="20"/>
						<VSpace Notify="MouseMove" height="20"/>
			</colgroup>
			<textentry id="result">text</textentry>
		</vgroup>
	</window>
</application>
]])

InstallEventHandler({RapaGUI = p_EventFunc})

Repeat
	WaitEvent
Forever
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: MouseMove, MouseLeft

Post by airsoftsoftwair »

bitRocky wrote: Sat Apr 26, 2025 5:46 pm If you press the left mousebutton over the upper images and the move the mouse over the buttons, I still get MouseMove events.
If you press the left mousebutton over the bottom images and the move the mouse over the buttons, you don't get MouseMove events.
Yes, I can reproduce that. Very strange. Does that also happen on MorphOS? (I assume you're on MorphOS because you mentioned that in the first post). I 've only tested it on Windows currently but I'd be surprised if MorphOS showed the very same behaviour because the implementation is very different on both systems (MUI vs wxWidgets).
bitRocky wrote: Sat Apr 26, 2025 5:46 pm What I wanted is to get MouseMove events if I leave a MouseMove object but without pressing a mouse button before!
Maybe this could be achieved if I could set the MouseMove Notify also for groups?
No, as described in the docs MouseMove is only supported for the classes Image/Scrollcanvas. I think it's currently impossible to do what you want. It would require a new attribute like Area.MouseLeave or something.
Post Reply