Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modal Forms and Menus 1

Status
Not open for further replies.

hayv

Programmer
Feb 27, 2001
15
CA
Need help with the following:
How can I run a modal form and only deactivate some pads on my menu, i.e keep the help menu activate. Modal forms deactivate all menu options automatically. I have seen it done in some accounting systems, modal forms appear and all but help bar are dissabled. Have any suggestions?

Thanks

Hayv
 
Hayv,
I believe the only way you can have a "live" menu when in a true modal form, would be to add your own pad to the menu from the INIT() of the form.

Rick
 
Thanks Rgbean, and your answer implies that there might be a way to emulate a modal form, is this possible?

Hayv
 
Hi!

No need to add menu pad in Init(), just enable items you need manually. There is a command in VFP that alows to manually enable or disable menu items. See help for SET SKIP OF command.

Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
Vlad,
A true modal form will disable all menu items defined at the time this form is created, and I know of no way to re-enable them.

If you are suggesting that you make the form non-modal, set a global flag to set the SKIP clause of each and every menu item you don't want to allow access to (not to mention adding code to your base form class to disallow activating any form that happens to be open when you activate your pseudo-modal form), then yes you could do it. I still think adding a new pad after the modal form is created is a lot easier. (Back in the FP DOS 2.0 when most all "screen" were modal, this was standard practice. And while some of the details have changed, the technique is basically the same.)

Rick
 
HI,

A nice way of using 'dynamic' menu's is to use the PUSH and POP MENU functions.
What I have done some time ago, is to assign popups and their bar to a type of form. In the activate event of the form these menu's where attached to my 'EDIT' pad (this was for data entry forms in which you could navigate, save etc.).
In the deactivate event (and the destroy event), the menu's where PUSH'ed or released (in case of the destroy event), i.e. when another form was active these menu's where not present on my 'EDIT' pad.

In this way you can assign form specific menu bars.

This gives a nice look and feel to an application.
I hate nothing more than disabled menu bars of which you (sometimes) have no idea why they are disabled and you do not have to consider every situation in which they should be disabled.

If you do not need to have a menu bar present, do not show it (exceptions to the rules are always there of course...;-)).

HTH,
Weedz (Wietze Veld)
veld4663@exact.nl

They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best.

After the GoldRush - Steve McConnell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top