1. Kevin Thai
  2. PowerBuilder
  3. Thursday, 5 November 2020 21:27 PM UTC

Hi all,

So I am having the issue from trying to get Ctrl + C/V/X  (copy paste cut) to work while using a Ribbonbar. How we used to do it was in the menu object, we would call of_SendMessage("pfc_copy"). So when I setting up my ribbonbar parent object I tried to do that but since it is not a message object it can't be done. I know that if I directly call the pfc_copy in a datawindow it would work like:

ue_copy(Ribbonbar Event){

Parent.dw_1.triggerevent("pfc_copy")

}

I am wonder if there is a way to make this more dynamic so I would not have to hard code each datawindow into the Ribbonbar. 

I hope this makes sense.

Your help is very appreciated! 

Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 1 December 2020 05:24 AM UTC
  2. PowerBuilder
  3. # 1

Hi Kevin,

I recommend that you define custom event names for the same category according to RibbonBar's button-type control classification.

Then identify the corresponding response event based on the tag attribute of the RibbonBar object, such as the pfc_copy event of the Datawindow you mentioned.

And you can download the demo app from the link below which can show you how to use the RibbonBar control.

https://github.com/Appeon/PowerBuilder-RestClient-Example.

 

Regards,

 

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 5 November 2020 22:42 PM UTC
  2. PowerBuilder
  3. # 2

Hi, Kevin -

I've not yet used the ribbon bar, but here is the code that is contained in the of_SendMessage function in the ancestor menu object pfc_m_master (it is located in the pfcwnsrv.pbl):

n_cst_menu lnv_menu

return lnv_menu.of_sendMessage (this, as_message)

"as_message" is the command ("pfc_copy", in your case). The problem is the first argument to the of_SendMessage function in the n_cst_menu object... which is an object of type menu. The RibbonBar is obviously NOT an object of type menu, so this code won't work in a RibbonBar as it stands.

You'll need to see if you can create/provide a function that does what the of_SendMessage function in pfc_n_cst_menu (the ancestor of n_cst_menu, which also resides in the pfcwnsrv.pbl) does. The code in that function is not complicated, but since I'm not familiar with the RibbonBar, I cannot say how difficular/easy this will be to accomplish.

I hope this helps point you in the right direction.

Regards, John

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.