1. Philip Troise
  2. PowerBuilder
  3. Friday, 15 January 2021 22:14 PM UTC

My base code comes from the example in R3 for RibbonBars. I just copied everything and using and replacing parts. 

 

I inserted code into the key event of w_main to capture key strokes. I could use this to trigger what I want for short cut keys, but there is a shortcut attribute in the XML. So I am going to see if that could be used instead of capturing key strokes and using the key event.

In example below tried to use Shortcut="A" to trigger opening an Add Screen.

I assign an "A" to shortcut. Now every time I had the key "A" the key event is not triggered, I do not know what happens. so thought maybe the clicked attribute event happens. So I changed it to ue_largebuttonclicked, which is what happens when the Add button is selected on menu, but still nothing happens

 

Shortcut="A" Tag="Add Reservation" Type="0" Visible="true" Clicked="ue_largebuttonclicked"></Item>

Accepted Answer
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Monday, 18 January 2021 08:55 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Philip,

 

I guess 'the example in R3 for RibbonBars' you mentioned is Example Sales App.

You added 'Shortcut keys' in the RibbonBar's MenuItem instead of LargeButton. So the Clicked event name should be ue_menuitemclicked.

e.g.:

Shortcut="A" Tag="Add Reservation" Type="0" Visible="true" Clicked="ue_menuitemclicked "></Item>

 

You can refer to the link below for how to define the Clicked event of the RibbonBar's MenuItem (there should be three arguments correspondingly):

https://docs.appeon.com/pb2019r2/powerscript_reference/ch09s16.html#clicked_event_syntax6 

 

However, in the Example Sales App, it uses the ue_largebuttonclicked event by default, it only has one corresponding argument, so it fails to invoke.

https://docs.appeon.com/pb2019r2/objects_and_controls/ch02s99.html 


You can find more descriptions of the RibbonBar from the following link:

https://docs.appeon.com/pb2019r2/pbug/ch13s04.html#_Important_notes 

The ribbon item controls have no events and must be bound with user events. For more, see the section called "Clicked" in Objects and Controls, the section called "Selected" in Objects and Controls, the section called "Modified" in Objects and Controls, and the section called "SelectionChanged" in Objects and Controls.

 

Regards,

 

Comment
There are no comments made yet.
Philip Troise Accepted Answer Pending Moderation
  1. Sunday, 17 January 2021 18:19 PM UTC
  2. PowerBuilder
  3. # 1

after doing as you instructed, I had to update the of_largebuttonclicked function with the same parameters.

Then is returns a -1 in li_return

 

I think I may need to chnage below code somewhat.....i would be just guessing. maybe you can help me out

 

RibbonLargeButtonItem lr_largebuttonitem
integer li_return
string ls_text


li_return = rbb_main.GetLargebutton(itemhandle, lr_largebuttonitem)

Comment
There are no comments made yet.
Christopher Craft Accepted Answer Pending Moderation
  1. Saturday, 16 January 2021 20:33 PM UTC
  2. PowerBuilder
  3. # 2

Philip,

What arguments do you have declared for your ue_largebuttonclicked event on the frame window? I assume this is an item so you should have 3 declared as longs.  ie. ue_largebuttonclicked(long aHandle, long aItem, long aSubItem)

If this is not declared properly then you will not get notified.

Chris Craft

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.
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.