1. alessandro feltrin
  2. PowerBuilder
  3. Friday, 25 September 2020 06:58 AM UTC

Hi all,

 

I have a Userobject which contains several objects including, datawindow, userobjects tab etc. and I would like to capture a function key (regardless of the object I am positioned on within the main userobject) to throw an event. If I use pbm_key in the main userObject, it never runs until the focus is on another contained object. How can I do without having to change every single object? Hope someone can help me. Thank you

alessandro feltrin Accepted Answer Pending Moderation
  1. Friday, 25 September 2020 13:49 PM UTC
  2. PowerBuilder
  3. # 1

I do this in a Userobject and not in a window, so i have no Menu. I don't know if I can attach a menu into an userObject. Is so this could be a nice solution.    

Comment
There are no comments made yet.
Brad Wery Accepted Answer Pending Moderation
  1. Friday, 25 September 2020 13:30 PM UTC
  2. PowerBuilder
  3. # 2

The easiest way is to add an invisible menu item to your menu (assuming you have a menu), using the function key as a shortcut. When the menu item clicked is triggered, broadcast a message to the active user object.

Comment
There are no comments made yet.
alessandro feltrin Accepted Answer Pending Moderation
  1. Friday, 25 September 2020 12:03 PM UTC
  2. PowerBuilder
  3. # 3

yes. All objects (main userobject and dw etc ) are all inherited  

Comment
  1. Andreas Mykonios
  2. Friday, 25 September 2020 13:18 PM UTC
Then you could try to add an inheritance level for those specific objects. Add to this level the equivalent event handling for keys pressed. This event for each of those ancestors should then forward the processing to the parent's equivalent event. And make those objects ancestors of the one you use in your userobject. This may sound very complicated, but can be easier to implement. It's just a thought. I haven't seen your specific project, I'm not sure if it can be a solution in your case.



Andreas.
  1. Helpful
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Friday, 25 September 2020 11:16 AM UTC
  2. PowerBuilder
  3. # 4

Hi.

Are you using inheritance?

Andreas.

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.