Skip to content

Commit 8a017e4

Browse files
committed
Add onPointerUp handling in cpp-tests BasetTest
1 parent 3e76f7d commit 8a017e4

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

tests/cpp-tests/Source/BaseTest.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,29 @@ class TestCustomTableView : public TableView
7272
return table;
7373
}
7474

75+
void onPointerUp(PointerEvent* event) override
76+
{
77+
if (!this->isVisible())
78+
{
79+
return;
80+
}
81+
82+
if (_touchedCell)
83+
{
84+
auto label = (Label*)_touchedCell->getChildByTag(TABEL_LABEL_TAG);
85+
86+
if (label->onPointerHitTest(event, nullptr) && _tableViewDelegate != nullptr)
87+
{
88+
_tableViewDelegate->tableCellUnhighlight(this, _touchedCell);
89+
_tableViewDelegate->tableCellTouched(this, _touchedCell);
90+
}
91+
92+
_touchedCell = nullptr;
93+
}
94+
95+
ScrollView::onPointerUp(event);
96+
}
97+
7598
bool onPointerScroll(PointerEvent* event) override
7699
{
77100
float moveY = event->getScrollY() * 20;

0 commit comments

Comments
 (0)