Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manipulating the Tools>>Editor>>Syntax color settings in compiled programs 2

Status
Not open for further replies.

dkean4

Programmer
Feb 15, 2015
282
US
I have created a VFP program which allows me to code VFP as if I was in the VFP IDE. The principal feature lies in the use of the command:

Code:
MODIFY COMMAND file.prg

This command is most likely connected to the resource file foxuser.dbf, where in one of the records the color code from Tools>>Editor>>Syntax color settings is residing.

A few days ago, however, the colors which I set in Tools>>Editor>>Syntax suddenly reverted to the default settings in the Compiled version of my application. Now I get that Blue on Black silly combination which I simply cannot tolerate.

This is the color setting in my Tools>>Editor>>Syntax color settings:

Edit_colors_r1xlod.png


This is what it looks like when I run my application directly from the VFP IDE:

goodColors_pzakhh.png


This is what it looks like when I run the compiled EXE application.

BadColors_l6aiok.png


I know that most people just live with the default, but I am not that guy.

In my start.prg, however I did specify the resource from which I assume the Editor Color Settings come from:

Startapp_ztmqbf.jpg


It does not help at all. I still get the same blue and black...

Any help would be appreciated

TIA


Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci
 
Olaf,

That was a very interesting topic. I really enjoyed reading it. And this is what came up. My EXE file does not have listings in the registry where I can make changes for it in the Registry to accommodate my MODIFY COMMAND "File.prg" window. That article was useful for this fellow to parse through the Editor color settings in the Registry and generate an HTML look alike color settings environment, I suppose in VFP or elsewhere.

I need to do that adjustment in a compiled EXE application, which is no longer wired into the VFP IDE. There are no Editor color settings in the registry for my exe file.

Any ideas, Olaf?

Thanks nevertheless. That article cleared up many cobwebs!

Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci
 
Even if you edit in the compiled exe, you use the VFP editor, that takes it's color from these registry keys. I'm pretty sure it does.

Bye, Olaf.
 
Hmmm... But I looked at them all and they all are correct as how it is shown in my VFP Tools>>Options>>Editor color Settings.

But it is not being picked up with my compiled app.



Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci
 
Dennis,

I'm not sure about this, as I haven't read Burkhard's article in detail, but is there any reason why you can't simply store your own choice of colours in HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\9.0\Options - including creating the entries if they don't already exist?

The fact that the relevant Registry settings "belong to" Microsoft shouldn't deter you.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike, testing a compiled EXE on the same machine as VFP is installed and editor colors are set up, the registry keys exist and are really not rea, I was too sure about that.
Knowing the registry keys, you can change colors to anything the editor options don't offer, so it's still nice to know, but the editor started via MODIFY COMMAND doesn't make use of the registry settings.

If that doesn't work, then that's a runtime vs IDE difference.

Help about the edit options tell this:
Help said:
Run-time applications display only the default color settings because run-time applications do not check the Windows registry for settings that you change in the Options dialog box, which specifies the default settings for color syntax.

I think your only chance is to use another text editor and use the config.fpw TEDIT option to specify it. There are editors allowing syntax coloring extensions, but I don't know of any VFP specific coloring extension.

Bye, Olaf.
 
There are editors allowing syntax coloring extensions, but I don't know of any VFP specific coloring extension.

Nor do I. But many programmers' editors allow you to define your own language-specific syntax colours and highlighting. For example, Notepad++ has a feature called "user-defined language" which you could use to define VFP-specific syntax.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Actually, Notepad++ does support VFP.

I've just found a user-contributed language definition file for it (contributed by José Guillermo Ortiz Hernández). The file is listed at (scroll down to VFP). There is some information about how to use it in VFP here: (written by Yousfi Benameur).

From what Mr Benameur says, it seems that using TEDIT to point to Notepad++ as your external editor should work - although it is not clear if that applies to a compiled EXE rather than just the IDE. It would be worth a try.

(By the way, I found Yousfi's web page very hard to read because of his choice of text and background colours. Fortunately, I have a useful Firefox add-in called Zap Colours, which changes everything to black on white.)

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
There are serious downsides, though, as the context menu of the native VFP editor has many options I (and surely you, too) regularly use, as beautify or commenting/uncommenting sections of code. Beautify can be called, but you'll have a hard time integrating that into an editor. You might live with the fact, that such features are generally similarly available in editors, but VFPs way to comment with * as first char is unusual.

Bye, Olaf.

 
Thank you for your contributions, Mike and Olaf. The next thing I was thinking of doing is to set up the colors for the window. But like Olaf said, the Editor Syntax coloring is probably not available to manipulate all the Editor related features expressed in colors. So, I will have to shed a few tears and go on.

To answer your question, Mike: My choice of colors is embedded already in the registry. Everything is correctly entered in each entry as soon as an adjustment is made in the tools>>Options>>Editor Color Settings. So, that is not the problem.



Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci
 
I take your point about the settings in the Registry, Dennis. Sorry I couldn't come up with anything else.

Regarding the user of an external editor, I appreciate the shortcomings of the TEDIT approach. However, I hope that what I posted (above) about using Notepadd++ for VFP will be of interest to others. Although I don't use it myself for Foxpro programming, it's interesting that someone has gone to the trouble of creating a VFP language definition file for it. I'll give it a try sometime to see how effective it is.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Yes, Mike, I intend to look into that. It does seem quite interesting. Possibly better than just having 2 colors. So, thank you kindly for that option. It does seem like the best option. And I am somewhat familiar with the Notepad++. I will give that a try as soon as I get out of another quagmire, which I will post shortly.



Dennis Kean

Simplicity is the extreme degree of sophistication.
Leonardo da Vinci
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top