Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best to create menu with code or designer?
Message
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00700583
Message ID:
00700584
Views:
9
Hi Joe,

>What is generally the best accepted method for creating menus? To use the designer or code it? I have been using the designer but this seems to make more work in some cases. I may make a change that affects a command button on a form and a menu. So I have to change the form and then the menu, then generate the menu. If I build the menu in code on the form it seems much better since I can change everything in one place. Also I don't see a way to dynamically change the "skip" expression on a compiled menu.

I'm creating all my menus from a metadata table. One of the reasons is exactly what you mentioned: There are more and more places from where the same function may be called (Listbar, Treeview, Menu, Shortcut menu, Buttons on forms, Toolbarbuttons, etc.)

I'm using a table where all the functions and their core data (icon, name, code to execute, etc.) is stored. In other tables the functions are put together to menus, toolbars, etc. The connection between these tables is made with a "function key". Menus, toolbars etc. are then created at runtime.

Disadvantage: It's not really easy to change anything in the whole thing. This means that moving a menu bar, placing a new function between existing toolbar buttons etc. is more difficult than doing it visually. But toolbars and so on could also be assembled visually and have a mechanism that sets the buttons accordingly to their function keys.

Great advantage of the whole thing: I change the icon or the name of a function in the table, restart the application and have the change reflected in all places from where this function can be called. Also cool for easy translation (one place, one string and that's it).

The whole stuff is managed by a "function manager" at runtime that sends and receives messages and requests to disable certain functions, marks menu items automatically etc. But this is another story :)

HTH,
Armin

Armin Neudert
Regional Director (Stuttgart) of German FoxPro User Group dFPUG

MCP for Visual FoxPro

Expert/Editor of the VFP section in the German Codezone community portal
Previous
Reply
Map
View

Click here to load this message in the networking platform