04-29-2022, 07:20 PM
As of CORE 0.8.0, labels still don't honor a double-click callback. Someone may have a better option, but for now here's my workaround:
At the end of the postStartup event I set a global Time variable clickTime to Time:Current(true).
I replaced the label's setTextField() function with setClickCallback. The callback begins with this:
The code accounts for people working past midnight.
I hope others can benefit from this, and that anyone with a better option will share it here.
At the end of the postStartup event I set a global Time variable clickTime to Time:Current(true).
I replaced the label's setTextField() function with setClickCallback. The callback begins with this:
Code:
hdi::core::Time t = hdi::core::Time::Current(true);
double secs1 = t.secondsSinceMidnight();
double secs2 = this->clickTime.secondsSinceMidnight();
this->clickTime = t;
if ((secs3 > .3) || (secs1 < secs2)){
// single-click code here
this->myTextField.focus();
return;
}
// double-click code goes below
The code accounts for people working past midnight.
I hope others can benefit from this, and that anyone with a better option will share it here.