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

Problems with 2.6 forms in VFP9

Status
Not open for further replies.

phil22046

Programmer
Sep 12, 2001
154
US
Unfortunately I have too many old 2.6 forms running as spr's to rewrite them. The problem I am experiencing is that check boxes are no longer 3d. When debugging in the watch window the properties of these check boxes as seen in the _screen.activeform have specialeffect setting as 0, not as 1, like it was in VFP6. I already set _screen.themes to .F. Is there any other 'global' setting I could make?

One suggestion from another programmer here is to add a call somewhere in the SPR to an external function that would scan through the _screen.activeform objects and set all the check boxes specialeffect properties to 1 from zero. I hope to avoid this as this seems like a lot of research time and many hours of testing.
 
Taking into account that all Forms are, in reality, data tables holding information on your Objects and their properties, here is a suggestion.

NOTE: It is un-tested, but maybe worth looking into.

Make a backup of all of your Form files first.

Make the desired change to ONE form only.
Save it to your disk.

Now open that Form's SCX file as a data table.
BROWSE FOR "checkbox" $ Baseclass
Look at the Properties Memo field for that record and see how the SpecialEffect property is set.
Example: SpecialEffect = 0
Close that form's SCX table.

Now, write a small utility program to identify all SCX files within your source code directory.

Have your utility program open each SCX file as a table and
USE (MyForm.SCX) in 0
SELECT MyForm
SET FILTER TO "checkbox" $ Baseclass;
AND !("SpecialEffect = 0") $ Alltrim(Properties)
Assuming that you want SpecialEffect = 0

Now add the property to the Memo field with a
REPLACE ALL Properties WITH ALLTRIM(Properties);
+ CHR(13);
+ "SpecialEffect = 0";
FOR "checkbox" $ Baseclass;
AND !("SpecialEffect = 0") $ Alltrim(Properties)

SELECT MyForm
USE

You might try it with one form to see if it works and then, if so, go ahead on all of your forms.

Good Luck,
JRB-Bldr

 

JRB-Bldr,

An ingenious solution, but I don't think it will work in this case. Phil22046's problem is that these are SPR files, not SCXs. If I'm not mistaken, SPRs aren't normal meta tables and can't be opened like a table.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 

Mike,

SPR files are like mpr files, like a prg with a different extension, just a text file.

That's what I thought. That's why I thought that JRB-Bldr's idea of opening them as tables wouldn't work.


Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Haven't worked with spr files for a long time, but a possible approach might be using the code references tool to find all the checkbox special effect setting = 0 and replacing it with 1.

Regards,
Jim
 
Well after considering all that has been offered here, I think my approach is going to be: Write a function to alter all check boxes in the _screen.activeform, the specialeffect property to turn on the 3d. I will change the read modal stmt in each spr file, adding a WHEN to call that function which will alway return a .T. at the end.

In the function, I will have to use a FOR EACH statement to go through the collection of objects on the _screen.activeform to find all the checkbox objects and set the specialeffect property.
 
This is the code I actually coded and it tested out ok
**********************************************************
*
* Function SetCheck - scr 2957 - Philip Sperry - 05/10/2006
* Checks _screen.Activeform check boxes and sets the
* specialeffects property to zero. This Causes the check boxes
* to Become 3D
*
**********************************************************
FUNCTION SetCheck(o_Form)
* Parameter o_Form usually is _Screen.Activeform
FOR EACH o_Page IN o_Form.PageFrame1.Pages
FOR EACH o_Control IN o_Page.Controls
IF o_Control.Baseclass = 'Checkbox'
o_Control.specialeffect = 0 && Set to 3D
ENDIF
ENDFOR
ENDFOR
RETURN .T.
ENDFUNC
**********************************************************
*
* End of new function for scr 2957
*
**********************************************************
 
Hi Phil,

I work in a similar situation, I have the scx/sct files that are the source of the spr.
Mine have a 3D look, I think depend on the font and size used: mine are Arial Bold 8 points.
Open your screens in FPW 2.6, check and modify the font and then rebuild the spr and run in VFP9.

Let me know.

Gianni
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top