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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Defining a DESKTOP WINDOW to edit a *.prg file in it 1

Status
Not open for further replies.

dkean4

Programmer
Feb 15, 2015
282
US
In the VFP IDE I can do this...

Code:
OpenFile = "f:\a_i\ff4.prg"
DEFINE WINDOW lala FROM 10,10 TO 30,50 TITLE OpenFile FLOAT GROW CLOSE MINIMIZE  FONT "Courier New",10
MODIFY COMMAND &OpenFile NOWAIT WINDOW lala


...and obtain


loco_lzriwd.png


Now I can edit this file to my heart's content, save it and execute it. The trouble is that I want to impart this ability to an application which will be compiled and running independently of the VFP IDE.

So, for that I can change the DEFINE statement with the IN DESKTOP option and all will be Honky-Dorey. Vive La France mes amis!!!

Code:
OpenFile = "f:\a_i\prgs\danny_funcs.prg"
DEFINE WINDOW lala FROM 10,10 TO 30, 50 IN DESKTOP NAME ZOB TITLE OpenFile FLOAT GROW CLOSE MINIMIZE  FONT "Courier New",12
MODIFY COMMAND &OpenFile NOWAIT WINDOW lala

loco_cpld55.png


WAIT A MINUTE! CARRAMBA!! That is not right!!! We should be getting that file in a Windows WINDOW, not a VFP WINDOW!?? What's going on?! From experience I know that I can create Windows type of WONDOW with the IN DESKTOP option.

Let's do this step by step to see what happens when we Use an ACTIVATE statement to view the window, before we try to open the file and edit it!

Code:
OpenFile = "f:\a_i\prgs\danny_funcs.prg"
DEFINE WINDOW lala FROM 10,10 TO 30, 50 IN DESKTOP NAME ZOB TITLE OpenFile FLOAT GROW CLOSE MINIMIZE  FONT "Courier New",12
ACTIVATE WINDOW lala   &&  This is going to show what is going on!

loco2_tdgeag.png


Great! Just what we wanted! Now let's edit the file inside this WINDOW which we called "lala"! Now we are getting somewhere. :

Code:
MODIFY COMMAND &OpenFile NOWAIT WINDOW lala

loco3_vydxcp.png


HEIN???! What is going on??? If we use an IN WINDOW option, which is not the same as the MODIFY COMMAND ..... WINDOW option, then we get this!

Code:
MODIFY COMMAND &OpenFile NOWAIT IN WINDOW lala

loco4_ozs9po.png


I am exasperated, by now. I tried all sorts of wacky and dumb ways to get it to open in the Windows style and not have a DOUBLE window which requires more manipulations to resize when you want to see more code in it.

If anyone knows the solution, please let me know. This is the desired result, but it is Photoshopped.

loco5_ixmqvw.png


TIA


Dennis Kean






Simplicity is the extreme degree of sophistication.
Leonardo da Vinci
 
Try using the TEDIT variable definition (look in Help). This allows you to assign an external editor of your choice for editing PRG files.
 
ggreen61

Interesting idea, but you cannot set the breakpoints for VFP in external Text Editors. This is a tool for editing VFP code withing a VFP app. It allows me to have a much better dynamic for testing.

Thanks



Simplicity is the extreme degree of sophistication.
Leonardo da Vinci
 
MODIFY COMMAND is creating it's own native VFP text editor Window. Always.

Just read the help here:

VFP help said:
IN [WINDOW] WindowName2
Specifies a parent window in which the editing window is opened. The editing window doesn't assume the characteristics of the parent window and cannot be moved outside the parent window. If the parent window is moved, the editing window moves with it.

So all you can do is define a parent window, not the editing window itself. Differently than other commands the IN WINDOW clause does not declare the window in which the text is edited itself. You will have a window in window.

Bye, Olaf.
 
Olaf,

Thanks Olaf. I thought I read everything... NOT!


Simplicity is the extreme degree of sophistication.
Leonardo da Vinci
 
The only thing you might try is make that parent window fully transparent.

Bye, Olaf.
 
Olaf,

You are a king. Astute! I feel like a retard, but I don't care. Make the outer window large enough and transparent is a great idea. No need to resize the outer window and everything under the invisible space remains accessible. Thanks for your endurance. You Rock, Olaf! Yeah... This was oppressing me for years, as far back as 2009. The funniest thing is that I use transparent windows a lot.

Hail to the king... [peace].



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

Part and Inventory Search

Sponsor

Back
Top