Skip to content

Mouse

Forums Forums SIMPOL Programming Mouse

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3425
    JD Kromkowski
    Participant

    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.

    #3451
    Michael
    Keymaster

    Hi 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: 0x00001000

    Any 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

    #3453
    JD Kromkowski
    Participant

    test

    #3454
    JD Kromkowski
    Participant

    testing

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.