Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Turn Word Wrap On/Off programmatically?
Message
From
28/01/2003 13:27:00
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00745936
Message ID:
00746335
Views:
21
Hi Sergey,
This is really nifty.
Now, can you think of a way to get it to execute automatically AFTER the edit window has opened? The ProjectHook.QueryModifyFile() executes BEFORE the edit window is opened.
The only thing I've been able to think of is to put "do macro Word_Wrap_Off" in the QueryModifyFile() method, which puts it into the keyboard buffer and waits until the window is opened before executing, but I don't like macros for this kind of thing.
I'd really like to have an "EditWindow.Activate()" method.

BTW: laEnv[16] - WOrd Wrap, 1-Yes, 0-No
should be: laEnv[16] - WOrd Wrap, 1=Yes, -1=No



>You can use FoxTolls _Ed* functions to do that. Here's a basic code that demonstrates how it can be done. It assumes, that FoxTolls.fll is already loaded.
LOCAL lnHandle, lnResult, laEnv[25]
>* Get the whandle for the current window
>lnHandle = _WonTop()
>* Get the environment settings for a text or program file opened for editing.
>lnResult = _EdGetEnv( lnHandle, @laEnv )
>IF ( lnResult = 0 )	;	&& Call to _EdGetEnv was unsuccesfuull
>		OR EMPTY(laEnv[1]) 	&& Empty file name
>	RETURN
>ENDIF
>* laEnv[16] - WOrd Wrap, 1-Yes, 0-No
>laEnv[16] = IIF( laEnv[16]=1, 0, 1)
>lnResult = _EdSetEnv( lnHandle, @laEnv )
>RETURN
>
>>I'm Using VFP7.0
>>
>>Is there any way to programically turn Word Wrap On/Off in the Editor? Other than with a macro?
>>
>>TIA
Bill Morris
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform