Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Who needs OOP Menus and Reports
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00107415
Message ID:
00107630
Views:
20
>I would like to see as much as possible moved toward OOP because of its power, etc. However, I don't feel a large, immediate need for OOP Menus and Reports. If I'm not mistaken, and correct me if I'm wrong, but Windows' menus are not OOP, are they? In relation to the Report Writer, I'd be happy if it was just "better" , i.e. more flexible.

VFP menus are not OOP, but you can make a custom class which programatically OOPifies the menu.

Here's what I'd like to see and where I'm going. In my apps, I allow the user to do stuff via the menu, the toolbars (both a top level and optionally a form toolbar) and also via a right-click popup menu. Some user options can be selected from the menu, toolbar or right-click, or any combination. If I need to add or remove a user option (or enable/disable an existing option), I have to do this programatically for the menu, and then repeat it for the toolbar and repeat it once again for the right-click popup. I have the toolbar and the right-click set up as a class with add/remove, enable/disable, etc. methods. I'm currently working on making the menu a class with the same options. Then I envision having some sort of wrapper class which uses these three classes. Then, I create a single application object based on this class which controls this whole user interface. Each form I instantiate would then set up the menu, tollbar(s) and right-click menu by calling methods of this user interface object (and each form would have its own setup). It would be the job of this object to save/restore the menus/toolbars when the user flips around to other forms. Finally, the cool part... If I need to create a new user option on a form, I simply call an AddOption method in this user interface object and specify if I want it on the menu (and where), toolbar (with a BMP) and/or the right-click popup menu. If I, for instance, need to disable it later, I just call the user interface object's DisableOption method and it will disable it whereever it is. Right now, some bugs I have are that user options are not always synchronized between the menus and toolbars, because I forget to keep them synchonized programatically.

This is just a rough vision I have in my head, and I still have to sweat out the details. It would be nice if VFP integrates all of this directly, but no big deal. The user options should all be integrated, regardless of the method (menu, toolbar, etc.). It should also be extensible to hook in other method of user interface in the future (voice?). There's my 2 cents.
Previous
Reply
Map
View

Click here to load this message in the networking platform