Forums › Forums › SIMPOL Programming › Mouse
Tagged: Mouse
- This topic has 3 replies, 2 voices, and was last updated 7 years, 3 months ago by JD Kromkowski.
- AuthorPosts
- December 30, 2016 at 4:06 pm #3425JD KromkowskiParticipant
I’ve forgotten how the onmouse works. Does anyone have a simple example.
A very long time ago, I thought I wrote and posted an example which moved a circle around a form (drag and drop kind of thing) and changed its color (depending on left or right mouse clicks) as a way of learning and showing how it works. But I cannot find my code.
January 9, 2017 at 5:53 pm #3451MichaelKeymasterHi John,
You define the onmouse handler as a function with the following parameter list:
function myonmouse(type(wxformcontrol) control, integer etype, integer keys, integer x, integer y, type(*) reference)
So you would set that function as the onmouse.function, the reference (if required) as the onmouse.reference, and then decide which events you wish to handle, by setting the onmousemask using setonmousemask(). The list is:
left button down: 0x00000001
left button up: 0x00000002
left button double click: 0x00000004
middle button down: 0x00000010
middle button up: 0x00000020
middle button dbl click: 0x00000040
right button down: 0x00000100
right button up: 0x00000200
right button dbl click: 0x00000400
motion: 0x00001000Any or all of these bit values can be combined and using the etype parameter you can determine which event has been sent to the handler.
Ciao, Neil
January 10, 2017 at 6:50 pm #3453JD KromkowskiParticipanttest
January 10, 2017 at 7:08 pm #3454JD KromkowskiParticipanttesting
- AuthorPosts
- You must be logged in to reply to this topic.