Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Nadeem Shah
  Where is Nadeem Shah?
 Rawalpindi
 Pakistan
 Nadeem Shah
 To: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 Tags
Subject: RE: _Screen.Property
Thread ID: 143128 Message ID: 143247 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Sunday, August 26, 2007 7:24:18 PM         
   


> Syed,
>
> As you are new to sub-classing, might I suggest that you begin by reading my FAQ here:
>
> https://www.foxite.com/faq/default.aspx?id=49
>
> You have two choices when dealing with sub-classes. First you can do things programmatically. You would create this code in a .Prg as it is shown in Marcia's post. The other way to do it is visually. Begin by going into the class tab of your project and click "New." This will pop a form asking you for the name of the class, the type of class on which to base this, and where you want to store your new class. In this case, you might want to call it "StdEnv" as Marcia has done (or you can use your own name.) Base it on "Custom" and tell VFP where to store it. For something like this, I would probably use a classlib like "SomeCommonDirectory\Classes\AppBasics.VCX." Note that Marcia has based her class on something called "CusBase." I am sure that Marcia will correct me if I am wrong, but I believe that "CusBase" stands for "Custom Base Class." She is creating a sub-class of a sub-class she has already created. While this is most definately the preferred method, it will probably cause you grief as you do not already have a "CusBase" class. Base yours on Custom.
>
> Note the first section of code after the DEFINE statement:
>
>   csysformats = ""
>   cansi = ""
>   ccentury = ""
>   cconfirm = ""
>   cdeleted = ""
>   cexact = ""
>   cexclusive = ""
>   nfdow = 0
>   cfullpath = ""
>   nmemowidth = 0
>   cnotify = ""
>   cnull = ""
>   csafety = ""
>   nreprocess = 0
>   cstatus = ""
>   cstatusbar = ""
>   nstrictdate = 0
>   ctalk = ""
>   cescape = ""
>   *-- Original setting of set('date')
>   cdate = ""
>   cseparator = ""
>   cpoint = ""
>   *-- Original Setting of Set TextMerge
>   ctextmerge = ""
>   *-- Setting of set spdialog
>   ccpdialog = ""
>   Name = "stdenv"
> 

>
> This is where Marcia has created new custom properties (except for "Name") and has applied the initial values to those properties. You can do the same thing visually by using the VFP menu: Class-> New Property. You then give the property a name (the first one would be cSysFormats) and you would leave it as Public. (Marcia has not protected or hidden any of her properties here.) When you get your properties created, you can then go into the properties window and give these properties their inital values.
>
> The second section deals with methods. You can again go to the VFP menu Class->New Method, give it a name (the first one being "Set".) Once again, Marcia has not hidden or protected any of her methods, so you can leave them as public. Next, go into the "methods" tab of your properties window and you can then open up each method in turn and add the method code. Note the procedures .Init() and .Destroy(). You will not have to create these as custom methods as they already exist. (Indeed, if you attemtp to create them, you will get an error message telling you that they already exist.) All you need do is open these procedures and add the code.
>
> You could select the first method and simply copy Marcia's code into a .prg, but that would teach you nothing. Take the time to go through the process of recreating this class visually - you will learn a lot more by doing so.
>
>
> Ken
> You shall know the truth - and the truth shall set you free. (John 8:33)

Thansk Ken. My rating for you.

Nadeem Iqbal

ENTIRE THREAD

_Screen.Property Posted by Ahsan Rana @ 8/25/2007 5:58:06 AM
RE: _Screen.Property Posted by Bernard Bout @ 8/25/2007 7:14:52 AM
RE: _Screen.Property Posted by Tariq mehmood @ 8/25/2007 12:17:41 PM
RE: _Screen.Property Posted by Cetin Basoz @ 8/25/2007 12:47:48 PM
RE: _Screen.Property Posted by Andy Kramek @ 8/25/2007 12:57:15 PM
RE: _Screen.Property Posted by Ken Murphy @ 8/25/2007 2:11:03 PM
RE: _Screen.Property Posted by Ahsan Rana @ 8/25/2007 7:49:51 PM
RE: _Screen.Property Posted by Marcia Akins @ 8/25/2007 9:15:57 PM
RE: _Screen.Property Posted by Syed Nadeem Iqbal @ 8/26/2007 4:32:33 AM
RE: _Screen.Property Posted by Ken Murphy @ 8/26/2007 2:50:34 PM
RE: _Screen.Property Posted by Benny Thomas @ 8/26/2007 3:37:53 PM
RE: _Screen.Property Posted by Ken Murphy @ 8/26/2007 3:48:51 PM
RE: _Screen.Property Posted by Syed Nadeem Iqbal @ 8/26/2007 7:24:18 PM
RE: _Screen.Property Posted by Marcia Akins @ 8/27/2007 4:19:27 PM
RE: _Screen.Property Posted by Benny Thomas @ 8/26/2007 8:34:50 AM
RE: _Screen.Property Posted by Ken Murphy @ 8/26/2007 2:26:07 PM
RE: _Screen.Property Posted by Marcia Akins @ 8/27/2007 4:22:38 PM
RE: _Screen.Property Posted by Benny Thomas @ 8/26/2007 10:01:16 AM
RE: _Screen.Property Posted by Ken Murphy @ 8/26/2007 2:53:52 PM
RE: _Screen.Property Posted by Marcia Akins @ 8/27/2007 4:24:06 PM
RE: _Screen.Property Posted by Ken Murphy @ 8/27/2007 5:15:36 PM
RE: _Screen.Property Posted by Benny Thomas @ 8/28/2007 8:33:23 AM