Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
KeyPress and the Tab Key
Message
De
04/12/2002 19:59:47
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00729134
Message ID:
00729704
Vues:
12
>>NODEFAULT .... Now there's an idea...why didn't I think of that???

Because you got UT for that :)

>>2 memos:
>>.. one with tabs,
>>.. one with spaces... that could work, if I could figure out the column (aka - how many blank spaces to insert for the current tab character)
>>If I can figure that out then that takes care of the tab stop question as well.
>>Sometimes the first tab (on each line) will move the cursor over 3 characters, 2 characters, and Sometimes 1 character, depending on it's starting position.
>>As a result I can't just do a STRTRAN( cMyText, CHR(9), SPACE(4))
>>
>>Any ideas how to approach this?
>>---------------------------------------
>Anyone know how I can detect where the cursor currently is, within an editbox? The editbox contains the data from memo field and if I know which column I'm in (ie - column 29) then I can do
>nSpacesToInsert = 3-MOD(29, 3)
>and take my
>KEYBOARD ' ' && replace it with 3 spaces
>and replace it with
>KEYBOARD SPACE(nSpacesToInsert) && replace it with 1,2 or 3 spaces
>
>What do you think???

editbox.selstart is the current cursor position that you can use in editbox.keypress code.

For conversion of tabs into the other memo, you'd have to convert them one by one, starting from left, because each replace would change the position of the next one. Something like (offhand code - check me):
do while chr(9)$cText
   nPos=at(chr(9), ctext)
   cText=stuff(cText, nPos, 1, space(3-nPos%3))
enddo
That 3 there may need to be 2 or 4... needs testing.

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

Click here to load this message in the networking platform