In a previous mail with the subJect of MB: buttons in context, I raised the
question of a custom menu not beeing remove if it contains one specific MI
menu item. I wrote

>>>if I create a menu including M_MAP_CHANGE_VIEW, when I try to terminate
the application with an "End Program", the menu name remains with only that
item  in its offerings. I need to "alter menu bar remove ..." to make it
disappear completely.<<<

I was fascinated then by the behavior of buttons in conjunction with that
item. I did not realized that the menu "problem" applies to ALL MI MENU
ITEMS.

The <End progam> statement contains a somewhat misleading explanation in MB
Help:
>>>If any procedure in a MapBasic application issues an End Program
statement, that entire application is halted - even if "sleeping" procedures
have been attached to custom menu items. When an application halts, MapInfo
automatically removes any menu items created by that application.<<<

It does not say anything specific about "menus" in themselves. I guess they
are removed when they are emptied by the removal of their constituing items.
But as the MI menu items are not affected by the ending of an application,
the custom menu containing such items are not fully emptied, and thus remain
in the menu (menu bar or as sub menu in an other menu).

What was just a hint becomes in this light a MUST: to remove a custom menu
containing MI menu items, one must first remove the menu from the menu bar
or sub menu, then end the program to close all references to custom
procedures.

Jacques Paris
e-mail  [EMAIL PROTECTED]
MapInfo/MapBasic support  http://www.paris-pc-gis.com

-----Original Message-----
From: Jacques Paris [mailto:[EMAIL PROTECTED]]
Sent: October 16, 2001 12:59
To: MIL
Subject: MB: buttons in context


I have found out that buttons of a custom pad may be disabled/enabled
automatically according to the context (active window type) in some
circumstances. If a button calls for M_MAP_... item, it will be
automatically disabled if the frontwindow() is not a mapper; that is not
very surprising. But one of these menu names is different: M_MAP_CHANGE_VIEW
will give its own status to all the custom buttons following it in the
buttonpad definition with some restrictions: the "influence" will stop at
the first "separator" and it will not extend over others M_MAP... buttons.
As examples some sequences and their outcomes

M_MAP_PREVIOUS M_MAP_CHANGE_VIEW button1 button2 >>> all buttons context
sensitive
M_MAP_CHANGE_VIEW M_MAP_PREVIOUS button1 button2 >>> button1 ..2 insensitive
M_MAP_PREVIOUS M_MAP_CHANGE_VIEW SEPARATOR button1 button2 >>> button1 ..2
insensitive

Do you have had other experiences of that behavior?


I have also noticed that if I create a menu including M_MAP_CHANGE_VIEW,
when I try to terminate the application with an "End Program", the menu name
remains with only that item  in its offerings. I need to "alter menu bar
remove ..." to make it disappear completely.

This is a second indication that some MI menu items may have very "special"
behavior.

More on the subject???

MI/MB version 6.0

Jacques Paris
e-mail  [EMAIL PROTECTED]
MapInfo/MapBasic support  http://www.paris-pc-gis.com



_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to