Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What method am I in?
Message
De
18/06/2004 03:52:30
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
17/06/2004 16:05:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00914067
Message ID:
00914930
Vues:
21
This message has been marked as the solution to the initial question of the thread.
"If I can grab the value in the node then I can process bases on that."
Nodeclick has only parameter, 'node'. Here mousedown code is also getting the 'node' w/o clicking (this.SelectedItem = oHitTest, oHitTest is the node itself). If you still want you can call NodeClick(oHitTest).
PS: I always have an accompanying cursor for a TV so for me it's sufficient to get node.key to get all other properties (fields) of a node record.
Cetin


>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
Ç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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform