Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TreeView
Message
De
27/03/2002 00:20:32
Eugene Kolmakov
Millennium Technologies
Vladivostok, Russie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Divers
Thread ID:
00637656
Message ID:
00637668
Vues:
29
Use DragOver event of Treeview to detect the node you're dragging over:

Treeview's DragOver event:
LPARAMETERS oSource, nXCoord, nYCoord, nState

THIS.DropHighlight = THIS.HitTest((nXcoord-THIS.Left) * TreeFactorX, (nYCoord-THIS.Top) * TreeFactorY)

Don't forget to apply this code before using Drag'n'Drop because TreeView uses it's own unit of measurement called Twip.

#define cnLOG_PIXELS_X 88
#define cnLOG_PIXELS_Y 90
#define cnTWIPS_PER_INCH 1440
* 1440 twips per inch

local liHWnd, liHDC, liPixelsPerInchX, liPixelsPerInchY

* Declare some Windows API functions.
declare integer GetActiveWindow in WIN32API
declare integer GetDC in WIN32API integer iHDC
declare integer GetDeviceCaps in WIN32API integer iHDC, integer iIndex

* Get a device context for VFP.
liHWnd = GetActiveWindow()
liHDC = GetDC(liHWnd)
* Get the pixels per inch.
liPixelsPerInchX = GetDeviceCaps(liHDC, cnLOG_PIXELS_X)
liPixelsPerInchY = GetDeviceCaps(liHDC, cnLOG_PIXELS_Y)
* Get the twips per pixel.
TreeFactorX = cnTWIPS_PER_INCH/liPixelsPerInchX
TreeFactorY = cnTWIPS_PER_INCH/liPixelsPerInchY
Eugene
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform