Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to distinguish between column click for drag or clic
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01368955
Message ID:
01368977
Vues:
18
This message has been marked as a message which has helped to the initial question of the thread.
>Hi all
>
>I catch the click() of the grid.column.header so that I can call a sort routine for the column. Now this grid also allows drag-drop of columns. So when the users is click-dragging the sort also gets called once the drag is completed. How can I distinguish between these two types of click so that sort is not called until there is a click on the header for sorting purposes only.
>

This test seems to work by setting a custom property in column.Moved():
LOCAL oForm as Form
oForm = CREATEOBJECT('TestForm')
oForm.Show(1)
RETURN

DEFINE CLASS TestForm as Form
	AllowOutput = .F.
	AutoCenter = .T.
	PROCEDURE Load
		CREATE CURSOR temp (test1 i, test2 i)
	ENDPROC
	ADD OBJECT TestGrid as TestGrid WITH RecordSource = 'temp'
ENDDEFINE

DEFINE CLASS TestGrid as Grid
	MemberClassLibrary = SYS(16)
	MemberClass = 'TestColumn'
ENDDEFINE
DEFINE CLASS TestColumn AS Column
	HeaderClassLibrary = SYS(16)
	HeaderClass = 'TestHeader'
	lMoved = .F.
	PROCEDURE Moved()
		This.lMoved = .T.
	ENDPROC
ENDDEFINE
DEFINE CLASS TestHeader as Header
	PROCEDURE Click
		IF This.Parent.lMoved
			RETURN
		ENDIF
		MESSAGEBOX(LOWER(PROGRAM()))
	ENDPROC
	PROCEDURE MouseDown(nButton, nShift, nXCoord, nYCoord)
		This.Parent.lMoved = .F.
	ENDPROC
ENDDEFINE
hth
-Stefan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform