Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use drag and drop method for treecontrol
Message
De
29/12/1999 08:44:23
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
29/12/1999 00:32:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00308541
Message ID:
00309779
Vues:
32
>I have vfp5 where sample shows only adding a new node.
>I tried using the hittest method with no results.
>Is there any other example on this site or some other site to see how it works in vfp 5.


Rajesh,
Even in VFP6 it has problems as far as I could see. But if that should help you try hittest like this :
*Oledragover
LPARAMETERS data, effect, button, shift, x, y, state
oHitTest = THIS.HitTest( X * THISFORM.nXTwips, Y * THISFORM.nYTwips )
if type("oHitTest")= "O"
  THIS.DropHighLight = oHitTest
endif

* Custom method saving nXTwips, nyTwips
#DEFINE cnLOG_PIXELS_X 88
#DEFINE cnLOG_PIXELS_Y 90
#DEFINE cnTWIPS_PER_INCH 1440
* 1440 twips per inch

* 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.
THISFORM.nXTwips = ( cnTWIPS_PER_INCH / liPixelsPerInchX )
THISFORM.nYTwips = ( cnTWIPS_PER_INCH / liPixelsPerInchY )
Or you could just try with 96 in place of twips (on many machines it was the value I opbserved for nXTwips and nYTwips - not the way to go but in testing stage doesn't harm).
BTW : In OLEDragdrop or somewhere else do not forget to set DropHighLight to .null. Otherwise node would keep highlight forever.
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform