| 2385 | |
| 2386 | |
| 2387 | ResultType GuiType::OnEvent(GuiControlType *aControl, UINT aEvent, UCHAR aEventKind |
| 2388 | , ExprTokenType *aParam[], int aParamCount, ResultToken &aResultToken) |
| 2389 | { |
| 2390 | // Caller has already converted aParam[0] to aEvent and validated it, |
| 2391 | // as well as verifying aParamCount >= 2. |
| 2392 | int max_threads = ParamIndexToOptionalInt(2, 1); |
| 2393 | if (max_threads < -1 || max_threads > 1) |
| 2394 | // An event can currently only run one thread at a time. By contrast, OnMessage |
| 2395 | // applies the thread limit per handler, not per message. It's hard to say which |
| 2396 | // approach is better. |
| 2397 | _o_throw_param(2); |
| 2398 | |
| 2399 | TCHAR nbuf[MAX_NUMBER_SIZE]; |
| 2400 | IObject *func = ParamIndexToObject(1); |
| 2401 | LPTSTR name = func ? nullptr : ParamIndexToString(1, nbuf); |
| 2402 | if (!func && !mEventSink) |
| 2403 | _o_throw_param(1); |
| 2404 | return OnEvent(aControl, aEvent, aEventKind, func, name, max_threads, aResultToken); |
| 2405 | } |
| 2406 | |
| 2407 | |
| 2408 | ResultType GuiType::OnEvent(GuiControlType *aControl, UINT aEvent, UCHAR aEventKind |
no test coverage detected