Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A crasher and goofs with menus
Message
From
12/08/2006 16:12:43
 
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01145066
Message ID:
01145080
Views:
27
I knew, essentially, what was happening under the covers but the fact that it's undocumented makes it a bug, perhaps a documentation bug if nothing else.

But crashing after a few build tries? Not good at all :-)

>
>It's not a bug. The MPR file is not added because of undocumented behavior of the Project manager. When PM encounters a file with MPR extension, it looks for the menu table (MNX and MNT) with the same name and adds it to the project instead of MPR. The Add() method returns NULL when file is not added, not an error.
>
>
>
>DELETE FILE foo*.*
>
>TEXT TO cCode NOSHOW
>X=1
>ENDTEXT
>=STRTOFILE(cCode,"foo.prg",0)
>
>TEXT TO cCode2 NOSHOW
>DEFINE MENU FOO
>ENDTEXT
>=STRTOFILE(cCode2,"foomenu.mpr",0)
>
>*!*	CREATE MENU foomenu NOWAIT
>*!*	KEYBOARD "{F10}M{Enter}{CTRL+W}"
>*!*	DOEVENTS
>
>CREATE PROJECT foo NOWAIT
>_VFP.ActiveProject.Files.Add("foo.prg")
>? _VFP.ActiveProject.Files.Add("foomenu.mpr")
>
>
>
>
>>Bug #3: Trying to add an "MPR" file (generated menu code) to a project using ActiveProject.Files.Add fails with no error and the file is not added. Here's the repro code:
><snip>
>
>SET SAFETY OFF
>>DELETE FILE foo.p*
>>
>>TEXT TO cCode NOSHOW
>>X=1
>>ENDTEXT
>>=STRTOFILE(cCode,"foo.prg",0)
>>
>>TEXT TO cCode2 NOSHOW
>>DEFINE MENU FOO
>>ENDTEXT
>>=STRTOFILE(cCode2,"dumdedum.mpr",0)
>>
>>CREATE PROJECT foo NOWAIT
>>_VFP.ActiveProject.Files.Add("foo.prg")
>>_VFP.ActiveProject.Files.Add("dumdedum.mpr")
>
>>
>>Bug #4: System menu File -> Exit and File -> Close behaviors are very weird in Top-Level form EXEs.
>>
>>If you have a Top-Level form with no screen (SCREEN=OFF in CONFIG.FPW) and have a menu using the system menu items for Close and Exit, the Close menu itemis enabled but Exit is not. However, both hotkeys, Ctrl-F4 and Alt-F4 respectively, will close the form (and application by default).
>>
>>This violates Windows UI as Ctrl-F4 shouldn't close an entire application *and* Alt-F4 should be enabled if using the system menu item.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform