// Created by raharu on 2014/05/10.
Scene* Overview::createScene()
auto scene = Scene::create();
auto layer = Overview::create();
// on "init" you need to initialize your instance
if ( !Layer::init() ) return false;
window_size = Director::getInstance()->getWinSize();
TableView* tableView = TableView::create(this, window_size);
tableView->setDirection(TableView::Direction::VERTICAL);
tableView->setVerticalFillOrder(TableView::VerticalFillOrder::TOP_DOWN);
tableView->setDelegate(this);
Size Overview::cellSizeForTable(TableView *table){
return Size(window_size.width, 25);
TableViewCell* Overview::tableCellAtIndex(TableView *table, ssize_t idx){
std::string id = StringUtils::format("%zd", idx);
std::string text = StringUtils::format("Line %zd", idx);
TableViewCell *cell = table->dequeueCell();
cell = new TableViewCell();
auto background_color = Color3B(255,255,255);
background_color = Color3B(200,200,200);
Sprite* bg = Sprite::create();
bg->setAnchorPoint(Point(0, 0));
bg->setTextureRect(Rect(0, 0, window_size.width, 24));
bg->setColor(background_color);
Sprite* line = Sprite::create();
line->setAnchorPoint(Point(0, 0));
line->setTextureRect(Rect(0, 0, window_size.width, 1));
line->setColor(Color3B(0,0,0));
auto *label_1 = LabelTTF::create(id.c_str(), "Arial", 20);
label_1->setAnchorPoint(Point(0, 0));
label_1->setPosition(Point(50, 0));
label_1->setColor(Color3B(0,0,0));
auto *label_2 = LabelTTF::create(text.c_str(), "Arial", 20);
label_2->setAnchorPoint(Point(0, 0));
label_2->setPosition(Point(100, 0));
label_2->setColor(Color3B(0,0,0));
ssize_t Overview::numberOfCellsInTableView(TableView *table){
void Overview::tableCellTouched(TableView* table, TableViewCell* cell){
CCLOG("%ziのセルがタッチされました", cell->getIdx());