1. ·Anne O'Dell
  2. PowerBuilder
  3. Monday, 24 April 2023 17:31 PM UTC

We have a datawindow field which allows the user to edit.  When the user clicks on the field and does a rightmouse click a menu appears - see the attachment.  We cannot find any code or attribute settings which trigger this.  How can we duplicate this?

Thank you,

Anne O'Dell

Attachments (1)
·Anne O'Dell Accepted Answer Pending Moderation
  1. Tuesday, 25 April 2023 14:22 PM UTC
  2. PowerBuilder
  3. # 1

Hi Chris,

Yes, I am looking to trigger the PB's "built-in" menu behavior.

This appears to sporadically work and I need to consistently trigger the "built-in" menu. I'm attaching an example of where DW #1 works by showing the "built-in" menu at runtime but DW #2 does not.  I checked all the DW settings and code and find them to match. Please help.

Anne O'Dell

Attachments (1)
Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 25 April 2023 20:16 PM UTC
Here are other places where the MS-Windows default pop-up menu can get changed / suppressed ...

1) The current window's menu has the same RMB short-cut as the DW. This would steal the DWO's RMB default pop-up processing behaviour

2) The DW Control has a User Event mapped that is mapped to the RMB event of the DW control and thus stealing the default RMB pop-up menu processing behaviour

3) The DW Control has code in the OTHER Event that is stealing the RMB event away from the DW control and thus canceling the default pop-up menu processing behaviour

4) The same as #2 & #3 but at the parent Window level that has code in either of those events that is stealing the RMB event away from the DW control thus, canceling the default DC's pop-up menu processing behaviour

5) The same as #2 & #3 but at the parent control (ie: TabPage or Tab control) level that has code in either of those events that is stealing the RMB event processing away from the DW control thus, canceling the default DC's pop-up menu processing behaviour.

HTH

Regards ... Chris
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 25 April 2023 12:13 PM UTC
  2. PowerBuilder
  3. # 2

Hi Anne;

  What you're looking at is PB's "built-in" menu behaviour. If you have no code on the DW's RMB event, PB displays the O/S's popup menu. 

   If you code anything on the RMB event, then the PB runtime assumes that you're in control and then suppresses the built-in pop-up menu. Now In your the RMB, code if you use PB's POPMENU() function, then you can present a pop-up menu of your design. HTH

Regards ... Chris 

Comment
There are no comments made yet.
·Anne O'Dell Accepted Answer Pending Moderation
  1. Tuesday, 25 April 2023 12:03 PM UTC
  2. PowerBuilder
  3. # 3

Thank you, John. I will work with sample code for my solution.

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 25 April 2023 02:59 AM UTC
  2. PowerBuilder
  3. # 4

Hi, Anne -

I'm not sure exactly what you are wanting to accomplish, but perhaps this CodeXchange example will help:

    https://community.appeon.com/index.php/codeexchange/powerbuilder/312-a-simple-popup-menu-for-datawindows

Best regards, John

Comment
  1. John Fauss
  2. Tuesday, 25 April 2023 04:54 AM UTC
Search the code for the DataWindow control's PopMenu function. This is what causes the RMB (Right-Mouse-Button) menu to appear.
  1. Helpful
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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.