◆ TestCustomTableView()
| TestCustomTableView::TestCustomTableView |
( |
| ) |
|
|
inlineprotected |
在文件 BaseTest.cpp 第 121 行定义.
123 auto mouseListener = EventListenerMouse::create();
125 _eventDispatcher->addEventListenerWithSceneGraphPriority(mouseListener,
this);
void onMouseScroll(Event *event)
引用了 onMouseScroll().
被这些函数引用 create().
◆ create()
| static TestCustomTableView * TestCustomTableView::create |
( |
TableViewDataSource * |
dataSource, |
|
|
Size |
size |
|
) |
| |
|
inlinestatic |
◆ onMouseScroll()
| void TestCustomTableView::onMouseScroll |
( |
Event * |
event | ) |
|
|
inline |
在文件 BaseTest.cpp 第 98 行定义.
100 auto mouseEvent =
static_cast<EventMouse*
>(event);
101 float moveY = mouseEvent->getScrollY() * 20;
103 auto minOffset = this->minContainerOffset();
104 auto maxOffset = this->maxContainerOffset();
106 auto offset = this->getContentOffset();
109 if (offset.y < minOffset.y)
111 offset.y = minOffset.y;
113 else if (offset.y > maxOffset.y)
115 offset.y = maxOffset.y;
117 this->setContentOffset(offset);
被这些函数引用 TestCustomTableView().
◆ onTouchEnded()
| virtual void TestCustomTableView::onTouchEnded |
( |
Touch * |
touch, |
|
|
Event * |
event |
|
) |
| |
|
inlineoverridevirtual |
在文件 BaseTest.cpp 第 72 行定义.
74 if (!this->isVisible())
83 Rect bbox = label->getBoundingBox();
84 bbox.origin = _touchedCell->convertToWorldSpace(bbox.origin);
86 if (bbox.containsPoint(touch->getLocation()) && _tableViewDelegate !=
nullptr)
88 _tableViewDelegate->tableCellUnhighlight(
this, _touchedCell);
89 _tableViewDelegate->tableCellTouched(
this, _touchedCell);
92 _touchedCell =
nullptr;
95 ScrollView::onTouchEnded(touch, event);
引用了 TABEL_LABEL_TAG.
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/BaseTest.cpp