Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining row/col pixel position of text cursor in con
Message
De
01/11/2001 12:45:01
 
 
À
01/11/2001 07:27:10
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00575285
Message ID:
00576261
Vues:
16
Cetin,

W-O-W! I'll repeat that again ... W-O-W! Absolutely fantastic!!!

THANK YOU VERY, VERY MUCH!!!

Regards,
Malcolm

PS: Might be a very cool feature to add to your FoxyClasses? :)


>>Is there a way to determine the row and column pixel position of the text cursor in an input control such as a text box, edit box, or combo box?
>>
>>We would like to be able to popup a small 'smart tag' like form in our edit boxes when we detect certain text patterns. Ideally we would like to popup this 'smart tag' like form relative to the position of the text cursor.
>>
>>Any help or insights appreciated!
>>Malcolm
>
>Malcolm,
>Sounds like this thread replicates your previous question.
>I replicate too in case someoe searches:)
>
>*Form.load && DLL, lib declarations
>declare short GetCaretPos in win32API string @ lpPoint
>declare short ClientToScreen in win32Api integer hWnd, string @ lpPoint
>declare SetCursorPos in win32API integer X, integer Y
>set library to home()+'foxtools.fll' additive
>
>*Where you need the follower - keypress, interactivechange etc
>Local lpPos, lnWHND, lnX,lnY,lnScreenX,lnScreenY
>Store 0 to lnX,lnY,lnScreenX,lnScreenY
>lpPos = space(8)
>lnHWND =  _WhToHwnd(_WOnTop())
>
>GetCaretPos(@lpPos) && Get text insertion point coordinates - in terms of form
>For ix=1 to 8   && Decode 2 long values (X and Y)
>  If ix<5
>    lnX = lnX + asc(substr(lpPos,ix))*256^(ix-1)
>  Else
>    lnY = lnY + asc(substr(lpPos,ix))*256^(ix-5)
>  Endif
>Endfor
>ClientToScreen(lnHWND, @ lpPos) && Convert client coords to screen coords
>For ix=1 to 8
>  If ix<5
>    lnScreenX = lnScreenX + asc(substr(lpPos,ix))*256^(ix-1)
>  Else
>    lnScreenY = lnScreenY + asc(substr(lpPos,ix))*256^(ix-5)
>  Endif
>Endfor
>SetCursorPos(lnScreenX,lnScreenY) && Set mouse pos to coords
>Set message to 'CurX:'+trans(lnX)+'   CurY:'+trans(lnY) && Line-Col in statbar
>
Cetin
Malcolm Greene
Brooks-Durham
mgreene@bdurham.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform