| 447 | } |
| 448 | |
| 449 | void CustomListView::MouseOver(const ScreenCoordsXY& pos, bool isMouseDown) |
| 450 | { |
| 451 | auto hitResult = GetItemIndexAt(pos); |
| 452 | if (hitResult) |
| 453 | { |
| 454 | HighlightedCell = hitResult; |
| 455 | if (HighlightedCell != LastHighlightedCell) |
| 456 | { |
| 457 | if (hitResult->Row != kHeaderRow && OnHighlight.context != nullptr && OnHighlight.IsValid()) |
| 458 | { |
| 459 | auto ctx = OnHighlight.context; |
| 460 | JSValue jsRow = JS_NewInt32(ctx, HighlightedCell->Row); |
| 461 | JSValue jsColumn = JS_NewInt32(ctx, HighlightedCell->Column); |
| 462 | auto& scriptEngine = GetContext()->GetScriptEngine(); |
| 463 | scriptEngine.ExecutePluginCall(Owner, OnHighlight.callback, { jsRow, jsColumn }, false); |
| 464 | } |
| 465 | Invalidate(); |
| 466 | } |
| 467 | } |
| 468 | |
| 469 | // Update the header currently held down |
| 470 | if (isMouseDown) |
| 471 | { |
| 472 | if (hitResult && hitResult->Row == kHeaderRow) |
| 473 | { |
| 474 | ColumnHeaderPressedCurrentState = (hitResult->Column == ColumnHeaderPressed); |
| 475 | Invalidate(); |
| 476 | } |
| 477 | IsMouseDown = true; |
| 478 | } |
| 479 | else |
| 480 | { |
| 481 | if (LastIsMouseDown) |
| 482 | { |
| 483 | MouseUp(pos); |
| 484 | } |
| 485 | IsMouseDown = false; |
| 486 | } |
| 487 | } |
| 488 | |
| 489 | void CustomListView::MouseDown(const ScreenCoordsXY& pos) |
| 490 | { |
no test coverage detected