[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Mouse events...

Posted on 2003-11-03
Medium Priority
Last Modified: 2013-12-26
I need the events that are thrown when the mouse moves over and moves out from any visual object
Question by:gseverina
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

gajender_99 earned 500 total points
ID: 9670481
every time you move a mouse it throws these it trigger mosuemove event and passes these values
(unsignedlong flags, integer xpos, integer ypos)


LVL 14

Assisted Solution

sandeep_patel earned 500 total points
ID: 9670652
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.


Assisted Solution

gafoor78 earned 500 total points
ID: 9672281

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Assisted Solution

srikanth_a earned 500 total points
ID: 9682632

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.


Expert Comment

ID: 9687876
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...


Expert Comment

ID: 9688606
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.


Expert Comment

ID: 9690181
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.


Expert Comment

ID: 12817063
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.


// 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
// Notify window which control has mouse over it
iw_parent.dynamic event ue_mouseOver(This)

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question