Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: George Kelly
  Where is George Kelly?
 Dromore
 United Kingdom
 George Kelly
 To: tushar
  Where is tushar?
 Kolhapur, Maharastra
 India
 tushar
 Tags
Subject: RE: Taking advantage of larger screen resolutions
Thread ID: 83768 Message ID: 120385 # Views: 25 # Ratings: 0
Version: Visual FoxPro 7 Category: General VFP Topics
Date: Wednesday, January 31, 2007 3:41:42 PM         
   


> > > > > > > > > > > > > "This looks like a very good idea for new projects..."
> > > > > > > > > > > > >
> > > > > > > > > > > > > George,
> > > > > > > > > > > > >
> > > > > > > > > > > > > When you have the sizer that you want, why not retrofit your old forms. Create your new form class (inlcuding the sizer) and then open your form as a table and change the form's classlib and class name:
> > > > > > > > > > > > >
> > > > > > > > > > > > > USE [Path2\MyForm.SCX] IN 0 EXCL ALIAS MyForm
> > > > > > > > > > > > > SELECT MyForm
> > > > > > > > > > > > > LOCATE FOR BaseClass = [Form]
> > > > > > > > > > > > > REPLACE Class WITH [MySizerFormClassName], ;
> > > > > > > > > > > > >         ClassLoc WITH [FulPath2\MyBaseClassLib.VCX]
> > > > > > > > > > > > > USE IN SELECT([MyForm])
> > > > > > > > > > > > > 

