How can i make a menu / item make disappear and reappear during runtime ?

TWELVE

Active Member
Licensed User
Hello,

sorry if that questions already had been answered, my search did not return any result.

I want to make disappear/reappear a menu and it's sub menus during runtime.

menuXX.enabled is working in a similar way, but it leaves the menu itself in place.I would like to make disappear it completely.


regards,

TWELVE
 

ceaser

Active Member
Licensed User
Hi Twelve

I have asked that question before, but it seems that it cannot be done. What I do now is to enable and disable menu items, depending whether you are using a GPS or a Total Station (Land Surveying)

Regards
Michael
 

TWELVE

Active Member
Licensed User
Thanks Andrew,

that's really great.But after reviewing the example code and the help file it still leaves me with the question: how i can i remove/hide a menu..?

Shame on me, i read a lot of technical documentations and also helpfiles all the day but i cannot figure out how that works.Especially with the options and parameters, i'm not sure what it is expecting in what format.

regards,

TWELVE
 

agraham

Expert
Licensed User
Longtime User
I see that the help could be better, particularly on events so I'll try to explain it a bit better here and will add this to the help file as well

The MainMenu and MenuItem objects are not the actual menu objects but are temporary containers that allow manipulation of the actual menu objects, in a similar manner to the Sprite object in the Sprites library. In many cases only one MainMenu and two or three MenuItems will be needed in an application.

Each Form has one main menu that contains one or more hierarchies of menu items. A MainMenu is used to manipulate main menus. The existing main menu of a Form, if any, can be obtained by GetMainMenu or a new one created with NewMainMenu. Once a MainMenu contains a main menu then menu items can be added to it with AddMenuItem and RemoveMenuItem. These are the visible "base" menu items of the main menu, each of which can contain a tree of menu items. The main menu of a Form is set by AddMainMenu which can be used at any time to alter the entire menu structure of a form.

A MenuItem contains a single menu item that itself can contain other menu items which themselves can contain other menu items so creating a tree of menu items. An existing menu item can be manipulated by setting the ControlRef property or a new menu item created by NewMenuItem. Once you have a menu item you can add or remove other MenuItems to it with AddMenuItem and RemoveMenuItem.

Menu items can be specified to raise a Click and/or a Popup event by AddClickEvent and AddPopupEvent. The event added will be raised by the MenuItem object that added to event to the menu item. When a menu item is clicked or pops up it makes itself the present menu item of the MenuItem that added the event and its properties accessed from that MenuItem.

The actual main menu and menu item objects can be saved in a cache within a MainMenu by SaveMainMenu and SaveMenuItem. The number of slots in the cache is specified in New1. Thise allows main menus and individual menu items to be saved whan they are not being used and then recalled for use by SavedMainMenu and SavedMenuItem.
 
Top