Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to automatically disable new objects
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00046491
Message ID:
00048004
Vues:
24
>>>>My problem is about how to enable a previously-disabled object.
>>>> I created a form by the form wizard. There was a default buttonset which would navigate all records,e.g. go next, add, delete. To add a new record, I had to click the "Add" button to make all objects enabled and click "Save" or "Cancel" to complete the process (objects would be disabled after that). The problem happened after I added a new object into the form. It would be always enabled independently. How to correct this?
>>
>>The code that controls everything on your form when you use the form wizard is contained in the button bar class "txtbtns" or perhaps one of the similar classes, depending on which button style you used. These classes are in VFP\WIZARDS\WIZSTYLE.VCX. The .SetAllProp method contains the code which enables and disables all the controls, depending on the parent class of each control and whether you are in edit mode. You will notice that this code does not account for comboboxes or spinners. It also does not account for pageframes, which are not true containers. If you make many changes to forms built from the form wizard, you will end up modifying a lot of the wizard code. Typical things it doesn't account for are filters set on the tables and default values for fields.
>
>Thank so much, Bret...
>It's exactly what you said about the form wizard. I'm in the situation of modifying lots of code and the results are not so pleasant. Is this the main reason people omit the wizard and have their own creation of objects and forms? I intend not to use the wizard anymore. Do you have any suggestion for me , a new Visual Foxpro user?
>Nond...

There have been a few threads here recently about frameworks. I have spent all my time in my current job modifying applications created using the form wizard. I did not feel at liberty to tear them all down and rebuild them, so I worked with what I have. I made copies of all the classes in WIZSTYLE.VCX that needed modification and put them in my own class library. Mainly it's my own versions of the txtbtns class, which controls everything on a basic data navigation and entry form, and the searchform and searchclass classes, which are used when you click the Search button of the txtbtns class (or similar classes for vertical nav buttons, or whatever). I've modified them to the point where they more or less do what I want. I can take one of these apps made with the form wizard, replace the button bar with my own version of the button bar, and make it work. This is not a great framework, but it works for the old apps I'm currently working on.

The lessons I think we're getting from users here who are more experienced than me are: 1) it's not very feasible to use a new framework on an old application. You pretty much have to start over. That's why I still use a lot of WIZSTYLE.VCX code and controls. 2) These frameworks you can buy are great, but they take a long time to learn. I don't think I'm in a position to purchase and take the time to learn codebook, visual maxframe, or any of these others which have been mentioned here, but which I've never seen. The short term investment would be too great for my current employer. 3) The tastrade app is a good example to use. It was made for the purpose and has its own class libraries. I've never seen anybody here criticize it. If I am given the chance to re-create my applications from scratch, I will probably use it, both as an example of a good framework and as a source of actual classes and code.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform