Merge branch 'develop' into develop_nutty_modify_framework_addnewreader

This commit is contained in:
CaiWenzhi 2013-12-26 20:32:50 +08:00
commit a8ab58d8d8
6 changed files with 24 additions and 16 deletions

View File

@ -288,15 +288,15 @@ public:
return NULL;
}
virtual long numberOfCellsInTableView(TableView *table)
virtual ssize_t numberOfCellsInTableView(TableView *table)
{
jsval ret;
bool ok = callJSDelegate(table, "numberOfCellsInTableView", ret);
if (ok)
{
JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
long count = 0;
JSBool isSucceed = jsval_to_long(cx, ret, &count);
ssize_t count = 0;
JSBool isSucceed = jsval_to_ssize(cx, ret, &count);
if (isSucceed) return count;
}
return 0;

View File

@ -1026,7 +1026,7 @@ public:
LUA_TableViewDataSource(){}
virtual ~LUA_TableViewDataSource(){}
virtual Size tableCellSizeForIndex(TableView *table, long idx)
virtual Size tableCellSizeForIndex(TableView *table, ssize_t idx)
{
if (nullptr != table )
{
@ -1052,7 +1052,7 @@ public:
return Size::ZERO;
}
virtual TableViewCell* tableCellAtIndex(TableView *table, long idx)
virtual TableViewCell* tableCellAtIndex(TableView *table, ssize_t idx)
{
if (nullptr != table )
{
@ -1078,7 +1078,7 @@ public:
return NULL;
}
virtual long numberOfCellsInTableView(TableView *table)
virtual ssize_t numberOfCellsInTableView(TableView *table)
{
if (nullptr != table )
{
@ -1094,7 +1094,7 @@ public:
Double* numbers = dynamic_cast<Double*>(resultArray.getObjectAtIndex(0));
if (NULL != numbers)
{
return (long)numbers->getValue();
return (ssize_t)numbers->getValue();
}
}
}

View File

@ -129,7 +129,7 @@ public:
*
* @return number of cells
*/
virtual long numberOfCellsInTableView(TableView *table) = 0;
virtual ssize_t numberOfCellsInTableView(TableView *table) = 0;
};

View File

@ -41,13 +41,11 @@ add_executable(${APP_NAME}
${SAMPLE_SRC}
)
#get our resources
add_custom_command(TARGET ${APP_NAME} PRE_BUILD
if(WIN32 AND MSVC)
#get our resources
add_custom_command(TARGET ${APP_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/Resources ${CMAKE_CURRENT_BINARY_DIR})
if(WIN32 AND MSVC)
#get our dlls
add_custom_command(TARGET ${APP_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
@ -62,6 +60,16 @@ if(WIN32 AND MSVC)
#Visual Studio Defaults to wrong type
set_target_properties(${APP_NAME} PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:WINDOWS")
set_target_properties(${APP_NAME} PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS")
else()
set(APP_BIN_DIR "${CMAKE_SOURCE_DIR}/bin/${APP_NAME}")
set_target_properties(${APP_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${APP_BIN_DIR}")
pre_build(${APP_NAME}
COMMAND ${CMAKE_COMMAND} -E remove_directory ${APP_BIN_DIR}/Resources
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/Resources ${APP_BIN_DIR}/Resources
)
endif()
target_link_libraries(${APP_NAME} audio cocos2d)

View File

@ -96,7 +96,7 @@ TableViewCell* TableViewTestLayer::tableCellAtIndex(TableView *table, ssize_t id
return cell;
}
long TableViewTestLayer::numberOfCellsInTableView(TableView *table)
ssize_t TableViewTestLayer::numberOfCellsInTableView(TableView *table)
{
return 20;
}

View File

@ -20,7 +20,7 @@ public:
virtual void tableCellTouched(cocos2d::extension::TableView* table, cocos2d::extension::TableViewCell* cell);
virtual cocos2d::Size tableCellSizeForIndex(cocos2d::extension::TableView *table, ssize_t idx);
virtual cocos2d::extension::TableViewCell* tableCellAtIndex(cocos2d::extension::TableView *table, ssize_t idx);
virtual long numberOfCellsInTableView(cocos2d::extension::TableView *table);
virtual ssize_t numberOfCellsInTableView(cocos2d::extension::TableView *table);
};
#endif // __TABLEVIEWTESTSCENE_H__