conversion problem (VO2.6 to 2.8)

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
User avatar
Plummet
Posts: 21
Joined: Tue Jan 19, 2016 4:18 pm

conversion problem (VO2.6 to 2.8)

Post by Plummet »

Hi Jan,
A quick reply here as have not had the time to look thru yr code.

In all my (mdi)windows, dbf or text(mle), I pass the menucommand on up to the owner. It works fine for me (VO 2.8 ).

METHOD MenuCommand(oMCE) CLASS BasicDBFWindow
// pass it on
SELF:Owner:MenuCommand(oMCE)

HTH - sorry if it is irrelevant,
Don
Jan@share.be
Posts: 66
Joined: Mon Nov 02, 2015 8:51 pm

conversion problem (VO2.6 to 2.8)

Post by Jan@share.be »

Don

Thanks, I'll play around with that idea
Jan@share.be
Posts: 66
Joined: Mon Nov 02, 2015 8:51 pm

conversion problem (VO2.6 to 2.8)

Post by Jan@share.be »

In my previous demo app, there was a small mistake
I hereby upload the updated version
Attachments
Demo menu V2.zip
(134.67 KiB) Downloaded 69 times
Jan@share.be
Posts: 66
Joined: Mon Nov 02, 2015 8:51 pm

conversion problem (VO2.6 to 2.8)

Post by Jan@share.be »

Don

Does this work on context menus as well?
In my case: no menucommand is called.

But, I'm using a dynamically build menu.
When I use the menueditor, it all works fine.

So I'm doing something wrong in building the menu, I suppose.

Anyone with experience to build menu's? dynamically?

thanks
Jan@share.be
Posts: 66
Joined: Mon Nov 02, 2015 8:51 pm

conversion problem (VO2.6 to 2.8)

Post by Jan@share.be »

Don

Does this work on context menus as well?
In my case: no menucommand is called.

But, I'm using a dynamically build menu.
When I use the menueditor, it all works fine.

So I'm doing something wrong in building the menu, I suppose.

Anyone with experience to build menu's? dynamically?

thanks
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

conversion problem (VO2.6 to 2.8)

Post by Chris »

Hi Jan,

I checked the code in the SDK, apparently the MenuCommand() callback gets called only if there's no method that is directly handling your menu command. In your case, there are appropriate methods that get called for all the menu options, so MenuCommand() never gets called. Even if it got called, it would be sent to the "designwin" window, which owns the menu, not on the "DSRWin" class, where I see you have it defined.

But since you are already handling the menu commands, may I ask why you need the MenuCommand() functionality anyway? In case it is necessary for any reason to trap the menu commands before they are dispatched automatically, you can use the PreMenuCommand() callback like this:

Code: Select all

METHOD PreMenuCommand(oMenuCommandEvent) CLASS designwin
? oMenuCommandEvent:Name
RETURN TRUE // or FALSE 
If you return TRUE from the method, itmeans that you have handled the even yourself, so the associated method with the menu item will not be called. If you return FALSE, the event gets dispatched normally.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Jan@share.be
Posts: 66
Joined: Mon Nov 02, 2015 8:51 pm

conversion problem (VO2.6 to 2.8)

Post by Jan@share.be »

Chris

thanks for all the effort you put in this.

I'm trying to catch the items form the contextmenu that is attached to the DSRWin, and for which I defined all the methods as 'Dummy()'. So I would expect it to call menucommand, but it doesn't. I tried MenuSelect and PreMenuCommand as wel, I don't get any result.
take a look at DSRWin:setmenu()

I my demo, the context menu is build dynamically although all options are predefined. But I also need the same thing working when I build the menu from entries that are in de database (in casu: different machines they are using, and that changes over time).
The only way to do that in my opinion is built the menu dynamically and determine in menucommand wich option has been chosen.

This setup worked fine in VO2.6.

thanks
Jan
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

conversion problem (VO2.6 to 2.8)

Post by Chris »

Hi Jan,

Oh, it's a Context Menu that you were asking for from the beginning? I think I remember I've had issues with those myself in the past and ended up using ShowAsPopup() manually, but do not remember the details. I will look into them and will get back to you. Of course also anyone else please do not hesitate to give your input!
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Jan@share.be
Posts: 66
Joined: Mon Nov 02, 2015 8:51 pm

conversion problem (VO2.6 to 2.8)

Post by Jan@share.be »

Chris

YES, this works.
events are a bit weard, still figuring out the details.
Not all callback events get the correct event.
But I'll manage this way.

Thank you very much!!!

We'll have a beer next time we meet!! OK?

see you

Jan
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

conversion problem (VO2.6 to 2.8)

Post by Chris »

Hi Jan,

Oh, you used the ShowAsPopup() method? OK, nice, so I am not gonna look more closely why the ContextMenu way did not work, and yes I really appreciate the beer offer :)

cheers!
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply