Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid MouseDown event not executing.
Message
From
29/04/1999 11:31:39
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00213493
Message ID:
00213506
Views:
35
>I am trying to detect when a user moves to a different record in a grid. I recorded the following events from the debugger which would work fine if the mousedown event of the grid executed.
>
>The grid object's name is element.
>
>wizard_master2.element.MouseMove(0, 0, 39, 219)
>wizard_master2.element.column8.MouseMove(0, 0, 39, 219)
>wizard_master2.element.MouseDown(1, 0, 39, 219)
>The above event is where I calculate if the position is a different record. If the user clicked on a different record I set lRecordChange to TRUE.
>
>wizard_master2.element.BeforeRowColChange(3)
>The above event I check to see if lRecordChange is TRUE and the current state of the grid is "ADD" I prompted the user with a "Save transaction?" If the user cancels I issue a NODEFAULT which places the cursor back in the last activate record.
>
>wizard_master2.element.column1.text1.RangeLow()
>wizard_master2.element.column1.text1.RangeHigh()
>wizard_master2.element.column1.text1.Valid()
>wizard_master2.element.column1.text1.LostFocus()
>wizard_master2.element.column8.btn.When()
>wizard_master2.element.column8.btn.GotFocus()
>wizard_master2.Paint()
>wizard_master2.element.AfterRowColChange(1)
>The above event is where I record the new current record position which is used to compare in the BeforeColChange event.
>
>wizard_master2.element.column8.btn.MouseDown(1, 0, 39, 219)
>wizard_master2.element.MouseUp(1, 0, 39, 219)
>wizard_master2.element.column8.btn.MouseUp(1, 0, 39, 219)
>
>The problem again is the debugger says the MouseDown event fired for the grid but the code in the event didn't execute.
>
>Any ideas?
>
>Thanks,
>Bill
Try using mdown() instead.
	if mdown()
		lnBottom	= .top+.headerheight+.relativerow * .rowheight
		lnTop		= lnBottom - this.rowheight
		lnMouseRowPos	= mrow(wontop(),3)
		lnMouseColPos	= mcol(wontop(),3)
		llChangingRow	= !(between(lnMouseRowPos,lnTop, lnBottom) ;
		                  and between(lnMouseColPos,.left,.left+.width))
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform