Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What method am I in?
Message
De
17/06/2004 16:05:29
 
 
À
17/06/2004 06:57:46
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00914067
Message ID:
00914781
Vues:
18
The reason I needed the nodeclick was simply because the nodeclick stores the matching record values (insured name, policy number, etc) of the imported record (the selected item in the 1st tree) into form properties. The oledragdropevent on the 2nd treeview then processes the imported record based on the values in the form properties. Afterwards, the item is removed from the treeview because it has been processed.

I can do the same as long as I can determine what the value is in the 1st treeview item that the user is dragging over to the 2nd treeview without actually running nodeclick. If I can grab the value in the node then I can process bases on that.

Thanks SO MUCH for the code, I'm testing some ideas it generated.

One more question.

Tracy

>>I have drag and drop implemented on two treeviews. Everything works fine except that when I click on a node in tree1 and drag it to tree2 I need to run code in the nodeclick event of the node clicked on in tree1 as though the user had clicked on the node and released the mouse button to select it before he started the drag and drop procedure... Is there anyway to do that?
>>
>>I cannot determine what method I am in when I click on a node but do not release the mouse button and drag the mouse over the 2nd treeview. It appears that I jump right into the 2nd tree's oledragoverevent without passing through any event in tree1?
>
>Tracy,
>You can use MouseDown event. However do you really need NodeClick ?
>ie:
>
>*** OLE Control Event *** MosueDown
>LPARAMETERS button, shift, x, y
>oHitTest = THIS.HitTest( X * THISFORM.nXTwips, Y * THISFORM.nYTwips )
>if type("oHitTest")= "O" and !isnull(oHitTest)
>	this.SelectedItem = oHitTest
>endif
>oHitTest = .null.
>
>* OleStartDrag
>*** ActiveX Control Event ***
>LPARAMETERS data, allowedeffects
>data.Setdata(this.SelectedItem.Key)
>
>* Tree2 OleDragOver
>*** OLE Control Event ***
>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
>	
>
>* Tree2 OleDragDrop
>*** ActiveX Control Event ***
>Lparameters data, effect, button, shift, x, y
>If Data.Getformat(1)	&&CF_TEXT
>  If type("this.DropHighLight") = "O" and !isnull(this.DropHighLight)
>  	lcKey = Data.GetData(1)
>  	loNode = thisform.OleTreeview.nodes(lcKey)
>    wait window "Dropped "+loNode.Text+" on "+this.DropHighLight.text
>  Endif
>Endif
>This.DropHighLight = .null.
>
>
>* Code setting form nX,nyTwips ( do not use constants like 15 or 1440/96 for this )
>*-- Code for PixelToTwips method
>LOCAL liHWnd, liHDC, liPixelsPerInchX, liPixelsPerInchY
>* Define some constants.
>
>#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 )
>
>
>Cetin
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform