on 12-19-2005 3:08 PM
Hi all,
The Menu Event it does not come intercepted
This is the Menu that I've insert
menuItem = this.appl.Menus.Item("43520");
mnuPkg.Type = SAPbouiCOM.BoMenuType.mt_POPUP;
mnuPkg.String = "Add-in";
mnuPkg.UniqueID = "D3F_AINSCO";
mnuPkg.Enabled = true;
mnuPkg.Position = menus.Count;
menus = menuItem.SubMenus;
menus.AddEx(mnuPkg);
menuItem = menus.Item("D3F_AINSCO");
mnuPkg.Type= SAPbouiCOM.BoMenuType.mt_STRING;
mnuPkg.String = "Manage";
mnuPkg.Enabled = true;
mnuPkg.Position = menus.Count;
mnuPkg.UniqueID = "D3F_MNT";
menus = menuItem.SubMenus;
menus.AddEx ( mnuPkg );
This is an Event Filter
evnt = evnts.Add(SAPbouiCOM.BoEventTypes.et_MENU_CLICK);
evnt.AddEx("D3F_MNT");
This is the Handle Event code
private void appl_MenuEvent(ref SAPbouiCOM.MenuEvent pVal, out bool BubbleEvent)
{
BubbleEvent = true;
if ( pVal.BeforeAction == true)
{
switch(pVal.MenuUID)
{
case "D3F_MNT":
this.LoadFormFromXml( stPath + "\Gst.srf");
break;
}
}
}
When I press on menu the form doesn't loaded.. and In the MenuEvent never it enter
where is my error??
Bye!!!
The error continue to appear... if i set an event filters ... only the ItemEvent/AppEvent Works... the MenuEvent nothing to do...
Message was edited by: H.Fay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In which order do you catch the events?
Know it sound silly, but I've actually seen it have inpact on what is called and what is not
try to compare your code to the following:
SboApplication.MenuEvent+=new _IApplicationEvents_MenuEventEventHandler(SetupMenuEvent);
SboApplication.ItemEvent+=new _IApplicationEvents_ItemEventEventHandler(SetupItemEvent);
SboApplication.AppEvent+=new _IApplicationEvents_AppEventEventHandler(AppEvent);
private static void SetupMenuEvent(ref MenuEvent pVal, out bool BubbleEvent) {
BubbleEvent = true; //[Standard]
if(pVal.MenuUID=="1540" && pVal.BeforeAction) {
SboApplication.MessageBox("Pressed Journal Entry",1,"OK","","");
}
}
Regarding why the bubbleevent set set to true... This is needed for an out param in C# so this is normal
I Don't belevie now doesn't work...
if i open an EventMonitor this doesn't work...
Message was edited by: H.Fay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rasmus I've Set like this:
this.SetEventFilters();
appl.ItemEvent +=new SAPbouiCOM._IApplicationEvents_ItemEventEventHandler(appl_ItemEvent);
appl.AppEvent +=new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(appl_AppEvent);
appl.MenuEvent +=new SAPbouiCOM._IApplicationEvents_MenuEventEventHandler
(appl_MenuEvent);
Thx Rasmus I've set the order like in your code and solve the problem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why are you bubbling the menu event? Shouldn't be there.
Then i can't see your whole menu event but it should be
Private Sub SBO_Application_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.MenuEvent
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi H.Fay,
I think the problem is that you're telling SBO to filter menu events on your own custom form, when you are actually click the main menu to open your form. The menu click event filter needs to be set up on the main menu (which is form 169). So your code needs to change to:
evnt = evnts.Add(SAPbouiCOM.BoEventTypes.et_MENU_CLICK);
evnt.AddEx("169");
Hope it helps,
Adele
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.