Solved

Mouse events...

Posted on 2003-11-03
10
1,608 Views
Last Modified: 2013-12-26
I need the events that are thrown when the mouse moves over and moves out from any visual object
0
Comment
Question by:gseverina
10 Comments
 
LVL 8

Accepted Solution

by:
gajender_99 earned 125 total points
ID: 9670481
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
 
LVL 14

Assisted Solution

by:sandeep_patel
sandeep_patel earned 125 total points
ID: 9670652
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
 
LVL 5

Assisted Solution

by:gafoor78
gafoor78 earned 125 total points
ID: 9672281
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
 
LVL 1

Assisted Solution

by:srikanth_a
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.



Srikanth
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 5

Expert Comment

by:gafoor78
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...

regrds
gafoor
0
 
LVL 1

Expert Comment

by:srikanth_a
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.


Srikanth
0
 
LVL 5

Expert Comment

by:gafoor78
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.

rgrds
gafoor
0
 
LVL 1

Expert Comment

by:bendep
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.

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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
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: …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now