Hello Jan,
You should maybe give some more details. With "this doesn't work" you probably mean that choosing the menu option doesn't result in your code running?
The first to check is of course if you have not made a typo. Then if the method in your menu is from the class your split window is from.
It's nearly always incorrect spelling or class, if nothing happens when you select your menu item.
Dick
conversion problem (VO2.6 to 2.8)
-
- Posts: 67
- Joined: Mon Nov 02, 2015 8:51 pm
conversion problem (VO2.6 to 2.8)
Dick
I'm very happy with all the help I get from this group, this helps me getting the work done sooner.
As I already said, this is a conversion project. I just imported the AEF in VO28 and started from there.
So, I don't think I have any typo's, this was a working situation in VO26.
I already found out that there are some differences in how the mousebutton callback functions work from 2.6 to 2.8. So I changed my code to have it working properly in VO28.
But this is different.
I use the menucommand callback function to get menu functions to operate (see code in attachment).
It works fine in VO26, in VO28, this callback function never gets called.
The menu pops up fine when I hit right mousebutton, but when selecting a menu-option, menucommand is not called.
Is this because I already use the mousebuttondown?
I'm trying to get my head around this and to find a way to get it working.
thanks for any idea's.
Jan
I'm very happy with all the help I get from this group, this helps me getting the work done sooner.
As I already said, this is a conversion project. I just imported the AEF in VO28 and started from there.
So, I don't think I have any typo's, this was a working situation in VO26.
I already found out that there are some differences in how the mousebutton callback functions work from 2.6 to 2.8. So I changed my code to have it working properly in VO28.
But this is different.
I use the menucommand callback function to get menu functions to operate (see code in attachment).
It works fine in VO26, in VO28, this callback function never gets called.
The menu pops up fine when I hit right mousebutton, but when selecting a menu-option, menucommand is not called.
Is this because I already use the mousebuttondown?
I'm trying to get my head around this and to find a way to get it working.
thanks for any idea's.
Jan
- Attachments
-
- context menu.pdf
- (67.92 KiB) Downloaded 76 times
conversion problem (VO2.6 to 2.8)
Hello Jan,
What happens if you just create the menu with the menu editor and fill in the method which should be called?
You can try a simple one-choice context menu. Call the first item Dummy (or whatever), then tab 1 x and enter the next option "Select alles" with method SelectAll CLASS DSRWin which only calls SELF:zoekselectall('A') .
As far as I can see there's nothing unusual in the code, except that you could achieve it all probably easier with the menu editor. Callback method menucommand should be called as the X# help says Provide a method that is invoked when an item on a menu owned by this window is selected. You assign a contextMenu to the Datawindow subclass which appear you write so I'd expect the menucommand method to be called.
Maybe Chris or Robert can tell if building the menu like you do reacts different in X#, but I'd say the quickest way to deal with it might be trying it otherwise, in this case using the menu editor.
Dick
What happens if you just create the menu with the menu editor and fill in the method which should be called?
You can try a simple one-choice context menu. Call the first item Dummy (or whatever), then tab 1 x and enter the next option "Select alles" with method SelectAll CLASS DSRWin which only calls SELF:zoekselectall('A') .
As far as I can see there's nothing unusual in the code, except that you could achieve it all probably easier with the menu editor. Callback method menucommand should be called as the X# help says Provide a method that is invoked when an item on a menu owned by this window is selected. You assign a contextMenu to the Datawindow subclass which appear you write so I'd expect the menucommand method to be called.
Maybe Chris or Robert can tell if building the menu like you do reacts different in X#, but I'd say the quickest way to deal with it might be trying it otherwise, in this case using the menu editor.
Dick
conversion problem (VO2.6 to 2.8)
Hi Jan,
Unfortunately code screenshots do not really help, can you please zip and send the .aef instead so we can have a look? If you do not want to send the complete app, maybe you can create a small test app reproducing the problem and send that one.
Unfortunately code screenshots do not really help, can you please zip and send the .aef instead so we can have a look? If you do not want to send the complete app, maybe you can create a small test app reproducing the problem and send that one.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
conversion problem (VO2.6 to 2.8)
Hi Jan,
unfortunately I have only VO 2.8 on my disk, so I cannot check the behavior of 2.6.
It seems that neither the MenuCommand nor the PreMenuCommand are called by VO 2.8 when using DataWindows and the context menu on the window itself.
When using the context menu on a control, the PreMenuCommand of the window is called.
I cannot say what is going wrong here or what was changed from 2.6, but it would be helpful if you posted a small working sample, maybe based on the Standard MDI Application instead of a useless and incomplete PDF.
Wolfgang
unfortunately I have only VO 2.8 on my disk, so I cannot check the behavior of 2.6.
It seems that neither the MenuCommand nor the PreMenuCommand are called by VO 2.8 when using DataWindows and the context menu on the window itself.
When using the context menu on a control, the PreMenuCommand of the window is called.
I cannot say what is going wrong here or what was changed from 2.6, but it would be helpful if you posted a small working sample, maybe based on the Standard MDI Application instead of a useless and incomplete PDF.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
-
- Posts: 67
- Joined: Mon Nov 02, 2015 8:51 pm
conversion problem (VO2.6 to 2.8)
Dick
I'm doing this in VO28, so my question is not about X#.
I already tried your suggestion, and indeed, that works fine. I can create the menu in the menubuilder, and then the context menu works as expected.
But, I also use the same technique to build a menu dynamically, based on a DB table. So in that case I cannot use the menu-builder.
I'll keep on trying.
thanks
I'm doing this in VO28, so my question is not about X#.
I already tried your suggestion, and indeed, that works fine. I can create the menu in the menubuilder, and then the context menu works as expected.
But, I also use the same technique to build a menu dynamically, based on a DB table. So in that case I cannot use the menu-builder.
I'll keep on trying.
thanks
-
- Posts: 67
- Joined: Mon Nov 02, 2015 8:51 pm
conversion problem (VO2.6 to 2.8)
Chris.
Ok, I'll put together a small app that demonstrates my problem and post it later today
thanks
Ok, I'll put together a small app that demonstrates my problem and post it later today
thanks
-
- Posts: 67
- Joined: Mon Nov 02, 2015 8:51 pm
conversion problem (VO2.6 to 2.8)
Wolfgang.
thank you for looking into this.
I'll put together a small application that demosntrates my problem and post it later today.
greetings
thank you for looking into this.
I'll put together a small application that demosntrates my problem and post it later today.
greetings
-
- Posts: 67
- Joined: Mon Nov 02, 2015 8:51 pm
conversion problem (VO2.6 to 2.8)
Wolfgang.
thank you for looking into this.
I'll put together a small application that demosntrates my problem and post it later today.
greetings
thank you for looking into this.
I'll put together a small application that demosntrates my problem and post it later today.
greetings
-
- Posts: 67
- Joined: Mon Nov 02, 2015 8:51 pm
conversion problem (VO2.6 to 2.8)
OkI hereby upload a small demo application that is an exact extract from the project I'm working on. All code that accesses the DB is eliminated.This is an application for a printshop, they have to make the layout of what they print (in this case it is labels) on the paper.So this part of the app lets them play around with the individual labels.THey can move them around or do some actions as turn them, align them, do group moves etc. All these actions are done via the context menu, the one that does not work now.thank you