Mouse events...

I need the events that are thrown when the mouse moves over and moves out from any visual object
gseverinaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gajender_99Commented:
hi
every time you move a mouse it throws these it trigger mosuemove event and passes these values
(unsignedlong flags, integer xpos, integer ypos)


thanks
Gajender

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sandeep_patelCommented:
hi,
as gajendra told there is only mousemove event. In pb this event is defined only for window only. But if you want same event for other objects like command button, datawindow then...

1) go to the script editor for that object and select (new event) from event list.
2) give ue_mousemove to the new event.
3) assign pbm_mousemove event id for that event. It will automatically assign parameters and return type.
4) Now you can write your logic of mousemove for this object.

You can use parameters xpos and ypos with the combination of this.x, this.y, this.width and this.height as per your requirement and can achieve the functionality of mouse enter and mouse out.

-sandeep
0
gafoor78Commented:
Hi

yes..u can create user event with event id pbm_mousemove for mouse move in the control.

but it will trigger all the time u move mouse over any part of the control. that means it will trigger many times. i think u may require to execute the code only once when even if mouse moves over the control many times without moving out.

also u cannot trap mouse out with  this.x, this.y, this.width and this.height with mousemove event ( bcos once the mouse is out of the control, mousemove event over that control will not occure)..

 u can try this to stimulate mouse over and mouse out

1. create mousemove event for ur control by creating user event with pbm_mousemove event id, say ur controls is p_1 and ur window is w_1

2. create an instance  boolean variable, say  ib_mousemove = false

4. script in the mousemove event of ur control

  if not ib_mousemove then // restricts code to execute only once
   
      ib_mousemove = true
     
     // put ur mouse over code here
     

 end if

5. and in the mousemove event of ur window put this code

 if  ib_mousemove then // mouse out of the control after coming over

    ib_mousemove = false

   //put ur mouse out code here

end if

6. if ur control is over any other control like command button inside a datawindow control, then u hav to do the coding 4 mouse out in the datawindow also.

7. and if ur control is over other two controls, then do in two other controls also...such case u can use an interger instance variable with some number values.


i think u will understand what i said...if u hav any clarification then let me know

rgrds
gafoor
 
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

srikanth_aCommented:


The best way is to put a messagebox on the  messagerouter event and see what are the windows events that are fired when the mouse movement takes place.



Srikanth
0
gafoor78Commented:
Hi srikanth

I tried to findout event id of a static text's mouse out event for my application thru the controls's other event...but i failed to findout.....

so can u check and findout the same for me...

regrds
gafoor
0
srikanth_aCommented:
Apart from  named mouse events, rest of the events which are not mapped in PB will occurin the other events.

Put a messagebox in the events and you should be able to get the ID's of it.
This is the simple version.


To be more specific  - Use of PFc should help.


Srikanth
0
gafoor78Commented:
Hi srikath

i know it is that the events that are not mapped by PB will go thru other event...

what i meant is it is difficult to find out the correct id.. there are several events happening...and several id's are showing
i cudn't diffrentiate the correct one.

so what i asked was, if u can findout it easily, just check and let me know the correct event id value.

rgrds
gafoor
0
bendepCommented:
you can code the mousemove event in all the controls you need (eg: pbm_dwnmousemove for datawindows, pbm_mousemove for others), but in order to know what control is the current control that has the focus you could remeber the last mousemoved control on the window.

Ben

///////////////////////////////////////////////////////
// on the window define an instance variable
Control ipo_mouseOverControl

///////////////////////////////////////////////////////
// Code an event ue_mouseOver(control ai_ctrl)
ipo_mouseOverControl = ai_ctrl
// ...

////////////////////////////////////////////////////////
// On each control code in the mousemove event
Window lw_parent
// Get parent window
of_getParentWindow(lw_parent)
// Notify window which control has mouse over it
iw_parent.dynamic event ue_mouseOver(This)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.