1. Miguel Leeuwe
  2. PowerBuilder
  3. Thursday, 7 May 2020 12:35 PM UTC

Hi,

I've been asked to do things "while the left mouse button on an icon of a menu toolbar is being hold down" and when it's being released.

I've tried to add pbm_lbuttondown and pbm_lbuttonup, but that doesn't seem to be fired.

So my question is: Should I maybe use a different event or is it simply not possible with a menuitem?

TIA

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 7 May 2020 19:54 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Miguel;

   The Menu Object and the Menu Item object is very much encapsulated and basically, only triggers either a SELECTED or CLICKED event due to the way it internally handles events. All the actual Menu events are fired  against the Window and then re-directed by the PBVM.

Regards ... Chris

Comment
  1. Miguel Leeuwe
  2. Thursday, 7 May 2020 20:20 PM UTC
Thank you Chris, I was afraid of that, maybe I'll see what possibilities I'd have using the new ribbon menu, though that might be even more restricted.
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 7 May 2020 14:56 PM UTC
  2. PowerBuilder
  3. # 1

Greetings, Miguel - 

In the cases when I wasn't sure what messages were sent to a particular control, I've created a DataWindow to hold Windows Message ID's, WParam and LParam values, created a DataStore, then coded the Other event to simply record a log of the events not handled by PB for subsequent, off-line analysis. I've never used this technique with Menu objects, so I cannot say with certainty this would work in your case...but, it's an idea to consider.

HTH, John

Comment
  1. Miguel Leeuwe
  2. Thursday, 7 May 2020 15:05 PM UTC
Thank you, yes I thought of that also. Later I'll try to see if I can add an "other" event to a menu and see if it works. I'm not too sure, since if you look at "selected" or "clicked" events of a menu, there's no pbm_..... tied to it, which makes me think that the menu object is going to be an exception.

But I'll try later on.

Cheers
  1. Helpful
  1. Andrew Barnes
  2. Thursday, 7 May 2020 23:21 PM UTC
I tried adding an other event (pbm_other) to a menu item, but it never was fired. Oftentimes PowerBuilder lets programmers play outside the normal sandbox, but with menus, not so much.
  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.