Dialog Object Event (auto)Results

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Dialog Object Event (auto)Results

Post by JRL » Thu Feb 28, 2013 8:25 pm

Macro Scheduler dialog objects have multiple events associated with them. Those events are used in AddDialogHandler>. I've noticed via the Watch List that when using some events, new variables are being created. For example the "OnMouseUp" event for the TEdit object in the following sample script, will create four new variables.

ATEST_BUTTON=0
ATEST_SHIFT=0
ATEST_X=76
ATEST_Y=7

With a little experimenting its easy to determine that the values of ATEST_X and ATEST_Y are the position of the mouse within the borders of the TEdit object when the OnMouseUp event occurs. But what is ATEST_BUTTON and ATEST_SHIFT? I've spent quite a bit of time scouring the internet to try to find information on this and I've found nothing. Part of my problem is not knowing what terms to search for and part of my problem is having a short attention span and allowing myself to read interesting articles I stumble upon.

Has anyone found a Delphi site that explains these object event results? Is there any way to determine what object event results are available to us without setting up hundreds of individual situations to see what gems might emerge?

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
  object Edit1: TEdit
  end
end
EndDialog>Dialog1

AddDialogHandler>Dialog1,Edit1,OnMouseUp,ATest

Show>Dialog1,res1

SRT>ATest
**BREAKPOINT**
END>ATest

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Thu Feb 28, 2013 9:29 pm

http://delphi.about.com/od/vclusing/a/mouseevents.htm

"There are three fundamental mouse event handlers: OnMouseDown, OnMouseMove, and OnMouseUp. The MouseUp and MouseDown event handlers take the same five parameters as follows (the MouseMove lacks a Button parameter):
•Sender - The object that detected the mouse action.
•Button - Indicates which mouse button was involved: mbLeft, mbMiddle, or mbRight.
•Shift - Indicates the state of the Alt, Ctrl, and Shift keys and the state of the mouse buttons when the event occurred.
•X, Y - The pixel coordinates of the mouse pointer in the client area of the Sender."

(I'm generally not an about.com fan but in this case I hope this is helpful.)

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Feb 28, 2013 10:24 pm

Thanks Me_again. You found that embarrassingly fast. :oops: Interesting reading.

Thinking about this a little more... When I posted, I was thinking: There are 15 objects with an average of 20 events each giving about 300 total events. But the event lists are similar for each object. There are actually only about 30 distinct object events.

So... now I think I'll just go through and detect the event results then post them so Me_again can look up what they mean. :wink:

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts