G2 Menu Hack Tool
The Visual FoxPro Menu Designer is fundamentally the same old Menu Designer
that we have been working with for years, since the days of FoxPro 2.6. There
are a number of issues that have not been addressed that have pushed the author
over the edge to create the first attempt at replacing the Menu Designer. The
result of this endeavor is something we are calling the G2 Menu Hack form.
There are a number of issues that the tool attempts to address:
The first is the woefully small area a developer
is given to enter in the menu prompt and the results or action of the menu
The other major frustration addressed is the need
to open up a modal form for the Options.
The Menu Designer only shows ten menu bars to
start is limiting when the designer is not resizable.
The Visual FoxPro Menu Designer difficult to use
is the way you navigate from one level to another.
The menu option for the Menu Designer are scatter
across two menu pads.
One word of caution when working with this tool and other Visual FoxPro
metadata tools, make sure you make a backup of your metadata before hacking it.
If you change something in the metadata and that change is not supported by the
Menu Designer or the GenMenu.prg you can simply disable the menu and the ability
to edit it in the native tools. This is the source code to your applications;
safeguard it before hacking into it. The author takes no responsibility for your
The source code for this tool is available with the purchase of the 1002
Things You Wanted to Know About Extending Visual FoxPro as part of the
Chapter 12 downloads. It will be available from
The intent of the G2 Menu Hack is not to generate a new Menu Designer from
the ground up. The original specifications dictate that it is 100% compatible
with the native Visual FoxPro metadata. The reason for this is that Visual
FoxPro developers still want to be able to use the native Visual FoxPro tools
and as noted later in this section, the tool does not completely replace all the
functionality of the native designer. It is capable of editing regular menus,
shortcut menus, and top-level form menus.
- The ability to see and edit all the menu bar information on one page. The
fundamentals page shows menu bar information for each menu item.
- The general page exposes records one and two of the menu metadata. The
primary focus of this page is to expose the setup and cleanup code as well as
the procedure code.
- Toggling between the fundamental and general pages will restrict the
records that are in scope since they address different aspects of the menu
metadata. The current record number of the metadata displayed is shown at the
bottom of the form.
- To address the restrictive navigation of the Menu Designer, the G2 Hack
Menu provides both a treeview and navigation buttons.
- If you want to look up a specific record you can use the search
(binoculars) and search again (binoculars with plus sign) buttons on the form
- The command window option provides the developer with the ultimate hack
tool. It executes a single command (future implementations will allow full
programs to be run).
- All the changes are fully revertible because the tool implements buffering
of the metadata. The changes are not saved until you press the save button on
the toolbar, or close the form and respond yes to the question about saving
- If you are comfortable with the technique of browsing the metadata, but
like the user interface of the G2 Hack Menu, yet find a limitation of the
interface, you can still browse the metadata within the tool.
- The Visual FoxPro Menu Designer does a darn good job of keeping logically
deleted records from hanging around. We still provide a
command just in case you find memo or record bloat in the metadata.
- Finally, the G2 Hack Menu supports both Visual FoxPro 7 and menus built in
previous versions of Visual FoxPro.
There are a few features in the Visual FoxPro Menu Designer that have not
made it into this cut of the G2 Menu Hack tool.
- The first is that you cannot add/delete menu pads or bars.
- The tool does not provide a call out to the MPR generation, nor is does it
have a menu preview mode, although the treeview provides the basic visual
- It has no mechanism to add Visual FoxPro bar resources either.
- Open up the various code editboxes into the program editor to show code
colorization and more importantly, allow the power of IntelliSense to be
available to the developer.
- Make the tool resizable.