Mouse events...

Posted on 2003-11-03
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

Accepted Solution

gajender_99 earned 125 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 125 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 125 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.


Assisted Solution

srikanth_a earned 125 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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

773 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