Skip to content

making onmouse event work

Forums Forums SIMPOL Programming making onmouse event work

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #164
    Jim Locker
    Member

    I am trying to get a combo box to respond to a right-click by running a handler that puts up my request20 dialog. I would expect this code to work: fc =@ f.addcontrol(wxformcombo, 307, 134, 164, 192, edittype=’dropedit’, name=’TextBox4′) fc.onlostfocus.function =@ ValUnit1 fc.onselectionchange.function =@ ValUnit1 :// patch fc.setonmousemask(0x00000100) fc.onmouse.function =@ CILoadtens but it doesn’t. There is no custom response that I can see to the onmouse event when I right-click. Instead, what I get is the same as what I get whenever I right-click on any edit controls; a default popup requester that has the usual cut/paste/select all choices – and mostly those are greyed out. What exactly do I need to do to get my event handler to run on a right-click of the mouse?

    #1502
    Michael
    Keymaster

    Jim wrote:
    > I am trying to get a combo box to respond to a right-click by running
    > a handler that puts up my request20 dialog.
    >
    > I would expect this code to work:
    >
    > fc =@ f.addcontrol(wxformcombo, 307, 134, 164, 192,
    > edittype='dropedit', name='TextBox4') fc.onlostfocus.function =@
    > ValUnit1 fc.onselectionchange.function =@ ValUnit1 :// patch
    > fc.setonmousemask(0x00000100) fc.onmouse.function =@ CILoadtens
    >
    > but it doesn't. There is no custom response that I can see to the
    > onmouse event when I right-click. Instead, what I get is the same as
    > what I get whenever I right-click on any edit controls; a default
    > popup requester that has the usual cut/paste/select all choices – and
    > mostly those are greyed out.
    >
    > What exactly do I need to do to get my event handler to run on a
    > right-click of the mouse?

    I am not certain you can. This is a known issue with wxWidgets controls
    and MS Windows. The menu that you are seeing is supplied by the OS, and
    as far as I know, you can't override it. A similar problem exists for
    edit controls.

    Ciao, Neil

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