Property Editor Issues

Topics: Attention VFPX Admins
Developer
Jan 25, 2008 at 3:19 PM
I'm not having too much luck with the Edit Property/Method Dialog. It works fine with one of my classes, which doesn't have any MemberData, but another class that does have MemberData has problems. Here are some specific things I'm seeing, but basically, almost none of the functionality works with this class.

  • I tried to change a tImportDateTime property from Protected to Public. I made the change and pressed Apply, but when I reopen the dialog, it's still Protected.
  • I thought maybe it was a bug and the change wasn't recognized, so I changed the property name to tImportDateTime2 and made it Public with the intention I would change it right back. Now, I have two properties: tImportDateTime and tImportDateTime2.
  • I deleted tImportDateTime2, but when I reopened the class, it was still there.
  • Since I was having problems, I tried changing a Property to a Method. That worked, but when I try to change the Method back to a Property, I get the following error: "TIMPORTDATETIME3 is a method,event, or object."

Unfortunately, I don't have time to dig into the code right now, but I at least wanted to post about it here. If it helps, here is the Properties field:

_memberdata =  877<VFPData><memberdata name="import" type="method" display="Import"/><memberdata name="importfile" type="method" display="ImportFile"/><memberdata name="cfdmfile" type="property" display="cFDMFile"/><memberdata name="processcontracts" type="method" display="ProcessContracts"/><memberdata name="addname" type="method" display="AddName"/><memberdata name="cpin" type="property" display="cPIN"/><memberdata name="lookup" type="method" display="Lookup"/><memberdata name="processcontract" type="method" display="ProcessContract"/><memberdata name="addlineitem" type="method" display="AddLineItem"/><memberdata name="opendata" type="method" display="OpenData"/><memberdata name="addcomment" type="method" display="AddComment"/><memberdata name="ocontract" type="property" display="oContract"/><memberdata name="timportdatetime" type="property" display="tImportDateTime"/></VFPData>

cfdmfile =
cpin =
ocontract = .NULL.
timportdatetime = / /
timportdatetime2 = / /
cdefaultview = Contract_v
cdefaultdbc = NexusLocal.DBC
odata = .F.
Name = "fdm_import"
Coordinator
Jan 25, 2008 at 8:05 PM
Hi Joel.

I can't reproduce any of those issues. Can you email me the VCX for the class and the entire directory (source + APP) for the dialog?

Doug
Developer
Jan 25, 2008 at 11:47 PM
Joel and Doug ... I'm having exactly the same problem!!! I just ripped out this property editor the other day and restored the normal one because I didn't have time to deal with it and I needed to get my classes written. Every time I tried to delete a property .. it would reappear. When I tried to change the name of a property, the new one appeared, but the old one was still there! When I tried to change a method to a property .. it would come back as a method.
Coordinator
Jan 28, 2008 at 3:51 PM
I found the problem. The parent class for the class open in the Class Designer has many native PEMs marked as hidden, including AddProperty. The RemoveProperty function, which the replacement dialog uses to remove a property prior to re-adding it with the desired attributes, doesn't work unless a property was added using the AddProperty function or method. So, the dialog first calls AddProperty to "add" the property (which doesn't really add the property since it already exists) so the property is "registered" for use with RemoveProperty. Unfortunately, since AddProperty is hidden, it doesn't give an error but also doesn't do anything. Thus RemoveProperty fails and the property can't be changed in any way (visibility altered, property removed, property changed to method, property renamed, etc.)

Although I didn't test this, I believe the solution is to mark AddProperty as Public.

Doug
Developer
Jan 28, 2008 at 7:54 PM
Ah, I forgot about that. I did that to slim down the interface on our business objects. It doesn't help with Intellisense, but hidden PEMS don't show up in the property sheet or COM interface.

In any case, making AddProperty() public worked. Thanks for your help. As an added bonus, VFP copies down hidden PEMs to each subclass (at least the native ones anyway). So, now I get to go into each and every subclass and make AddProperty() public. Yay! How's that for inheritance!
Developer
Jan 28, 2008 at 8:33 PM
One other minor issue I forgot to mention, and this affects both the New Property and the Edit Property dialogs. They both remember their position on the screen, but if you have any windows docked on the left side of the IDE, the position is offset by that when restored. In other words, it's too far to the right.

Thanks,

Joel
Coordinator
Jan 29, 2008 at 2:23 AM
Hi Joel,

>>One other minor issue I forgot to mention, and this affects both the New Property and the Edit Property dialogs. They both remember their position on the screen, but if you have any windows docked on the left side of the IDE, the position is offset by that when restored. In other words, it's too far to the right.<<

I think this is a VFP bug with respect to docked windows. I had the same problem with a custom tool I wrote a few years back (Tab Order Builder). I had to write special code to offset the way VFP decided to "float" my undocked window. I just keep nudging over the New Property/Method dialog every once and a while.

Rick