> > > > > > > > > > > > >
> > > > > > > > > > > > > With VFP, just about everything is a table. Using ADIR() you could write a little program that looped through all of the forms in you Forms directory and change the class and classlib to your new new sizerform class.
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > Ken
> > > > > > > > > > > > > You shall know the truth - and the truth shall set you free. (John 8:33)
> > > > > > > > > > > >
> > > > > > > > > > > > This is real good for application wide changes Ken!
> > > > > > > > > > > > Question:
> > > > > > > > > > > > Is it OK to insert "records" e.g. Command buttons
> > > > > > > > > > > > If yes, What are the rules for assigning values for UniqueID and timestamp.
> > > > > > > > > > > >
> > > > > > > > > > > > George
> > > > > > > > > > >
> > > > > > > > > > > Unique IDs sys(2015)
> > > > > > > > > > > TimeStamp I use seconds()*1000
> > > > > > > > > > >
> > > > > > > > > > > Regards
> > > > > > > > > > > Tushar
> > > > > > > > > >
> > > > > > > > > > Thanks Tushar!
> > > > > > > > > > I'm still experimenting.
> > > > > > > > > >
> > > > > > > > > > Ive written a small program which scans through a table of forms, opening each form in the file as a table, looks for a "marker" in INIT code, and inserts a new block of code immediately before the location of that "marker" code.
> > > > > > > > > > Problem is:
> > > > > > > > > > When I view the updated table (i.e. the form opened as a table) I can see my changes - perfectly. My block of code has been inserted at the correct position.
> > > > > > > > > >
> > > > > > > > > > However, When I open the form using
> > > > > > > > > > modify form myform
> > > > > > > > > > I DONT see the NEW code!!!
> > > > > > > > > >
> > > > > > > > > > EDITED LATER: I FOUND THE REASON FOR ABOVE BEHAVIOR
> > > > > > > > > > After making changes to the form's table you must do this:
> > > > > > > > > > compile FORM myform
> > > > > > > > > >
> > > > > > > > > > May be of interest to others (and save hairloss!)
> > > > > > > > > >
> > > > > > > > > > George
> > > > > > > > >
> > > > > > > > > I forgot to tell you that yesterday. By today you had already found that out for yourself. Hope there wasn't too much hairloss :).
> > > > > > > > >
> > > > > > > > > Some other things that may not be immediately apparent
> > > > > > > > > In the record with class='form' , the field reserved3 has a list of methods / properties that you declare. Methods start with '*'. All properties seem to be listed first.
> > > > > > > > > In the record with class='dataenvironment' , the field reserved2 has the Number of Tables + Number of Relationships +1.
> > > > > > > > >
> > > > > > > > > Hope this prevents hairloss during your experiments.
> > > > > > > > >
> > > > > > > > > Also check out http://www.foxite.com/archives/0000119235.htm
> > > > > > > > >
> > > > > > > > > Regards
> > > > > > > > > Tushar
> > > > > > > >
> > > > > > > > Thanks for the link. Ive saved that code by Eric (thanks Eric).
> > > > > > > > One niggly problem remains, Tushar.
> > > > > > > >
> > > > > > > > (When things are easy, nothing is learned. When a bit of code doesnt work, you explore, and learn a LOT. Hairloss caused by brain expansion?)
> > > > > > > >
> > > > > > > > Heres the latest status
> > > > > > > > Background to my exercise:
> > > > > > > > When you add Labels to forms, they default to Name= like Label1, Label2 etc.
> > > > > > > > When you add Command buttons to a forms, they default to Name= Command1, Command2 etc.
> > > > > > > > I usually rename them to something more meaningful. However, many remain set at the default.
> > > > > > > > I'm making my apps multi-lingual. Anything with captions needs to be bi-lingual.
> > > > > > > > In referring to Labels and Command buttons, I wanted their names to relate in some way to their purpose.
> > > > > > > >
> > > > > > > > What I did:
> > > > > > > > Using Ken Murphys tip in the thread, I developed a program to scan all the forms in my folder, and added them to a table= Formlist. Then I processed each form in formlist and wrote exceptions to a table which I call Fixlist - its an exception table of labels and command buttons which have the default names.
> > > > > > > >
> > > > > > > > I then browse the Fixlist table (a few hundred records, from a hundred or so forms), and type in a value in a NEWobjname field.
> > > > > > > >
> > > > > > > > Changing the Name property in my forms:
> > > > > > > > I developed a program to update the "Name" in the Myform.scx table
> > > > > > > >
> > > > > > > > I change the value in the field Myform.objname to NEWobjname
> > > > > > > >
> > > > > > > > and
> > > > > > > >
> > > > > > > > In the myform.properties field I search for the old, find and replace:
> > > > > > > > Name= "Label1" to Name= "Newobjname".
> > > > > > > >
> > > > > > > > (More hairloss to figure out what to change, and to develop that code)
> > > > > > > >
> > > > > > > > Same for Command buttons.
> > > > > > > >
> > > > > > > > Then when the form is processed, (objnames changed in myform.sct TABLE) I do a
> > > > > > > > Compile form myform
> > > > > > > >
> > > > > > > > Then I keep my fingers crossed, and do:
> > > > > > > > modify form myform
> > > > > > > >
> > > > > > > > The niggly problem. I get a series of error messages, telling me that Name is incorrect, one message for each field changed.
> > > > > > > > Fortunately the form opens!! The Name values have changed to my new values, as expected.
> > > > > > > > I SAVE the form.
> > > > > > > > I modify form again, and it opens with NO errors.
> > > > > > > >
> > > > > > > > Looks like the "Compile form" code executed when the form is saved is doing a little bit more than when I execute the "compile form" command in my Conversion program.
> > > > > > > >
> > > > > > > > Have you experienced that before? Looks like you have done some work in this field?
> > > > > > > >
> > > > > > > > George
> > > > > > >
> > > > > > > Those are the two places where I put the value of the name. Can you upload the form giving errors. I don't actually use the compile form command. I rebuild the project with recompile. If this goes thru, I will also be using the compile form command as it will be faster.
> > > > > > >
> > > > > > > Regards
> > > > > > > Tushar
> > > > > >
> > > > > > I'm not at my development computer at present, but I'll try the project recompile and see how it workd for me.
> > > > > > Shall I upload a form as an attachment?
> > > > > >
> > > > > > George
> > > > >
> > > > > Zip it and upload it here.
> > > > >
> > > > > Regards
> > > > > Tushar
> > > >
> > > > File attached Tushar
> > > > Instructions:
> > > > Open the program: applyfixes
> > > > Theres a readme at the beginning of the code, and credits at the end.
> > > >
> > > > George
> > > > http://www.foxite.com/uploads/dbac0634-d73c-4f1d-bfd6-a78c16dca827.zip
> > >
> > > I think you need a space after the =
> > > Name = "cmdNewName"
> > >
> > > Which version are you using. VFP7 refused to open the form.
> > >
> > > Regards
> > > Tushar
> >
> > I dint incluse the program which created the table FIXLIST Tushar.
> > I'll upload that later.
> >
> > I'm using VFP9
> >
> > For a test, Ive switched to VFP7 and re-run the program.
> > As you say, it does NOT open the amended form. However it returns additional ERROR message info:
> > .name: expression is invalid. Use a valid expression for NAME property
> > Note the . before Name
> > When you open the file as a table, you'll find no . before Name
> >
> > RE: I think you need a space after the =
> > Yes, The position of the = (and spaces) is important.
> > However, the format of the replacement text is exactly the same format as the original.
> > Note how the program starts with a RAT() looking for Name, and builds the original string up one character at a time, to get the exact original format.
> > As per comments in the program, I found the the format was slightly different between Command and Label
> > In development, I did a RAT() for Name =
> > I got the program to work for one, but it failed in the other.
> > Hence I went back a few characters and did a RAT() for Name
> >
> > I'm planning to use the program in LIVE forms today. I'll let you know how it goes.
> >
> > George
>
> I think there is something wrong in your program. When I tried it, it updated it without the space after the =. Why don't you use STRT()
>
> replace properties with strt(properties,'Name = "OldName"','Name = "NewName"')
>
> Regards
> Tushar

