PuzzleSDK
TestCustomTableView类 参考
+ 类 TestCustomTableView 继承关系图:
+ TestCustomTableView 的协作图:

Public 成员函数

virtual void onTouchEnded (Touch *touch, Event *event) override
 
void onMouseScroll (Event *event)
 

静态 Public 成员函数

static TestCustomTableViewcreate (TableViewDataSource *dataSource, Size size)
 

Protected 成员函数

 TestCustomTableView ()
 

详细描述

在文件 BaseTest.cpp57 行定义.

构造及析构函数说明

◆ TestCustomTableView()

TestCustomTableView::TestCustomTableView ( )
inlineprotected

在文件 BaseTest.cpp121 行定义.

122 {
123 auto mouseListener = EventListenerMouse::create();
124 mouseListener->onMouseScroll = CC_CALLBACK_1(TestCustomTableView::onMouseScroll, this);
125 _eventDispatcher->addEventListenerWithSceneGraphPriority(mouseListener, this);
126 }
void onMouseScroll(Event *event)
Definition: BaseTest.cpp:98

引用了 onMouseScroll().

被这些函数引用 create().

+ 函数调用图:
+ 这是这个函数的调用关系图:

成员函数说明

◆ create()

static TestCustomTableView * TestCustomTableView::create ( TableViewDataSource *  dataSource,
Size  size 
)
inlinestatic

在文件 BaseTest.cpp60 行定义.

61 {
62 auto table = new (std::nothrow) TestCustomTableView();
63 table->initWithViewSize(size, nullptr);
64 table->autorelease();
65 table->setDataSource(dataSource);
66 table->_updateCellPositions();
67 table->_updateContentSize();
68
69 return table;
70 }

引用了 TestCustomTableView().

被这些函数引用 TestList::runThisTest().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ onMouseScroll()

void TestCustomTableView::onMouseScroll ( Event *  event)
inline

在文件 BaseTest.cpp98 行定义.

99 {
100 auto mouseEvent = static_cast<EventMouse*>(event);
101 float moveY = mouseEvent->getScrollY() * 20;
102
103 auto minOffset = this->minContainerOffset();
104 auto maxOffset = this->maxContainerOffset();
105
106 auto offset = this->getContentOffset();
107 offset.y += moveY;
108
109 if (offset.y < minOffset.y)
110 {
111 offset.y = minOffset.y;
112 }
113 else if (offset.y > maxOffset.y)
114 {
115 offset.y = maxOffset.y;
116 }
117 this->setContentOffset(offset);
118 }

被这些函数引用 TestCustomTableView().

+ 这是这个函数的调用关系图:

◆ onTouchEnded()

virtual void TestCustomTableView::onTouchEnded ( Touch *  touch,
Event *  event 
)
inlineoverridevirtual

在文件 BaseTest.cpp72 行定义.

73 {
74 if (!this->isVisible())
75 {
76 return;
77 }
78
79 if (_touchedCell)
80 {
81 auto label = (Label*)_touchedCell->getChildByTag(TABEL_LABEL_TAG);
82
83 Rect bbox = label->getBoundingBox();
84 bbox.origin = _touchedCell->convertToWorldSpace(bbox.origin);
85
86 if (bbox.containsPoint(touch->getLocation()) && _tableViewDelegate != nullptr)
87 {
88 _tableViewDelegate->tableCellUnhighlight(this, _touchedCell);
89 _tableViewDelegate->tableCellTouched(this, _touchedCell);
90 }
91
92 _touchedCell = nullptr;
93 }
94
95 ScrollView::onTouchEnded(touch, event);
96 }
#define TABEL_LABEL_TAG
Definition: BaseTest.cpp:33

引用了 TABEL_LABEL_TAG.


该类的文档由以下文件生成: