1. Bjarne Anker
  2. PowerBuilder
  3. Friday, 1 December 2017 12:26 PM UTC

Hi again.

I'm circling back to this issue, since I really want to make this work.
As previously mentioned, the pbm_menuselect event fires every time the user moves the pointer over an menuitem.
And that doesn't make any sense in my case. There is also no way to filter out if the user moves over og clicks a menuitem.

Is there any other event that I can implement to register only the click on a specific menuitem?
Or is the solution as cumbersome as to make a function on the main menu which records the clicks and call it on each menuitem's clicked() event?

Perhaps some of the Appeon engineers or SAP MVP's have another take on this issue?

 

Hopefully awaiting answers.

Bjarne Anker

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 4 December 2017 03:08 AM UTC
  2. PowerBuilder
  3. # 1

Hi Roland;

   I tried your approach but it totally messed up the application toolbars in my PB 2017 App's.

Hi Bjarne;

   I have got the start of it working in my framework using the MS-Windows API's  ...

Regards ... Chris

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Friday, 1 December 2017 16:49 PM UTC
  2. PowerBuilder
  3. # 2

I have a solution which doesn't need any Windows API functions or special event code.

First create a menu object called 'm_menuitem' with one menu item. After saving the object, delete the menu item and save the menu object again. Close the menu painter.

Open the menu object used by the main app window in Edit Source mode. Replace 'from menu within' with 'from m_menuitem within'. Save the object and close the source editor.

Now all the menu items in your main menu inherit from m_menuitem. Add code to the clicked event of m_menuitem to record the clicks. If you want to have the recording code in the window, you can call a window function like this:

ParentWindow.Dynamic Function wf_menuclicked(this.ClassName())

 

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.