Forums › Forums › SIMPOL Programming › making onmouse event work
- This topic has 1 reply, 2 voices, and was last updated 14 years, 5 months ago by Michael.
- AuthorPosts
- December 16, 2009 at 12:16 am #164Jim LockerMember
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?
December 16, 2009 at 8:16 pm #1502MichaelKeymasterJim 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
- AuthorPosts
- You must be logged in to reply to this topic.