This is only if mouse button is down, right?
I need it without a mouse button pressed.
MouseMove, MouseLeft
Re: MouseMove, MouseLeft
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.
I thought it would only trigger if I press the mouse down over an object and release it outside of the object.
Re: MouseMove, MouseLeft
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!
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!
Re: MouseMove, MouseLeft
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
- airsoftsoftwair
- Posts: 5830
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: MouseMove, MouseLeft
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).
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.