1. Bhavesh Vyas
  2. PowerBuilder
  3. Thursday, 18 July 2024 07:39 AM UTC
*Phenomenon: Need to detect Triple Click similar to DoubleClicked and Clicked Events in Powerbuilder.

Is there any way to detect the triple click in powerbuilder. Some of our clients needs functionality with Triple Clicks in Editable Fields in Datawindow.

*Reproduce Steps: So far this is no way we can detect triple clicks in powerbuilder datawindows or windows objects.
Bhavesh Vyas Accepted Answer Pending Moderation
  1. Thursday, 1 August 2024 12:35 PM UTC
  2. PowerBuilder
  3. # 1

Hi, John

 

Functional requirement is to select multi word data in the dropdown and text fields similar to other applications where on double click a word is selected and on triple click whole sentence gets selected.

 

Regards,

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 1 August 2024 13:01 PM UTC
Hi Bhavesh;

Since there is no Triple Click in MS-Windows, I would personally implement this as either...

1) Pop-up menu in RMB with a "Select Sentence" option //OR

2) Use a control key sequence to select the sentence at the current cursor (ie: CTRL/SHIFT+S). //OR

3) Use a menu item click to select the sentence at the current cursor

Etc. HTH

Regards... Chris
  1. Helpful
  1. Bhavesh Vyas
  2. Thursday, 1 August 2024 14:04 PM UTC
Hi Chris,



Thanks for understanding the requirement and providing possible ways of implementation. However, our client is habitual with the triple clicks in other applications and they are too specific with the requirement to be fulfilled with triple clicks only.



Regards,
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 1 August 2024 15:03 PM UTC
OK .. then the other approach would be to use something the low level "MouseDown" and "MouseUp" events to capture 3 clicks within a reasonable time frame and if so, then action the "Select Sentence" feature. HTH
  1. Helpful 1
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Thursday, 18 July 2024 13:34 PM UTC
  2. PowerBuilder
  3. # 2

Hi, Bhavesh -

The Windows operating system does not recognize triple clicks. Rene is correct that you will have to experiment and develop code to recognize and handle this feature yourself.

If I may ask, what is the functional requirement for a triple-click event (what action will a triple-click initiate)? If we knew a little more about the requirement, we might be able to suggest an alternative approach.

Best regards, John

Comment
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Thursday, 18 July 2024 08:51 AM UTC
  2. PowerBuilder
  3. # 3

I do not know a tripleclicked event. But I think you can write some code to detect it.

A very simple test case:

// instance variable
integer ii_clickedcount

// clicked event
ii_clickcount++
if ii_clickcount = 3 then 
	messagebox ("", "clicked 3 times")
	ii_clickcount = 0
end if

// doubleclicked event
ii_clickcount++
if ii_clickcount = 3 then 
	messagebox ("", "clicked 3 times")
	ii_clickcount = 0
end if

 

You need to enhance this code:

  • add some timer to reset ii_clickcount after a short time. You may also store the cpu() function value instead and check that next click is not after a specified number of milliseconds
  • for datawindows you may also want to check that second and third click are on same dw object and row

 

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.