GOTTIT!
It now works perfectly in VFP7 and 9
The program was not including that space between = and "
I'll wrap up the programs, plus the additional ones to create the file FORMLIST and FIXLIST, and upload later

P.S. Ive never used strt (= strtofile) in my programs.
Any advantages?

George

COMPLETE THREAD

Taking advantage of larger screen resolutions Posted by George Kelly @ 12/12/2005 5:19:12 PM
RE: Taking advantage of larger screen resolutions Posted by Eric den Doop @ 12/12/2005 5:34:51 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 12/13/2005 5:42:03 PM
RE: Taking advantage of larger screen resolutions Posted by Eric den Doop @ 12/13/2005 5:47:15 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 12/13/2005 6:00:58 PM
RE: Taking advantage of larger screen resolutions Posted by Dale Dedoroy @ 12/13/2005 11:03:46 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 12/14/2005 1:39:39 AM
RE: Taking advantage of larger screen resolutions Posted by Dale Dedoroy @ 12/14/2005 6:00:28 AM
RE: Taking advantage of larger screen resolutions Posted by Frank Cazabon @ 12/9/2006 6:40:31 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 12/10/2006 8:37:43 PM
RE: Taking advantage of larger screen resolutions Posted by Frank Cazabon @ 12/11/2006 2:14:38 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 12/11/2006 3:46:23 PM
RE: Taking advantage of larger screen resolutions Posted by Soykan OZCELIK @ 12/7/2006 1:01:41 AM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 12/7/2006 10:20:15 AM
RE: Taking advantage of larger screen resolutions Posted by kevin woods @ 12/7/2006 11:42:03 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/21/2007 12:11:59 AM
RE: Taking advantage of larger screen resolutions Posted by Mike Yearwood @ 1/20/2007 1:44:11 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/20/2007 11:49:10 PM
RE: Taking advantage of larger screen resolutions Posted by Steve Hanlan @ 1/22/2007 11:16:48 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/22/2007 11:32:54 PM
RE: Taking advantage of larger screen resolutions Posted by Ken Murphy @ 1/23/2007 1:40:56 AM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/23/2007 2:01:54 AM
RE: Taking advantage of larger screen resolutions Posted by Ken Murphy @ 1/23/2007 2:21:53 AM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/29/2007 11:07:58 AM
RE: Taking advantage of larger screen resolutions Posted by Ken Murphy @ 1/29/2007 1:06:17 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/29/2007 2:22:41 PM
RE: Taking advantage of larger screen resolutions Posted by Ken Murphy @ 1/29/2007 3:31:13 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/29/2007 3:50:23 PM
RE: Taking advantage of larger screen resolutions Posted by tushar @ 1/29/2007 4:12:41 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/29/2007 6:45:26 PM
RE: Taking advantage of larger screen resolutions Posted by tushar @ 1/30/2007 5:47:10 AM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/30/2007 1:34:06 PM
RE: Taking advantage of larger screen resolutions Posted by tushar @ 1/30/2007 2:15:47 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/30/2007 3:52:54 PM
RE: Taking advantage of larger screen resolutions Posted by tushar @ 1/30/2007 5:09:35 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/31/2007 1:37:29 AM
RE: Taking advantage of larger screen resolutions Posted by tushar @ 1/31/2007 7:05:55 AM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/31/2007 11:11:01 AM
RE: Taking advantage of larger screen resolutions Posted by tushar @ 1/31/2007 1:57:16 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/31/2007 3:41:42 PM
RE: Taking advantage of larger screen resolutions Posted by tushar @ 1/31/2007 3:56:37 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/31/2007 4:55:03 PM
RE: Taking advantage of larger screen resolutions Posted by Ken Murphy @ 1/31/2007 5:04:43 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 1/31/2007 8:11:57 PM
RE: Taking advantage of larger screen resolutions Posted by Ken Murphy @ 1/31/2007 8:32:47 PM
RE: Taking advantage of larger screen resolutions Posted by George Kelly @ 2/1/2007 12:23:07 AM