Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Treeview node click - click on text only
Message
De
25/07/2007 11:26:08
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Divers
Thread ID:
01243424
Message ID:
01243497
Vues:
31
>Hi Dragan,
>
>Here's a prototype code that seems to do what you want

I have to slap myself - this is something I was using years ago and completely forgotten about it. That's how I handle the treeviews in my own code. Well... looked it up and I actually have a very simplified version of this (assumes 15 twips per pixel) - and my version doesn't try to loop closer to the node. Mmmm... yes, this is much better :). Благодарю.

>
>* MoseDown
>*** ActiveX Control Event ***
>LPARAMETERS button, shift, x, y
>declare integer GetActiveWindow in WIN32API
>declare integer GetDC in WIN32API integer iHDC
>declare integer GetDeviceCaps in WIN32API integer iHDC,integer iIndex
>* Device context
>liHwnd=GetActiveWindow()
>liHDC=GetDC(liHwnd)
>* Pixels per Inch
>liPixelsPerInchX=GetDeviceCaps(liHDC,88)
>liPixelsPerInchY=GetDeviceCaps(liHDC,90)
>* Twips per pixel and store
>unLTVX=1440/liPixelsPerInchX
>unLTVY=1440/liPixelsPerInchY
>oNode=this.HitTest(x*unLTVX,Y*unLTVY)
>IF NOT ISNULL(oNode)
>	RETURN
>ENDIF
>
>FOR ix = 1 TO x
>	oNode = this.HitTest(ix*unLTVX,Y*unLTVY)
>	IF NOT ISNULL(oNode)
>  	        this.NodeClick(oNode)
>	        this.SelectedItem = oNode
>		EXIT
>	ENDIF
>ENDFOR
>
>
>
>>This is probably very old, and maybe someone remembers.
>>
>>A treeview will select the current node but will not register a nodeclick if it's clicked anywhere to the right of the node's caption. There was a thought that this may be solved by simply adding spaces, but then it would cause the horizontal scrollbar to appear (which we don't want).
>>
>>The treeview used in Windows Explorer, however, behaves differently - you click to the right and the node expands, the right pane is refreshed etc. So... is the treeview we know different, obsolete, buggy, or we just don't know how to get the desired behavior?

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform