This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20.6
Clickcount
|
Clickcount -> Function result | ||||||||
Parameter | Type | Description | ||||||
Function result | Longint |
![]() |
Number of consecutive clicks | |||||
The Clickcount command returns, in the context of a mouse click event, the number of times the user has clicked in rapid succession with the same mouse button. Typically, this command returns 2 for a double-click.
This command allows you to detect double-clicks in listbox headers or footers, and also to handle sequences of triple-clicks or more.
Every mouse button click generates a separate click event. For example, if a user double-clicks, an event is sent for the first click in which Clickcount returns 1; then another event is sent for the second click in which Clickcount returns 2.
This command must only be used in the context of On Clicked, On Header Click or On Footer Click form events. It is therefore necessary to check in Design mode that the appropriate event has been properly selected in the Form properties and/or for the specific object.
When both On Clicked and On Double Clicked form events are enabled, the following sequence will be returned by Clickcount:
The following code structure can be placed in a listbox header to handle single- and double-clicks:
Case of
:(Form event code=On Header Click)
Case of
:(Clickcount=1)
... //single-click action
:(Clickcount=2)
... //double-click action
End case
End case
Labels are not enterable but they become so after a triple-click. If you want to allow users to edit labels, you can write the following in the object method:
If(Form event code=On Clicked)
Case of
:(Clickcount=3)
OBJECT SET ENTERABLE(*;"Label";True)
EDIT ITEM(*;"Label")
End case
End if
Product: 4D
Theme: Form Events
Number:
1332
Created: 4D v14 R5
4D Language Reference ( 4D v20)
4D Language Reference ( 4D v20.1)
4D Language Reference ( 4D v20.2)
4D Language Reference ( 4D v20.3)
4D Language Reference ( 4D v20.4)
4D Language Reference ( 4D v20.5)
4D Language Reference ( 4D v20.6)