Hello, all -
Having some spare time time while I'm away from work for a couple of days, I've come up with a solution for this problem. I created a small example app to demonstrate the solution, which is attached to this post as a zip file. The app was created using PB 2017 R3 and it is 100% PB, no Windows API function calls are used.
To accomplish the goal of slowing down the repeat rate when the left-mouse-button (LMB) is held down on an edit mask control's spin button, I created a custom edit mask control inherited from the standard control. In the custom edit mask control, I added a user event mapped to the pbm_enchange event. This event is triggered each time the user changes the data value in the control, either by typing or by clicking on a spin button. When the LMB is held down on a spin button, PB triggers this event repeatedly, approximately every 0.155 seconds. This timing is NOT configurable.
Then it occurred to me: To effectively slow down the repeat rate, maybe it is possible to prevent the data value from being changed until every second, or third, or fourth, etc. event occurs. After handling a few complicating conditions, it appears to work! A dedicated Timing object is needed in order to detect when the LMB is no longer being held down, since the typical LButtonDown/LButtonUp events do not get passed along to the application when the user clicks on a spin button.
To incorporate this functionality into your own application, you need to export the n_timing_editmask and u_editmask_slowdown objects from the sample application and import them into your app's PBL (Note: Import the Timing object first, then the custom edit mask control to get a clean import), then replace an existing edit mask control with the u_editmask_slowdown user object. It contains a method to set the slow-down factor for the spin buttons in the range 1-10. A factor of 1 means a normal repeat rate, no slow-down, and 10 is a pretty extreme slow-down. I found that using a factor of 3 or 4 provides a nice user experience.
Subhabrata, I hope this provides you with an acceptable solution to the issue and puts a smile on your user's face.
Best regards, John