From 69e2b815ed2f2f122314845fda897b431242a5b9 Mon Sep 17 00:00:00 2001 From: lite3 Date: Tue, 12 Aug 2014 17:05:23 +0800 Subject: [PATCH 01/45] fix: copy map when getParseCallBackMap() and getParseObjectMap() --- cocos/editor-support/cocostudio/CCSGUIReader.cpp | 8 ++++---- cocos/editor-support/cocostudio/CCSGUIReader.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index d86f04c166..61c9b86ca8 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -1512,11 +1512,11 @@ void WidgetPropertiesReader0300::setPropsForAllCustomWidgetFromJsonDictionary(co { GUIReader* guiReader = GUIReader::getInstance(); - std::map object_map = GUIReader::getInstance()->getParseObjectMap(); - Ref* object = object_map[classType]; + std::map *object_map = guiReader->getParseObjectMap(); + Ref* object = (*object_map)[classType]; - std::map selector_map = guiReader->getParseCallBackMap(); - SEL_ParseEvent selector = selector_map[classType]; + std::map *selector_map = guiReader->getParseCallBackMap(); + SEL_ParseEvent selector = (*selector_map)[classType]; if (object && selector) { diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.h b/cocos/editor-support/cocostudio/CCSGUIReader.h index 89f27a6a1b..a4e6b880f3 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.h +++ b/cocos/editor-support/cocostudio/CCSGUIReader.h @@ -85,8 +85,8 @@ protected: ParseObjectMap _mapObject; public: - ParseCallBackMap getParseCallBackMap() { return _mapParseSelector; }; - ParseObjectMap getParseObjectMap() { return _mapObject; }; + ParseCallBackMap* getParseCallBackMap() { return &_mapParseSelector; }; + ParseObjectMap* getParseObjectMap() { return &_mapObject; }; }; From 8f59d8ac93941b42e9d9df47af6448451000d599 Mon Sep 17 00:00:00 2001 From: lite3 Date: Tue, 12 Aug 2014 17:19:52 +0800 Subject: [PATCH 02/45] add GUIReader::registerTypeAndCallBack for std::function --- cocos/base/ObjectFactory.cpp | 23 +++++++++++++++++-- cocos/base/ObjectFactory.h | 3 +++ .../cocostudio/CCSGUIReader.cpp | 21 +++++++++++++++++ .../editor-support/cocostudio/CCSGUIReader.h | 5 ++++ 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/cocos/base/ObjectFactory.cpp b/cocos/base/ObjectFactory.cpp index 3179b5f1f6..9612b2ab57 100644 --- a/cocos/base/ObjectFactory.cpp +++ b/cocos/base/ObjectFactory.cpp @@ -23,6 +23,7 @@ THE SOFTWARE. ****************************************************************************/ #include "ObjectFactory.h" +#include NS_CC_BEGIN @@ -30,12 +31,22 @@ NS_CC_BEGIN ObjectFactory::TInfo::TInfo(void) :_class("") ,_fun(nullptr) +,_func(nullptr) { } ObjectFactory::TInfo::TInfo(const std::string& type, Instance ins) :_class(type) ,_fun(ins) +,_func(nullptr) +{ + ObjectFactory::getInstance()->registerType(*this); +} + +ObjectFactory::TInfo::TInfo(const std::string& type, InstanceFunc ins) + :_class(type) + ,_fun(nullptr) + ,_func(ins) { ObjectFactory::getInstance()->registerType(*this); } @@ -44,18 +55,21 @@ ObjectFactory::TInfo::TInfo(const TInfo &t) { _class = t._class; _fun = t._fun; + _func = t._func; } ObjectFactory::TInfo::~TInfo(void) { _class = ""; _fun = nullptr; + _func = nullptr; } ObjectFactory::TInfo& ObjectFactory::TInfo::operator= (const TInfo &t) { _class = t._class; _fun = t._fun; + _func = t._func; return *this; } @@ -92,8 +106,13 @@ Ref* ObjectFactory::createObject(const std::string &name) do { const TInfo t = _typeMap[name]; - CC_BREAK_IF(t._fun == nullptr); - o = t._fun(); + if (t._fun != nullptr) + { + o = t._fun(); + }else if (t._func != nullptr) + { + o = t._func(); + } } while (0); return o; diff --git a/cocos/base/ObjectFactory.h b/cocos/base/ObjectFactory.h index 658fc65352..ce74615d61 100644 --- a/cocos/base/ObjectFactory.h +++ b/cocos/base/ObjectFactory.h @@ -36,15 +36,18 @@ class CC_DLL ObjectFactory { public: typedef cocos2d::Ref* (*Instance)(void); + typedef std::function InstanceFunc; struct CC_DLL TInfo { TInfo(void); TInfo(const std::string& type, Instance ins = NULL); + TInfo(const std::string& type, InstanceFunc ins = NULL); TInfo(const TInfo &t); ~TInfo(void); TInfo& operator= (const TInfo &t); std::string _class; Instance _fun; + InstanceFunc _func; }; typedef std::unordered_map FactoryMap; diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.cpp b/cocos/editor-support/cocostudio/CCSGUIReader.cpp index 61c9b86ca8..b766a39b67 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.cpp +++ b/cocos/editor-support/cocostudio/CCSGUIReader.cpp @@ -177,6 +177,27 @@ void GUIReader::registerTypeAndCallBack(const std::string& classType, } } +void GUIReader::registerTypeAndCallBack(const std::string& classType, + ObjectFactory::InstanceFunc ins, + Ref *object, + SEL_ParseEvent callBack) +{ + ObjectFactory* factoryCreate = ObjectFactory::getInstance(); + + ObjectFactory::TInfo t(classType, ins); + factoryCreate->registerType(t); + + if (object) + { + _mapObject.insert(ParseObjectMap::value_type(classType, object)); + } + + if (callBack) + { + _mapParseSelector.insert(ParseCallBackMap::value_type(classType, callBack)); + } +} + Widget* GUIReader::widgetFromJsonFile(const char *fileName) { diff --git a/cocos/editor-support/cocostudio/CCSGUIReader.h b/cocos/editor-support/cocostudio/CCSGUIReader.h index a4e6b880f3..12239ead66 100644 --- a/cocos/editor-support/cocostudio/CCSGUIReader.h +++ b/cocos/editor-support/cocostudio/CCSGUIReader.h @@ -72,6 +72,11 @@ public: cocos2d::ObjectFactory::Instance ins, Ref* object, SEL_ParseEvent callBack); + + void registerTypeAndCallBack(const std::string& classType, + cocos2d::ObjectFactory::InstanceFunc ins, + Ref* object, + SEL_ParseEvent callBack); protected: GUIReader(); ~GUIReader(); From fa83d63c5dcfa14f36884144d3116d079dd23c9f Mon Sep 17 00:00:00 2001 From: lite3 Date: Tue, 12 Aug 2014 17:35:18 +0800 Subject: [PATCH 03/45] replace NULL to nullptr fix compile error --- cocos/base/ObjectFactory.cpp | 2 +- cocos/base/ObjectFactory.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cocos/base/ObjectFactory.cpp b/cocos/base/ObjectFactory.cpp index 9612b2ab57..8baebbf4e9 100644 --- a/cocos/base/ObjectFactory.cpp +++ b/cocos/base/ObjectFactory.cpp @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#include "ObjectFactory.h" #include +#include "ObjectFactory.h" NS_CC_BEGIN diff --git a/cocos/base/ObjectFactory.h b/cocos/base/ObjectFactory.h index ce74615d61..c9342f2c9d 100644 --- a/cocos/base/ObjectFactory.h +++ b/cocos/base/ObjectFactory.h @@ -27,6 +27,7 @@ THE SOFTWARE. #include #include +#include #include "base/CCRef.h" #include "base/CCPlatformMacros.h" @@ -40,8 +41,8 @@ public: struct CC_DLL TInfo { TInfo(void); - TInfo(const std::string& type, Instance ins = NULL); - TInfo(const std::string& type, InstanceFunc ins = NULL); + TInfo(const std::string& type, Instance ins = nullptr); + TInfo(const std::string& type, InstanceFunc ins = nullptr); TInfo(const TInfo &t); ~TInfo(void); TInfo& operator= (const TInfo &t); From 8d1c422ac5ab63bac5a7ba09747b3f31351bc628 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 19 Aug 2014 10:28:24 +0800 Subject: [PATCH 04/45] merge extension EditBox to ui module --- build/cocos2d_libs.xcodeproj/project.pbxproj | 72 ++ build/cocos2d_tests.xcodeproj/project.pbxproj | 8 + cocos/platform/ios/CCEAGLView.mm | 3 +- cocos/ui/Android.mk | 4 +- cocos/ui/CocosGUI.h | 2 +- cocos/ui/UIEditBox/UIEditBox.cpp | 460 ++++++++++++ cocos/ui/UIEditBox/UIEditBox.h | 462 ++++++++++++ cocos/ui/UIEditBox/UIEditBoxImpl.h | 103 +++ cocos/ui/UIEditBox/UIEditBoxImplAndroid.cpp | 319 ++++++++ cocos/ui/UIEditBox/UIEditBoxImplAndroid.h | 112 +++ cocos/ui/UIEditBox/UIEditBoxImplIOS.h | 147 ++++ cocos/ui/UIEditBox/UIEditBoxImplIOS.mm | 678 ++++++++++++++++++ cocos/ui/UIEditBox/UIEditBoxImplMac.h | 136 ++++ cocos/ui/UIEditBox/UIEditBoxImplMac.mm | 524 ++++++++++++++ cocos/ui/UIEditBox/UIEditBoxImplNone.cpp | 18 + cocos/ui/UIEditBox/UIEditBoxImplWin.cpp | 302 ++++++++ cocos/ui/UIEditBox/UIEditBoxImplWin.h | 118 +++ cocos/ui/UIEditBox/UIEditBoxImplWp8.cpp | 307 ++++++++ cocos/ui/UIEditBox/UIEditBoxImplWp8.h | 88 +++ cocos/ui/proj.win32/Win32InputBox.cpp | 383 ++++++++++ cocos/ui/proj.win32/Win32InputBox.h | 106 +++ cocos/ui/proj.win32/libui.vcxproj | 7 + cocos/ui/proj.win32/libui.vcxproj.filters | 24 + cocos/ui/proj.wp8/libGUI.vcxproj | 5 + cocos/ui/proj.wp8/libGUI.vcxproj.filters | 15 + tests/cpp-tests/Android.mk | 1 + .../CocoStudioGUITest/CocosGUIScene.cpp | 13 +- .../CocoStudioGUITest/UIEditBoxTest.cpp | 137 ++++ .../UITest/CocoStudioGUITest/UIEditBoxTest.h | 52 ++ .../UITest/CocoStudioGUITest/UIScene.h | 2 +- .../CocoStudioGUITest/UISceneManager.cpp | 4 + .../UITest/CocoStudioGUITest/UISceneManager.h | 1 + tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 2 + .../proj.win32/cpp-tests.vcxproj.filters | 6 + .../cpp-testsComponent.vcxproj | 2 + .../cpp-testsComponent.vcxproj.filters | 6 + 36 files changed, 4623 insertions(+), 6 deletions(-) create mode 100644 cocos/ui/UIEditBox/UIEditBox.cpp create mode 100644 cocos/ui/UIEditBox/UIEditBox.h create mode 100644 cocos/ui/UIEditBox/UIEditBoxImpl.h create mode 100644 cocos/ui/UIEditBox/UIEditBoxImplAndroid.cpp create mode 100644 cocos/ui/UIEditBox/UIEditBoxImplAndroid.h create mode 100644 cocos/ui/UIEditBox/UIEditBoxImplIOS.h create mode 100644 cocos/ui/UIEditBox/UIEditBoxImplIOS.mm create mode 100644 cocos/ui/UIEditBox/UIEditBoxImplMac.h create mode 100644 cocos/ui/UIEditBox/UIEditBoxImplMac.mm create mode 100644 cocos/ui/UIEditBox/UIEditBoxImplNone.cpp create mode 100644 cocos/ui/UIEditBox/UIEditBoxImplWin.cpp create mode 100644 cocos/ui/UIEditBox/UIEditBoxImplWin.h create mode 100644 cocos/ui/UIEditBox/UIEditBoxImplWp8.cpp create mode 100644 cocos/ui/UIEditBox/UIEditBoxImplWp8.h create mode 100644 cocos/ui/proj.win32/Win32InputBox.cpp create mode 100644 cocos/ui/proj.win32/Win32InputBox.h create mode 100644 tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp create mode 100644 tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.h diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 497aa3862f..0225d99ce9 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -638,6 +638,24 @@ 1AD71EF5180E27CF00808F54 /* CCPhysicsSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71EEE180E27CF00808F54 /* CCPhysicsSprite.cpp */; }; 1AD71EF6180E27CF00808F54 /* CCPhysicsSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */; }; 1AD71EF7180E27CF00808F54 /* CCPhysicsSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EEF180E27CF00808F54 /* CCPhysicsSprite.h */; }; + 292CEFF619A18DF200E8E6A0 /* UIEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292CEFE819A18DF200E8E6A0 /* UIEditBox.cpp */; }; + 292CEFF719A18DF200E8E6A0 /* UIEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292CEFE819A18DF200E8E6A0 /* UIEditBox.cpp */; }; + 292CEFF819A18DF200E8E6A0 /* UIEditBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 292CEFE919A18DF200E8E6A0 /* UIEditBox.h */; }; + 292CEFF919A18DF200E8E6A0 /* UIEditBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 292CEFE919A18DF200E8E6A0 /* UIEditBox.h */; }; + 292CEFFA19A18DF200E8E6A0 /* UIEditBoxImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 292CEFEA19A18DF200E8E6A0 /* UIEditBoxImpl.h */; }; + 292CEFFB19A18DF200E8E6A0 /* UIEditBoxImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 292CEFEA19A18DF200E8E6A0 /* UIEditBoxImpl.h */; }; + 292CEFFE19A18DF200E8E6A0 /* UIEditBoxImplAndroid.h in Headers */ = {isa = PBXBuildFile; fileRef = 292CEFEC19A18DF200E8E6A0 /* UIEditBoxImplAndroid.h */; }; + 292CEFFF19A18DF200E8E6A0 /* UIEditBoxImplAndroid.h in Headers */ = {isa = PBXBuildFile; fileRef = 292CEFEC19A18DF200E8E6A0 /* UIEditBoxImplAndroid.h */; }; + 292CF00019A18DF200E8E6A0 /* UIEditBoxImplIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 292CEFED19A18DF200E8E6A0 /* UIEditBoxImplIOS.h */; }; + 292CF00119A18DF200E8E6A0 /* UIEditBoxImplIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 292CEFED19A18DF200E8E6A0 /* UIEditBoxImplIOS.h */; }; + 292CF00319A18DF200E8E6A0 /* UIEditBoxImplIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 292CEFEE19A18DF200E8E6A0 /* UIEditBoxImplIOS.mm */; }; + 292CF00419A18DF200E8E6A0 /* UIEditBoxImplMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 292CEFEF19A18DF200E8E6A0 /* UIEditBoxImplMac.h */; }; + 292CF00519A18DF200E8E6A0 /* UIEditBoxImplMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 292CEFEF19A18DF200E8E6A0 /* UIEditBoxImplMac.h */; }; + 292CF00619A18DF200E8E6A0 /* UIEditBoxImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 292CEFF019A18DF200E8E6A0 /* UIEditBoxImplMac.mm */; }; + 292CF00C19A18DF200E8E6A0 /* UIEditBoxImplWin.h in Headers */ = {isa = PBXBuildFile; fileRef = 292CEFF319A18DF200E8E6A0 /* UIEditBoxImplWin.h */; }; + 292CF00D19A18DF200E8E6A0 /* UIEditBoxImplWin.h in Headers */ = {isa = PBXBuildFile; fileRef = 292CEFF319A18DF200E8E6A0 /* UIEditBoxImplWin.h */; }; + 292CF01019A18DF200E8E6A0 /* UIEditBoxImplWp8.h in Headers */ = {isa = PBXBuildFile; fileRef = 292CEFF519A18DF200E8E6A0 /* UIEditBoxImplWp8.h */; }; + 292CF01119A18DF200E8E6A0 /* UIEditBoxImplWp8.h in Headers */ = {isa = PBXBuildFile; fileRef = 292CEFF519A18DF200E8E6A0 /* UIEditBoxImplWp8.h */; }; 2958244B19873D8E00F9746D /* UIScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */; }; 2958244C19873D8E00F9746D /* UIScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */; }; 2958244D19873D8E00F9746D /* UIScale9Sprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 2958244A19873D8E00F9746D /* UIScale9Sprite.h */; }; @@ -2488,6 +2506,20 @@ 2905FA1318CF08D100240AA3 /* UIWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIWidget.cpp; sourceTree = ""; }; 2905FA1418CF08D100240AA3 /* UIWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidget.h; sourceTree = ""; }; 29080DEB191B82CE0066F8DF /* UIDeprecated.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIDeprecated.h; sourceTree = ""; }; + 292CEFE819A18DF200E8E6A0 /* UIEditBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIEditBox.cpp; sourceTree = ""; }; + 292CEFE919A18DF200E8E6A0 /* UIEditBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBox.h; sourceTree = ""; }; + 292CEFEA19A18DF200E8E6A0 /* UIEditBoxImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBoxImpl.h; sourceTree = ""; }; + 292CEFEB19A18DF200E8E6A0 /* UIEditBoxImplAndroid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIEditBoxImplAndroid.cpp; sourceTree = ""; }; + 292CEFEC19A18DF200E8E6A0 /* UIEditBoxImplAndroid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBoxImplAndroid.h; sourceTree = ""; }; + 292CEFED19A18DF200E8E6A0 /* UIEditBoxImplIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBoxImplIOS.h; sourceTree = ""; }; + 292CEFEE19A18DF200E8E6A0 /* UIEditBoxImplIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIEditBoxImplIOS.mm; sourceTree = ""; }; + 292CEFEF19A18DF200E8E6A0 /* UIEditBoxImplMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBoxImplMac.h; sourceTree = ""; }; + 292CEFF019A18DF200E8E6A0 /* UIEditBoxImplMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIEditBoxImplMac.mm; sourceTree = ""; }; + 292CEFF119A18DF200E8E6A0 /* UIEditBoxImplNone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIEditBoxImplNone.cpp; sourceTree = ""; }; + 292CEFF219A18DF200E8E6A0 /* UIEditBoxImplWin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIEditBoxImplWin.cpp; sourceTree = ""; }; + 292CEFF319A18DF200E8E6A0 /* UIEditBoxImplWin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBoxImplWin.h; sourceTree = ""; }; + 292CEFF419A18DF200E8E6A0 /* UIEditBoxImplWp8.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIEditBoxImplWp8.cpp; sourceTree = ""; }; + 292CEFF519A18DF200E8E6A0 /* UIEditBoxImplWp8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBoxImplWp8.h; sourceTree = ""; }; 2958244919873D8E00F9746D /* UIScale9Sprite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIScale9Sprite.cpp; sourceTree = ""; }; 2958244A19873D8E00F9746D /* UIScale9Sprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIScale9Sprite.h; sourceTree = ""; }; 2986667818B1B079000E39CA /* CCTweenFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCTweenFunction.cpp; sourceTree = ""; }; @@ -4371,6 +4403,7 @@ 2905F9E618CF08D000240AA3 /* ui */ = { isa = PBXGroup; children = ( + 292CEFE719A18DF200E8E6A0 /* UIEditBox */, 29CB8F531929D67D00C841D6 /* widgets */, 29CB8F521929D65500C841D6 /* experimental */, 29CB8F511929D64500C841D6 /* base */, @@ -4382,6 +4415,27 @@ path = ../cocos/ui; sourceTree = ""; }; + 292CEFE719A18DF200E8E6A0 /* UIEditBox */ = { + isa = PBXGroup; + children = ( + 292CEFE819A18DF200E8E6A0 /* UIEditBox.cpp */, + 292CEFE919A18DF200E8E6A0 /* UIEditBox.h */, + 292CEFEA19A18DF200E8E6A0 /* UIEditBoxImpl.h */, + 292CEFEB19A18DF200E8E6A0 /* UIEditBoxImplAndroid.cpp */, + 292CEFEC19A18DF200E8E6A0 /* UIEditBoxImplAndroid.h */, + 292CEFED19A18DF200E8E6A0 /* UIEditBoxImplIOS.h */, + 292CEFEE19A18DF200E8E6A0 /* UIEditBoxImplIOS.mm */, + 292CEFEF19A18DF200E8E6A0 /* UIEditBoxImplMac.h */, + 292CEFF019A18DF200E8E6A0 /* UIEditBoxImplMac.mm */, + 292CEFF119A18DF200E8E6A0 /* UIEditBoxImplNone.cpp */, + 292CEFF219A18DF200E8E6A0 /* UIEditBoxImplWin.cpp */, + 292CEFF319A18DF200E8E6A0 /* UIEditBoxImplWin.h */, + 292CEFF419A18DF200E8E6A0 /* UIEditBoxImplWp8.cpp */, + 292CEFF519A18DF200E8E6A0 /* UIEditBoxImplWp8.h */, + ); + path = UIEditBox; + sourceTree = ""; + }; 29CB8F501929D63600C841D6 /* layout */ = { isa = PBXGroup; children = ( @@ -6120,18 +6174,24 @@ files = ( B2DB4778197665BF00411E16 /* UIHelper.h in Headers */, B2DB478A1976664400411E16 /* UISlider.h in Headers */, + 292CF00019A18DF200E8E6A0 /* UIEditBoxImplIOS.h in Headers */, + 292CEFFA19A18DF200E8E6A0 /* UIEditBoxImpl.h in Headers */, B2DB47841976661A00411E16 /* UIImageView.h in Headers */, B2DB47881976663A00411E16 /* UIRichText.h in Headers */, B2DB47801976660200411E16 /* UIButton.h in Headers */, B2DB47821976660C00411E16 /* UICheckBox.h in Headers */, B2DB47861976662D00411E16 /* UILoadingBar.h in Headers */, + 292CEFF819A18DF200E8E6A0 /* UIEditBox.h in Headers */, B2DB47681976650A00411E16 /* UIWidget.h in Headers */, 2958244D19873D8E00F9746D /* UIScale9Sprite.h in Headers */, B2DB47691976651E00411E16 /* UIHBox.h in Headers */, + 292CF01019A18DF200E8E6A0 /* UIEditBoxImplWp8.h in Headers */, + 292CF00C19A18DF200E8E6A0 /* UIEditBoxImplWin.h in Headers */, B2DB478F1976666100411E16 /* UIText.h in Headers */, B2DB47901976666100411E16 /* UITextAtlas.h in Headers */, B2DB47911976666100411E16 /* UITextBMFont.h in Headers */, B2DB47921976666100411E16 /* UITextField.h in Headers */, + 292CEFFE19A18DF200E8E6A0 /* UIEditBoxImplAndroid.h in Headers */, B2DB476A1976653000411E16 /* UILayout.h in Headers */, B2DB477A197665D000411E16 /* UIListView.h in Headers */, B2DB477C197665DB00411E16 /* UIPageView.h in Headers */, @@ -6140,6 +6200,7 @@ B2DB476E1976655C00411E16 /* UILayoutParameter.h in Headers */, B2DB47701976657000411E16 /* UIRelativeBox.h in Headers */, B2DB47721976658000411E16 /* UIVBox.h in Headers */, + 292CF00419A18DF200E8E6A0 /* UIEditBoxImplMac.h in Headers */, B2DB47741976659800411E16 /* CocosGUI.h in Headers */, B2DB4776197665AA00411E16 /* UIDeprecated.h in Headers */, ); @@ -6152,14 +6213,18 @@ B2C59A3419777EB600B452DF /* UIListView.h in Headers */, B2C59A3519777EB600B452DF /* UILoadingBar.h in Headers */, B2C59A3619777EB600B452DF /* UIPageView.h in Headers */, + 292CF00119A18DF200E8E6A0 /* UIEditBoxImplIOS.h in Headers */, B2C59A3719777EB600B452DF /* UIRichText.h in Headers */, B2C59A3819777EB600B452DF /* UIScrollView.h in Headers */, B2C59A3919777EB600B452DF /* UISlider.h in Headers */, B2C59A3A19777EB600B452DF /* UIText.h in Headers */, + 292CF00519A18DF200E8E6A0 /* UIEditBoxImplMac.h in Headers */, B2C59A3B19777EB600B452DF /* UITextAtlas.h in Headers */, B2C59A3C19777EB600B452DF /* UITextBMFont.h in Headers */, + 292CEFFB19A18DF200E8E6A0 /* UIEditBoxImpl.h in Headers */, B2C59A3D19777EB600B452DF /* UITextField.h in Headers */, B2C59A3E19777EB600B452DF /* UIButton.h in Headers */, + 292CF01119A18DF200E8E6A0 /* UIEditBoxImplWp8.h in Headers */, B2C59A3F19777EB600B452DF /* UICheckBox.h in Headers */, B2C59A4019777EB600B452DF /* UIImageView.h in Headers */, B2C59A4119777EBC00B452DF /* UIVideoPlayer.h in Headers */, @@ -6167,10 +6232,13 @@ B2C59A4319777EC700B452DF /* UIWidget.h in Headers */, B2C59A4519777EC700B452DF /* UIHelper.h in Headers */, B2C59A4619777EC700B452DF /* GUIDefine.h in Headers */, + 292CEFF919A18DF200E8E6A0 /* UIEditBox.h in Headers */, B2C59A4719777ECF00B452DF /* UIHBox.h in Headers */, B2C59A4819777ECF00B452DF /* UIRelativeBox.h in Headers */, + 292CF00D19A18DF200E8E6A0 /* UIEditBoxImplWin.h in Headers */, B2C59A4919777ECF00B452DF /* UIVBox.h in Headers */, 2958244E19873D8E00F9746D /* UIScale9Sprite.h in Headers */, + 292CEFFF19A18DF200E8E6A0 /* UIEditBoxImplAndroid.h in Headers */, B2C59A4A19777ECF00B452DF /* UILayout.h in Headers */, B2C59A4B19777ECF00B452DF /* UILayoutParameter.h in Headers */, B2C59A4C19777ECF00B452DF /* UILayoutManager.h in Headers */, @@ -7598,10 +7666,12 @@ B2DB476F1976656D00411E16 /* UIRelativeBox.cpp in Sources */, B2DB47711976657A00411E16 /* UIVBox.cpp in Sources */, B2DB47731976658E00411E16 /* CocosGUI.cpp in Sources */, + 292CF00619A18DF200E8E6A0 /* UIEditBoxImplMac.mm in Sources */, B2DB4775197665A500411E16 /* UIDeprecated.cpp in Sources */, 2958244B19873D8E00F9746D /* UIScale9Sprite.cpp in Sources */, B2DB47891976664200411E16 /* UISlider.cpp in Sources */, B2DB4779197665CD00411E16 /* UIListView.cpp in Sources */, + 292CEFF619A18DF200E8E6A0 /* UIEditBox.cpp in Sources */, B2DB47851976662B00411E16 /* UILoadingBar.cpp in Sources */, B2DB478B1976665700411E16 /* UIText.cpp in Sources */, B2DB478C1976665700411E16 /* UITextAtlas.cpp in Sources */, @@ -7631,6 +7701,7 @@ B2C59A2419777E7500B452DF /* UITextBMFont.cpp in Sources */, B2C59A2519777E7500B452DF /* UITextField.cpp in Sources */, B2C59A2619777E7500B452DF /* UIButton.cpp in Sources */, + 292CF00319A18DF200E8E6A0 /* UIEditBoxImplIOS.mm in Sources */, B2C59ACB197782FF00B452DF /* UIVideoPlayerIOS.mm in Sources */, B2C59A2719777E7500B452DF /* UICheckBox.cpp in Sources */, B2C59A2819777E7500B452DF /* UIImageView.cpp in Sources */, @@ -7638,6 +7709,7 @@ B2C59A2B19777E8300B452DF /* UIWidget.cpp in Sources */, B2C59A2D19777E8300B452DF /* UIHelper.cpp in Sources */, B2C59A2E19777E8C00B452DF /* UIHBox.cpp in Sources */, + 292CEFF719A18DF200E8E6A0 /* UIEditBox.cpp in Sources */, B2C59A2F19777E8C00B452DF /* UIRelativeBox.cpp in Sources */, B2C59A3019777E8C00B452DF /* UIVBox.cpp in Sources */, B2C59A3119777E8C00B452DF /* UILayout.cpp in Sources */, diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index b75a2a309f..596da6fe3b 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -913,6 +913,8 @@ 29080DE6191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29080D8B191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.cpp */; }; 290E94B5196FC16900694919 /* CocostudioParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */; }; 290E94B6196FC16900694919 /* CocostudioParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */; }; + 292CF01419A1965E00E8E6A0 /* UIEditBoxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292CF01219A1965E00E8E6A0 /* UIEditBoxTest.cpp */; }; + 292CF01519A1965E00E8E6A0 /* UIEditBoxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292CF01219A1965E00E8E6A0 /* UIEditBoxTest.cpp */; }; 295824591987415900F9746D /* UIScale9SpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 295824571987415900F9746D /* UIScale9SpriteTest.cpp */; }; 2958245A1987415900F9746D /* UIScale9SpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 295824571987415900F9746D /* UIScale9SpriteTest.cpp */; }; 29FBBBFE196A9ECD00E65826 /* CocostudioParserJsonTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29FBBBFC196A9ECD00E65826 /* CocostudioParserJsonTest.cpp */; }; @@ -3677,6 +3679,8 @@ 29080D8C191B595E0066F8DF /* UIWidgetAddNodeTest_Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidgetAddNodeTest_Editor.h; sourceTree = ""; }; 290E94B3196FC16900694919 /* CocostudioParserTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CocostudioParserTest.cpp; path = ../CocostudioParserTest.cpp; sourceTree = ""; }; 290E94B4196FC16900694919 /* CocostudioParserTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CocostudioParserTest.h; path = ../CocostudioParserTest.h; sourceTree = ""; }; + 292CF01219A1965E00E8E6A0 /* UIEditBoxTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIEditBoxTest.cpp; sourceTree = ""; }; + 292CF01319A1965E00E8E6A0 /* UIEditBoxTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBoxTest.h; sourceTree = ""; }; 295824571987415900F9746D /* UIScale9SpriteTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIScale9SpriteTest.cpp; sourceTree = ""; }; 295824581987415900F9746D /* UIScale9SpriteTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIScale9SpriteTest.h; sourceTree = ""; }; 29FBBBFC196A9ECD00E65826 /* CocostudioParserJsonTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocostudioParserJsonTest.cpp; sourceTree = ""; }; @@ -7864,6 +7868,8 @@ children = ( 295824571987415900F9746D /* UIScale9SpriteTest.cpp */, 295824581987415900F9746D /* UIScale9SpriteTest.h */, + 292CF01219A1965E00E8E6A0 /* UIEditBoxTest.cpp */, + 292CF01319A1965E00E8E6A0 /* UIEditBoxTest.h */, 29080D1F191B595E0066F8DF /* CocosGUIScene.cpp */, 29080D20191B595E0066F8DF /* CocosGUIScene.h */, 29080D37191B595E0066F8DF /* GUIEditorTest.cpp */, @@ -9237,6 +9243,7 @@ 1AC35B7D18CECF0C00F37B72 /* PlayerController.cpp in Sources */, 29080D9F191B595E0066F8DF /* CustomReader.cpp in Sources */, 1AC35BE718CECF0C00F37B72 /* CCControlScene.cpp in Sources */, + 292CF01419A1965E00E8E6A0 /* UIEditBoxTest.cpp in Sources */, 29080DBF191B595E0066F8DF /* UIPageViewTest_Editor.cpp in Sources */, 1AC35B5F18CECF0C00F37B72 /* DataVisitorTest.cpp in Sources */, 1AC35B5D18CECF0C00F37B72 /* CurrentLanguageTest.cpp in Sources */, @@ -9418,6 +9425,7 @@ 1AC35C0618CECF0C00F37B72 /* FontTest.cpp in Sources */, 1AC35C3818CECF0C00F37B72 /* PerformanceTest.cpp in Sources */, 1F33635018E37E840074764D /* RefPtrTest.cpp in Sources */, + 292CF01519A1965E00E8E6A0 /* UIEditBoxTest.cpp in Sources */, 1AC35B2818CECF0C00F37B72 /* ActionsTest.cpp in Sources */, 1AC35C4A18CECF0C00F37B72 /* ShaderTest.cpp in Sources */, 1AC35BFE18CECF0C00F37B72 /* Scale9SpriteTest.cpp in Sources */, diff --git a/cocos/platform/ios/CCEAGLView.mm b/cocos/platform/ios/CCEAGLView.mm index 3c5c1c7b37..87a02a566c 100644 --- a/cocos/platform/ios/CCEAGLView.mm +++ b/cocos/platform/ios/CCEAGLView.mm @@ -374,7 +374,8 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. for(UIView* view in subviews) { - if([view isKindOfClass:NSClassFromString(@"CCCustomUITextField")]) + if([view isKindOfClass:NSClassFromString(@"CCCustomUITextField")] || + [view isKindOfClass:NSClassFromString(@"UICustomUITextField")]) { if ([view isFirstResponder]) { diff --git a/cocos/ui/Android.mk b/cocos/ui/Android.mk index 40f4cb6a31..e63516d5a1 100644 --- a/cocos/ui/Android.mk +++ b/cocos/ui/Android.mk @@ -31,6 +31,8 @@ UIRelativeBox.cpp \ UIVideoPlayerAndroid.cpp \ UIDeprecated.cpp \ UIScale9Sprite.cpp \ +UIEditBox/UIEditBox.cpp \ +UIEditBox/UIEditBoxImplAndroid.cpp \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \ $(LOCAL_PATH)/../editor-support @@ -43,9 +45,7 @@ $(LOCAL_PATH)/../editor-support LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static -LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static include $(BUILD_STATIC_LIBRARY) -$(call import-module,extensions) $(call import-module,.) diff --git a/cocos/ui/CocosGUI.h b/cocos/ui/CocosGUI.h index 5fc08abefc..eea8bdfa4c 100644 --- a/cocos/ui/CocosGUI.h +++ b/cocos/ui/CocosGUI.h @@ -51,7 +51,7 @@ THE SOFTWARE. #include "ui/UIDeprecated.h" #include "ui/GUIExport.h" #include "ui/UIScale9Sprite.h" - +#include "ui/UIEditBox/UIEditBox.h" NS_CC_BEGIN namespace ui { diff --git a/cocos/ui/UIEditBox/UIEditBox.cpp b/cocos/ui/UIEditBox/UIEditBox.cpp new file mode 100644 index 0000000000..12723cdb6e --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBox.cpp @@ -0,0 +1,460 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2012 James Chen + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "UIEditBox.h" +#include "UIEditBoxImpl.h" + +NS_CC_BEGIN + +namespace ui { + +static const float CHECK_EDITBOX_POSITION_INTERVAL = 0.1f; + +EditBox::EditBox(void) +: _editBoxImpl(nullptr) +, _delegate(nullptr) +, _editBoxInputMode(EditBox::InputMode::SINGLE_LINE) +, _editBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS) +, _keyboardReturnType(KeyboardReturnType::DEFAULT) +, _fontSize(-1) +, _placeholderFontSize(-1) +, _colText(Color3B::WHITE) +, _colPlaceHolder(Color3B::GRAY) +, _maxLength(0) +, _adjustHeight(0.0f) +, _backgroundSprite(nullptr) +#if CC_ENABLE_SCRIPT_BINDING +, _scriptEditBoxHandler(0) +#endif +{ +} + +EditBox::~EditBox(void) +{ + CC_SAFE_DELETE(_editBoxImpl); +#if CC_ENABLE_SCRIPT_BINDING + unregisterScriptEditBoxHandler(); +#endif +} + + +void EditBox::touchDownAction(Ref *sender, TouchEventType controlEvent) +{ + if (controlEvent == Widget::TouchEventType::ENDED) { + _editBoxImpl->openKeyboard(); + } +} + +EditBox* EditBox::create(const Size& size, + const std::string& pNormal9SpriteBg, + TextureResType texType /*= TextureResType::LOCAL*/) +{ + EditBox* pRet = new EditBox(); + + if (pRet != nullptr && pRet->initWithSizeAndBackgroundSprite(size, pNormal9SpriteBg, texType)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_DELETE(pRet); + } + + return pRet; +} + +bool EditBox::initWithSizeAndBackgroundSprite(const Size& size, + const std::string& pNormal9SpriteBg, + TextureResType texType) +{ + if (Widget::init()) + { + _editBoxImpl = __createSystemEditBox(this); + _editBoxImpl->initWithSize(size); + _editBoxImpl->setInputMode(EditBox::InputMode::ANY); + + if (texType == Widget::TextureResType::LOCAL) + { + _backgroundSprite = Scale9Sprite::create(pNormal9SpriteBg); + } + else + { + _backgroundSprite = Scale9Sprite::createWithSpriteFrameName(pNormal9SpriteBg); + } + this->setContentSize(size); + this->setPosition(Vec2(0, 0)); + + _backgroundSprite->setPosition(Vec2(_contentSize.width/2, _contentSize.height/2)); + _backgroundSprite->setContentSize(size); + this->addProtectedChild(_backgroundSprite); + + this->setTouchEnabled(true); + + this->addTouchEventListener(CC_CALLBACK_2(EditBox::touchDownAction, this)); + + return true; + } + return false; +} + +void EditBox::setDelegate(EditBoxDelegate* pDelegate) +{ + _delegate = pDelegate; + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setDelegate(pDelegate); + } +} + +EditBoxDelegate* EditBox::getDelegate() +{ + return _delegate; +} + +void EditBox::setText(const char* pText) +{ + if (pText != nullptr) + { + _text = pText; + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setText(pText); + } + } +} + +const char* EditBox::getText(void) +{ + if (_editBoxImpl != nullptr) + { + const char* pText = _editBoxImpl->getText(); + if(pText != nullptr) + return pText; + } + + return ""; +} + +void EditBox::setFont(const char* pFontName, int fontSize) +{ + _fontName = pFontName; + _fontSize = fontSize; + if (pFontName != nullptr) + { + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setFont(pFontName, fontSize); + } + } +} + +void EditBox::setFontName(const char* pFontName) +{ + _fontName = pFontName; + if (_editBoxImpl != nullptr && _fontSize != -1) + { + _editBoxImpl->setFont(pFontName, _fontSize); + } +} + +void EditBox::setFontSize(int fontSize) +{ + _fontSize = fontSize; + if (_editBoxImpl != nullptr && _fontName.length() > 0) + { + _editBoxImpl->setFont(_fontName.c_str(), _fontSize); + } +} + +void EditBox::setFontColor(const Color3B& color) +{ + _colText = color; + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setFontColor(color); + } +} + +void EditBox::setPlaceholderFont(const char* pFontName, int fontSize) +{ + _placeholderFontName = pFontName; + _placeholderFontSize = fontSize; + if (pFontName != nullptr) + { + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setPlaceholderFont(pFontName, fontSize); + } + } +} + +void EditBox::setPlaceholderFontName(const char* pFontName) +{ + _placeholderFontName = pFontName; + if (_editBoxImpl != nullptr && _placeholderFontSize != -1) + { + _editBoxImpl->setPlaceholderFont(pFontName, _fontSize); + } +} + +void EditBox::setPlaceholderFontSize(int fontSize) +{ + _placeholderFontSize = fontSize; + if (_editBoxImpl != nullptr && _placeholderFontName.length() > 0) + { + _editBoxImpl->setPlaceholderFont(_placeholderFontName.c_str(), _fontSize); + } +} + +void EditBox::setPlaceholderFontColor(const Color3B& color) +{ + _colText = color; + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setPlaceholderFontColor(color); + } +} + +void EditBox::setPlaceHolder(const char* pText) +{ + if (pText != nullptr) + { + _placeHolder = pText; + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setPlaceHolder(pText); + } + } +} + +const char* EditBox::getPlaceHolder(void) +{ + return _placeHolder.c_str(); +} + +void EditBox::setInputMode(EditBox::InputMode inputMode) +{ + _editBoxInputMode = inputMode; + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setInputMode(inputMode); + } +} + +void EditBox::setMaxLength(int maxLength) +{ + _maxLength = maxLength; + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setMaxLength(maxLength); + } +} + + +int EditBox::getMaxLength() +{ + return _maxLength; +} + +void EditBox::setInputFlag(EditBox::InputFlag inputFlag) +{ + _editBoxInputFlag = inputFlag; + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setInputFlag(inputFlag); + } +} + +void EditBox::setReturnType(EditBox::KeyboardReturnType returnType) +{ + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setReturnType(returnType); + } +} + +/* override function */ +void EditBox::setPosition(const Vec2& pos) +{ + Widget::setPosition(pos); + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setPosition(pos); + } +} + +void EditBox::setVisible(bool visible) +{ + Widget::setVisible(visible); + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setVisible(visible); + } +} + +void EditBox::setContentSize(const Size& size) +{ + Widget::setContentSize(size); + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setContentSize(size); + } +} + +void EditBox::adaptRenderers() +{ + if (_contentSizeDirty) + { + _backgroundSprite->setContentSize(_contentSize); + _backgroundSprite->setPosition(Vec2(_contentSize.width/2, _contentSize.height/2)); + } +} + +void EditBox::setAnchorPoint(const Vec2& anchorPoint) +{ + Widget::setAnchorPoint(anchorPoint); + if (_editBoxImpl != nullptr) + { + _editBoxImpl->setAnchorPoint(anchorPoint); + } +} + +void EditBox::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) +{ + Widget::visit(renderer, parentTransform, parentFlags); + if (_editBoxImpl != nullptr) + { + _editBoxImpl->visit(); + } +} + +void EditBox::onEnter(void) +{ +#if CC_ENABLE_SCRIPT_BINDING + if (_scriptType == kScriptTypeJavascript) + { + if (ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnEnter)) + return; + } +#endif + + Widget::onEnter(); + if (_editBoxImpl != nullptr) + { + _editBoxImpl->onEnter(); + } +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) + this->schedule(schedule_selector(EditBox::updatePosition), CHECK_EDITBOX_POSITION_INTERVAL); +#endif +} + +void EditBox::updatePosition(float dt) +{ + if (nullptr != _editBoxImpl) { + _editBoxImpl->updatePosition(dt); + } +} + + +void EditBox::onExit(void) +{ + Widget::onExit(); + if (_editBoxImpl != nullptr) + { + // remove system edit control + _editBoxImpl->closeKeyboard(); + } +} + +static Rect getRect(Node * pNode) +{ + Size contentSize = pNode->getContentSize(); + Rect rect = Rect(0, 0, contentSize.width, contentSize.height); + return RectApplyTransform(rect, pNode->getNodeToWorldTransform()); +} + +void EditBox::keyboardWillShow(IMEKeyboardNotificationInfo& info) +{ + // CCLOG("CCEditBox::keyboardWillShow"); + Rect rectTracked = getRect(this); + // some adjustment for margin between the keyboard and the edit box. + rectTracked.origin.y -= 4; + + // if the keyboard area doesn't intersect with the tracking node area, nothing needs to be done. + if (!rectTracked.intersectsRect(info.end)) + { + CCLOG("needn't to adjust view layout."); + return; + } + + // assume keyboard at the bottom of screen, calculate the vertical adjustment. + _adjustHeight = info.end.getMaxY() - rectTracked.getMinY(); + // CCLOG("CCEditBox:needAdjustVerticalPosition(%f)", _adjustHeight); + + if (_editBoxImpl != nullptr) + { + _editBoxImpl->doAnimationWhenKeyboardMove(info.duration, _adjustHeight); + } +} + +void EditBox::keyboardDidShow(IMEKeyboardNotificationInfo& info) +{ + +} + +void EditBox::keyboardWillHide(IMEKeyboardNotificationInfo& info) +{ + // CCLOG("CCEditBox::keyboardWillHide"); + if (_editBoxImpl != nullptr) + { + _editBoxImpl->doAnimationWhenKeyboardMove(info.duration, -_adjustHeight); + } +} + +void EditBox::keyboardDidHide(IMEKeyboardNotificationInfo& info) +{ + +} + +#if CC_ENABLE_SCRIPT_BINDING +void EditBox::registerScriptEditBoxHandler(int handler) +{ + unregisterScriptEditBoxHandler(); + _scriptEditBoxHandler = handler; +} + +void EditBox::unregisterScriptEditBoxHandler(void) +{ + if (0 != _scriptEditBoxHandler) + { + ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_scriptEditBoxHandler); + _scriptEditBoxHandler = 0; + } +} +#endif + +} + +NS_CC_END diff --git a/cocos/ui/UIEditBox/UIEditBox.h b/cocos/ui/UIEditBox/UIEditBox.h new file mode 100644 index 0000000000..335193fee8 --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBox.h @@ -0,0 +1,462 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2012 James Chen + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __UIEDITTEXT_H__ +#define __UIEDITTEXT_H__ + +#include "base/CCIMEDelegate.h" +#include "ui/GUIDefine.h" +#include "ui/UIButton.h" +#include "ui/UIScale9Sprite.h" + +NS_CC_BEGIN + +namespace ui { + + class EditBox; + class EditBoxImpl; + + + class CC_GUI_DLL EditBoxDelegate + { + public: + /** + * @js NA + * @lua NA + */ + virtual ~EditBoxDelegate() {}; + + /** + * This method is called when an edit box gains focus after keyboard is shown. + * @param editBox The edit box object that generated the event. + * @js NA + * @lua NA + */ + virtual void editBoxEditingDidBegin(EditBox* editBox) {}; + + + /** + * This method is called when an edit box loses focus after keyboard is hidden. + * @param editBox The edit box object that generated the event. + * @js NA + * @lua NA + */ + virtual void editBoxEditingDidEnd(EditBox* editBox) {}; + + /** + * This method is called when the edit box text was changed. + * @param editBox The edit box object that generated the event. + * @param text The new text. + * @js NA + * @lua NA + */ + virtual void editBoxTextChanged(EditBox* editBox, const std::string& text) {}; + + /** + * This method is called when the return button was pressed or the outside area of keyboard was touched. + * @param editBox The edit box object that generated the event. + * @js NA + * @lua NA + */ + virtual void editBoxReturn(EditBox* editBox) = 0; + + }; + + /** + * \brief Class for edit box. + * + * You can use this widget to gather small amounts of text from the user. + * + */ + + class CC_GUI_DLL EditBox + : public Widget + , public IMEDelegate + { + public: + enum class KeyboardReturnType + { + DEFAULT, + DONE, + SEND, + SEARCH, + GO + }; + + /** + * \brief The EditBox::InputMode defines the type of text that the user is allowed + * to enter. + */ + enum class InputMode + { + /** + * The user is allowed to enter any text, including line breaks. + */ + ANY, + + /** + * The user is allowed to enter an e-mail address. + */ + EMAIL_ADDRESS, + + /** + * The user is allowed to enter an integer value. + */ + NUMERIC, + + /** + * The user is allowed to enter a phone number. + */ + PHONE_NUMBER, + + /** + * The user is allowed to enter a URL. + */ + URL, + + /** + * The user is allowed to enter a real number value. + * This extends kEditBoxInputModeNumeric by allowing a decimal point. + */ + DECIMAL, + + /** + * The user is allowed to enter any text, except for line breaks. + */ + SINGLE_LINE, + }; + + /** + * \brief The EditBox::InputFlag defines how the input text is displayed/formatted. + */ + enum class InputFlag + { + /** + * Indicates that the text entered is confidential data that should be + * obscured whenever possible. This implies EDIT_BOX_INPUT_FLAG_SENSITIVE. + */ + PASSWORD, + + /** + * Indicates that the text entered is sensitive data that the + * implementation must never store into a dictionary or table for use + * in predictive, auto-completing, or other accelerated input schemes. + * A credit card number is an example of sensitive data. + */ + SENSITIVE, + + /** + * This flag is a hint to the implementation that during text editing, + * the initial letter of each word should be capitalized. + */ + INITIAL_CAPS_WORD, + + /** + * This flag is a hint to the implementation that during text editing, + * the initial letter of each sentence should be capitalized. + */ + INITIAL_CAPS_SENTENCE, + + /** + * Capitalize all characters automatically. + */ + INTIAL_CAPS_ALL_CHARACTERS, + }; + + /** + * create a edit box with size. + * @return An autorelease pointer of EditBox, you don't need to release it only if you retain it again. + */ + static EditBox* create(const Size& size, + const std::string& pNormal9SpriteBg, + TextureResType texType = TextureResType::LOCAL); + + /** + * Constructor. + * @js ctor + */ + EditBox(void); + + /** + * Destructor. + * @js NA + * @lua NA + */ + virtual ~EditBox(void); + + /** + * Init edit box with specified size. This method should be invoked right after constructor. + * @param size The size of edit box. + */ + bool initWithSizeAndBackgroundSprite(const Size& size, + const std::string& pNormal9SpriteBg, + TextureResType texType = TextureResType::LOCAL); + + /** + * Gets/Sets the delegate for edit box. + * @lua NA + */ + void setDelegate(EditBoxDelegate* pDelegate); + /** + * @js NA + * @lua NA + */ + EditBoxDelegate* getDelegate(); + +#if CC_ENABLE_SCRIPT_BINDING + /** + * Registers a script function that will be called for EditBox events. + * + * This handler will be removed automatically after onExit() called. + * @code + * -- lua sample + * local function editboxEventHandler(eventType) + * if eventType == "began" then + * -- triggered when an edit box gains focus after keyboard is shown + * elseif eventType == "ended" then + * -- triggered when an edit box loses focus after keyboard is hidden. + * elseif eventType == "changed" then + * -- triggered when the edit box text was changed. + * elseif eventType == "return" then + * -- triggered when the return button was pressed or the outside area of keyboard was touched. + * end + * end + * + * local editbox = EditBox:create(Size(...), Scale9Sprite:create(...)) + * editbox = registerScriptEditBoxHandler(editboxEventHandler) + * @endcode + * + * @param handler A number that indicates a lua function. + * @js NA + * @lua NA + */ + void registerScriptEditBoxHandler(int handler); + + /** + * Unregisters a script function that will be called for EditBox events. + * @js NA + * @lua NA + */ + void unregisterScriptEditBoxHandler(void); + /** + * get a script Handler + * @js NA + * @lua NA + */ + int getScriptEditBoxHandler(void){ return _scriptEditBoxHandler ;} + +#endif // #if CC_ENABLE_SCRIPT_BINDING + + /** + * Set the text entered in the edit box. + * @param pText The given text. + */ + void setText(const char* pText); + + /** + * Get the text entered in the edit box. + * @return The text entered in the edit box. + */ + const char* getText(void); + + /** + * Set the font. + * @param pFontName The font name. + * @param fontSize The font size. + */ + void setFont(const char* pFontName, int fontSize); + + /** + * Set the font name. + * @param pFontName The font name. + */ + void setFontName(const char* pFontName); + + /** + * Set the font size. + * @param fontSize The font size. + */ + void setFontSize(int fontSize); + + /** + * Set the font color of the widget's text. + */ + void setFontColor(const Color3B& color); + + /** + * Set the placeholder's font. + * @param pFontName The font name. + * @param fontSize The font size. + */ + void setPlaceholderFont(const char* pFontName, int fontSize); + + /** + * Set the placeholder's font name. + * @param pFontName The font name. + */ + void setPlaceholderFontName(const char* pFontName); + + /** + * Set the placeholder's font size. + * @param fontSize The font size. + */ + void setPlaceholderFontSize(int fontSize); + + /** + * Set the font color of the placeholder text when the edit box is empty. + * Not supported on IOS. + */ + void setPlaceholderFontColor(const Color3B& color); + + /** + * Set a text in the edit box that acts as a placeholder when an + * edit box is empty. + * @param pText The given text. + */ + void setPlaceHolder(const char* pText); + + /** + * Get a text in the edit box that acts as a placeholder when an + * edit box is empty. + */ + const char* getPlaceHolder(void); + + /** + * Set the input mode of the edit box. + * @param inputMode One of the EditBox::InputMode constants. + */ + void setInputMode(InputMode inputMode); + + /** + * Sets the maximum input length of the edit box. + * Setting this value enables multiline input mode by default. + * Available on Android, iOS and Windows Phone. + * + * @param maxLength The maximum length. + */ + void setMaxLength(int maxLength); + + /** + * Gets the maximum input length of the edit box. + * + * @return Maximum input length. + */ + int getMaxLength(); + + /** + * Set the input flags that are to be applied to the edit box. + * @param inputFlag One of the EditBox::InputFlag constants. + */ + void setInputFlag(InputFlag inputFlag); + + /** + * Set the return type that are to be applied to the edit box. + * @param returnType One of the EditBox::KeyboardReturnType constants. + */ + void setReturnType(EditBox::KeyboardReturnType returnType); + + /* override functions */ + virtual void setPosition(const Vec2& pos) override; + virtual void setVisible(bool visible) override; + virtual void setContentSize(const Size& size) override; + virtual void setAnchorPoint(const Vec2& anchorPoint) override; + /** + * @js NA + * @lua NA + */ + virtual void visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override; + /** + * @js NA + * @lua NA + */ + virtual void onEnter(void) override; + /** + * @js NA + * @lua NA + */ + virtual void onExit(void) override; + /** + * @js NA + * @lua NA + */ + virtual void keyboardWillShow(IMEKeyboardNotificationInfo& info) override; + /** + * @js NA + * @lua NA + */ + virtual void keyboardDidShow(IMEKeyboardNotificationInfo& info) override; + /** + * @js NA + * @lua NA + */ + virtual void keyboardWillHide(IMEKeyboardNotificationInfo& info) override; + /** + * @js NA + * @lua NA + */ + virtual void keyboardDidHide(IMEKeyboardNotificationInfo& info) override; + + /* callback funtions + * @js NA + * @lua NA + */ + void touchDownAction(Ref *sender, TouchEventType controlEvent); + + protected: + virtual void adaptRenderers(); + + void updatePosition(float dt); + EditBoxImpl* _editBoxImpl; + EditBoxDelegate* _delegate; + + InputMode _editBoxInputMode; + InputFlag _editBoxInputFlag; + EditBox::KeyboardReturnType _keyboardReturnType; + + Scale9Sprite *_backgroundSprite; + std::string _text; + std::string _placeHolder; + + std::string _fontName; + std::string _placeholderFontName; + + int _fontSize; + int _placeholderFontSize; + + Color3B _colText; + Color3B _colPlaceHolder; + + int _maxLength; + float _adjustHeight; +#if CC_ENABLE_SCRIPT_BINDING + int _scriptEditBoxHandler; +#endif + }; +} + +NS_CC_END + +#endif /* __UIEDITTEXT_H__ */ + diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl.h b/cocos/ui/UIEditBox/UIEditBoxImpl.h new file mode 100644 index 0000000000..8413b62bae --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImpl.h @@ -0,0 +1,103 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2012 James Chen + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __UIEditBoxIMPL_H__ +#define __UIEditBoxIMPL_H__ + +#include "UIEditBox.h" + + +namespace cocos2d { + namespace ui{ + + class CC_GUI_DLL EditBoxImpl + { + public: + /** + * @js NA + */ + EditBoxImpl(EditBox* pEditBox) : _delegate(nullptr),_editBox(pEditBox) {} + /** + * @js NA + * @lua NA + */ + virtual ~EditBoxImpl() {} + + virtual bool initWithSize(const Size& size) = 0; + virtual void setFont(const char* pFontName, int fontSize) = 0; + virtual void setFontColor(const Color3B& color) = 0; + virtual void setPlaceholderFont(const char* pFontName, int fontSize) = 0; + virtual void setPlaceholderFontColor(const Color3B& color) = 0; + virtual void setInputMode(EditBox::InputMode inputMode) = 0; + virtual void setInputFlag(EditBox::InputFlag inputFlag) = 0; + virtual void setMaxLength(int maxLength) = 0; + virtual int getMaxLength() = 0; + virtual void setReturnType(EditBox::KeyboardReturnType returnType) = 0; + virtual bool isEditing() = 0; + + virtual void setText(const char* pText) = 0; + virtual const char* getText(void) = 0; + virtual void setPlaceHolder(const char* pText) = 0; + virtual void doAnimationWhenKeyboardMove(float duration, float distance) = 0; + + virtual void openKeyboard() = 0; + virtual void closeKeyboard() = 0; + + virtual void setPosition(const Vec2& pos) = 0; + virtual void setVisible(bool visible) = 0; + virtual void setContentSize(const Size& size) = 0; + virtual void setAnchorPoint(const Vec2& anchorPoint) = 0; + + /** + * check the editbox's position, update it when needed + */ + virtual void updatePosition(float dt){}; + /** + * @js NA + * @lua NA + */ + virtual void visit(void) = 0; + /** + * @js NA + * @lua NA + */ + virtual void onEnter(void) = 0; + + + void setDelegate(EditBoxDelegate* pDelegate) { _delegate = pDelegate; }; + EditBoxDelegate* getDelegate() { return _delegate; }; + EditBox* getEditBox() { return _editBox; }; + protected: + EditBoxDelegate* _delegate; + EditBox* _editBox; + }; + + // This method must be implemented at each subclass of EditBoxImpl. + extern EditBoxImpl* __createSystemEditBox(EditBox* pEditBox); + + } +} + +#endif /* __UIEditBoxIMPL_H__ */ diff --git a/cocos/ui/UIEditBox/UIEditBoxImplAndroid.cpp b/cocos/ui/UIEditBox/UIEditBoxImplAndroid.cpp new file mode 100644 index 0000000000..62251e235f --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImplAndroid.cpp @@ -0,0 +1,319 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2012 James Chen + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "UIEditBoxImplAndroid.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + +#include "UIEditBox.h" +#include "jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h" +#include "jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" + + +NS_CC_BEGIN + +namespace ui { + +EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) +{ + return new EditBoxImplAndroid(pEditBox); +} + +EditBoxImplAndroid::EditBoxImplAndroid(EditBox* pEditText) +: EditBoxImpl(pEditText) +, _label(nullptr) +, _labelPlaceHolder(nullptr) +, _editBoxInputMode(EditBox::InputMode::SINGLE_LINE) +, _editBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS) +, _keyboardReturnType(EditBox::KeyboardReturnType::DEFAULT) +, _colText(Color3B::WHITE) +, _colPlaceHolder(Color3B::GRAY) +, _maxLength(-1) +{ + +} + +EditBoxImplAndroid::~EditBoxImplAndroid() +{ + +} + +void EditBoxImplAndroid::doAnimationWhenKeyboardMove(float duration, float distance) +{ // don't need to be implemented on android platform. + +} + +static const int CC_EDIT_BOX_PADDING = 5; + +bool EditBoxImplAndroid::initWithSize(const Size& size) +{ + int fontSize = getFontSizeAccordingHeightJni(size.height-12); + _label = Label::create(); + _label->setSystemFontSize(size.height-12); + // align the text vertically center + _label->setAnchorPoint(Vec2(0, 0.5f)); + _label->setPosition(Vec2(CC_EDIT_BOX_PADDING, size.height / 2.0f)); + _label->setColor(_colText); + _editBox->addChild(_label); + + _labelPlaceHolder = Label::create(); + _labelPlaceHolder->setSystemFontSize(size.height-12); + // align the text vertically center + _labelPlaceHolder->setAnchorPoint(Vec2(0, 0.5f)); + _labelPlaceHolder->setPosition(Vec2(CC_EDIT_BOX_PADDING, size.height / 2.0f)); + _labelPlaceHolder->setVisible(false); + _labelPlaceHolder->setColor(_colPlaceHolder); + _editBox->addChild(_labelPlaceHolder); + + _editSize = size; + return true; +} + +void EditBoxImplAndroid::setFont(const char* pFontName, int fontSize) +{ + if(_label != NULL) { + _label->setSystemFontName(pFontName); + _label->setSystemFontSize(fontSize); + } + + if(_labelPlaceHolder != NULL) { + _labelPlaceHolder->setSystemFontName(pFontName); + _labelPlaceHolder->setSystemFontSize(fontSize); + } +} + +void EditBoxImplAndroid::setFontColor(const Color3B& color) +{ + _colText = color; + _label->setColor(color); +} + +void EditBoxImplAndroid::setPlaceholderFont(const char* pFontName, int fontSize) +{ + if(_labelPlaceHolder != NULL) { + _labelPlaceHolder->setSystemFontName(pFontName); + _labelPlaceHolder->setSystemFontSize(fontSize); + } +} + +void EditBoxImplAndroid::setPlaceholderFontColor(const Color3B& color) +{ + _colPlaceHolder = color; + _labelPlaceHolder->setColor(color); +} + +void EditBoxImplAndroid::setInputMode(EditBox::InputMode inputMode) +{ + _editBoxInputMode = inputMode; +} + +void EditBoxImplAndroid::setMaxLength(int maxLength) +{ + _maxLength = maxLength; +} + +int EditBoxImplAndroid::getMaxLength() +{ + return _maxLength; +} + +void EditBoxImplAndroid::setInputFlag(EditBox::InputFlag inputFlag) +{ + _editBoxInputFlag = inputFlag; +} + +void EditBoxImplAndroid::setReturnType(EditBox::KeyboardReturnType returnType) +{ + _keyboardReturnType = returnType; +} + +bool EditBoxImplAndroid::isEditing() +{ + return false; +} + +void EditBoxImplAndroid::setText(const char* pText) +{ + if (pText != NULL) + { + _text = pText; + + if (_text.length() > 0) + { + _labelPlaceHolder->setVisible(false); + + std::string strToShow; + + if (EditBox::InputFlag::PASSWORD == _editBoxInputFlag) + { + long length = cc_utf8_strlen(_text.c_str(), -1); + for (long i = 0; i < length; i++) + { + strToShow.append("*"); + } + } + else + { + strToShow = _text; + } + + _label->setString(strToShow.c_str()); + + // Clip the text width to fit to the text box + + float fMaxWidth = _editSize.width - CC_EDIT_BOX_PADDING * 2; + auto labelSize = _label->getContentSize(); + if(labelSize.width > fMaxWidth) { + _label->setDimensions(fMaxWidth,labelSize.height); + } + } + else + { + _labelPlaceHolder->setVisible(true); + _label->setString(""); + } + + } +} + +const char* EditBoxImplAndroid::getText(void) +{ + return _text.c_str(); +} + +void EditBoxImplAndroid::setPlaceHolder(const char* pText) +{ + if (pText != NULL) + { + _placeHolder = pText; + if (_placeHolder.length() > 0 && _text.length() == 0) + { + _labelPlaceHolder->setVisible(true); + } + + _labelPlaceHolder->setString(_placeHolder.c_str()); + } +} + +void EditBoxImplAndroid::setPosition(const Vec2& pos) +{ // don't need to be implemented on android platform. + +} + +void EditBoxImplAndroid::setVisible(bool visible) +{ // don't need to be implemented on android platform. + +} + +void EditBoxImplAndroid::setContentSize(const Size& size) +{ // don't need to be implemented on android platform. + +} + +void EditBoxImplAndroid::setAnchorPoint(const Vec2& anchorPoint) +{ // don't need to be implemented on android platform. + +} + +void EditBoxImplAndroid::visit(void) +{ // don't need to be implemented on android platform. + +} + +void EditBoxImplAndroid::onEnter(void) +{ // don't need to be implemented on android platform. + +} + +static void editBoxCallbackFunc(const char* pText, void* ctx) +{ + EditBoxImplAndroid* thiz = (EditBoxImplAndroid*)ctx; + thiz->setText(pText); + + if (thiz->getDelegate() != NULL) + { + thiz->getDelegate()->editBoxTextChanged(thiz->getEditBox(), thiz->getText()); + thiz->getDelegate()->editBoxEditingDidEnd(thiz->getEditBox()); + thiz->getDelegate()->editBoxReturn(thiz->getEditBox()); + } + +#if CC_ENABLE_SCRIPT_BINDING + EditBox* pEditBox = thiz->getEditBox(); + if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + { + CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "changed",pEditBox); + ScriptEvent event(kCommonEvent,(void*)&data); + ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + memset(data.eventName, 0, sizeof(data.eventName)); + strncpy(data.eventName, "ended", sizeof(data.eventName)); + event.data = (void*)&data; + ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + memset(data.eventName, 0, sizeof(data.eventName)); + strncpy(data.eventName, "return", sizeof(data.eventName)); + event.data = (void*)&data; + ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } +#endif +} + +void EditBoxImplAndroid::openKeyboard() +{ + if (_delegate != NULL) + { + _delegate->editBoxEditingDidBegin(_editBox); + } + +#if CC_ENABLE_SCRIPT_BINDING + EditBox* pEditBox = this->getEditBox(); + if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + { + CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); + ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); + ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } +#endif + + showEditTextDialogJNI( _placeHolder.c_str(), + _text.c_str(), + (int)_editBoxInputMode, + (int)_editBoxInputFlag, + (int)_keyboardReturnType, + _maxLength, + editBoxCallbackFunc, + (void*)this ); + +} + +void EditBoxImplAndroid::closeKeyboard() +{ + +} + +} + +NS_CC_END + +#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) */ + diff --git a/cocos/ui/UIEditBox/UIEditBoxImplAndroid.h b/cocos/ui/UIEditBox/UIEditBoxImplAndroid.h new file mode 100644 index 0000000000..2b38934752 --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImplAndroid.h @@ -0,0 +1,112 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2012 James Chen + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __UIEDITBOXIMPLANDROID_H__ +#define __UIEDITBOXIMPLANDROID_H__ + +#include "cocos2d.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) + +#include "UIEditBoxImpl.h" + +NS_CC_BEGIN + +namespace ui { + +class EditBox; + +class EditBoxImplAndroid : public EditBoxImpl +{ +public: + /** + * @js NA + */ + EditBoxImplAndroid(EditBox* pEditText); + /** + * @js NA + * @lua NA + */ + virtual ~EditBoxImplAndroid(); + + virtual bool initWithSize(const Size& size); + virtual void setFont(const char* pFontName, int fontSize); + virtual void setFontColor(const Color3B& color); + virtual void setPlaceholderFont(const char* pFontName, int fontSize); + virtual void setPlaceholderFontColor(const Color3B& color); + virtual void setInputMode(EditBox::InputMode inputMode); + virtual void setInputFlag(EditBox::InputFlag inputFlag); + virtual void setMaxLength(int maxLength); + virtual int getMaxLength(); + virtual void setReturnType(EditBox::KeyboardReturnType returnType); + virtual bool isEditing(); + + virtual void setText(const char* pText); + virtual const char* getText(void); + virtual void setPlaceHolder(const char* pText); + virtual void setPosition(const Vec2& pos); + virtual void setVisible(bool visible); + virtual void setContentSize(const Size& size); + virtual void setAnchorPoint(const Vec2& anchorPoint); + /** + * @js NA + * @lua NA + */ + virtual void visit(void); + /** + * @js NA + * @lua NA + */ + virtual void onEnter(void); + virtual void doAnimationWhenKeyboardMove(float duration, float distance); + virtual void openKeyboard(); + virtual void closeKeyboard(); + +private: + Label* _label; + Label* _labelPlaceHolder; + EditBox::InputMode _editBoxInputMode; + EditBox::InputFlag _editBoxInputFlag; + EditBox::KeyboardReturnType _keyboardReturnType; + + std::string _text; + std::string _placeHolder; + + Color3B _colText; + Color3B _colPlaceHolder; + + int _maxLength; + Size _editSize; +}; + + +} + +NS_CC_END + +#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) */ + +#endif /* __UIEDITBOXIMPLANDROID_H__ */ + diff --git a/cocos/ui/UIEditBox/UIEditBoxImplIOS.h b/cocos/ui/UIEditBox/UIEditBoxImplIOS.h new file mode 100644 index 0000000000..b78ce96da6 --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImplIOS.h @@ -0,0 +1,147 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2012 James Chen + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __UIEditBoxIMPLIOS_H__ +#define __UIEditBoxIMPLIOS_H__ + +#include "cocos2d.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + +#include "extensions/ExtensionMacros.h" +#include "UIEditBoxImpl.h" + +#import +#import + +@interface UICustomUITextField : UITextField +{ +} + +@end + + +@interface UIEditBoxImplIOS_objc : NSObject +{ + UICustomUITextField* textField_; + void* editBox_; + BOOL editState_; +} + +@property(nonatomic, retain) UITextField* textField; +@property(nonatomic, readonly, getter = isEditState) BOOL editState; +@property(nonatomic, assign) void* editBox; + +-(id) initWithFrame: (CGRect) frameRect editBox: (void*) editBox; +-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance; +-(void) setPosition:(CGPoint) pos; +-(void) setContentSize:(CGSize) size; +-(void) visit; +-(void) openKeyboard; +-(void) closeKeyboard; + +@end + +NS_CC_BEGIN + +namespace ui { + +class EditBox; + +class EditBoxImplIOS : public EditBoxImpl +{ +public: + /** + * @js NA + */ + EditBoxImplIOS(EditBox* pEditText); + /** + * @js NA + * @lua NA + */ + virtual ~EditBoxImplIOS(); + + virtual bool initWithSize(const Size& size); + virtual void setFont(const char* pFontName, int fontSize); + virtual void setFontColor(const Color3B& color); + virtual void setPlaceholderFont(const char* pFontName, int fontSize); + virtual void setPlaceholderFontColor(const Color3B& color); + virtual void setInputMode(EditBox::InputMode inputMode); + virtual void setInputFlag(EditBox::InputFlag inputFlag); + virtual void setMaxLength(int maxLength); + virtual int getMaxLength(); + virtual void setReturnType(EditBox::KeyboardReturnType returnType); + virtual bool isEditing(); + + virtual void setText(const char* pText); + virtual const char* getText(void); + virtual void refreshInactiveText(); + virtual void setPlaceHolder(const char* pText); + virtual void setPosition(const Vec2& pos); + virtual void setVisible(bool visible); + virtual void setContentSize(const Size& size); + virtual void setAnchorPoint(const Vec2& anchorPoint); + virtual void updatePosition(float dt) override; + /** + * @js NA + * @lua NA + */ + virtual void visit(void); + /** + * @js NA + * @lua NA + */ + virtual void onEnter(void); + virtual void doAnimationWhenKeyboardMove(float duration, float distance); + virtual void openKeyboard(); + virtual void closeKeyboard(); + + virtual void onEndEditing(); +private: + void initInactiveLabels(const Size& size); + void setInactiveText(const char* pText); + void adjustTextFieldPosition(); + void placeInactiveLabels(); + + Label* _label; + Label* _labelPlaceHolder; + Size _contentSize; + Vec2 _position; + Vec2 _anchorPoint; + UIEditBoxImplIOS_objc* _systemControl; + int _maxTextLength; + bool _inRetinaMode; +}; + + +} + +NS_CC_END + + +#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */ + +#endif /* __UIEditBoxIMPLIOS_H__ */ + diff --git a/cocos/ui/UIEditBox/UIEditBoxImplIOS.mm b/cocos/ui/UIEditBox/UIEditBoxImplIOS.mm new file mode 100644 index 0000000000..44a5b1a33e --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImplIOS.mm @@ -0,0 +1,678 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2012 James Chen + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ +#include "UIEditBoxImplIOS.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + +#define kLabelZOrder 9999 + +#include "UIEditBox.h" +#import "CCEAGLView.h" + +#define getEditBoxImplIOS() ((cocos2d::ui::EditBoxImplIOS*)editBox_) + +static const int CC_EDIT_BOX_PADDING = 5; + +@implementation UICustomUITextField +- (CGRect)textRectForBounds:(CGRect)bounds +{ + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + + float padding = CC_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); + return CGRectMake(bounds.origin.x + padding, bounds.origin.y + padding, + bounds.size.width - padding*2, bounds.size.height - padding*2); +} +- (CGRect)editingRectForBounds:(CGRect)bounds { + return [self textRectForBounds:bounds]; +} +@end + + +@implementation UIEditBoxImplIOS_objc + +@synthesize textField = textField_; +@synthesize editState = editState_; +@synthesize editBox = editBox_; + +- (void)dealloc +{ + [textField_ resignFirstResponder]; + [textField_ removeFromSuperview]; + self.textField = NULL; + [super dealloc]; +} + +-(id) initWithFrame: (CGRect) frameRect editBox: (void*) editBox +{ + self = [super init]; + + if (self) + { + editState_ = NO; + self.textField = [[[UICustomUITextField alloc] initWithFrame: frameRect] autorelease]; + + [textField_ setTextColor:[UIColor whiteColor]]; + textField_.font = [UIFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here. + textField_.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; + textField_.backgroundColor = [UIColor clearColor]; + textField_.borderStyle = UITextBorderStyleNone; + textField_.delegate = self; + textField_.hidden = true; + textField_.returnKeyType = UIReturnKeyDefault; + [textField_ addTarget:self action:@selector(textChanged) forControlEvents:UIControlEventEditingChanged]; + self.editBox = editBox; + } + + return self; +} + +-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance +{ + auto view = cocos2d::Director::getInstance()->getOpenGLView(); + CCEAGLView *eaglview = (CCEAGLView *) view->getEAGLView(); + + [eaglview doAnimationWhenKeyboardMoveWithDuration:duration distance:distance]; +} + +-(void) setPosition:(CGPoint) pos +{ + CGRect frame = [textField_ frame]; + frame.origin = pos; + [textField_ setFrame:frame]; +} + +-(void) setContentSize:(CGSize) size +{ + CGRect frame = [textField_ frame]; + frame.size = size; + [textField_ setFrame:frame]; +} + +-(void) visit +{ + +} + +-(void) openKeyboard +{ + auto view = cocos2d::Director::getInstance()->getOpenGLView(); + CCEAGLView *eaglview = (CCEAGLView *) view->getEAGLView(); + + [eaglview addSubview:textField_]; + [textField_ becomeFirstResponder]; +} + +-(void) closeKeyboard +{ + [textField_ resignFirstResponder]; + [textField_ removeFromSuperview]; +} + +- (BOOL)textFieldShouldReturn:(UITextField *)sender +{ + if (sender == textField_) { + [sender resignFirstResponder]; + } + return NO; +} + +-(void)animationSelector +{ + auto view = cocos2d::Director::getInstance()->getOpenGLView(); + CCEAGLView *eaglview = (CCEAGLView *) view->getEAGLView(); + + [eaglview doAnimationWhenAnotherEditBeClicked]; +} + +- (BOOL)textFieldShouldBeginEditing:(UITextField *)sender // return NO to disallow editing. +{ + CCLOG("textFieldShouldBeginEditing..."); + editState_ = YES; + + auto view = cocos2d::Director::getInstance()->getOpenGLView(); + CCEAGLView *eaglview = (CCEAGLView *) view->getEAGLView(); + + if ([eaglview isKeyboardShown]) + { + [self performSelector:@selector(animationSelector) withObject:nil afterDelay:0.0f]; + } + cocos2d::ui::EditBoxDelegate* pDelegate = getEditBoxImplIOS()->getDelegate(); + if (pDelegate != NULL) + { + pDelegate->editBoxEditingDidBegin(getEditBoxImplIOS()->getEditBox()); + } + +#if CC_ENABLE_SCRIPT_BINDING + cocos2d::ui::EditBox* pEditBox= getEditBoxImplIOS()->getEditBox(); + if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + { + cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); + cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); + cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } +#endif + return YES; +} + +- (BOOL)textFieldShouldEndEditing:(UITextField *)sender +{ + CCLOG("textFieldShouldEndEditing..."); + editState_ = NO; + getEditBoxImplIOS()->refreshInactiveText(); + + cocos2d::ui::EditBoxDelegate* pDelegate = getEditBoxImplIOS()->getDelegate(); + if (pDelegate != NULL) + { + pDelegate->editBoxEditingDidEnd(getEditBoxImplIOS()->getEditBox()); + pDelegate->editBoxReturn(getEditBoxImplIOS()->getEditBox()); + } + +#if CC_ENABLE_SCRIPT_BINDING + cocos2d::ui::EditBox* pEditBox= getEditBoxImplIOS()->getEditBox(); + if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + { + cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "ended",pEditBox); + cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); + cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + memset(data.eventName, 0, sizeof(data.eventName)); + strncpy(data.eventName, "return", sizeof(data.eventName)); + event.data = (void*)&data; + cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } +#endif + + if(editBox_ != nil) + { + getEditBoxImplIOS()->onEndEditing(); + } + return YES; +} + +/** + * Delegate method called before the text has been changed. + * @param textField The text field containing the text. + * @param range The range of characters to be replaced. + * @param string The replacement string. + * @return YES if the specified text range should be replaced; otherwise, NO to keep the old text. + */ +- (BOOL)textField:(UITextField *) textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string +{ + if (getEditBoxImplIOS()->getMaxLength() < 0) + { + return YES; + } + + NSUInteger oldLength = [textField.text length]; + NSUInteger replacementLength = [string length]; + NSUInteger rangeLength = range.length; + + NSUInteger newLength = oldLength - rangeLength + replacementLength; + + return newLength <= getEditBoxImplIOS()->getMaxLength(); +} + +/** + * Called each time when the text field's text has changed. + */ +- (void) textChanged +{ + // NSLog(@"text is %@", self.textField.text); + cocos2d::ui::EditBoxDelegate* pDelegate = getEditBoxImplIOS()->getDelegate(); + if (pDelegate != NULL) + { + pDelegate->editBoxTextChanged(getEditBoxImplIOS()->getEditBox(), getEditBoxImplIOS()->getText()); + } + +#if CC_ENABLE_SCRIPT_BINDING + cocos2d::ui::EditBox* pEditBox= getEditBoxImplIOS()->getEditBox(); + if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + { + cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "changed",pEditBox); + cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); + cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } +#endif +} + +@end + + +NS_CC_BEGIN + +namespace ui { + +EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) +{ + return new EditBoxImplIOS(pEditBox); +} + +EditBoxImplIOS::EditBoxImplIOS(EditBox* pEditText) +: EditBoxImpl(pEditText) +, _label(nullptr) +, _labelPlaceHolder(nullptr) +, _anchorPoint(Vec2(0.5f, 0.5f)) +, _systemControl(nullptr) +, _maxTextLength(-1) +{ + auto view = cocos2d::Director::getInstance()->getOpenGLView(); + + _inRetinaMode = view->isRetinaDisplay(); +} + +EditBoxImplIOS::~EditBoxImplIOS() +{ + [_systemControl release]; +} + +void EditBoxImplIOS::doAnimationWhenKeyboardMove(float duration, float distance) +{ + if ([_systemControl isEditState] || distance < 0.0f) + { + [_systemControl doAnimationWhenKeyboardMoveWithDuration:duration distance:distance]; + } +} + +bool EditBoxImplIOS::initWithSize(const Size& size) +{ + do + { + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + + CGRect rect = CGRectMake(0, 0, size.width * glview->getScaleX(),size.height * glview->getScaleY()); + + if (_inRetinaMode) + { + rect.size.width /= 2.0f; + rect.size.height /= 2.0f; + } + + _systemControl = [[UIEditBoxImplIOS_objc alloc] initWithFrame:rect editBox:this]; + if (!_systemControl) break; + + initInactiveLabels(size); + setContentSize(size); + + return true; + }while (0); + + return false; +} + +void EditBoxImplIOS::initInactiveLabels(const Size& size) +{ + const char* pDefaultFontName = [[_systemControl.textField.font fontName] UTF8String]; + + _label = Label::create(); + _label->setAnchorPoint(Vec2(0, 0.5f)); + _label->setColor(Color3B::WHITE); + _label->setVisible(false); + _editBox->addChild(_label, kLabelZOrder); + + _labelPlaceHolder = Label::create(); + // align the text vertically center + _labelPlaceHolder->setAnchorPoint(Vec2(0, 0.5f)); + _labelPlaceHolder->setColor(Color3B::GRAY); + _editBox->addChild(_labelPlaceHolder, kLabelZOrder); + + setFont(pDefaultFontName, size.height*2/3); + setPlaceholderFont(pDefaultFontName, size.height*2/3); +} + +void EditBoxImplIOS::placeInactiveLabels() +{ + _label->setPosition(Vec2(CC_EDIT_BOX_PADDING, _contentSize.height / 2.0f)); + _labelPlaceHolder->setPosition(Vec2(CC_EDIT_BOX_PADDING, _contentSize.height / 2.0f)); +} + +void EditBoxImplIOS::setInactiveText(const char* pText) +{ + if(_systemControl.textField.secureTextEntry == YES) + { + std::string passwordString; + for(int i = 0; i < strlen(pText); ++i) + passwordString.append("\u25CF"); + _label->setString(passwordString.c_str()); + } + else + _label->setString(getText()); + + // Clip the text width to fit to the text box + float fMaxWidth = _editBox->getContentSize().width - CC_EDIT_BOX_PADDING * 2; + Size labelSize = _label->getContentSize(); + if(labelSize.width > fMaxWidth) { + _label->setDimensions(fMaxWidth,labelSize.height); + } +} + +void EditBoxImplIOS::setFont(const char* pFontName, int fontSize) +{ + bool isValidFontName = true; + if(pFontName == NULL || strlen(pFontName) == 0) { + isValidFontName = false; + } + + float retinaFactor = _inRetinaMode ? 2.0f : 1.0f; + NSString * fntName = [NSString stringWithUTF8String:pFontName]; + + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + + float scaleFactor = glview->getScaleX(); + UIFont *textFont = nil; + if (isValidFontName) { + textFont = [UIFont fontWithName:fntName size:fontSize * scaleFactor / retinaFactor]; + } + + if (!isValidFontName || textFont == nil){ + textFont = [UIFont systemFontOfSize:fontSize * scaleFactor / retinaFactor]; + } + + if(textFont != nil) { + [_systemControl.textField setFont:textFont]; + } + + _label->setSystemFontName(pFontName); + _label->setSystemFontSize(fontSize); + _labelPlaceHolder->setSystemFontName(pFontName); + _labelPlaceHolder->setSystemFontSize(fontSize); +} + +void EditBoxImplIOS::setFontColor(const Color3B& color) +{ + _systemControl.textField.textColor = [UIColor colorWithRed:color.r / 255.0f green:color.g / 255.0f blue:color.b / 255.0f alpha:1.0f]; + _label->setColor(color); +} + +void EditBoxImplIOS::setPlaceholderFont(const char* pFontName, int fontSize) +{ + // TODO need to be implemented. +} + +void EditBoxImplIOS::setPlaceholderFontColor(const Color3B& color) +{ + _labelPlaceHolder->setColor(color); +} + +void EditBoxImplIOS::setInputMode(EditBox::InputMode inputMode) +{ + switch (inputMode) + { + case EditBox::InputMode::EMAIL_ADDRESS: + _systemControl.textField.keyboardType = UIKeyboardTypeEmailAddress; + break; + case EditBox::InputMode::NUMERIC: + _systemControl.textField.keyboardType = UIKeyboardTypeDecimalPad; + break; + case EditBox::InputMode::PHONE_NUMBER: + _systemControl.textField.keyboardType = UIKeyboardTypePhonePad; + break; + case EditBox::InputMode::URL: + _systemControl.textField.keyboardType = UIKeyboardTypeURL; + break; + case EditBox::InputMode::DECIMAL: + _systemControl.textField.keyboardType = UIKeyboardTypeDecimalPad; + break; + case EditBox::InputMode::SINGLE_LINE: + _systemControl.textField.keyboardType = UIKeyboardTypeDefault; + break; + default: + _systemControl.textField.keyboardType = UIKeyboardTypeDefault; + break; + } +} + +void EditBoxImplIOS::setMaxLength(int maxLength) +{ + _maxTextLength = maxLength; +} + +int EditBoxImplIOS::getMaxLength() +{ + return _maxTextLength; +} + +void EditBoxImplIOS::setInputFlag(EditBox::InputFlag inputFlag) +{ + switch (inputFlag) + { + case EditBox::InputFlag::PASSWORD: + _systemControl.textField.secureTextEntry = YES; + break; + case EditBox::InputFlag::INITIAL_CAPS_WORD: + _systemControl.textField.autocapitalizationType = UITextAutocapitalizationTypeWords; + break; + case EditBox::InputFlag::INITIAL_CAPS_SENTENCE: + _systemControl.textField.autocapitalizationType = UITextAutocapitalizationTypeSentences; + break; + case EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS: + _systemControl.textField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters; + break; + case EditBox::InputFlag::SENSITIVE: + _systemControl.textField.autocorrectionType = UITextAutocorrectionTypeNo; + break; + default: + break; + } +} + +void EditBoxImplIOS::setReturnType(EditBox::KeyboardReturnType returnType) +{ + switch (returnType) { + case EditBox::KeyboardReturnType::DEFAULT: + _systemControl.textField.returnKeyType = UIReturnKeyDefault; + break; + case EditBox::KeyboardReturnType::DONE: + _systemControl.textField.returnKeyType = UIReturnKeyDone; + break; + case EditBox::KeyboardReturnType::SEND: + _systemControl.textField.returnKeyType = UIReturnKeySend; + break; + case EditBox::KeyboardReturnType::SEARCH: + _systemControl.textField.returnKeyType = UIReturnKeySearch; + break; + case EditBox::KeyboardReturnType::GO: + _systemControl.textField.returnKeyType = UIReturnKeyGo; + break; + default: + _systemControl.textField.returnKeyType = UIReturnKeyDefault; + break; + } +} + +bool EditBoxImplIOS::isEditing() +{ + return [_systemControl isEditState] ? true : false; +} + +void EditBoxImplIOS::refreshInactiveText() +{ + const char* text = getText(); + if(_systemControl.textField.hidden == YES) + { + setInactiveText(text); + if(strlen(text) == 0) + { + _label->setVisible(false); + _labelPlaceHolder->setVisible(true); + } + else + { + _label->setVisible(true); + _labelPlaceHolder->setVisible(false); + } + } +} + +void EditBoxImplIOS::setText(const char* text) +{ + NSString* nsText =[NSString stringWithUTF8String:text]; + if ([nsText compare:_systemControl.textField.text] != NSOrderedSame) + { + _systemControl.textField.text = nsText; + } + + refreshInactiveText(); +} + +NSString* removeSiriString(NSString* str) +{ + NSString* siriString = @"\xef\xbf\xbc"; + return [str stringByReplacingOccurrencesOfString:siriString withString:@""]; +} + +const char* EditBoxImplIOS::getText(void) +{ + return [removeSiriString(_systemControl.textField.text) UTF8String]; +} + +void EditBoxImplIOS::setPlaceHolder(const char* pText) +{ + _systemControl.textField.placeholder = [NSString stringWithUTF8String:pText]; + _labelPlaceHolder->setString(pText); +} + +static CGPoint convertDesignCoordToScreenCoord(const Vec2& designCoord, bool bInRetinaMode) +{ + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + CCEAGLView *eaglview = (CCEAGLView *) glview->getEAGLView(); + + float viewH = (float)[eaglview getHeight]; + + Vec2 visiblePos = Vec2(designCoord.x * glview->getScaleX(), designCoord.y * glview->getScaleY()); + Vec2 screenGLPos = visiblePos + glview->getViewPortRect().origin; + + CGPoint screenPos = CGPointMake(screenGLPos.x, viewH - screenGLPos.y); + + if (bInRetinaMode) + { + screenPos.x = screenPos.x / 2.0f; + screenPos.y = screenPos.y / 2.0f; + } + CCLOGINFO("[EditBox] pos x = %f, y = %f", screenGLPos.x, screenGLPos.y); + return screenPos; +} + +void EditBoxImplIOS::setPosition(const Vec2& pos) +{ + _position = pos; + adjustTextFieldPosition(); +} + +void EditBoxImplIOS::setVisible(bool visible) +{ +// _systemControl.textField.hidden = !visible; +} + +void EditBoxImplIOS::setContentSize(const Size& size) +{ + _contentSize = size; + CCLOG("[Edit text] content size = (%f, %f)", size.width, size.height); + placeInactiveLabels(); + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + CGSize controlSize = CGSizeMake(size.width * glview->getScaleX(),size.height * glview->getScaleY()); + + if (_inRetinaMode) + { + controlSize.width /= 2.0f; + controlSize.height /= 2.0f; + } + [_systemControl setContentSize:controlSize]; +} + +void EditBoxImplIOS::setAnchorPoint(const Vec2& anchorPoint) +{ + CCLOG("[Edit text] anchor point = (%f, %f)", anchorPoint.x, anchorPoint.y); + _anchorPoint = anchorPoint; + setPosition(_position); +} + +void EditBoxImplIOS::visit(void) +{ +} + +void EditBoxImplIOS::onEnter(void) +{ + adjustTextFieldPosition(); + const char* pText = getText(); + if (pText) { + setInactiveText(pText); + } +} + +void EditBoxImplIOS::updatePosition(float dt) +{ + if (nullptr != _systemControl) { + this->adjustTextFieldPosition(); + } +} + + + +void EditBoxImplIOS::adjustTextFieldPosition() +{ + Size contentSize = _editBox->getContentSize(); + Rect rect = Rect(0, 0, contentSize.width, contentSize.height); + rect = RectApplyAffineTransform(rect, _editBox->nodeToWorldTransform()); + + Vec2 designCoord = Vec2(rect.origin.x, rect.origin.y + rect.size.height); + [_systemControl setPosition:convertDesignCoordToScreenCoord(designCoord, _inRetinaMode)]; +} + +void EditBoxImplIOS::openKeyboard() +{ + _label->setVisible(false); + _labelPlaceHolder->setVisible(false); + + _systemControl.textField.hidden = NO; + [_systemControl openKeyboard]; +} + +void EditBoxImplIOS::closeKeyboard() +{ + [_systemControl closeKeyboard]; +} + +void EditBoxImplIOS::onEndEditing() +{ + _systemControl.textField.hidden = YES; + if(strlen(getText()) == 0) + { + _label->setVisible(false); + _labelPlaceHolder->setVisible(true); + } + else + { + _label->setVisible(true); + _labelPlaceHolder->setVisible(false); + setInactiveText(getText()); + } +} + +} + +NS_CC_END + +#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */ + + diff --git a/cocos/ui/UIEditBox/UIEditBoxImplMac.h b/cocos/ui/UIEditBox/UIEditBoxImplMac.h new file mode 100644 index 0000000000..ffb53d29ef --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImplMac.h @@ -0,0 +1,136 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2012 Jozef Pridavok + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __UIEditBoxIMPLMAC_H__ +#define __UIEditBoxIMPLMAC_H__ + +#include "cocos2d.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) + +#import +#import + +#include "UIEditBoxImpl.h" + + +@interface UIEditBoxImplMac : NSObject +{ + NSTextField* textField_; + NSSecureTextField* secureTextField_; + void* editBox_; + BOOL editState_; + NSMutableDictionary* placeholderAttributes_; +} + +@property(nonatomic, retain) NSTextField* textField; +@property(nonatomic, retain) NSSecureTextField* secureTextField; +@property(nonatomic, retain) NSMutableDictionary* placeholderAttributes; +@property(nonatomic, readonly, getter = isEditState) BOOL editState; +@property(nonatomic, assign) void* editBox; + +-(id) initWithFrame: (NSRect) frameRect editBox: (void*) editBox; +-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance; +-(void) setPosition:(NSPoint) pos; +-(void) setContentSize:(NSSize) size; +-(void) visit; +-(void) openKeyboard; +-(void) closeKeyboard; + +@end + + +NS_CC_BEGIN + +namespace ui { + +class EditBox; + +class EditBoxImplMac : public EditBoxImpl +{ +public: + /** + * @js NA + */ + EditBoxImplMac(EditBox* pEditText); + /** + * @js NA + * @lua NA + */ + virtual ~EditBoxImplMac(); + + virtual bool initWithSize(const Size& size); + virtual void setFont(const char* pFontName, int fontSize); + virtual void setFontColor(const Color3B& color); + virtual void setPlaceholderFont(const char* pFontName, int fontSize); + virtual void setPlaceholderFontColor(const Color3B& color); + virtual void setInputMode(EditBox::InputMode inputMode); + virtual void setInputFlag(EditBox::InputFlag inputFlag); + virtual void setMaxLength(int maxLength); + virtual int getMaxLength(); + virtual void setReturnType(EditBox::KeyboardReturnType returnType); + virtual bool isEditing(); + + virtual void setText(const char* pText); + virtual const char* getText(void); + virtual void setPlaceHolder(const char* pText); + virtual void setPosition(const Vec2& pos); + virtual void setVisible(bool visible); + virtual void setContentSize(const Size& size); + virtual void setAnchorPoint(const Vec2& anchorPoint); + /** + * @js NA + * @lua NA + */ + virtual void visit(void); + virtual void doAnimationWhenKeyboardMove(float duration, float distance); + virtual void openKeyboard(); + virtual void closeKeyboard(); + virtual void updatePosition(float dt) override; + /** + * @js NA + * @lua NA + */ + virtual void onEnter(void); +private: + NSPoint convertDesignCoordToScreenCoord(const Vec2& designCoord, bool bInRetinaMode); + void adjustTextFieldPosition(); + Size _contentSize; + Vec2 _position; + Vec2 _anchorPoint; + int _maxTextLength; + bool _inRetinaMode; + UIEditBoxImplMac* _sysEdit; +}; + + +} + +NS_CC_END + +#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) + +#endif /* __UIEditBoxIMPLMAC_H__ */ + diff --git a/cocos/ui/UIEditBox/UIEditBoxImplMac.mm b/cocos/ui/UIEditBox/UIEditBoxImplMac.mm new file mode 100644 index 0000000000..b832f3d8bd --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImplMac.mm @@ -0,0 +1,524 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2012 Jozef Pridavok + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "UIEditBoxImplMac.h" +#include "base/CCDirector.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) + +#include "UIEditBox.h" + + +#define getEditBoxImplMac() ((cocos2d::ui::EditBoxImplMac*)editBox_) + + + +@implementation UIEditBoxImplMac + +@synthesize textField = textField_; +@synthesize secureTextField = secureTextField_; +@synthesize placeholderAttributes = placeholderAttributes_; +@synthesize editState = editState_; +@synthesize editBox = editBox_; + +- (id) getNSWindow +{ + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + return glview->getCocoaWindow(); +} + +- (void)dealloc +{ + [textField_ resignFirstResponder]; + [textField_ removeFromSuperview]; + [textField_ release]; + + [secureTextField_ resignFirstResponder]; + [secureTextField_ removeFromSuperview]; + [secureTextField_ release]; + + [placeholderAttributes_ release]; + [super dealloc]; +} + +-(id) initWithFrame: (NSRect) frameRect editBox: (void*) editBox +{ + self = [super init]; + + if (self) + { + editState_ = NO; + self.textField = [[[NSTextField alloc] initWithFrame:frameRect] autorelease]; + self.secureTextField = [[[NSSecureTextField alloc] initWithFrame:frameRect] autorelease]; + + NSFont *font = [NSFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here. + textField_.font = font; + secureTextField_.font = font; + + [self setupTextField:textField_]; + [self setupTextField:secureTextField_]; + + self.editBox = editBox; + self.placeholderAttributes = [NSMutableDictionary dictionaryWithObjectsAndKeys: + font, NSFontAttributeName, + [NSColor grayColor], NSForegroundColorAttributeName, + nil]; + + [[[self getNSWindow] contentView] addSubview:textField_]; + } + + return self; +} + +- (void)setupTextField:(NSTextField *)textField +{ + [textField setTextColor:[NSColor whiteColor]]; + [textField setBackgroundColor:[NSColor clearColor]]; + [textField setBordered:NO]; + [textField setHidden:NO]; + [textField setWantsLayer:YES]; + [textField setDelegate:self]; +} + +-(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance +{ + [[[self getNSWindow] contentView] doAnimationWhenKeyboardMoveWithDuration:duration distance:distance]; +} + +-(void) setPosition:(NSPoint) pos +{ + NSRect frame = [textField_ frame]; + frame.origin = pos; + [textField_ setFrame:frame]; + [secureTextField_ setFrame:frame]; +} + +-(void) setContentSize:(NSSize) size +{ + +} + +-(void) visit +{ + +} + +-(void) openKeyboard +{ + if ([textField_ superview]) { + [textField_ becomeFirstResponder]; + } + else { + [secureTextField_ becomeFirstResponder]; + } +} + +-(void) closeKeyboard +{ + if ([textField_ superview]) { + [textField_ resignFirstResponder]; + [textField_ removeFromSuperview]; + } + else { + [secureTextField_ resignFirstResponder]; + [secureTextField_ removeFromSuperview]; + } +} + +- (BOOL)textFieldShouldReturn:(NSTextField *)sender +{ + if (sender == textField_ || sender == secureTextField_) { + [sender resignFirstResponder]; + } + return NO; +} + +-(void)animationSelector +{ +} + +- (void)controlTextDidBeginEditing:(NSNotification *)notification +{ + editState_ = YES; + cocos2d::ui::EditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate(); + if (pDelegate != NULL) + { + pDelegate->editBoxEditingDidBegin(getEditBoxImplMac()->getEditBox()); + } + +#if CC_ENABLE_SCRIPT_BINDING + cocos2d::ui::EditBox* pEditBox= getEditBoxImplMac()->getEditBox(); + if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + { + cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); + cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); + cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } +#endif +} + +- (void)controlTextDidEndEditing:(NSNotification *)notification +{ + editState_ = NO; + cocos2d::ui::EditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate(); + if (pDelegate != NULL) + { + pDelegate->editBoxEditingDidEnd(getEditBoxImplMac()->getEditBox()); + pDelegate->editBoxReturn(getEditBoxImplMac()->getEditBox()); + } + +#if CC_ENABLE_SCRIPT_BINDING + cocos2d::ui::EditBox* pEditBox= getEditBoxImplMac()->getEditBox(); + if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + { + cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "ended",pEditBox); + cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); + cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + memset(data.eventName, 0, sizeof(data.eventName)); + strncpy(data.eventName, "return", sizeof(data.eventName)); + event.data = (void*)&data; + cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } +#endif +} + +/** + * Delegate method called before the text has been changed. + * @param textField The text field containing the text. + * @param range The range of characters to be replaced. + * @param string The replacement string. + * @return YES if the specified text range should be replaced; otherwise, NO to keep the old text. + */ +- (BOOL)textField:(NSTextField *) textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string +{ + if (getEditBoxImplMac()->getMaxLength() < 0) + { + return YES; + } + + NSUInteger oldLength = [[textField stringValue] length]; + NSUInteger replacementLength = [string length]; + NSUInteger rangeLength = range.length; + + NSUInteger newLength = oldLength - rangeLength + replacementLength; + + return newLength <= getEditBoxImplMac()->getMaxLength(); +} + +/** + * Called each time when the text field's text has changed. + */ +- (void)controlTextDidChange:(NSNotification *)notification +{ + cocos2d::ui::EditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate(); + if (pDelegate != NULL) + { + pDelegate->editBoxTextChanged(getEditBoxImplMac()->getEditBox(), getEditBoxImplMac()->getText()); + } + +#if CC_ENABLE_SCRIPT_BINDING + cocos2d::ui::EditBox* pEditBox= getEditBoxImplMac()->getEditBox(); + if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + { + cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "changed",pEditBox); + cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); + cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } +#endif +} + +@end + +NS_CC_BEGIN + +namespace ui { + +EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) +{ + return new EditBoxImplMac(pEditBox); +} + +EditBoxImplMac::EditBoxImplMac(EditBox* pEditText) +: EditBoxImpl(pEditText) +, _anchorPoint(Vec2(0.5f, 0.5f)) +, _maxTextLength(-1) +, _sysEdit(nullptr) +{ + //! TODO: Retina on Mac + //! _inRetinaMode = [[CCEAGLView sharedEGLView] contentScaleFactor] == 2.0f ? true : false; + _inRetinaMode = false; +} + +EditBoxImplMac::~EditBoxImplMac() +{ + [_sysEdit release]; +} + +void EditBoxImplMac::doAnimationWhenKeyboardMove(float duration, float distance) +{ + if ([_sysEdit isEditState] || distance < 0.0f) + [_sysEdit doAnimationWhenKeyboardMoveWithDuration:duration distance:distance]; +} + +bool EditBoxImplMac::initWithSize(const Size& size) +{ + GLView* eglView = Director::getInstance()->getOpenGLView(); + + NSRect rect = NSMakeRect(0, 0, size.width * eglView->getScaleX(),size.height * eglView->getScaleY()); + + if (_inRetinaMode) { + rect.size.width /= 2.0f; + rect.size.height /= 2.0f; + } + + _sysEdit = [[UIEditBoxImplMac alloc] initWithFrame:rect editBox:this]; + + if (!_sysEdit) + return false; + + return true; +} + +void EditBoxImplMac::setFont(const char* pFontName, int fontSize) +{ + NSString * fntName = [NSString stringWithUTF8String:pFontName]; + float retinaFactor = _inRetinaMode ? 2.0f : 1.0f; + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + float scaleFactor = glview->getScaleX(); + NSFont *textFont = [NSFont fontWithName:fntName size:fontSize * scaleFactor / retinaFactor]; + if (textFont != nil) { + [_sysEdit.textField setFont:textFont]; + [_sysEdit.secureTextField setFont:textFont]; + } +} + +void EditBoxImplMac::setPlaceholderFont(const char* pFontName, int fontSize) +{ + NSString *fontName = [NSString stringWithUTF8String:pFontName]; + float retinaFactor = _inRetinaMode ? 2.0f : 1.0f; + auto glview = cocos2d::Director::getInstance()->getOpenGLView(); + float scaleFactor = glview->getScaleX(); + NSFont *font = [NSFont fontWithName:fontName size:fontSize * scaleFactor / retinaFactor]; + + if (!font) { + CCLOGWARN("Font not found: %s", pFontName); + return; + } + + [_sysEdit.placeholderAttributes setObject:font forKey:NSFontAttributeName]; + + /* reload placeholder */ + const char *placeholder = [_sysEdit.textField.cell placeholderAttributedString].string.UTF8String; + if (placeholder) { + setPlaceHolder(placeholder); + } +} + +void EditBoxImplMac::setFontColor(const Color3B& color) +{ + NSColor *newColor = [NSColor colorWithCalibratedRed:color.r / 255.0f green:color.g / 255.0f blue:color.b / 255.0f alpha:1.0f]; + _sysEdit.textField.textColor = newColor; + _sysEdit.secureTextField.textColor = newColor; +} + +void EditBoxImplMac::setPlaceholderFontColor(const Color3B& color) +{ + NSColor *nsColor = [NSColor colorWithCalibratedRed:color.r/255.f green:color.g / 255.f blue:color.b / 255.f alpha:1.0f]; + [_sysEdit.placeholderAttributes setObject:nsColor forKey:NSForegroundColorAttributeName]; + + /* reload placeholder */ + const char *placeholder = [_sysEdit.textField.cell placeholderAttributedString].string.UTF8String; + if (placeholder) { + setPlaceHolder(placeholder); + } +} + +void EditBoxImplMac::setInputMode(EditBox::InputMode inputMode) +{ +} + +void EditBoxImplMac::setMaxLength(int maxLength) +{ + _maxTextLength = maxLength; +} + +int EditBoxImplMac::getMaxLength() +{ + return _maxTextLength; +} + +void EditBoxImplMac::setInputFlag(EditBox::InputFlag inputFlag) +{ + switch (inputFlag) + { + case EditBox::InputFlag::PASSWORD: + [_sysEdit.textField.superview addSubview:_sysEdit.secureTextField]; + [_sysEdit.textField removeFromSuperview]; + break; + case EditBox::InputFlag::INITIAL_CAPS_WORD: + CCLOGWARN("INITIAL_CAPS_WORD not implemented"); + break; + case EditBox::InputFlag::INITIAL_CAPS_SENTENCE: + CCLOGWARN("INITIAL_CAPS_SENTENCE not implemented"); + break; + case EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS: + CCLOGWARN("INTIAL_CAPS_ALL_CHARACTERS not implemented"); + break; + case EditBox::InputFlag::SENSITIVE: + CCLOGWARN("SENSITIVE not implemented"); + break; + default: + break; + } +} + +void EditBoxImplMac::setReturnType(EditBox::KeyboardReturnType returnType) +{ +} + +bool EditBoxImplMac::isEditing() +{ + return [_sysEdit isEditState] ? true : false; +} + +void EditBoxImplMac::setText(const char* pText) +{ + NSString *string = [NSString stringWithUTF8String:pText]; + _sysEdit.textField.stringValue = string; + _sysEdit.secureTextField.stringValue = string; +} + +const char* EditBoxImplMac::getText(void) +{ + if (_sysEdit.secureTextField.superview) { + return [_sysEdit.secureTextField.stringValue UTF8String]; + } + + return [_sysEdit.textField.stringValue UTF8String]; +} + +void EditBoxImplMac::setPlaceHolder(const char* pText) +{ + NSAttributedString *as = [[NSAttributedString alloc] initWithString:[NSString stringWithUTF8String:pText] + attributes:_sysEdit.placeholderAttributes]; + + [[_sysEdit.textField cell] setPlaceholderAttributedString:as]; + [[_sysEdit.secureTextField cell] setPlaceholderAttributedString:as]; + [as release]; +} + +NSPoint EditBoxImplMac::convertDesignCoordToScreenCoord(const Vec2& designCoord, bool bInRetinaMode) +{ + NSRect frame = [_sysEdit.textField frame]; + CGFloat height = frame.size.height; + + GLView* eglView = Director::getInstance()->getOpenGLView(); + + Vec2 visiblePos = Vec2(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY()); + Vec2 screenGLPos = visiblePos + eglView->getViewPortRect().origin; + + //TODO: I don't know why here needs to substract `height`. + NSPoint screenPos = NSMakePoint(screenGLPos.x, screenGLPos.y-height); + + if (bInRetinaMode) { + screenPos.x = screenPos.x / 2.0f; + screenPos.y = screenPos.y / 2.0f; + } + + CCLOGINFO("[EditBox] pos x = %f, y = %f", screenGLPos.x, screenGLPos.y); + return screenPos; +} + +void EditBoxImplMac::updatePosition(float dt) +{ + if(nullptr != _sysEdit) + { + adjustTextFieldPosition(); + } +} + +void EditBoxImplMac::adjustTextFieldPosition() +{ + Size contentSize = _editBox->getContentSize(); + Rect rect = Rect(0, 0, contentSize.width, contentSize.height); + + rect = RectApplyAffineTransform(rect, _editBox->nodeToWorldTransform()); + + Vec2 designCoord = Vec2(rect.origin.x, rect.origin.y + rect.size.height); + [_sysEdit setPosition:convertDesignCoordToScreenCoord(designCoord, _inRetinaMode)]; +} + +void EditBoxImplMac::setPosition(const Vec2& pos) +{ + _position = pos; + adjustTextFieldPosition(); +} + +void EditBoxImplMac::setVisible(bool visible) +{ + [_sysEdit.textField setHidden:!visible]; + [_sysEdit.secureTextField setHidden:!visible]; +} + +void EditBoxImplMac::setContentSize(const Size& size) +{ + _contentSize = size; + CCLOG("[Edit text] content size = (%f, %f)", size.width, size.height); +} + +void EditBoxImplMac::setAnchorPoint(const Vec2& anchorPoint) +{ + CCLOG("[Edit text] anchor point = (%f, %f)", anchorPoint.x, anchorPoint.y); + _anchorPoint = anchorPoint; + setPosition(_position); +} + +void EditBoxImplMac::visit(void) +{ + +} + +void EditBoxImplMac::openKeyboard() +{ + [_sysEdit openKeyboard]; +} + +void EditBoxImplMac::closeKeyboard() +{ + [_sysEdit closeKeyboard]; +} + +void EditBoxImplMac::onEnter(void) +{ + adjustTextFieldPosition(); +} + +} + +NS_CC_END + +#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) + + diff --git a/cocos/ui/UIEditBox/UIEditBoxImplNone.cpp b/cocos/ui/UIEditBox/UIEditBoxImplNone.cpp new file mode 100644 index 0000000000..7e3899672c --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImplNone.cpp @@ -0,0 +1,18 @@ +#include "UIEditBox.h" + +#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID ) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS ) && (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) && (CC_TARGET_PLATFORM != CC_PLATFORM_TIZEN) + +NS_CC_BEGIN + +namespace ui { + +EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) +{ + return NULL; +} + +} + +NS_CC_END + +#endif /* #if (..) */ diff --git a/cocos/ui/UIEditBox/UIEditBoxImplWin.cpp b/cocos/ui/UIEditBox/UIEditBoxImplWin.cpp new file mode 100644 index 0000000000..e539dabd41 --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImplWin.cpp @@ -0,0 +1,302 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013 Jozef Pridavok + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ +#include "UIEditBoxImplWin.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) + +#include "UIEditBox.h" +#include "proj.win32/Win32InputBox.h" + +NS_CC_BEGIN + +namespace ui { + +EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) +{ + return new EditBoxImplWin(pEditBox); +} + +EditBoxImplWin::EditBoxImplWin(EditBox* pEditText) +: EditBoxImpl(pEditText) +, _label(nullptr) +, _labelPlaceHolder(nullptr) +, _editBoxInputMode(EditBox::InputMode::SINGLE_LINE) +, _editBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS) +, _keyboardReturnType(EditBox::KeyboardReturnType::DEFAULT) +, _colText(Color3B::WHITE) +, _colPlaceHolder(Color3B::GRAY) +, _maxLength(-1) +{ + +} + +EditBoxImplWin::~EditBoxImplWin() +{ +} + +void EditBoxImplWin::doAnimationWhenKeyboardMove(float duration, float distance) +{ +} + +bool EditBoxImplWin::initWithSize(const Size& size) +{ + //! int fontSize = getFontSizeAccordingHeightJni(size.height-12); + _label = Label::create(); + _label->setSystemFontSize(size.height-12); + // align the text vertically center + _label->setAnchorPoint(Vec2(0, 0.5f)); + _label->setPosition(Vec2(5, size.height / 2.0f)); + _label->setColor(_colText); + _editBox->addChild(_label); + + _labelPlaceHolder = Label::create(); + _labelPlaceHolder->setSystemFontSize(size.height-12); + // align the text vertically center + _labelPlaceHolder->setAnchorPoint(Vec2(0, 0.5f)); + _labelPlaceHolder->setPosition(Vec2(5, size.height / 2.0f)); + _labelPlaceHolder->setVisible(false); + _labelPlaceHolder->setColor(_colPlaceHolder); + _editBox->addChild(_labelPlaceHolder); + + _editSize = size; + return true; +} + +void EditBoxImplWin::setFont(const char* pFontName, int fontSize) +{ + if(_label != nullptr) { + _label->setSystemFontName(pFontName); + _label->setSystemFontSize(fontSize); + } + + if(_labelPlaceHolder != nullptr) { + _labelPlaceHolder->setSystemFontName(pFontName); + _labelPlaceHolder->setSystemFontSize(fontSize); + } +} + +void EditBoxImplWin::setFontColor(const Color3B& color) +{ + _colText = color; + _label->setColor(color); +} + +void EditBoxImplWin::setPlaceholderFont(const char* pFontName, int fontSize) +{ + if(_labelPlaceHolder != nullptr) { + _labelPlaceHolder->setSystemFontName(pFontName); + _labelPlaceHolder->setSystemFontSize(fontSize); + } +} + +void EditBoxImplWin::setPlaceholderFontColor(const Color3B& color) +{ + _colPlaceHolder = color; + _labelPlaceHolder->setColor(color); +} + +void EditBoxImplWin::setInputMode(EditBox::InputMode inputMode) +{ + _editBoxInputMode = inputMode; +} + +void EditBoxImplWin::setMaxLength(int maxLength) +{ + _maxLength = maxLength; +} + +int EditBoxImplWin::getMaxLength() +{ + return _maxLength; +} + +void EditBoxImplWin::setInputFlag(EditBox::InputFlag inputFlag) +{ + _editBoxInputFlag = inputFlag; +} + +void EditBoxImplWin::setReturnType(EditBox::KeyboardReturnType returnType) +{ + _keyboardReturnType = returnType; +} + +bool EditBoxImplWin::isEditing() +{ + return false; +} + +void EditBoxImplWin::setText(const char* pText) +{ + if (pText != nullptr) + { + _text = pText; + + if (_text.length() > 0) + { + _labelPlaceHolder->setVisible(false); + + std::string strToShow; + + if (EditBox::InputFlag::PASSWORD == _editBoxInputFlag) + { + long length = cc_utf8_strlen(_text.c_str(), -1); + for (long i = 0; i < length; i++) + { + strToShow.append("*"); + } + } + else + { + strToShow = _text; + } + + //! std::string strWithEllipsis = getStringWithEllipsisJni(strToShow.c_str(), _editSize.width, _editSize.height-12); + //! _label->setString(strWithEllipsis.c_str()); + _label->setString(strToShow.c_str()); + } + else + { + _labelPlaceHolder->setVisible(true); + _label->setString(""); + } + + } +} + +const char* EditBoxImplWin::getText(void) +{ + return _text.c_str(); +} + +void EditBoxImplWin::setPlaceHolder(const char* pText) +{ + if (pText != nullptr) + { + _placeHolder = pText; + if (_placeHolder.length() > 0 && _text.length() == 0) + { + _labelPlaceHolder->setVisible(true); + } + + _labelPlaceHolder->setString(_placeHolder.c_str()); + } +} + +void EditBoxImplWin::setPosition(const Vec2& pos) +{ + //_label->setPosition(pos); + //_labelPlaceHolder->setPosition(pos); +} + +void EditBoxImplWin::setVisible(bool visible) +{ // don't need to be implemented on win32 platform. +} + +void EditBoxImplWin::setContentSize(const Size& size) +{ +} + +void EditBoxImplWin::setAnchorPoint(const Vec2& anchorPoint) +{ // don't need to be implemented on win32 platform. + +} + +void EditBoxImplWin::visit(void) +{ +} + +void EditBoxImplWin::openKeyboard() +{ + if (_delegate != nullptr) + { + _delegate->editBoxEditingDidBegin(_editBox); + } + + EditBox* pEditBox = this->getEditBox(); + if (nullptr != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + { + CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); + ScriptEvent event(kCommonEvent,(void*)&data); + ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } + + std::string placeHolder = _labelPlaceHolder->getString(); + if (placeHolder.length() == 0) + placeHolder = "Enter value"; + + char pText[100]= {0}; + std::string text = getText(); + if (text.length()) + strncpy(pText, text.c_str(), 100); + auto glView = Director::getInstance()->getOpenGLView(); + HWND hwnd = glView->getWin32Window(); + bool didChange = CWin32InputBox::InputBox("Input", placeHolder.c_str(), pText, 100, false, hwnd) == IDOK; + + if (didChange) + setText(pText); + + if (_delegate != nullptr) { + if (didChange) + _delegate->editBoxTextChanged(_editBox, getText()); + _delegate->editBoxEditingDidEnd(_editBox); + _delegate->editBoxReturn(_editBox); + } + +#if CC_ENABLE_SCRIPT_BINDING + if (nullptr != _editBox && 0 != _editBox->getScriptEditBoxHandler()) + { + CommonScriptData data(_editBox->getScriptEditBoxHandler(), "changed",_editBox); + ScriptEvent event(kCommonEvent,(void*)&data); + if (didChange) + { + ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } + memset(data.eventName,0,sizeof(data.eventName)); + strncpy(data.eventName,"ended",sizeof(data.eventName)); + event.data = (void*)&data; + ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + memset(data.eventName,0,sizeof(data.eventName)); + strncpy(data.eventName,"return",sizeof(data.eventName)); + event.data = (void*)&data; + ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } +#endif // #if CC_ENABLE_SCRIPT_BINDING +} + +void EditBoxImplWin::closeKeyboard() +{ + +} + +void EditBoxImplWin::onEnter(void) +{ + +} + +} + +NS_CC_END + +#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ diff --git a/cocos/ui/UIEditBox/UIEditBoxImplWin.h b/cocos/ui/UIEditBox/UIEditBoxImplWin.h new file mode 100644 index 0000000000..b4c9cf9f47 --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImplWin.h @@ -0,0 +1,118 @@ +/**************************************************************************** + Copyright (c) 2010-2012 cocos2d-x.org + Copyright (c) 2013 Jozef Pridavok + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __UIEditBoxIMPLWIN_H__ +#define __UIEditBoxIMPLWIN_H__ + +#include "cocos2d.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) + +#include "UIEditBoxImpl.h" + +NS_CC_BEGIN + +namespace ui { + +class EditBox; + +class CC_GUI_DLL EditBoxImplWin : public EditBoxImpl +{ +public: + /** + * @js NA + */ + EditBoxImplWin(EditBox* pEditText); + /** + * @js NA + * @lua NA + */ + virtual ~EditBoxImplWin(); + + virtual bool initWithSize(const Size& size); + virtual void setFont(const char* pFontName, int fontSize); + virtual void setFontColor(const Color3B& color); + virtual void setPlaceholderFont(const char* pFontName, int fontSize); + virtual void setPlaceholderFontColor(const Color3B& color); + virtual void setInputMode(EditBox::InputMode inputMode); + virtual void setInputFlag(EditBox::InputFlag inputFlag); + virtual void setMaxLength(int maxLength); + virtual int getMaxLength(); + virtual void setReturnType(EditBox::KeyboardReturnType returnType); + virtual bool isEditing(); + + virtual void setText(const char* pText); + virtual const char* getText(void); + virtual void setPlaceHolder(const char* pText); + virtual void setPosition(const Vec2& pos); + virtual void setVisible(bool visible); + virtual void setContentSize(const Size& size); + virtual void setAnchorPoint(const Vec2& anchorPoint); + /** + * @js NA + * @lua NA + */ + virtual void visit(void); + virtual void doAnimationWhenKeyboardMove(float duration, float distance); + virtual void openKeyboard(); + virtual void closeKeyboard(); + /** + * @js NA + * @lua NA + */ + virtual void onEnter(void); +private: + + Label* _label; + Label* _labelPlaceHolder; + EditBox::InputMode _editBoxInputMode; + EditBox::InputFlag _editBoxInputFlag; + EditBox::KeyboardReturnType _keyboardReturnType; + + std::string _text; + std::string _placeHolder; + + Color3B _colText; + Color3B _colPlaceHolder; + + int _maxLength; + Size _editSize; + + /* + Size _contentSize; + HWND _sysEdit; + int _maxTextLength; + */ +}; + + +} + +NS_CC_END + +#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ + +#endif /* __UIEditBoxIMPLWIN_H__ */ + diff --git a/cocos/ui/UIEditBox/UIEditBoxImplWp8.cpp b/cocos/ui/UIEditBox/UIEditBoxImplWp8.cpp new file mode 100644 index 0000000000..b8a2f23050 --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImplWp8.cpp @@ -0,0 +1,307 @@ +/**************************************************************************** +Copyright (c) 2014 cocos2d-x.org + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ + +#include "UIEditBoxImplWp8.h" +#include "UIEditBox.h" +#include "CCGLViewImpl.h" +#include "base/CCScriptSupport.h" +#include "base/ccUTF8.h" + +NS_CC_BEGIN + +namespace ui { + +EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) +{ + return new UIEditBoxImplWp8(pEditBox); +} + +UIEditBoxImplWp8::UIEditBoxImplWp8( EditBox* pEditText ) + : EditBoxImpl(pEditText) + , m_pLabel(NULL) + , m_pLabelPlaceHolder(NULL) + , m_eEditBoxInputMode(EditBox::InputMode::SINGLE_LINE) + , m_eEditBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS) + , m_eKeyboardReturnType(EditBox::KeyboardReturnType::DEFAULT) + , m_colText(Color3B::WHITE) + , m_colPlaceHolder(Color3B::GRAY) + , m_nMaxLength(-1) +{ + +} + +UIEditBoxImplWp8::~UIEditBoxImplWp8() +{ + +} + +void UIEditBoxImplWp8::openKeyboard() +{ + if (_delegate != NULL) + { + _delegate->editBoxEditingDidBegin(_editBox); + } + + EditBox* pEditBox = this->getEditBox(); + if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) + { + CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); + ScriptEvent event(kCommonEvent,(void*)&data); + ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); + } + + std::string placeHolder = m_pLabelPlaceHolder->getString(); + if (placeHolder.length() == 0) + placeHolder = "Enter value"; + + char pText[100]= {0}; + std::string text = getText(); + if (text.length()) + strncpy(pText, text.c_str(), 100); + + Windows::Foundation::EventHandler^ receiveHandler = ref new Windows::Foundation::EventHandler( + [this](Platform::Object^ sender, Platform::String^ arg) + { + setText(PlatformStringTostring(arg).c_str()); + if (_delegate != NULL) { + _delegate->editBoxTextChanged(_editBox, getText()); + _delegate->editBoxEditingDidEnd(_editBox); + _delegate->editBoxReturn(_editBox); + } + }); + + GLViewImpl::sharedOpenGLView()->OpenXamlEditBox(stringToPlatformString(placeHolder), stringToPlatformString(getText()), m_nMaxLength, (int)m_eEditBoxInputMode, (int)m_eEditBoxInputFlag, receiveHandler); +} + +bool UIEditBoxImplWp8::initWithSize( const Size& size ) +{ + //! int fontSize = getFontSizeAccordingHeightJni(size.height-12); + m_pLabel = Label::createWithSystemFont("", "", size.height-12); + // align the text vertically center + m_pLabel->setAnchorPoint(Vec2(0.0f, 0.5f)); + m_pLabel->setPosition(Vec2(5.0, size.height / 2.0f)); + m_pLabel->setColor(m_colText); + _editBox->addChild(m_pLabel); + + m_pLabelPlaceHolder = Label::createWithSystemFont("", "", size.height-12); + // align the text vertically center + m_pLabelPlaceHolder->setAnchorPoint(Vec2(0.0f, 0.5f)); + m_pLabelPlaceHolder->setPosition(Vec2(5.0f, size.height / 2.0f)); + m_pLabelPlaceHolder->setVisible(false); + m_pLabelPlaceHolder->setColor(m_colPlaceHolder); + _editBox->addChild(m_pLabelPlaceHolder); + + m_EditSize = size; + return true; +} + +void UIEditBoxImplWp8::setFont( const char* pFontName, int fontSize ) +{ + if(m_pLabel != NULL) { + m_pLabel->setSystemFontName(pFontName); + m_pLabel->setSystemFontSize(fontSize); + } + + if(m_pLabelPlaceHolder != NULL) { + m_pLabelPlaceHolder->setSystemFontName(pFontName); + m_pLabelPlaceHolder->setSystemFontSize(fontSize); + } +} + +void UIEditBoxImplWp8::setFontColor( const Color3B& color ) +{ + m_colText = color; + m_pLabel->setColor(color); +} + +void UIEditBoxImplWp8::setPlaceholderFont( const char* pFontName, int fontSize ) +{ + if(m_pLabelPlaceHolder != NULL) { + m_pLabelPlaceHolder->setSystemFontName(pFontName); + m_pLabelPlaceHolder->setSystemFontSize(fontSize); + } +} + +void UIEditBoxImplWp8::setPlaceholderFontColor( const Color3B& color ) +{ + m_colPlaceHolder = color; + m_pLabelPlaceHolder->setColor(color); +} + +void UIEditBoxImplWp8::setInputMode( EditBox::InputMode inputMode ) +{ + m_eEditBoxInputMode = inputMode; +} + +void UIEditBoxImplWp8::setInputFlag(EditBox::InputFlag inputFlag ) +{ + m_eEditBoxInputFlag = inputFlag; +} + +void UIEditBoxImplWp8::setMaxLength( int maxLength ) +{ + m_nMaxLength = maxLength; +} + +int UIEditBoxImplWp8::getMaxLength() +{ + return m_nMaxLength; +} + +void UIEditBoxImplWp8::setReturnType( EditBox::KeyboardReturnType returnType ) +{ + m_eKeyboardReturnType = returnType; +} + +bool UIEditBoxImplWp8::isEditing() +{ + return false; +} + +void UIEditBoxImplWp8::setText( const char* pText ) +{ + if (pText != NULL) + { + m_strText = pText; + + if (m_strText.length() > 0) + { + m_pLabelPlaceHolder->setVisible(false); + + std::string strToShow; + + if (EditBox::InputFlag::PASSWORD == m_eEditBoxInputFlag) + { + long length = cc_utf8_strlen(m_strText.c_str(), -1); + for (long i = 0; i < length; i++) + { + strToShow.append("*"); + } + } + else + { + strToShow = m_strText; + } + + //! std::string strWithEllipsis = getStringWithEllipsisJni(strToShow.c_str(), m_EditSize.width, m_EditSize.height-12); + //! m_pLabel->setString(strWithEllipsis.c_str()); + m_pLabel->setString(strToShow.c_str()); + } + else + { + m_pLabelPlaceHolder->setVisible(true); + m_pLabel->setString(""); + } + + } +} + +const char* UIEditBoxImplWp8::getText( void ) +{ + return m_strText.c_str(); +} + +void UIEditBoxImplWp8::setPlaceHolder( const char* pText ) +{ + if (pText != NULL) + { + m_strPlaceHolder = pText; + if (m_strPlaceHolder.length() > 0 && m_strText.length() == 0) + { + m_pLabelPlaceHolder->setVisible(true); + } + + m_pLabelPlaceHolder->setString(m_strPlaceHolder.c_str()); + } +} + +void UIEditBoxImplWp8::setPosition( const Vec2& pos ) +{ + +} + +void UIEditBoxImplWp8::setVisible( bool visible ) +{ + +} + +void UIEditBoxImplWp8::setContentSize( const Size& size ) +{ + +} + +void UIEditBoxImplWp8::setAnchorPoint( const Vec2& anchorPoint ) +{ + +} + +void UIEditBoxImplWp8::visit( void ) +{ + +} + +void UIEditBoxImplWp8::doAnimationWhenKeyboardMove( float duration, float distance ) +{ + +} + +void UIEditBoxImplWp8::closeKeyboard() +{ + +} + +void UIEditBoxImplWp8::onEnter( void ) +{ + +} + +Platform::String^ UIEditBoxImplWp8::stringToPlatformString( std::string strSrc ) +{ + // to wide char + int nStrLen = MultiByteToWideChar(CP_UTF8, 0, strSrc.c_str(), -1, NULL, 0); + wchar_t* pWStr = new wchar_t[nStrLen + 1]; + memset(pWStr, 0, nStrLen + 1); + MultiByteToWideChar(CP_UTF8, 0, strSrc.c_str(), -1, pWStr, nStrLen); + Platform::String^ strDst = ref new Platform::String(pWStr); + delete[] pWStr; + return strDst; +} + +std::string UIEditBoxImplWp8::PlatformStringTostring( Platform::String^ strSrc ) +{ + const wchar_t* pWStr = strSrc->Data(); + int nStrLen = WideCharToMultiByte(CP_UTF8, 0, pWStr, -1, NULL, 0, NULL, NULL); + char* pStr = new char[nStrLen + 1]; + memset(pStr, 0, nStrLen + 1); + WideCharToMultiByte(CP_UTF8, 0, pWStr, -1, pStr, nStrLen, NULL, NULL); ; + + std::string strDst = std::string(pStr); + + delete[] pStr; + return strDst; +} + +} + +NS_CC_END diff --git a/cocos/ui/UIEditBox/UIEditBoxImplWp8.h b/cocos/ui/UIEditBox/UIEditBoxImplWp8.h new file mode 100644 index 0000000000..09d78167cd --- /dev/null +++ b/cocos/ui/UIEditBox/UIEditBoxImplWp8.h @@ -0,0 +1,88 @@ +/**************************************************************************** +Copyright (c) 2014 cocos2d-x.org + +http://www.cocos2d-x.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +****************************************************************************/ +#ifndef __UIEditBoxIMPLWP8_H__ +#define __UIEditBoxIMPLWP8_H__ + +#include "UIEditBoxImpl.h" + +NS_CC_BEGIN + +namespace ui { + class EditBox; + + class CC_GUI_DLL UIEditBoxImplWp8 : public EditBoxImpl + { + public: + UIEditBoxImplWp8(EditBox* pEditText); + virtual ~UIEditBoxImplWp8(); + + virtual bool initWithSize(const Size& size); + virtual void setFont(const char* pFontName, int fontSize); + virtual void setFontColor(const Color3B& color); + virtual void setPlaceholderFont(const char* pFontName, int fontSize); + virtual void setPlaceholderFontColor(const Color3B& color); + virtual void setInputMode(EditBox::InputMode inputMode); + virtual void setInputFlag(EditBox::InputFlag inputFlag); + virtual void setMaxLength(int maxLength); + virtual int getMaxLength(); + virtual void setReturnType(EditBox::KeyboardReturnType returnType); + virtual bool isEditing(); + + virtual void setText(const char* pText); + virtual const char* getText(void); + virtual void setPlaceHolder(const char* pText); + virtual void setPosition(const Vec2& pos); + virtual void setVisible(bool visible); + virtual void setContentSize(const Size& size); + virtual void setAnchorPoint(const Vec2& anchorPoint); + virtual void visit(void); + virtual void doAnimationWhenKeyboardMove(float duration, float distance); + virtual void openKeyboard(); + virtual void closeKeyboard(); + virtual void onEnter(void); + private: + Platform::String^ stringToPlatformString(std::string strSrc); + std::string PlatformStringTostring(Platform::String^ strSrc); + private: + + Label* m_pLabel; + Label* m_pLabelPlaceHolder; + EditBox::InputMode m_eEditBoxInputMode; + EditBox::InputFlag m_eEditBoxInputFlag; + (EditBox::KeyboardReturnType m_eKeyboardReturnType; + + std::string m_strText; + std::string m_strPlaceHolder; + + Color3B m_colText; + Color3B m_colPlaceHolder; + + int m_nMaxLength; + Size m_EditSize; + }; +} + +NS_CC_END + +#endif diff --git a/cocos/ui/proj.win32/Win32InputBox.cpp b/cocos/ui/proj.win32/Win32InputBox.cpp new file mode 100644 index 0000000000..da1cb12301 --- /dev/null +++ b/cocos/ui/proj.win32/Win32InputBox.cpp @@ -0,0 +1,383 @@ +#include "Win32InputBox.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) + +#include + +#pragma warning (disable: 4312) + +typedef struct _MSDN_DLGTEMPLATEEX +{ + WORD dlgVer; + WORD signature; + DWORD helpID; + DWORD exStyle; + DWORD style; + WORD cDlgItems; + short x; + short y; + short cx; + short cy; + BYTE _rest[1]; // rest of structure +} MSDN_DLGTEMPLATEEX; + +static bool IsDlgTemplateExtended(DLGTEMPLATE *dlgTemplate) +{ + MSDN_DLGTEMPLATEEX *dgExTemplate = (MSDN_DLGTEMPLATEEX *) dlgTemplate; + + // MSDN excerpt: + //* dlgVer + // Specifies the version number of the extended dialog box template. This member must be 1. + //* signature + // Indicates whether a template is an extended dialog box template. + // If signature is 0xFFFF, this is an extended dialog box template. + // In this case, the dlgVer member specifies the template version number. + // If signature is any value other than 0xFFFF, this is a standard dialog box template that uses the DLGTEMPLATE and DLGITEMTEMPLATE structures. + + return (dgExTemplate->dlgVer == 1) && (dgExTemplate->signature == 0xFFFF); +} + +// Use alignment if supported by the compiler +#ifdef _MSC_VER + #if _MSC_VER > 1200 + __declspec(align(4)) + #endif +#endif + +// per the MSDN, the DLGTEMPLATE must be DWORD aligned +// this was generated by the DlgResToDlgTemplate tool +static unsigned char definputbox_dlg[] = +{ + 0x01,0x00,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc8,0x00,0xc8,0x00,0x06, + 0x00,0x16,0x00,0x11,0x00,0xe7,0x00,0x6d,0x00,0x00,0x00,0x00,0x00,0x57,0x00,0x69, + 0x00,0x6e,0x00,0x33,0x00,0x32,0x00,0x49,0x00,0x6e,0x00,0x70,0x00,0x75,0x00,0x74, + 0x00,0x42,0x00,0x6f,0x00,0x78,0x00,0x00,0x00,0x08,0x00,0xbc,0x02,0x00,0x00,0x4d, + 0x00,0x53,0x00,0x20,0x00,0x53,0x00,0x68,0x00,0x65,0x00,0x6c,0x00,0x6c,0x00,0x20, + 0x00,0x44,0x00,0x6c,0x00,0x67,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x80,0x00,0x02,0x50,0x06,0x00,0x04,0x00,0x9d,0x00,0x21,0x00,0xe8, + 0x03,0x00,0x00,0xff,0xff,0x82,0x00,0x50,0x00,0x72,0x00,0x6f,0x00,0x6d,0x00,0x70, + 0x00,0x74,0x00,0x3a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x80,0x00,0x81,0x50,0x06,0x00,0x25,0x00,0xd8,0x00,0x0e,0x00,0xe9, + 0x03,0x00,0x00,0xff,0xff,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x84,0x10,0xa1,0x50,0x06,0x00,0x37,0x00,0xd8,0x00,0x31,0x00,0xea, + 0x03,0x00,0x00,0xff,0xff,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x01,0x00,0x03,0x50,0xab,0x00,0x04,0x00,0x33,0x00,0x0e,0x00,0x01, + 0x00,0x00,0x00,0xff,0xff,0x80,0x00,0x4f,0x00,0x4b,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x50,0xab,0x00,0x15,0x00,0x33, + 0x00,0x0e,0x00,0x02,0x00,0x00,0x00,0xff,0xff,0x80,0x00,0x43,0x00,0x41,0x00,0x4e, + 0x00,0x43,0x00,0x45,0x00,0x4c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x02,0x40,0x00,0x00,0x27,0x00,0x08,0x00,0x08,0x00,0xff, + 0xff,0xff,0xff,0xff,0xff,0x82,0x00,0x00,0x00,0x00,0x00 +}; + +static LPCTSTR definputbox_buttonnames[] = { _T("OK"), _T("CANCEL") }; +static const INT_PTR definputbox_buttonids[] = { IDOK, IDCANCEL }; + +static const INT + definputbox_id_prompt = 1000, + definputbox_id_edit1 = 1001, + definputbox_id_edit2 = 1002; + +WIN32INPUTBOX_PARAM::WIN32INPUTBOX_PARAM() +{ + bMultiline = false; + hwndOwner = 0; + DlgTemplateName = 0; + hInstance = (HINSTANCE) ::GetModuleHandle(0); + DlgTemplateData = definputbox_dlg; + + bCenter = true; + + dwStylesPlus = 0; + dwExStylesPlus = 0; + dwStylesMinus = 0xFFFFFFFF; + dwExStylesMinus = 0xFFFFFFFF; + + xPos = yPos = -1; + + szResult = 0; + nResultSize = 0; +} + +CWin32InputBox::CWin32InputBox(WIN32INPUTBOX_PARAM *param) +{ + _param = param; +} + +CWin32InputBox::~CWin32InputBox() +{ + +} + +void CWin32InputBox::SetParam(WIN32INPUTBOX_PARAM *param) +{ + _param = param; +} + +WIN32INPUTBOX_PARAM *CWin32InputBox::GetParam() +{ + return _param; +} + +INT_PTR CWin32InputBox::InputBoxEx(WIN32INPUTBOX_PARAM *param) +{ + // Check mandatory parameters + if (param->szResult == 0) + { + ::SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + LPDLGTEMPLATE dlgTemplate; + + if (param->DlgTemplateName != 0) + { + HMODULE hModule = (HMODULE)param->hInstance; +#ifdef __MINGW32__ + HRSRC rcDlg = ::FindResource(hModule, (LPWSTR)(ULONG_PTR)(size_t)(param->DlgTemplateName), RT_DIALOG); +#else + HRSRC rcDlg = ::FindResource(hModule, MAKEINTRESOURCE(param->DlgTemplateName), RT_DIALOG); +#endif + if (rcDlg == nullptr) + return 0; + + HGLOBAL hglobalDlg = ::LoadResource(hModule, rcDlg); + if (hglobalDlg == nullptr) + return 0; + + dlgTemplate = (LPDLGTEMPLATE) hglobalDlg; + } + else if (param->DlgTemplateData != 0) + { + dlgTemplate = (LPDLGTEMPLATE) param->DlgTemplateData; + } + + MSDN_DLGTEMPLATEEX *dlgTemplateEx = + IsDlgTemplateExtended((LPDLGTEMPLATE) dlgTemplate) ? (MSDN_DLGTEMPLATEEX *) dlgTemplate : 0; + + if (dlgTemplateEx != 0) + { + dlgTemplateEx->exStyle |= param->dwExStylesPlus; + dlgTemplateEx->style |= param->dwStylesPlus; + dlgTemplateEx->exStyle &= param->dwExStylesMinus; + dlgTemplateEx->style &= param->dwStylesMinus; + + if (param->bCenter) + dlgTemplateEx->style |= DS_CENTER; + + if (param->xPos != -1) + dlgTemplateEx->x = param->xPos; + if (param->yPos != -1) + dlgTemplateEx->y = param->yPos; + } + else + { + dlgTemplate->dwExtendedStyle |= param->dwExStylesPlus; + dlgTemplate->style |= param->dwStylesPlus; + dlgTemplate->dwExtendedStyle &= param->dwExStylesMinus; + dlgTemplate->style &= param->dwStylesMinus; + + if (param->bCenter) + dlgTemplate->style |= DS_CENTER; + + if (param->xPos != -1) + dlgTemplate->x = param->xPos; + + if (param->yPos != -1) + dlgTemplate->y = param->yPos; + } + + CWin32InputBox inputbox(param); + + // Resize dialog and SHOW or HIDE multiline + INT_PTR r = ::DialogBoxIndirectParam(param->hInstance, dlgTemplate, param->hwndOwner, (DLGPROC)DlgProc, (LPARAM)&inputbox); + + return r; +} + +INT_PTR CWin32InputBox::InputBox( + LPCSTR szTitle, + LPCSTR szPrompt, + LPSTR szResult, + DWORD nResultSize, + bool bMultiLine, + HWND hwndParent) +{ + WIN32INPUTBOX_PARAM param; + + param.szTitle = szTitle; + param.szPrompt = szPrompt; + param.szResult = szResult; + param.nResultSize = nResultSize; + param.bMultiline = bMultiLine; + param.hwndOwner = hwndParent; + return InputBoxEx(¶m); +} + +void CWin32InputBox::InitDialog() +{ + // Set the button captions + for (size_t i=0;ihDlg, (int) definputbox_buttonids[i], definputbox_buttonnames[i]); + + // Set other controls + ::SetWindowTextA(_param->hDlg, Utf8ToAnsi(_param->szTitle).c_str()); + ::SetDlgItemTextA(_param->hDlg, definputbox_id_prompt, Utf8ToAnsi(_param->szPrompt).c_str()); + + HWND hwndEdit1 = ::GetDlgItem(_param->hDlg, definputbox_id_edit1); + HWND hwndEdit2 = ::GetDlgItem(_param->hDlg, definputbox_id_edit2); + + if (_param->bMultiline) + _hwndEditCtrl = hwndEdit2; + else + _hwndEditCtrl = hwndEdit1; + + ::SetWindowTextA(_hwndEditCtrl, Utf8ToAnsi(_param->szResult).c_str()); + + RECT rectDlg, rectEdit1, rectEdit2; + + ::GetWindowRect(_param->hDlg, &rectDlg); + ::GetWindowRect(hwndEdit1, &rectEdit1); + ::GetWindowRect(hwndEdit2, &rectEdit2); + + if (_param->bMultiline) + { + ::ShowWindow(hwndEdit1, SW_HIDE); + ::SetWindowPos( + hwndEdit2, + HWND_NOTOPMOST, + rectEdit1.left - rectDlg.left, + (rectEdit1.top - rectDlg.top) - (rectEdit1.bottom - rectEdit1.top), + 0, + 0, + SWP_NOSIZE | SWP_NOZORDER); + + ::SetWindowPos( + _param->hDlg, + HWND_NOTOPMOST, + 0, + 0, + rectDlg.right - rectDlg.left, + rectDlg.bottom - rectDlg.top - (rectEdit1.bottom - rectEdit1.top), + SWP_NOMOVE); + + } + else + { + ::SetWindowPos( + _param->hDlg, + HWND_NOTOPMOST, + 0, + 0, + rectDlg.right - rectDlg.left, + rectEdit1.bottom - rectDlg.top + 5, + SWP_NOMOVE); + + ::ShowWindow(hwndEdit2, SW_HIDE); + } +} + +// Message handler for about box. +LRESULT CALLBACK CWin32InputBox::DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + CWin32InputBox *_this = (CWin32InputBox *) ::GetWindowLongPtr(hDlg, GWLP_USERDATA); + WIN32INPUTBOX_PARAM *param = _this ? _this->GetParam() : 0; + + switch (message) + { + case WM_INITDIALOG: + { + SetWindowLongPtr(hDlg, GWLP_USERDATA, (LONG_PTR) lParam); + + _this = (CWin32InputBox *) lParam; + _this->_param->hDlg = hDlg; + _this->InitDialog(); + return TRUE; + } + + case WM_COMMAND: + { +#ifdef _MY_DEBUG + CHAR buf[1024]; + static int i=0; + sprintf(buf, "WM_COMMAND: %09d wParam=%08X lParam=%08X\n", i++, wParam, lParam); + OutputDebugString(buf); +#endif + INT_PTR buttonId = LOWORD(wParam); + for (size_t i=0; + i_hwndEditCtrl, + _this->_param->szResult, + _this->_param->nResultSize); + + std::string strUtf8 = AnsiToUtf8(_this->_param->szResult); + + memset(_this->_param->szResult, 0, _this->_param->nResultSize); + strncpy(_this->_param->szResult, strUtf8.c_str(), _this->_param->nResultSize-1); + + ::EndDialog(hDlg, buttonId); + return TRUE; + } + } + } + break; + } + return FALSE; +} + + +std::string CWin32InputBox::AnsiToUtf8(std::string strAnsi) +{ + std::string ret; + if (strAnsi.length() > 0) + { + int nWideStrLength = MultiByteToWideChar(CP_ACP, 0, strAnsi.c_str(), -1, nullptr, 0); + WCHAR* pwszBuf = (WCHAR*)malloc((nWideStrLength+1)*sizeof(WCHAR)); + memset(pwszBuf, 0, (nWideStrLength+1)*sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, strAnsi.c_str(), -1, pwszBuf, (nWideStrLength+1)*sizeof(WCHAR)); + + int nUtf8Length = WideCharToMultiByte( CP_UTF8,0,pwszBuf,-1,nullptr,0,nullptr,FALSE ); + char* pszUtf8Buf = (char*)malloc((nUtf8Length+1)*sizeof(char)); + memset(pszUtf8Buf, 0, (nUtf8Length+1)*sizeof(char)); + + WideCharToMultiByte(CP_UTF8, 0, pwszBuf, -1, pszUtf8Buf, (nUtf8Length+1)*sizeof(char), nullptr, FALSE); + ret = pszUtf8Buf; + + free(pszUtf8Buf); + free(pwszBuf); + } + return ret; +} + +std::string CWin32InputBox::Utf8ToAnsi(std::string strUTF8) +{ + std::string ret; + if (strUTF8.length() > 0) + { + int nWideStrLength = MultiByteToWideChar(CP_UTF8, 0, strUTF8.c_str(), -1, nullptr, 0); + WCHAR* pwszBuf = (WCHAR*)malloc((nWideStrLength+1)*sizeof(WCHAR)); + memset(pwszBuf, 0, (nWideStrLength+1)*sizeof(WCHAR)); + MultiByteToWideChar(CP_UTF8, 0, strUTF8.c_str(), -1, pwszBuf, (nWideStrLength+1)*sizeof(WCHAR)); + + int nAnsiStrLength = WideCharToMultiByte( CP_ACP,0,pwszBuf,-1,nullptr,0,nullptr,FALSE ); + char* pszAnsiBuf = (char*)malloc((nAnsiStrLength+1)*sizeof(char)); + memset(pszAnsiBuf, 0, (nAnsiStrLength+1)*sizeof(char)); + + WideCharToMultiByte(CP_ACP, 0, pwszBuf, -1, pszAnsiBuf, (nAnsiStrLength+1)*sizeof(char), nullptr, FALSE); + ret = pszAnsiBuf; + + free(pszAnsiBuf); + free(pwszBuf); + } + + return ret; +} + + + +#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ diff --git a/cocos/ui/proj.win32/Win32InputBox.h b/cocos/ui/proj.win32/Win32InputBox.h new file mode 100644 index 0000000000..1fd46a5593 --- /dev/null +++ b/cocos/ui/proj.win32/Win32InputBox.h @@ -0,0 +1,106 @@ +#ifndef __03022006__WIN32INPUTBOX__ +#define __03022006__WIN32INPUTBOX__ + +#include "cocos2d.h" + +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) +/* + +This library is (c) Elias Bachaalany aka lallous +You may use this library under the following license agreement: + +The zlib/libpng License. +--------------------------- +This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, including commercial applications, +and to alter it and redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; + you must not claim that you wrote the original software. + If you use this software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, + and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + +*/ + +#include +#include + +class CWin32InputBox; + +// Structure used to orient the inputbox behavior +struct WIN32INPUTBOX_PARAM +{ + friend class CWin32InputBox; + + // + IN OPTIONAL bool bMultiline; + + // Pass this as none zero so to use this memory dlg template + IN OPTIONAL LPVOID DlgTemplateData; + + // Pass this as none ZERO so to load DLGTEMPLATE from resources + IN OPTIONAL LPCSTR DlgTemplateName; + + // passing both "DlgTemplateName" and "DlgTemplateData" ZERO will cause + // the dialog to use his default embedded resource + + // Center on monitor or owner window? + IN OPTIONAL bool bCenter; + + // Want to add more styles to the dialog? + IN OPTIONAL DWORD dwStylesPlus, dwStylesMinus; + IN OPTIONAL DWORD dwExStylesPlus, dwExStylesMinus; + + IN LPCSTR szTitle, szPrompt; + + // Return buffer + OUT LPSTR szResult; + IN DWORD nResultSize; + + // Owner window + HWND hwndOwner; + HINSTANCE hInstance; + + short xPos, yPos; + + WIN32INPUTBOX_PARAM(); +private: + HWND hDlg; +}; + +class CWin32InputBox +{ +private: + WIN32INPUTBOX_PARAM *_param; + static LRESULT CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM); + HWND _hwndEditCtrl; + + void InitDialog(); + void SetParam(WIN32INPUTBOX_PARAM *); + WIN32INPUTBOX_PARAM * GetParam(); + +public: + + CWin32InputBox(WIN32INPUTBOX_PARAM *); + ~CWin32InputBox(); + + static INT_PTR InputBoxEx(WIN32INPUTBOX_PARAM *); + static INT_PTR InputBox( + LPCSTR szTitle, + LPCSTR szPrompt, + LPSTR szResult, + DWORD nResultSize, + bool bMultiLine = false, + HWND hwndParent = 0); + + static std::string AnsiToUtf8(std::string strAnsi); + static std::string Utf8ToAnsi(std::string strUTF8); +}; + +#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ + +#endif diff --git a/cocos/ui/proj.win32/libui.vcxproj b/cocos/ui/proj.win32/libui.vcxproj index ed67cf90df..92003d88cd 100644 --- a/cocos/ui/proj.win32/libui.vcxproj +++ b/cocos/ui/proj.win32/libui.vcxproj @@ -16,6 +16,9 @@ + + + @@ -36,12 +39,15 @@ + + + @@ -62,6 +68,7 @@ + diff --git a/cocos/ui/proj.win32/libui.vcxproj.filters b/cocos/ui/proj.win32/libui.vcxproj.filters index c51a43c85d..2933d8b07f 100644 --- a/cocos/ui/proj.win32/libui.vcxproj.filters +++ b/cocos/ui/proj.win32/libui.vcxproj.filters @@ -16,6 +16,9 @@ {b59b178a-b7e0-4826-ba07-44c46cd29a10} + + {08fb4468-821b-4e5c-9298-8b57a3152a5b} + @@ -93,6 +96,18 @@ BaseClasses + + UIWidgets\UIEditBox + + + UIWidgets\UIEditBox + + + UIWidgets\UIEditBox + + + UIWidgets\UIEditBox + @@ -167,5 +182,14 @@ BaseClasses + + UIWidgets\UIEditBox + + + UIWidgets\UIEditBox + + + UIWidgets\UIEditBox + \ No newline at end of file diff --git a/cocos/ui/proj.wp8/libGUI.vcxproj b/cocos/ui/proj.wp8/libGUI.vcxproj index 5e2e4e6453..47ec5d9d10 100644 --- a/cocos/ui/proj.wp8/libGUI.vcxproj +++ b/cocos/ui/proj.wp8/libGUI.vcxproj @@ -184,6 +184,9 @@ + + + @@ -210,6 +213,8 @@ + + diff --git a/cocos/ui/proj.wp8/libGUI.vcxproj.filters b/cocos/ui/proj.wp8/libGUI.vcxproj.filters index 7a7b4ae6b4..c0a7f8250b 100644 --- a/cocos/ui/proj.wp8/libGUI.vcxproj.filters +++ b/cocos/ui/proj.wp8/libGUI.vcxproj.filters @@ -87,6 +87,15 @@ BaseClasses + + UIWidgets + + + UIWidgets + + + UIWidgets + @@ -161,5 +170,11 @@ BaseClasses + + UIWidgets + + + UIWidgets + \ No newline at end of file diff --git a/tests/cpp-tests/Android.mk b/tests/cpp-tests/Android.mk index c1fcaefe21..6d122eac83 100644 --- a/tests/cpp-tests/Android.mk +++ b/tests/cpp-tests/Android.mk @@ -70,6 +70,7 @@ Classes/UITest/CocoStudioGUITest/GUIEditorTest.cpp \ Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp \ Classes/UITest/CocoStudioGUITest/UIScene.cpp \ Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp \ +Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp \ Classes/UITest/CocoStudioGUITest/UISceneManager.cpp \ Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp \ Classes/UITest/CocoStudioGUITest/UIFocusTest/UIFocusTest.cpp \ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 51fb94d967..5e0141dbd1 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -37,12 +37,23 @@ g_guisTests[] = UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); sceneManager->setCurrentUISceneId(KUIFocusTest_HBox); sceneManager->setMinUISceneId(KUIFocusTest_HBox); - //TODO: improve ListView focus sceneManager->setMaxUISceneId(KUIFocusTest_NestedLayout3); Scene* scene = sceneManager->currentUIScene(); Director::getInstance()->replaceScene(scene); } }, + { + "EditBox test", + [](Ref* sender) + { + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUIEditBoxTest); + sceneManager->setMinUISceneId(kUIEditBoxTest); + sceneManager->setMaxUISceneId(kUIEditBoxTest); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); + } + }, { "Scale9 Sprite Test", [](Ref* sender) diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp new file mode 100644 index 0000000000..30d7fcc822 --- /dev/null +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp @@ -0,0 +1,137 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "UIEditBoxTest.h" +#include "testResource.h" + +// UIEditBoxTest +UIEditBoxTest::UIEditBoxTest() +{ + +} + +UIEditBoxTest::~UIEditBoxTest() +{ +} + +bool UIEditBoxTest::init() +{ + if (UIScene::init()) + { + auto glview = Director::getInstance()->getOpenGLView(); + auto visibleOrigin = glview->getVisibleOrigin(); + auto visibleSize = glview->getVisibleSize(); + + auto pBg = Sprite::create("Images/HelloWorld.png"); + pBg->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2)); + addChild(pBg); + + _TTFShowEditReturn = Label::createWithSystemFont("No edit control return!", "Arial", 30); + _TTFShowEditReturn->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y + visibleSize.height - 50)); + addChild(_TTFShowEditReturn); + + + auto editBoxSize = Size(visibleSize.width - 100, 60); + + // top + std::string pNormalSprite = "extensions/green_edit.png"; + _editName = ui::EditBox::create(editBoxSize, pNormalSprite); + _editName->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height*3/4)); + _editName->setFontName("Paint Boy"); + _editName->setFontSize(25); + _editName->setFontColor(Color3B::RED); + _editName->setPlaceHolder("Name:"); + _editName->setPlaceholderFontColor(Color3B::WHITE); + _editName->setMaxLength(8); + _editName->setReturnType(ui::EditBox::KeyboardReturnType::DONE); + _editName->setDelegate(this); + addChild(_editName); + + // middle + _editPassword = ui::EditBox::create(editBoxSize, "extensions/orange_edit.png"); + _editPassword->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2)); +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) + _editPassword->setFont("American Typewriter", 30); +#else + _editPassword->setFont("American Typewriter", 80); + _editPassword->setPlaceholderFont("American Typewriter", 80); +#endif + _editPassword->setFontColor(Color3B::GREEN); + _editPassword->setPlaceHolder("Password:"); + _editPassword->setMaxLength(6); + _editPassword->setInputFlag(ui::EditBox::InputFlag::PASSWORD); + _editPassword->setInputMode(ui::EditBox::InputMode::SINGLE_LINE); + _editPassword->setDelegate(this); + addChild(_editPassword); + + // bottom + _editEmail = ui::EditBox::create(Size(editBoxSize.width, editBoxSize.height), "extensions/yellow_edit.png"); + _editEmail->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/4)); + _editEmail->setAnchorPoint(Vec2(0.5, 1.0f)); + _editEmail->setPlaceHolder("Email:"); + _editEmail->setInputMode(ui::EditBox::InputMode::EMAIL_ADDRESS); + _editEmail->setDelegate(this); + addChild(_editEmail); + + this->setPosition(Vec2(10, 20)); + + + + return true; + } + return false; +} + +void UIEditBoxTest::editBoxEditingDidBegin(cocos2d::ui::EditBox* editBox) +{ + log("editBox %p DidBegin !", editBox); +} + +void UIEditBoxTest::editBoxEditingDidEnd(cocos2d::ui::EditBox* editBox) +{ + log("editBox %p DidEnd !", editBox); +} + +void UIEditBoxTest::editBoxTextChanged(cocos2d::ui::EditBox* editBox, const std::string& text) +{ + log("editBox %p TextChanged, text: %s ", editBox, text.c_str()); +} + +void UIEditBoxTest::editBoxReturn(ui::EditBox* editBox) +{ + log("editBox %p was returned !",editBox); + + if (_editName == editBox) + { + _TTFShowEditReturn->setString("Name EditBox return !"); + } + else if (_editPassword == editBox) + { + _TTFShowEditReturn->setString("Password EditBox return !"); + } + else if (_editEmail == editBox) + { + _TTFShowEditReturn->setString("Email EditBox return !"); + } +} diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.h new file mode 100644 index 0000000000..3d93dd7717 --- /dev/null +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.h @@ -0,0 +1,52 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __cocos2d_tests__UIEditBoxTest__ +#define __cocos2d_tests__UIEditBoxTest__ + +#include "UIScene.h" + +class UIEditBoxTest : public UIScene, public cocos2d::ui::EditBoxDelegate +{ +public: + UIEditBoxTest(); + ~UIEditBoxTest(); + bool init(); + + virtual void editBoxEditingDidBegin(cocos2d::ui::EditBox* editBox); + virtual void editBoxEditingDidEnd(cocos2d::ui::EditBox* editBox); + virtual void editBoxTextChanged(cocos2d::ui::EditBox* editBox, const std::string& text); + virtual void editBoxReturn(cocos2d::ui::EditBox* editBox); + + +protected: + cocos2d::Label* _TTFShowEditReturn; + cocos2d::ui::EditBox* _editName; + cocos2d::ui::EditBox* _editPassword; + cocos2d::ui::EditBox* _editEmail; + + UI_SCENE_CREATE_FUNC(UIEditBoxTest) +}; + +#endif /* defined(__cocos2d_tests__UIEditBoxTest__) */ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.h index 28a1b172e7..51aa68a126 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIScene.h @@ -31,7 +31,7 @@ USING_NS_CC; USING_NS_CC_EXT; -using namespace ui; +using namespace cocos2d::ui; #define UI_SCENE_CREATE_FUNC(UIScene) \ public: \ diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index 11e781e255..ee0ff4e5b1 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -22,6 +22,7 @@ #include "UIVideoPlayerTest/UIVideoPlayerTest.h" #endif #include "UIScale9SpriteTest.h" +#include "UIEditBoxTest.h" USING_NS_CC; @@ -35,6 +36,7 @@ static const char* s_testArray[] = "UIButtonTest_RemoveSelf", "UIButtonTestSwitchScale9", "UIButtonTestZoomScale", + "UIEditBoxTest", "UICheckBoxTest", "UISliderTest", "UISliderTest_Scale9", @@ -369,6 +371,8 @@ Scene *UISceneManager::currentUIScene() return UIS9Flip::sceneWithTitle(s_testArray[_currentUISceneId]); case kUIS9ChangeAnchorPoint: return UIS9ChangeAnchorPoint::sceneWithTitle(s_testArray[_currentUISceneId]); + case kUIEditBoxTest: + return UIEditBoxTest::sceneWithTitle(s_testArray[_currentUISceneId]); } return nullptr; } diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h index 4361de611f..6562a722db 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.h @@ -38,6 +38,7 @@ enum kUIButtonTest_RemoveSelf, kUIButtonTestSwitchScale9, kUIButtonTestZoomScale, + kUIEditBoxTest, kUICheckBoxTest, kUISliderTest, kUISliderTest_Scale9, diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index cd2cbd3f0a..0b80cec40e 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -204,6 +204,7 @@ + @@ -392,6 +393,7 @@ + diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters index e815660d53..7d7fc6199c 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters @@ -867,6 +867,9 @@ Classes\Sprite3DTest + + Classes\UITest\CocostudioGUISceneTest + @@ -1601,5 +1604,8 @@ Classes\Sprite3DTest + + Classes\UITest\CocostudioGUISceneTest + \ No newline at end of file diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj index c152ba0746..9d77c284f5 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj @@ -248,6 +248,7 @@ + @@ -449,6 +450,7 @@ + diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters index 5959863578..98b5c51559 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters @@ -858,6 +858,9 @@ Classes\UITest\CocosStudioGUITest + + Classes\UITest\CocosStudioGUITest + @@ -1590,6 +1593,9 @@ Classes\UITest\CocosStudioGUITest + + Classes\UITest\CocosStudioGUITest + From 534938d88c22fd3349dda3f94299c84dc84ce3e4 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 19 Aug 2014 15:17:48 +0800 Subject: [PATCH 05/45] fix linux compile error --- tests/cpp-tests/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index 5dcfe748c8..81baa37543 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -82,6 +82,7 @@ set(SAMPLE_SRC Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp Classes/UITest/CocoStudioGUITest/UIScene.cpp Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp + Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp Classes/UITest/CocoStudioGUITest/UISceneManager.cpp Classes/UITest/CocoStudioGUITest/CocostudioParserTest/CocostudioParserJsonTest.cpp Classes/UITest/CocoStudioGUITest/CocostudioParserTest.cpp From a8ab1a85b71e175bc66ff7a785d0ebce3d238418 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 19 Aug 2014 17:42:17 +0800 Subject: [PATCH 06/45] fix linux compile error --- cocos/ui/CMakeLists.txt | 4 ++++ .../Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp | 2 ++ .../Classes/UITest/CocoStudioGUITest/UISceneManager.cpp | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/cocos/ui/CMakeLists.txt b/cocos/ui/CMakeLists.txt index 3ccdf27b25..132f7c4635 100644 --- a/cocos/ui/CMakeLists.txt +++ b/cocos/ui/CMakeLists.txt @@ -23,6 +23,10 @@ set(COCOS_UI_SRC UIWidget.cpp UIDeprecated.cpp UIScale9Sprite.cpp + UIEditBox/UIEditBox.cpp + UIEditBox/UIEditBoxImplAndroid.cpp + UIEditBox/UIEditBoxImplNone.cpp + UIEditBox/UIEditBoxImplWin.cpp ) include_directories( diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 5e0141dbd1..e3cd3c24fb 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -42,6 +42,7 @@ g_guisTests[] = Director::getInstance()->replaceScene(scene); } }, +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) { "EditBox test", [](Ref* sender) @@ -54,6 +55,7 @@ g_guisTests[] = Director::getInstance()->replaceScene(scene); } }, +#endif { "Scale9 Sprite Test", [](Ref* sender) diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp index ee0ff4e5b1..d552528b00 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UISceneManager.cpp @@ -22,7 +22,9 @@ #include "UIVideoPlayerTest/UIVideoPlayerTest.h" #endif #include "UIScale9SpriteTest.h" +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) #include "UIEditBoxTest.h" +#endif USING_NS_CC; @@ -36,7 +38,9 @@ static const char* s_testArray[] = "UIButtonTest_RemoveSelf", "UIButtonTestSwitchScale9", "UIButtonTestZoomScale", +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) "UIEditBoxTest", +#endif "UICheckBoxTest", "UISliderTest", "UISliderTest_Scale9", @@ -371,8 +375,11 @@ Scene *UISceneManager::currentUIScene() return UIS9Flip::sceneWithTitle(s_testArray[_currentUISceneId]); case kUIS9ChangeAnchorPoint: return UIS9ChangeAnchorPoint::sceneWithTitle(s_testArray[_currentUISceneId]); +#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) case kUIEditBoxTest: return UIEditBoxTest::sceneWithTitle(s_testArray[_currentUISceneId]); +#endif + } return nullptr; } From 46f3ab9b571a0d7837ffb1d026a76d69d9649144 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 20 Aug 2014 16:08:28 +0800 Subject: [PATCH 07/45] add Scale9Sprite to create method of ui::EditBox --- cocos/ui/UIEditBox/UIEditBox.cpp | 43 +++++++++++++++++++ cocos/ui/UIEditBox/UIEditBox.h | 9 ++++ .../CocoStudioGUITest/UIEditBoxTest.cpp | 2 +- 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/cocos/ui/UIEditBox/UIEditBox.cpp b/cocos/ui/UIEditBox/UIEditBox.cpp index 12723cdb6e..3d9034d372 100644 --- a/cocos/ui/UIEditBox/UIEditBox.cpp +++ b/cocos/ui/UIEditBox/UIEditBox.cpp @@ -84,6 +84,49 @@ EditBox* EditBox::create(const Size& size, return pRet; } + +EditBox* EditBox::create(const cocos2d::Size &size, cocos2d::ui::Scale9Sprite *pNormal9SpriteBg) +{ + EditBox* pRet = new EditBox(); + + if (pRet != nullptr && pRet->initWithSizeAndBackgroundSprite(size, pNormal9SpriteBg)) + { + pRet->autorelease(); + } + else + { + CC_SAFE_DELETE(pRet); + } + + return pRet; +} + +bool EditBox::initWithSizeAndBackgroundSprite(const cocos2d::Size &size, cocos2d::ui::Scale9Sprite *pNormal9SpriteBg) +{ + if (Widget::init()) + { + _editBoxImpl = __createSystemEditBox(this); + _editBoxImpl->initWithSize(size); + _editBoxImpl->setInputMode(EditBox::InputMode::ANY); + + _backgroundSprite = pNormal9SpriteBg; + + this->setContentSize(size); + this->setPosition(Vec2(0, 0)); + + _backgroundSprite->setPosition(Vec2(_contentSize.width/2, _contentSize.height/2)); + _backgroundSprite->setContentSize(size); + this->addProtectedChild(_backgroundSprite); + + this->setTouchEnabled(true); + + this->addTouchEventListener(CC_CALLBACK_2(EditBox::touchDownAction, this)); + + return true; + } + return false; +} + bool EditBox::initWithSizeAndBackgroundSprite(const Size& size, const std::string& pNormal9SpriteBg, diff --git a/cocos/ui/UIEditBox/UIEditBox.h b/cocos/ui/UIEditBox/UIEditBox.h index 335193fee8..61bbeab965 100644 --- a/cocos/ui/UIEditBox/UIEditBox.h +++ b/cocos/ui/UIEditBox/UIEditBox.h @@ -185,6 +185,13 @@ namespace ui { INTIAL_CAPS_ALL_CHARACTERS, }; + /** + * create a edit box with size. + * @return An autorelease pointer of EditBox, you don't need to release it only if you retain it again. + */ + static EditBox* create(const Size& size, + Scale9Sprite* pNormal9SpriteBg); + /** * create a edit box with size. * @return An autorelease pointer of EditBox, you don't need to release it only if you retain it again. @@ -214,6 +221,8 @@ namespace ui { const std::string& pNormal9SpriteBg, TextureResType texType = TextureResType::LOCAL); + bool initWithSizeAndBackgroundSprite(const Size& size, Scale9Sprite* pNormal9SpriteBg); + /** * Gets/Sets the delegate for edit box. * @lua NA diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp index 30d7fcc822..121f6a1fb0 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp @@ -56,7 +56,7 @@ bool UIEditBoxTest::init() // top std::string pNormalSprite = "extensions/green_edit.png"; - _editName = ui::EditBox::create(editBoxSize, pNormalSprite); + _editName = ui::EditBox::create(editBoxSize, ui::Scale9Sprite::create(pNormalSprite)); _editName->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height*3/4)); _editName->setFontName("Paint Boy"); _editName->setFontSize(25); From 2d8bec2ba92741056654691c738c850fa13d3de7 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 20 Aug 2014 16:20:57 +0800 Subject: [PATCH 08/45] remove Extension EditBox --- build/cocos2d_libs.xcodeproj/project.pbxproj | 62 -- extensions/GUI/CCEditBox/CCEditBox.cpp | 435 ----------- extensions/GUI/CCEditBox/CCEditBox.h | 452 ------------ extensions/GUI/CCEditBox/CCEditBoxImpl.h | 104 --- .../GUI/CCEditBox/CCEditBoxImplAndroid.cpp | 315 -------- .../GUI/CCEditBox/CCEditBoxImplAndroid.h | 109 --- extensions/GUI/CCEditBox/CCEditBoxImplIOS.h | 143 ---- extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm | 674 ------------------ extensions/GUI/CCEditBox/CCEditBoxImplMac.h | 132 ---- extensions/GUI/CCEditBox/CCEditBoxImplMac.mm | 520 -------------- .../GUI/CCEditBox/CCEditBoxImplNone.cpp | 14 - extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp | 298 -------- extensions/GUI/CCEditBox/CCEditBoxImplWin.h | 116 --- extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp | 303 -------- extensions/GUI/CCEditBox/CCEditBoxImplWp8.h | 87 --- extensions/cocos-ext.h | 2 +- .../EditBoxTest/EditBoxTest.cpp | 13 +- .../ExtensionsTest/EditBoxTest/EditBoxTest.h | 16 +- 18 files changed, 16 insertions(+), 3779 deletions(-) delete mode 100644 extensions/GUI/CCEditBox/CCEditBox.cpp delete mode 100644 extensions/GUI/CCEditBox/CCEditBox.h delete mode 100644 extensions/GUI/CCEditBox/CCEditBoxImpl.h delete mode 100644 extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp delete mode 100644 extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h delete mode 100644 extensions/GUI/CCEditBox/CCEditBoxImplIOS.h delete mode 100644 extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm delete mode 100644 extensions/GUI/CCEditBox/CCEditBoxImplMac.h delete mode 100644 extensions/GUI/CCEditBox/CCEditBoxImplMac.mm delete mode 100644 extensions/GUI/CCEditBox/CCEditBoxImplNone.cpp delete mode 100644 extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp delete mode 100644 extensions/GUI/CCEditBox/CCEditBoxImplWin.h delete mode 100644 extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp delete mode 100644 extensions/GUI/CCEditBox/CCEditBoxImplWp8.h diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 0225d99ce9..83f7a98a31 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -731,19 +731,6 @@ 460E47AC18080904000CDD6D /* CCInvocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1684B1807AF4E005B8026 /* CCInvocation.h */; }; 460E47AD18080904000CDD6D /* CCScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684C1807AF4E005B8026 /* CCScale9Sprite.cpp */; }; 460E47AE18080904000CDD6D /* CCScale9Sprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1684D1807AF4E005B8026 /* CCScale9Sprite.h */; }; - 460E47AF1808090B000CDD6D /* CCEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684F1807AF4E005B8026 /* CCEditBox.cpp */; }; - 460E47B01808090B000CDD6D /* CCEditBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168501807AF4E005B8026 /* CCEditBox.h */; }; - 460E47B11808090B000CDD6D /* CCEditBoxImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168511807AF4E005B8026 /* CCEditBoxImpl.h */; }; - 460E47BD1808090D000CDD6D /* CCEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684F1807AF4E005B8026 /* CCEditBox.cpp */; }; - 460E47BE1808090D000CDD6D /* CCEditBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168501807AF4E005B8026 /* CCEditBox.h */; }; - 460E47BF1808090D000CDD6D /* CCEditBoxImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168511807AF4E005B8026 /* CCEditBoxImpl.h */; }; - 460E47C01808090D000CDD6D /* CCEditBoxImplAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168521807AF4E005B8026 /* CCEditBoxImplAndroid.cpp */; }; - 460E47C11808090D000CDD6D /* CCEditBoxImplAndroid.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168531807AF4E005B8026 /* CCEditBoxImplAndroid.h */; }; - 460E47C21808090D000CDD6D /* CCEditBoxImplIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */; }; - 460E47C31808090D000CDD6D /* CCEditBoxImplIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */; }; - 460E47C61808090D000CDD6D /* CCEditBoxImplNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168581807AF4E005B8026 /* CCEditBoxImplNone.cpp */; }; - 460E47C91808090D000CDD6D /* CCEditBoxImplWin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1685B1807AF4E005B8026 /* CCEditBoxImplWin.cpp */; }; - 460E47CA1808090D000CDD6D /* CCEditBoxImplWin.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1685C1807AF4E005B8026 /* CCEditBoxImplWin.h */; }; 460E47CB18080913000CDD6D /* CCScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1685E1807AF4E005B8026 /* CCScrollView.cpp */; }; 460E47CC18080913000CDD6D /* CCScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1685F1807AF4E005B8026 /* CCScrollView.h */; }; 460E47CF18080913000CDD6D /* CCTableView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168621807AF4E005B8026 /* CCTableView.cpp */; }; @@ -1365,8 +1352,6 @@ B276EF651988D1D500CD400F /* CCVertexIndexBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B276EF5E1988D1D500CD400F /* CCVertexIndexBuffer.cpp */; }; B276EF661988D1D500CD400F /* CCVertexIndexBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B276EF5E1988D1D500CD400F /* CCVertexIndexBuffer.cpp */; }; B27AEE0219768934008BD575 /* libwebsockets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AAF5384180E35A3000584C8 /* libwebsockets.a */; }; - B282B4801980E08F00666787 /* CCEditBoxImplMac.h in Headers */ = {isa = PBXBuildFile; fileRef = B282B47D1980E02B00666787 /* CCEditBoxImplMac.h */; }; - B282B4811980E0A300666787 /* CCEditBoxImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B282B47C1980E02B00666787 /* CCEditBoxImplMac.mm */; }; B29594B41926D5EC003EEF37 /* CCMeshCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594B21926D5EC003EEF37 /* CCMeshCommand.cpp */; }; B29594B51926D5EC003EEF37 /* CCMeshCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B29594B21926D5EC003EEF37 /* CCMeshCommand.cpp */; }; B29594B61926D5EC003EEF37 /* CCMeshCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B29594B31926D5EC003EEF37 /* CCMeshCommand.h */; }; @@ -2629,16 +2614,6 @@ 46A1684B1807AF4E005B8026 /* CCInvocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCInvocation.h; sourceTree = ""; }; 46A1684C1807AF4E005B8026 /* CCScale9Sprite.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCScale9Sprite.cpp; sourceTree = ""; }; 46A1684D1807AF4E005B8026 /* CCScale9Sprite.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCScale9Sprite.h; sourceTree = ""; }; - 46A1684F1807AF4E005B8026 /* CCEditBox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBox.cpp; sourceTree = ""; }; - 46A168501807AF4E005B8026 /* CCEditBox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBox.h; sourceTree = ""; }; - 46A168511807AF4E005B8026 /* CCEditBoxImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImpl.h; sourceTree = ""; }; - 46A168521807AF4E005B8026 /* CCEditBoxImplAndroid.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplAndroid.cpp; sourceTree = ""; }; - 46A168531807AF4E005B8026 /* CCEditBoxImplAndroid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplAndroid.h; sourceTree = ""; }; - 46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplIOS.h; sourceTree = ""; }; - 46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEditBoxImplIOS.mm; sourceTree = ""; }; - 46A168581807AF4E005B8026 /* CCEditBoxImplNone.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplNone.cpp; sourceTree = ""; }; - 46A1685B1807AF4E005B8026 /* CCEditBoxImplWin.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplWin.cpp; sourceTree = ""; }; - 46A1685C1807AF4E005B8026 /* CCEditBoxImplWin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplWin.h; sourceTree = ""; }; 46A1685E1807AF4E005B8026 /* CCScrollView.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCScrollView.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 46A1685F1807AF4E005B8026 /* CCScrollView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCScrollView.h; sourceTree = ""; }; 46A168621807AF4E005B8026 /* CCTableView.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCTableView.cpp; sourceTree = ""; }; @@ -3103,8 +3078,6 @@ B276EF5C1988D1D500CD400F /* CCVertexIndexData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCVertexIndexData.cpp; sourceTree = ""; }; B276EF5D1988D1D500CD400F /* CCVertexIndexBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCVertexIndexBuffer.h; sourceTree = ""; }; B276EF5E1988D1D500CD400F /* CCVertexIndexBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCVertexIndexBuffer.cpp; sourceTree = ""; }; - B282B47C1980E02B00666787 /* CCEditBoxImplMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEditBoxImplMac.mm; sourceTree = ""; }; - B282B47D1980E02B00666787 /* CCEditBoxImplMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplMac.h; sourceTree = ""; }; B29594AF1926D5D9003EEF37 /* ccShader_3D_Color.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_Color.frag; sourceTree = ""; }; B29594B01926D5D9003EEF37 /* ccShader_3D_ColorTex.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_ColorTex.frag; sourceTree = ""; }; B29594B11926D5D9003EEF37 /* ccShader_3D_PositionTex.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_PositionTex.vert; sourceTree = ""; }; @@ -4596,7 +4569,6 @@ isa = PBXGroup; children = ( 46A168341807AF4E005B8026 /* CCControlExtension */, - 46A1684E1807AF4E005B8026 /* CCEditBox */, 46A1685D1807AF4E005B8026 /* CCScrollView */, ); path = GUI; @@ -4634,25 +4606,6 @@ path = CCControlExtension; sourceTree = ""; }; - 46A1684E1807AF4E005B8026 /* CCEditBox */ = { - isa = PBXGroup; - children = ( - B282B47C1980E02B00666787 /* CCEditBoxImplMac.mm */, - B282B47D1980E02B00666787 /* CCEditBoxImplMac.h */, - 46A1684F1807AF4E005B8026 /* CCEditBox.cpp */, - 46A168501807AF4E005B8026 /* CCEditBox.h */, - 46A168511807AF4E005B8026 /* CCEditBoxImpl.h */, - 46A168521807AF4E005B8026 /* CCEditBoxImplAndroid.cpp */, - 46A168531807AF4E005B8026 /* CCEditBoxImplAndroid.h */, - 46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */, - 46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */, - 46A168581807AF4E005B8026 /* CCEditBoxImplNone.cpp */, - 46A1685B1807AF4E005B8026 /* CCEditBoxImplWin.cpp */, - 46A1685C1807AF4E005B8026 /* CCEditBoxImplWin.h */, - ); - path = CCEditBox; - sourceTree = ""; - }; 46A1685D1807AF4E005B8026 /* CCScrollView */ = { isa = PBXGroup; children = ( @@ -5774,15 +5727,12 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - B282B4801980E08F00666787 /* CCEditBoxImplMac.h in Headers */, 460E478318080902000CDD6D /* CCControlExtensions.h in Headers */, 460E477E18080902000CDD6D /* CCControl.h in Headers */, - 460E47B11808090B000CDD6D /* CCEditBoxImpl.h in Headers */, 460E477B180808F5000CDD6D /* ExtensionMacros.h in Headers */, 460E479118080902000CDD6D /* CCControlUtils.h in Headers */, 460E468118080832000CDD6D /* cocos-ext.h in Headers */, 460E47CC18080913000CDD6D /* CCScrollView.h in Headers */, - 460E47B01808090B000CDD6D /* CCEditBox.h in Headers */, 460E478918080902000CDD6D /* CCControlSaturationBrightnessPicker.h in Headers */, 460E47D018080913000CDD6D /* CCTableView.h in Headers */, 460E478F18080902000CDD6D /* CCControlSwitch.h in Headers */, @@ -6044,13 +5994,10 @@ 460E47A418080904000CDD6D /* CCControlSlider.h in Headers */, 460E479E18080904000CDD6D /* CCControlHuePicker.h in Headers */, 460E468218080836000CDD6D /* cocos-ext.h in Headers */, - 460E47BF1808090D000CDD6D /* CCEditBoxImpl.h in Headers */, 460E47AE18080904000CDD6D /* CCScale9Sprite.h in Headers */, 460E477C180808F7000CDD6D /* ExtensionMacros.h in Headers */, 460E47A218080904000CDD6D /* CCControlSaturationBrightnessPicker.h in Headers */, 460E479B18080904000CDD6D /* CCControlColourPicker.h in Headers */, - 460E47C11808090D000CDD6D /* CCEditBoxImplAndroid.h in Headers */, - 460E47CA1808090D000CDD6D /* CCEditBoxImplWin.h in Headers */, 460E47AA18080904000CDD6D /* CCControlUtils.h in Headers */, 460E47A818080904000CDD6D /* CCControlSwitch.h in Headers */, 460E47D818080914000CDD6D /* CCTableView.h in Headers */, @@ -6059,8 +6006,6 @@ 460E47DA18080914000CDD6D /* CCTableViewCell.h in Headers */, 460E47AC18080904000CDD6D /* CCInvocation.h in Headers */, 460E47A018080904000CDD6D /* CCControlPotentiometer.h in Headers */, - 460E47BE1808090D000CDD6D /* CCEditBox.h in Headers */, - 460E47C21808090D000CDD6D /* CCEditBoxImplIOS.h in Headers */, 1AD71EF3180E27CF00808F54 /* CCPhysicsDebugNode.h in Headers */, 1AD71EF7180E27CF00808F54 /* CCPhysicsSprite.h in Headers */, 1AAF5356180E3060000584C8 /* AssetsManager.h in Headers */, @@ -7303,7 +7248,6 @@ buildActionMask = 2147483647; files = ( 460E477D18080902000CDD6D /* CCControl.cpp in Sources */, - B282B4811980E0A300666787 /* CCEditBoxImplMac.mm in Sources */, 460E47CB18080913000CDD6D /* CCScrollView.cpp in Sources */, 460E47D118080913000CDD6D /* CCTableViewCell.cpp in Sources */, 460E47CF18080913000CDD6D /* CCTableView.cpp in Sources */, @@ -7315,7 +7259,6 @@ 460E478E18080902000CDD6D /* CCControlSwitch.cpp in Sources */, 460E479218080902000CDD6D /* CCInvocation.cpp in Sources */, 460E477F18080902000CDD6D /* CCControlButton.cpp in Sources */, - 460E47AF1808090B000CDD6D /* CCEditBox.cpp in Sources */, 460E479418080902000CDD6D /* CCScale9Sprite.cpp in Sources */, 460E478118080902000CDD6D /* CCControlColourPicker.cpp in Sources */, 460E479018080902000CDD6D /* CCControlUtils.cpp in Sources */, @@ -7526,12 +7469,8 @@ buildActionMask = 2147483647; files = ( 460E47D918080914000CDD6D /* CCTableViewCell.cpp in Sources */, - 460E47C01808090D000CDD6D /* CCEditBoxImplAndroid.cpp in Sources */, 460E47A118080904000CDD6D /* CCControlSaturationBrightnessPicker.cpp in Sources */, - 460E47BD1808090D000CDD6D /* CCEditBox.cpp in Sources */, - 460E47C61808090D000CDD6D /* CCEditBoxImplNone.cpp in Sources */, 460E47D318080914000CDD6D /* CCScrollView.cpp in Sources */, - 460E47C91808090D000CDD6D /* CCEditBoxImplWin.cpp in Sources */, 460E47A918080904000CDD6D /* CCControlUtils.cpp in Sources */, 460E47D718080914000CDD6D /* CCTableView.cpp in Sources */, 460E479F18080904000CDD6D /* CCControlPotentiometer.cpp in Sources */, @@ -7540,7 +7479,6 @@ 460E47A318080904000CDD6D /* CCControlSlider.cpp in Sources */, 460E47AB18080904000CDD6D /* CCInvocation.cpp in Sources */, 460E47AD18080904000CDD6D /* CCScale9Sprite.cpp in Sources */, - 460E47C31808090D000CDD6D /* CCEditBoxImplIOS.mm in Sources */, 460E47A718080904000CDD6D /* CCControlSwitch.cpp in Sources */, 460E479618080904000CDD6D /* CCControl.cpp in Sources */, 460E47A518080904000CDD6D /* CCControlStepper.cpp in Sources */, diff --git a/extensions/GUI/CCEditBox/CCEditBox.cpp b/extensions/GUI/CCEditBox/CCEditBox.cpp deleted file mode 100644 index 97c34951c7..0000000000 --- a/extensions/GUI/CCEditBox/CCEditBox.cpp +++ /dev/null @@ -1,435 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2012 James Chen - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "CCEditBox.h" -#include "CCEditBoxImpl.h" - -NS_CC_EXT_BEGIN - -static const float CHECK_EDITBOX_POSITION_INTERVAL = 0.1f; - -EditBox::EditBox(void) -: _editBoxImpl(nullptr) -, _delegate(nullptr) -, _editBoxInputMode(EditBox::InputMode::SINGLE_LINE) -, _editBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS) -, _keyboardReturnType(KeyboardReturnType::DEFAULT) -, _fontSize(-1) -, _placeholderFontSize(-1) -, _colText(Color3B::WHITE) -, _colPlaceHolder(Color3B::GRAY) -, _maxLength(0) -, _adjustHeight(0.0f) -#if CC_ENABLE_SCRIPT_BINDING -, _scriptEditBoxHandler(0) -#endif -{ -} - -EditBox::~EditBox(void) -{ - CC_SAFE_DELETE(_editBoxImpl); -#if CC_ENABLE_SCRIPT_BINDING - unregisterScriptEditBoxHandler(); -#endif -} - - -void EditBox::touchDownAction(Ref *sender, Control::EventType controlEvent) -{ - _editBoxImpl->openKeyboard(); -} - -EditBox* EditBox::create(const Size& size, Scale9Sprite* pNormal9SpriteBg, Scale9Sprite* pPressed9SpriteBg/* = nullptr*/, Scale9Sprite* pDisabled9SpriteBg/* = nullptr*/) -{ - EditBox* pRet = new EditBox(); - - if (pRet != nullptr && pRet->initWithSizeAndBackgroundSprite(size, pNormal9SpriteBg)) - { - if (pPressed9SpriteBg != nullptr) - { - pRet->setBackgroundSpriteForState(pPressed9SpriteBg, Control::State::HIGH_LIGHTED); - } - - if (pDisabled9SpriteBg != nullptr) - { - pRet->setBackgroundSpriteForState(pDisabled9SpriteBg, Control::State::DISABLED); - } - pRet->autorelease(); - } - else - { - CC_SAFE_DELETE(pRet); - } - - return pRet; -} - -bool EditBox::initWithSizeAndBackgroundSprite(const Size& size, Scale9Sprite* pPressed9SpriteBg) -{ - if (ControlButton::initWithBackgroundSprite(pPressed9SpriteBg)) - { - _editBoxImpl = __createSystemEditBox(this); - _editBoxImpl->initWithSize(size); - _editBoxImpl->setInputMode(EditBox::InputMode::ANY); - - this->setZoomOnTouchDown(false); - this->setPreferredSize(size); - this->setPosition(Vec2(0, 0)); - this->addTargetWithActionForControlEvent(this, cccontrol_selector(EditBox::touchDownAction), Control::EventType::TOUCH_UP_INSIDE); - - return true; - } - return false; -} - -void EditBox::setDelegate(EditBoxDelegate* pDelegate) -{ - _delegate = pDelegate; - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setDelegate(pDelegate); - } -} - -EditBoxDelegate* EditBox::getDelegate() -{ - return _delegate; -} - -void EditBox::setText(const char* pText) -{ - if (pText != nullptr) - { - _text = pText; - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setText(pText); - } - } -} - -const char* EditBox::getText(void) -{ - if (_editBoxImpl != nullptr) - { - const char* pText = _editBoxImpl->getText(); - if(pText != nullptr) - return pText; - } - - return ""; -} - -void EditBox::setFont(const char* pFontName, int fontSize) -{ - _fontName = pFontName; - _fontSize = fontSize; - if (pFontName != nullptr) - { - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setFont(pFontName, fontSize); - } - } -} - -void EditBox::setFontName(const char* pFontName) -{ - _fontName = pFontName; - if (_editBoxImpl != nullptr && _fontSize != -1) - { - _editBoxImpl->setFont(pFontName, _fontSize); - } -} - -void EditBox::setFontSize(int fontSize) -{ - _fontSize = fontSize; - if (_editBoxImpl != nullptr && _fontName.length() > 0) - { - _editBoxImpl->setFont(_fontName.c_str(), _fontSize); - } -} - -void EditBox::setFontColor(const Color3B& color) -{ - _colText = color; - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setFontColor(color); - } -} - -void EditBox::setPlaceholderFont(const char* pFontName, int fontSize) -{ - _placeholderFontName = pFontName; - _placeholderFontSize = fontSize; - if (pFontName != nullptr) - { - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setPlaceholderFont(pFontName, fontSize); - } - } -} - -void EditBox::setPlaceholderFontName(const char* pFontName) -{ - _placeholderFontName = pFontName; - if (_editBoxImpl != nullptr && _placeholderFontSize != -1) - { - _editBoxImpl->setPlaceholderFont(pFontName, _fontSize); - } -} - -void EditBox::setPlaceholderFontSize(int fontSize) -{ - _placeholderFontSize = fontSize; - if (_editBoxImpl != nullptr && _placeholderFontName.length() > 0) - { - _editBoxImpl->setPlaceholderFont(_placeholderFontName.c_str(), _fontSize); - } -} - -void EditBox::setPlaceholderFontColor(const Color3B& color) -{ - _colText = color; - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setPlaceholderFontColor(color); - } -} - -void EditBox::setPlaceHolder(const char* pText) -{ - if (pText != nullptr) - { - _placeHolder = pText; - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setPlaceHolder(pText); - } - } -} - -const char* EditBox::getPlaceHolder(void) -{ - return _placeHolder.c_str(); -} - -void EditBox::setInputMode(EditBox::InputMode inputMode) -{ - _editBoxInputMode = inputMode; - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setInputMode(inputMode); - } -} - -void EditBox::setMaxLength(int maxLength) -{ - _maxLength = maxLength; - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setMaxLength(maxLength); - } -} - - -int EditBox::getMaxLength() -{ - return _maxLength; -} - -void EditBox::setInputFlag(EditBox::InputFlag inputFlag) -{ - _editBoxInputFlag = inputFlag; - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setInputFlag(inputFlag); - } -} - -void EditBox::setReturnType(EditBox::KeyboardReturnType returnType) -{ - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setReturnType(returnType); - } -} - -/* override function */ -void EditBox::setPosition(const Vec2& pos) -{ - ControlButton::setPosition(pos); - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setPosition(pos); - } -} - -void EditBox::setVisible(bool visible) -{ - ControlButton::setVisible(visible); - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setVisible(visible); - } -} - -void EditBox::setContentSize(const Size& size) -{ - ControlButton::setContentSize(size); - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setContentSize(size); - } -} - -void EditBox::setAnchorPoint(const Vec2& anchorPoint) -{ - ControlButton::setAnchorPoint(anchorPoint); - if (_editBoxImpl != nullptr) - { - _editBoxImpl->setAnchorPoint(anchorPoint); - } -} - -void EditBox::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) -{ - ControlButton::visit(renderer, parentTransform, parentFlags); - if (_editBoxImpl != nullptr) - { - _editBoxImpl->visit(); - } -} - -void EditBox::onEnter(void) -{ -#if CC_ENABLE_SCRIPT_BINDING - if (_scriptType == kScriptTypeJavascript) - { - if (ScriptEngineManager::sendNodeEventToJSExtended(this, kNodeOnEnter)) - return; - } -#endif - - ControlButton::onEnter(); - if (_editBoxImpl != nullptr) - { - _editBoxImpl->onEnter(); - } -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) - this->schedule(schedule_selector(EditBox::updatePosition), CHECK_EDITBOX_POSITION_INTERVAL); -#endif -} - -void EditBox::updatePosition(float dt) -{ - if (nullptr != _editBoxImpl) { - _editBoxImpl->updatePosition(dt); - } -} - - -void EditBox::onExit(void) -{ - ControlButton::onExit(); - if (_editBoxImpl != nullptr) - { - // remove system edit control - _editBoxImpl->closeKeyboard(); - } -} - -static Rect getRect(Node * pNode) -{ - Size contentSize = pNode->getContentSize(); - Rect rect = Rect(0, 0, contentSize.width, contentSize.height); - return RectApplyTransform(rect, pNode->getNodeToWorldTransform()); -} - -void EditBox::keyboardWillShow(IMEKeyboardNotificationInfo& info) -{ - // CCLOG("CCEditBox::keyboardWillShow"); - Rect rectTracked = getRect(this); - // some adjustment for margin between the keyboard and the edit box. - rectTracked.origin.y -= 4; - - // if the keyboard area doesn't intersect with the tracking node area, nothing needs to be done. - if (!rectTracked.intersectsRect(info.end)) - { - CCLOG("needn't to adjust view layout."); - return; - } - - // assume keyboard at the bottom of screen, calculate the vertical adjustment. - _adjustHeight = info.end.getMaxY() - rectTracked.getMinY(); - // CCLOG("CCEditBox:needAdjustVerticalPosition(%f)", _adjustHeight); - - if (_editBoxImpl != nullptr) - { - _editBoxImpl->doAnimationWhenKeyboardMove(info.duration, _adjustHeight); - } -} - -void EditBox::keyboardDidShow(IMEKeyboardNotificationInfo& info) -{ - -} - -void EditBox::keyboardWillHide(IMEKeyboardNotificationInfo& info) -{ - // CCLOG("CCEditBox::keyboardWillHide"); - if (_editBoxImpl != nullptr) - { - _editBoxImpl->doAnimationWhenKeyboardMove(info.duration, -_adjustHeight); - } -} - -void EditBox::keyboardDidHide(IMEKeyboardNotificationInfo& info) -{ - -} - -#if CC_ENABLE_SCRIPT_BINDING -void EditBox::registerScriptEditBoxHandler(int handler) -{ - unregisterScriptEditBoxHandler(); - _scriptEditBoxHandler = handler; -} - -void EditBox::unregisterScriptEditBoxHandler(void) -{ - if (0 != _scriptEditBoxHandler) - { - ScriptEngineManager::getInstance()->getScriptEngine()->removeScriptHandler(_scriptEditBoxHandler); - _scriptEditBoxHandler = 0; - } -} -#endif - -NS_CC_EXT_END diff --git a/extensions/GUI/CCEditBox/CCEditBox.h b/extensions/GUI/CCEditBox/CCEditBox.h deleted file mode 100644 index 9203cbfaac..0000000000 --- a/extensions/GUI/CCEditBox/CCEditBox.h +++ /dev/null @@ -1,452 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2012 James Chen - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCEDITTEXT_H__ -#define __CCEDITTEXT_H__ - -#include "base/CCIMEDelegate.h" -#include "extensions/ExtensionMacros.h" -#include "../CCControlExtension/CCControlExtensions.h" -#include "extensions/ExtensionExport.h" - -NS_CC_EXT_BEGIN - -class EditBox; -class EditBoxImpl; - - -class CC_EX_DLL EditBoxDelegate -{ -public: - /** - * @js NA - * @lua NA - */ - virtual ~EditBoxDelegate() {}; - - /** - * This method is called when an edit box gains focus after keyboard is shown. - * @param editBox The edit box object that generated the event. - * @js NA - * @lua NA - */ - virtual void editBoxEditingDidBegin(EditBox* editBox) {}; - - - /** - * This method is called when an edit box loses focus after keyboard is hidden. - * @param editBox The edit box object that generated the event. - * @js NA - * @lua NA - */ - virtual void editBoxEditingDidEnd(EditBox* editBox) {}; - - /** - * This method is called when the edit box text was changed. - * @param editBox The edit box object that generated the event. - * @param text The new text. - * @js NA - * @lua NA - */ - virtual void editBoxTextChanged(EditBox* editBox, const std::string& text) {}; - - /** - * This method is called when the return button was pressed or the outside area of keyboard was touched. - * @param editBox The edit box object that generated the event. - * @js NA - * @lua NA - */ - virtual void editBoxReturn(EditBox* editBox) = 0; - -}; - -/** - * \brief Class for edit box. - * - * You can use this widget to gather small amounts of text from the user. - * - */ - -class CC_EX_DLL EditBox -: public ControlButton -, public IMEDelegate -{ -public: - enum class KeyboardReturnType - { - DEFAULT, - DONE, - SEND, - SEARCH, - GO - }; - - /** - * \brief The EditBox::InputMode defines the type of text that the user is allowed - * to enter. - */ - enum class InputMode - { - /** - * The user is allowed to enter any text, including line breaks. - */ - ANY, - - /** - * The user is allowed to enter an e-mail address. - */ - EMAIL_ADDRESS, - - /** - * The user is allowed to enter an integer value. - */ - NUMERIC, - - /** - * The user is allowed to enter a phone number. - */ - PHONE_NUMBER, - - /** - * The user is allowed to enter a URL. - */ - URL, - - /** - * The user is allowed to enter a real number value. - * This extends kEditBoxInputModeNumeric by allowing a decimal point. - */ - DECIMAL, - - /** - * The user is allowed to enter any text, except for line breaks. - */ - SINGLE_LINE, - }; - - /** - * \brief The EditBox::InputFlag defines how the input text is displayed/formatted. - */ - enum class InputFlag - { - /** - * Indicates that the text entered is confidential data that should be - * obscured whenever possible. This implies EDIT_BOX_INPUT_FLAG_SENSITIVE. - */ - PASSWORD, - - /** - * Indicates that the text entered is sensitive data that the - * implementation must never store into a dictionary or table for use - * in predictive, auto-completing, or other accelerated input schemes. - * A credit card number is an example of sensitive data. - */ - SENSITIVE, - - /** - * This flag is a hint to the implementation that during text editing, - * the initial letter of each word should be capitalized. - */ - INITIAL_CAPS_WORD, - - /** - * This flag is a hint to the implementation that during text editing, - * the initial letter of each sentence should be capitalized. - */ - INITIAL_CAPS_SENTENCE, - - /** - * Capitalize all characters automatically. - */ - INTIAL_CAPS_ALL_CHARACTERS, - }; - - /** - * create a edit box with size. - * @return An autorelease pointer of EditBox, you don't need to release it only if you retain it again. - */ - static EditBox* create(const Size& size, Scale9Sprite* pNormal9SpriteBg, Scale9Sprite* pPressed9SpriteBg = NULL, Scale9Sprite* pDisabled9SpriteBg = NULL); - - /** - * Constructor. - * @js ctor - */ - EditBox(void); - - /** - * Destructor. - * @js NA - * @lua NA - */ - virtual ~EditBox(void); - - /** - * Init edit box with specified size. This method should be invoked right after constructor. - * @param size The size of edit box. - */ - bool initWithSizeAndBackgroundSprite(const Size& size, Scale9Sprite* pNormal9SpriteBg); - - /** - * Gets/Sets the delegate for edit box. - * @lua NA - */ - void setDelegate(EditBoxDelegate* pDelegate); - /** - * @js NA - * @lua NA - */ - EditBoxDelegate* getDelegate(); - -#if CC_ENABLE_SCRIPT_BINDING - /** - * Registers a script function that will be called for EditBox events. - * - * This handler will be removed automatically after onExit() called. - * @code - * -- lua sample - * local function editboxEventHandler(eventType) - * if eventType == "began" then - * -- triggered when an edit box gains focus after keyboard is shown - * elseif eventType == "ended" then - * -- triggered when an edit box loses focus after keyboard is hidden. - * elseif eventType == "changed" then - * -- triggered when the edit box text was changed. - * elseif eventType == "return" then - * -- triggered when the return button was pressed or the outside area of keyboard was touched. - * end - * end - * - * local editbox = EditBox:create(Size(...), Scale9Sprite:create(...)) - * editbox = registerScriptEditBoxHandler(editboxEventHandler) - * @endcode - * - * @param handler A number that indicates a lua function. - * @js NA - * @lua NA - */ - void registerScriptEditBoxHandler(int handler); - - /** - * Unregisters a script function that will be called for EditBox events. - * @js NA - * @lua NA - */ - void unregisterScriptEditBoxHandler(void); - /** - * get a script Handler - * @js NA - * @lua NA - */ - int getScriptEditBoxHandler(void){ return _scriptEditBoxHandler ;} - -#endif // #if CC_ENABLE_SCRIPT_BINDING - - /** - * Set the text entered in the edit box. - * @param pText The given text. - */ - void setText(const char* pText); - - /** - * Get the text entered in the edit box. - * @return The text entered in the edit box. - */ - const char* getText(void); - - /** - * Set the font. - * @param pFontName The font name. - * @param fontSize The font size. - */ - void setFont(const char* pFontName, int fontSize); - - /** - * Set the font name. - * @param pFontName The font name. - */ - void setFontName(const char* pFontName); - - /** - * Set the font size. - * @param fontSize The font size. - */ - void setFontSize(int fontSize); - - /** - * Set the font color of the widget's text. - */ - void setFontColor(const Color3B& color); - - /** - * Set the placeholder's font. - * @param pFontName The font name. - * @param fontSize The font size. - */ - void setPlaceholderFont(const char* pFontName, int fontSize); - - /** - * Set the placeholder's font name. - * @param pFontName The font name. - */ - void setPlaceholderFontName(const char* pFontName); - - /** - * Set the placeholder's font size. - * @param fontSize The font size. - */ - void setPlaceholderFontSize(int fontSize); - - /** - * Set the font color of the placeholder text when the edit box is empty. - * Not supported on IOS. - */ - void setPlaceholderFontColor(const Color3B& color); - - /** - * Set a text in the edit box that acts as a placeholder when an - * edit box is empty. - * @param pText The given text. - */ - void setPlaceHolder(const char* pText); - - /** - * Get a text in the edit box that acts as a placeholder when an - * edit box is empty. - */ - const char* getPlaceHolder(void); - - /** - * Set the input mode of the edit box. - * @param inputMode One of the EditBox::InputMode constants. - */ - void setInputMode(InputMode inputMode); - - /** - * Sets the maximum input length of the edit box. - * Setting this value enables multiline input mode by default. - * Available on Android, iOS and Windows Phone. - * - * @param maxLength The maximum length. - */ - void setMaxLength(int maxLength); - - /** - * Gets the maximum input length of the edit box. - * - * @return Maximum input length. - */ - int getMaxLength(); - - /** - * Set the input flags that are to be applied to the edit box. - * @param inputFlag One of the EditBox::InputFlag constants. - */ - void setInputFlag(InputFlag inputFlag); - - /** - * Set the return type that are to be applied to the edit box. - * @param returnType One of the EditBox::KeyboardReturnType constants. - */ - void setReturnType(EditBox::KeyboardReturnType returnType); - - /* override functions */ - virtual void setPosition(const Vec2& pos) override; - virtual void setVisible(bool visible) override; - virtual void setContentSize(const Size& size) override; - virtual void setAnchorPoint(const Vec2& anchorPoint) override; - /** - * @js NA - * @lua NA - */ - virtual void visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override; - /** - * @js NA - * @lua NA - */ - virtual void onEnter(void) override; - /** - * @js NA - * @lua NA - */ - virtual void onExit(void) override; - /** - * @js NA - * @lua NA - */ - virtual void keyboardWillShow(IMEKeyboardNotificationInfo& info) override; - /** - * @js NA - * @lua NA - */ - virtual void keyboardDidShow(IMEKeyboardNotificationInfo& info) override; - /** - * @js NA - * @lua NA - */ - virtual void keyboardWillHide(IMEKeyboardNotificationInfo& info) override; - /** - * @js NA - * @lua NA - */ - virtual void keyboardDidHide(IMEKeyboardNotificationInfo& info) override; - - /* callback funtions - * @js NA - * @lua NA - */ - void touchDownAction(Ref *sender, Control::EventType controlEvent); - -protected: - void updatePosition(float dt); - EditBoxImpl* _editBoxImpl; - EditBoxDelegate* _delegate; - - InputMode _editBoxInputMode; - InputFlag _editBoxInputFlag; - EditBox::KeyboardReturnType _keyboardReturnType; - - std::string _text; - std::string _placeHolder; - - std::string _fontName; - std::string _placeholderFontName; - - int _fontSize; - int _placeholderFontSize; - - Color3B _colText; - Color3B _colPlaceHolder; - - int _maxLength; - float _adjustHeight; -#if CC_ENABLE_SCRIPT_BINDING - int _scriptEditBoxHandler; -#endif -}; - -NS_CC_EXT_END - -#endif /* __CCEDITTEXT_H__ */ - diff --git a/extensions/GUI/CCEditBox/CCEditBoxImpl.h b/extensions/GUI/CCEditBox/CCEditBoxImpl.h deleted file mode 100644 index 79d3d8f3fa..0000000000 --- a/extensions/GUI/CCEditBox/CCEditBoxImpl.h +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2012 James Chen - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCEditBoxIMPL_H__ -#define __CCEditBoxIMPL_H__ - -#include "extensions/ExtensionMacros.h" -#include "CCEditBox.h" -#include "extensions/ExtensionExport.h" - -NS_CC_EXT_BEGIN - - -class CC_EX_DLL EditBoxImpl -{ -public: - /** - * @js NA - */ - EditBoxImpl(EditBox* pEditBox) : _delegate(nullptr),_editBox(pEditBox) {} - /** - * @js NA - * @lua NA - */ - virtual ~EditBoxImpl() {} - - virtual bool initWithSize(const Size& size) = 0; - virtual void setFont(const char* pFontName, int fontSize) = 0; - virtual void setFontColor(const Color3B& color) = 0; - virtual void setPlaceholderFont(const char* pFontName, int fontSize) = 0; - virtual void setPlaceholderFontColor(const Color3B& color) = 0; - virtual void setInputMode(EditBox::InputMode inputMode) = 0; - virtual void setInputFlag(EditBox::InputFlag inputFlag) = 0; - virtual void setMaxLength(int maxLength) = 0; - virtual int getMaxLength() = 0; - virtual void setReturnType(EditBox::KeyboardReturnType returnType) = 0; - virtual bool isEditing() = 0; - - virtual void setText(const char* pText) = 0; - virtual const char* getText(void) = 0; - virtual void setPlaceHolder(const char* pText) = 0; - virtual void doAnimationWhenKeyboardMove(float duration, float distance) = 0; - - virtual void openKeyboard() = 0; - virtual void closeKeyboard() = 0; - - virtual void setPosition(const Vec2& pos) = 0; - virtual void setVisible(bool visible) = 0; - virtual void setContentSize(const Size& size) = 0; - virtual void setAnchorPoint(const Vec2& anchorPoint) = 0; - - /** - * check the editbox's position, update it when needed - */ - virtual void updatePosition(float dt){}; - /** - * @js NA - * @lua NA - */ - virtual void visit(void) = 0; - /** - * @js NA - * @lua NA - */ - virtual void onEnter(void) = 0; - - - void setDelegate(EditBoxDelegate* pDelegate) { _delegate = pDelegate; }; - EditBoxDelegate* getDelegate() { return _delegate; }; - EditBox* getEditBox() { return _editBox; }; -protected: - EditBoxDelegate* _delegate; - EditBox* _editBox; -}; - -// This method must be implemented at each subclass of EditBoxImpl. -extern EditBoxImpl* __createSystemEditBox(EditBox* pEditBox); - - -NS_CC_EXT_END - -#endif /* __CCEditBoxIMPL_H__ */ diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp b/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp deleted file mode 100644 index e610819d17..0000000000 --- a/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp +++ /dev/null @@ -1,315 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2012 James Chen - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "CCEditBoxImplAndroid.h" - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - -#include "CCEditBox.h" -#include "jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.h" -#include "jni/Java_org_cocos2dx_lib_Cocos2dxHelper.h" - - -NS_CC_EXT_BEGIN - -EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) -{ - return new EditBoxImplAndroid(pEditBox); -} - -EditBoxImplAndroid::EditBoxImplAndroid(EditBox* pEditText) -: EditBoxImpl(pEditText) -, _label(nullptr) -, _labelPlaceHolder(nullptr) -, _editBoxInputMode(EditBox::InputMode::SINGLE_LINE) -, _editBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS) -, _keyboardReturnType(EditBox::KeyboardReturnType::DEFAULT) -, _colText(Color3B::WHITE) -, _colPlaceHolder(Color3B::GRAY) -, _maxLength(-1) -{ - -} - -EditBoxImplAndroid::~EditBoxImplAndroid() -{ - -} - -void EditBoxImplAndroid::doAnimationWhenKeyboardMove(float duration, float distance) -{ // don't need to be implemented on android platform. - -} - -static const int CC_EDIT_BOX_PADDING = 5; - -bool EditBoxImplAndroid::initWithSize(const Size& size) -{ - int fontSize = getFontSizeAccordingHeightJni(size.height-12); - _label = Label::create(); - _label->setSystemFontSize(size.height-12); - // align the text vertically center - _label->setAnchorPoint(Vec2(0, 0.5f)); - _label->setPosition(Vec2(CC_EDIT_BOX_PADDING, size.height / 2.0f)); - _label->setColor(_colText); - _editBox->addChild(_label); - - _labelPlaceHolder = Label::create(); - _labelPlaceHolder->setSystemFontSize(size.height-12); - // align the text vertically center - _labelPlaceHolder->setAnchorPoint(Vec2(0, 0.5f)); - _labelPlaceHolder->setPosition(Vec2(CC_EDIT_BOX_PADDING, size.height / 2.0f)); - _labelPlaceHolder->setVisible(false); - _labelPlaceHolder->setColor(_colPlaceHolder); - _editBox->addChild(_labelPlaceHolder); - - _editSize = size; - return true; -} - -void EditBoxImplAndroid::setFont(const char* pFontName, int fontSize) -{ - if(_label != NULL) { - _label->setSystemFontName(pFontName); - _label->setSystemFontSize(fontSize); - } - - if(_labelPlaceHolder != NULL) { - _labelPlaceHolder->setSystemFontName(pFontName); - _labelPlaceHolder->setSystemFontSize(fontSize); - } -} - -void EditBoxImplAndroid::setFontColor(const Color3B& color) -{ - _colText = color; - _label->setColor(color); -} - -void EditBoxImplAndroid::setPlaceholderFont(const char* pFontName, int fontSize) -{ - if(_labelPlaceHolder != NULL) { - _labelPlaceHolder->setSystemFontName(pFontName); - _labelPlaceHolder->setSystemFontSize(fontSize); - } -} - -void EditBoxImplAndroid::setPlaceholderFontColor(const Color3B& color) -{ - _colPlaceHolder = color; - _labelPlaceHolder->setColor(color); -} - -void EditBoxImplAndroid::setInputMode(EditBox::InputMode inputMode) -{ - _editBoxInputMode = inputMode; -} - -void EditBoxImplAndroid::setMaxLength(int maxLength) -{ - _maxLength = maxLength; -} - -int EditBoxImplAndroid::getMaxLength() -{ - return _maxLength; -} - -void EditBoxImplAndroid::setInputFlag(EditBox::InputFlag inputFlag) -{ - _editBoxInputFlag = inputFlag; -} - -void EditBoxImplAndroid::setReturnType(EditBox::KeyboardReturnType returnType) -{ - _keyboardReturnType = returnType; -} - -bool EditBoxImplAndroid::isEditing() -{ - return false; -} - -void EditBoxImplAndroid::setText(const char* pText) -{ - if (pText != NULL) - { - _text = pText; - - if (_text.length() > 0) - { - _labelPlaceHolder->setVisible(false); - - std::string strToShow; - - if (EditBox::InputFlag::PASSWORD == _editBoxInputFlag) - { - long length = cc_utf8_strlen(_text.c_str(), -1); - for (long i = 0; i < length; i++) - { - strToShow.append("*"); - } - } - else - { - strToShow = _text; - } - - _label->setString(strToShow.c_str()); - - // Clip the text width to fit to the text box - - float fMaxWidth = _editSize.width - CC_EDIT_BOX_PADDING * 2; - auto labelSize = _label->getContentSize(); - if(labelSize.width > fMaxWidth) { - _label->setDimensions(fMaxWidth,labelSize.height); - } - } - else - { - _labelPlaceHolder->setVisible(true); - _label->setString(""); - } - - } -} - -const char* EditBoxImplAndroid::getText(void) -{ - return _text.c_str(); -} - -void EditBoxImplAndroid::setPlaceHolder(const char* pText) -{ - if (pText != NULL) - { - _placeHolder = pText; - if (_placeHolder.length() > 0 && _text.length() == 0) - { - _labelPlaceHolder->setVisible(true); - } - - _labelPlaceHolder->setString(_placeHolder.c_str()); - } -} - -void EditBoxImplAndroid::setPosition(const Vec2& pos) -{ // don't need to be implemented on android platform. - -} - -void EditBoxImplAndroid::setVisible(bool visible) -{ // don't need to be implemented on android platform. - -} - -void EditBoxImplAndroid::setContentSize(const Size& size) -{ // don't need to be implemented on android platform. - -} - -void EditBoxImplAndroid::setAnchorPoint(const Vec2& anchorPoint) -{ // don't need to be implemented on android platform. - -} - -void EditBoxImplAndroid::visit(void) -{ // don't need to be implemented on android platform. - -} - -void EditBoxImplAndroid::onEnter(void) -{ // don't need to be implemented on android platform. - -} - -static void editBoxCallbackFunc(const char* pText, void* ctx) -{ - EditBoxImplAndroid* thiz = (EditBoxImplAndroid*)ctx; - thiz->setText(pText); - - if (thiz->getDelegate() != NULL) - { - thiz->getDelegate()->editBoxTextChanged(thiz->getEditBox(), thiz->getText()); - thiz->getDelegate()->editBoxEditingDidEnd(thiz->getEditBox()); - thiz->getDelegate()->editBoxReturn(thiz->getEditBox()); - } - -#if CC_ENABLE_SCRIPT_BINDING - EditBox* pEditBox = thiz->getEditBox(); - if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) - { - CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "changed",pEditBox); - ScriptEvent event(kCommonEvent,(void*)&data); - ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - memset(data.eventName, 0, sizeof(data.eventName)); - strncpy(data.eventName, "ended", sizeof(data.eventName)); - event.data = (void*)&data; - ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - memset(data.eventName, 0, sizeof(data.eventName)); - strncpy(data.eventName, "return", sizeof(data.eventName)); - event.data = (void*)&data; - ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - } -#endif -} - -void EditBoxImplAndroid::openKeyboard() -{ - if (_delegate != NULL) - { - _delegate->editBoxEditingDidBegin(_editBox); - } - -#if CC_ENABLE_SCRIPT_BINDING - EditBox* pEditBox = this->getEditBox(); - if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) - { - CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); - ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); - ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - } -#endif - - showEditTextDialogJNI( _placeHolder.c_str(), - _text.c_str(), - (int)_editBoxInputMode, - (int)_editBoxInputFlag, - (int)_keyboardReturnType, - _maxLength, - editBoxCallbackFunc, - (void*)this ); - -} - -void EditBoxImplAndroid::closeKeyboard() -{ - -} - -NS_CC_EXT_END - -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) */ - diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h b/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h deleted file mode 100644 index 8f4d6a1e95..0000000000 --- a/extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2012 James Chen - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCEDITBOXIMPLANDROID_H__ -#define __CCEDITBOXIMPLANDROID_H__ - -#include "cocos2d.h" - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - -#include "extensions/ExtensionMacros.h" -#include "CCEditBoxImpl.h" - -NS_CC_EXT_BEGIN - -class EditBox; - -class EditBoxImplAndroid : public EditBoxImpl -{ -public: - /** - * @js NA - */ - EditBoxImplAndroid(EditBox* pEditText); - /** - * @js NA - * @lua NA - */ - virtual ~EditBoxImplAndroid(); - - virtual bool initWithSize(const Size& size); - virtual void setFont(const char* pFontName, int fontSize); - virtual void setFontColor(const Color3B& color); - virtual void setPlaceholderFont(const char* pFontName, int fontSize); - virtual void setPlaceholderFontColor(const Color3B& color); - virtual void setInputMode(EditBox::InputMode inputMode); - virtual void setInputFlag(EditBox::InputFlag inputFlag); - virtual void setMaxLength(int maxLength); - virtual int getMaxLength(); - virtual void setReturnType(EditBox::KeyboardReturnType returnType); - virtual bool isEditing(); - - virtual void setText(const char* pText); - virtual const char* getText(void); - virtual void setPlaceHolder(const char* pText); - virtual void setPosition(const Vec2& pos); - virtual void setVisible(bool visible); - virtual void setContentSize(const Size& size); - virtual void setAnchorPoint(const Vec2& anchorPoint); - /** - * @js NA - * @lua NA - */ - virtual void visit(void); - /** - * @js NA - * @lua NA - */ - virtual void onEnter(void); - virtual void doAnimationWhenKeyboardMove(float duration, float distance); - virtual void openKeyboard(); - virtual void closeKeyboard(); - -private: - Label* _label; - Label* _labelPlaceHolder; - EditBox::InputMode _editBoxInputMode; - EditBox::InputFlag _editBoxInputFlag; - EditBox::KeyboardReturnType _keyboardReturnType; - - std::string _text; - std::string _placeHolder; - - Color3B _colText; - Color3B _colPlaceHolder; - - int _maxLength; - Size _editSize; -}; - - -NS_CC_EXT_END - -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) */ - -#endif /* __CCEDITBOXIMPLANDROID_H__ */ - diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h deleted file mode 100644 index 0e666ee6ed..0000000000 --- a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.h +++ /dev/null @@ -1,143 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2012 James Chen - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCEditBoxIMPLIOS_H__ -#define __CCEditBoxIMPLIOS_H__ - -#include "cocos2d.h" - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - -#include "extensions/ExtensionMacros.h" -#include "CCEditBoxImpl.h" - -#import -#import - -@interface CCCustomUITextField : UITextField -{ -} - -@end - - -@interface CCEditBoxImplIOS_objc : NSObject -{ - CCCustomUITextField* textField_; - void* editBox_; - BOOL editState_; -} - -@property(nonatomic, retain) UITextField* textField; -@property(nonatomic, readonly, getter = isEditState) BOOL editState; -@property(nonatomic, assign) void* editBox; - --(id) initWithFrame: (CGRect) frameRect editBox: (void*) editBox; --(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance; --(void) setPosition:(CGPoint) pos; --(void) setContentSize:(CGSize) size; --(void) visit; --(void) openKeyboard; --(void) closeKeyboard; - -@end - -NS_CC_EXT_BEGIN - -class EditBox; - -class EditBoxImplIOS : public EditBoxImpl -{ -public: - /** - * @js NA - */ - EditBoxImplIOS(EditBox* pEditText); - /** - * @js NA - * @lua NA - */ - virtual ~EditBoxImplIOS(); - - virtual bool initWithSize(const Size& size); - virtual void setFont(const char* pFontName, int fontSize); - virtual void setFontColor(const Color3B& color); - virtual void setPlaceholderFont(const char* pFontName, int fontSize); - virtual void setPlaceholderFontColor(const Color3B& color); - virtual void setInputMode(EditBox::InputMode inputMode); - virtual void setInputFlag(EditBox::InputFlag inputFlag); - virtual void setMaxLength(int maxLength); - virtual int getMaxLength(); - virtual void setReturnType(EditBox::KeyboardReturnType returnType); - virtual bool isEditing(); - - virtual void setText(const char* pText); - virtual const char* getText(void); - virtual void refreshInactiveText(); - virtual void setPlaceHolder(const char* pText); - virtual void setPosition(const Vec2& pos); - virtual void setVisible(bool visible); - virtual void setContentSize(const Size& size); - virtual void setAnchorPoint(const Vec2& anchorPoint); - virtual void updatePosition(float dt) override; - /** - * @js NA - * @lua NA - */ - virtual void visit(void); - /** - * @js NA - * @lua NA - */ - virtual void onEnter(void); - virtual void doAnimationWhenKeyboardMove(float duration, float distance); - virtual void openKeyboard(); - virtual void closeKeyboard(); - - virtual void onEndEditing(); -private: - void initInactiveLabels(const Size& size); - void setInactiveText(const char* pText); - void adjustTextFieldPosition(); - void placeInactiveLabels(); - - Label* _label; - Label* _labelPlaceHolder; - Size _contentSize; - Vec2 _position; - Vec2 _anchorPoint; - CCEditBoxImplIOS_objc* _systemControl; - int _maxTextLength; - bool _inRetinaMode; -}; - - -NS_CC_EXT_END - - -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */ - -#endif /* __CCEditBoxIMPLIOS_H__ */ - diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm b/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm deleted file mode 100644 index edab22c826..0000000000 --- a/extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm +++ /dev/null @@ -1,674 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2012 James Chen - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#include "CCEditBoxImplIOS.h" - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - -#define kLabelZOrder 9999 - -#include "CCEditBox.h" -#import "CCEAGLView.h" - -#define getEditBoxImplIOS() ((cocos2d::extension::EditBoxImplIOS*)editBox_) - -static const int CC_EDIT_BOX_PADDING = 5; - -@implementation CCCustomUITextField -- (CGRect)textRectForBounds:(CGRect)bounds -{ - auto glview = cocos2d::Director::getInstance()->getOpenGLView(); - - float padding = CC_EDIT_BOX_PADDING * glview->getScaleX() / glview->getContentScaleFactor(); - return CGRectMake(bounds.origin.x + padding, bounds.origin.y + padding, - bounds.size.width - padding*2, bounds.size.height - padding*2); -} -- (CGRect)editingRectForBounds:(CGRect)bounds { - return [self textRectForBounds:bounds]; -} -@end - - -@implementation CCEditBoxImplIOS_objc - -@synthesize textField = textField_; -@synthesize editState = editState_; -@synthesize editBox = editBox_; - -- (void)dealloc -{ - [textField_ resignFirstResponder]; - [textField_ removeFromSuperview]; - self.textField = NULL; - [super dealloc]; -} - --(id) initWithFrame: (CGRect) frameRect editBox: (void*) editBox -{ - self = [super init]; - - if (self) - { - editState_ = NO; - self.textField = [[[CCCustomUITextField alloc] initWithFrame: frameRect] autorelease]; - - [textField_ setTextColor:[UIColor whiteColor]]; - textField_.font = [UIFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here. - textField_.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; - textField_.backgroundColor = [UIColor clearColor]; - textField_.borderStyle = UITextBorderStyleNone; - textField_.delegate = self; - textField_.hidden = true; - textField_.returnKeyType = UIReturnKeyDefault; - [textField_ addTarget:self action:@selector(textChanged) forControlEvents:UIControlEventEditingChanged]; - self.editBox = editBox; - } - - return self; -} - --(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance -{ - auto view = cocos2d::Director::getInstance()->getOpenGLView(); - CCEAGLView *eaglview = (CCEAGLView *) view->getEAGLView(); - - [eaglview doAnimationWhenKeyboardMoveWithDuration:duration distance:distance]; -} - --(void) setPosition:(CGPoint) pos -{ - CGRect frame = [textField_ frame]; - frame.origin = pos; - [textField_ setFrame:frame]; -} - --(void) setContentSize:(CGSize) size -{ - CGRect frame = [textField_ frame]; - frame.size = size; - [textField_ setFrame:frame]; -} - --(void) visit -{ - -} - --(void) openKeyboard -{ - auto view = cocos2d::Director::getInstance()->getOpenGLView(); - CCEAGLView *eaglview = (CCEAGLView *) view->getEAGLView(); - - [eaglview addSubview:textField_]; - [textField_ becomeFirstResponder]; -} - --(void) closeKeyboard -{ - [textField_ resignFirstResponder]; - [textField_ removeFromSuperview]; -} - -- (BOOL)textFieldShouldReturn:(UITextField *)sender -{ - if (sender == textField_) { - [sender resignFirstResponder]; - } - return NO; -} - --(void)animationSelector -{ - auto view = cocos2d::Director::getInstance()->getOpenGLView(); - CCEAGLView *eaglview = (CCEAGLView *) view->getEAGLView(); - - [eaglview doAnimationWhenAnotherEditBeClicked]; -} - -- (BOOL)textFieldShouldBeginEditing:(UITextField *)sender // return NO to disallow editing. -{ - CCLOG("textFieldShouldBeginEditing..."); - editState_ = YES; - - auto view = cocos2d::Director::getInstance()->getOpenGLView(); - CCEAGLView *eaglview = (CCEAGLView *) view->getEAGLView(); - - if ([eaglview isKeyboardShown]) - { - [self performSelector:@selector(animationSelector) withObject:nil afterDelay:0.0f]; - } - cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplIOS()->getDelegate(); - if (pDelegate != NULL) - { - pDelegate->editBoxEditingDidBegin(getEditBoxImplIOS()->getEditBox()); - } - -#if CC_ENABLE_SCRIPT_BINDING - cocos2d::extension::EditBox* pEditBox= getEditBoxImplIOS()->getEditBox(); - if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) - { - cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); - cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); - cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - } -#endif - return YES; -} - -- (BOOL)textFieldShouldEndEditing:(UITextField *)sender -{ - CCLOG("textFieldShouldEndEditing..."); - editState_ = NO; - getEditBoxImplIOS()->refreshInactiveText(); - - cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplIOS()->getDelegate(); - if (pDelegate != NULL) - { - pDelegate->editBoxEditingDidEnd(getEditBoxImplIOS()->getEditBox()); - pDelegate->editBoxReturn(getEditBoxImplIOS()->getEditBox()); - } - -#if CC_ENABLE_SCRIPT_BINDING - cocos2d::extension::EditBox* pEditBox= getEditBoxImplIOS()->getEditBox(); - if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) - { - cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "ended",pEditBox); - cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); - cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - memset(data.eventName, 0, sizeof(data.eventName)); - strncpy(data.eventName, "return", sizeof(data.eventName)); - event.data = (void*)&data; - cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - } -#endif - - if(editBox_ != nil) - { - getEditBoxImplIOS()->onEndEditing(); - } - return YES; -} - -/** - * Delegate method called before the text has been changed. - * @param textField The text field containing the text. - * @param range The range of characters to be replaced. - * @param string The replacement string. - * @return YES if the specified text range should be replaced; otherwise, NO to keep the old text. - */ -- (BOOL)textField:(UITextField *) textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string -{ - if (getEditBoxImplIOS()->getMaxLength() < 0) - { - return YES; - } - - NSUInteger oldLength = [textField.text length]; - NSUInteger replacementLength = [string length]; - NSUInteger rangeLength = range.length; - - NSUInteger newLength = oldLength - rangeLength + replacementLength; - - return newLength <= getEditBoxImplIOS()->getMaxLength(); -} - -/** - * Called each time when the text field's text has changed. - */ -- (void) textChanged -{ - // NSLog(@"text is %@", self.textField.text); - cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplIOS()->getDelegate(); - if (pDelegate != NULL) - { - pDelegate->editBoxTextChanged(getEditBoxImplIOS()->getEditBox(), getEditBoxImplIOS()->getText()); - } - -#if CC_ENABLE_SCRIPT_BINDING - cocos2d::extension::EditBox* pEditBox= getEditBoxImplIOS()->getEditBox(); - if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) - { - cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "changed",pEditBox); - cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); - cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - } -#endif -} - -@end - - -NS_CC_EXT_BEGIN - -EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) -{ - return new EditBoxImplIOS(pEditBox); -} - -EditBoxImplIOS::EditBoxImplIOS(EditBox* pEditText) -: EditBoxImpl(pEditText) -, _label(nullptr) -, _labelPlaceHolder(nullptr) -, _anchorPoint(Vec2(0.5f, 0.5f)) -, _systemControl(nullptr) -, _maxTextLength(-1) -{ - auto view = cocos2d::Director::getInstance()->getOpenGLView(); - - _inRetinaMode = view->isRetinaDisplay(); -} - -EditBoxImplIOS::~EditBoxImplIOS() -{ - [_systemControl release]; -} - -void EditBoxImplIOS::doAnimationWhenKeyboardMove(float duration, float distance) -{ - if ([_systemControl isEditState] || distance < 0.0f) - { - [_systemControl doAnimationWhenKeyboardMoveWithDuration:duration distance:distance]; - } -} - -bool EditBoxImplIOS::initWithSize(const Size& size) -{ - do - { - auto glview = cocos2d::Director::getInstance()->getOpenGLView(); - - CGRect rect = CGRectMake(0, 0, size.width * glview->getScaleX(),size.height * glview->getScaleY()); - - if (_inRetinaMode) - { - rect.size.width /= 2.0f; - rect.size.height /= 2.0f; - } - - _systemControl = [[CCEditBoxImplIOS_objc alloc] initWithFrame:rect editBox:this]; - if (!_systemControl) break; - - initInactiveLabels(size); - setContentSize(size); - - return true; - }while (0); - - return false; -} - -void EditBoxImplIOS::initInactiveLabels(const Size& size) -{ - const char* pDefaultFontName = [[_systemControl.textField.font fontName] UTF8String]; - - _label = Label::create(); - _label->setAnchorPoint(Vec2(0, 0.5f)); - _label->setColor(Color3B::WHITE); - _label->setVisible(false); - _editBox->addChild(_label, kLabelZOrder); - - _labelPlaceHolder = Label::create(); - // align the text vertically center - _labelPlaceHolder->setAnchorPoint(Vec2(0, 0.5f)); - _labelPlaceHolder->setColor(Color3B::GRAY); - _editBox->addChild(_labelPlaceHolder, kLabelZOrder); - - setFont(pDefaultFontName, size.height*2/3); - setPlaceholderFont(pDefaultFontName, size.height*2/3); -} - -void EditBoxImplIOS::placeInactiveLabels() -{ - _label->setPosition(Vec2(CC_EDIT_BOX_PADDING, _contentSize.height / 2.0f)); - _labelPlaceHolder->setPosition(Vec2(CC_EDIT_BOX_PADDING, _contentSize.height / 2.0f)); -} - -void EditBoxImplIOS::setInactiveText(const char* pText) -{ - if(_systemControl.textField.secureTextEntry == YES) - { - std::string passwordString; - for(int i = 0; i < strlen(pText); ++i) - passwordString.append("\u25CF"); - _label->setString(passwordString.c_str()); - } - else - _label->setString(getText()); - - // Clip the text width to fit to the text box - float fMaxWidth = _editBox->getContentSize().width - CC_EDIT_BOX_PADDING * 2; - Size labelSize = _label->getContentSize(); - if(labelSize.width > fMaxWidth) { - _label->setDimensions(fMaxWidth,labelSize.height); - } -} - -void EditBoxImplIOS::setFont(const char* pFontName, int fontSize) -{ - bool isValidFontName = true; - if(pFontName == NULL || strlen(pFontName) == 0) { - isValidFontName = false; - } - - float retinaFactor = _inRetinaMode ? 2.0f : 1.0f; - NSString * fntName = [NSString stringWithUTF8String:pFontName]; - - auto glview = cocos2d::Director::getInstance()->getOpenGLView(); - - float scaleFactor = glview->getScaleX(); - UIFont *textFont = nil; - if (isValidFontName) { - textFont = [UIFont fontWithName:fntName size:fontSize * scaleFactor / retinaFactor]; - } - - if (!isValidFontName || textFont == nil){ - textFont = [UIFont systemFontOfSize:fontSize * scaleFactor / retinaFactor]; - } - - if(textFont != nil) { - [_systemControl.textField setFont:textFont]; - } - - _label->setSystemFontName(pFontName); - _label->setSystemFontSize(fontSize); - _labelPlaceHolder->setSystemFontName(pFontName); - _labelPlaceHolder->setSystemFontSize(fontSize); -} - -void EditBoxImplIOS::setFontColor(const Color3B& color) -{ - _systemControl.textField.textColor = [UIColor colorWithRed:color.r / 255.0f green:color.g / 255.0f blue:color.b / 255.0f alpha:1.0f]; - _label->setColor(color); -} - -void EditBoxImplIOS::setPlaceholderFont(const char* pFontName, int fontSize) -{ - // TODO need to be implemented. -} - -void EditBoxImplIOS::setPlaceholderFontColor(const Color3B& color) -{ - _labelPlaceHolder->setColor(color); -} - -void EditBoxImplIOS::setInputMode(EditBox::InputMode inputMode) -{ - switch (inputMode) - { - case EditBox::InputMode::EMAIL_ADDRESS: - _systemControl.textField.keyboardType = UIKeyboardTypeEmailAddress; - break; - case EditBox::InputMode::NUMERIC: - _systemControl.textField.keyboardType = UIKeyboardTypeDecimalPad; - break; - case EditBox::InputMode::PHONE_NUMBER: - _systemControl.textField.keyboardType = UIKeyboardTypePhonePad; - break; - case EditBox::InputMode::URL: - _systemControl.textField.keyboardType = UIKeyboardTypeURL; - break; - case EditBox::InputMode::DECIMAL: - _systemControl.textField.keyboardType = UIKeyboardTypeDecimalPad; - break; - case EditBox::InputMode::SINGLE_LINE: - _systemControl.textField.keyboardType = UIKeyboardTypeDefault; - break; - default: - _systemControl.textField.keyboardType = UIKeyboardTypeDefault; - break; - } -} - -void EditBoxImplIOS::setMaxLength(int maxLength) -{ - _maxTextLength = maxLength; -} - -int EditBoxImplIOS::getMaxLength() -{ - return _maxTextLength; -} - -void EditBoxImplIOS::setInputFlag(EditBox::InputFlag inputFlag) -{ - switch (inputFlag) - { - case EditBox::InputFlag::PASSWORD: - _systemControl.textField.secureTextEntry = YES; - break; - case EditBox::InputFlag::INITIAL_CAPS_WORD: - _systemControl.textField.autocapitalizationType = UITextAutocapitalizationTypeWords; - break; - case EditBox::InputFlag::INITIAL_CAPS_SENTENCE: - _systemControl.textField.autocapitalizationType = UITextAutocapitalizationTypeSentences; - break; - case EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS: - _systemControl.textField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters; - break; - case EditBox::InputFlag::SENSITIVE: - _systemControl.textField.autocorrectionType = UITextAutocorrectionTypeNo; - break; - default: - break; - } -} - -void EditBoxImplIOS::setReturnType(EditBox::KeyboardReturnType returnType) -{ - switch (returnType) { - case EditBox::KeyboardReturnType::DEFAULT: - _systemControl.textField.returnKeyType = UIReturnKeyDefault; - break; - case EditBox::KeyboardReturnType::DONE: - _systemControl.textField.returnKeyType = UIReturnKeyDone; - break; - case EditBox::KeyboardReturnType::SEND: - _systemControl.textField.returnKeyType = UIReturnKeySend; - break; - case EditBox::KeyboardReturnType::SEARCH: - _systemControl.textField.returnKeyType = UIReturnKeySearch; - break; - case EditBox::KeyboardReturnType::GO: - _systemControl.textField.returnKeyType = UIReturnKeyGo; - break; - default: - _systemControl.textField.returnKeyType = UIReturnKeyDefault; - break; - } -} - -bool EditBoxImplIOS::isEditing() -{ - return [_systemControl isEditState] ? true : false; -} - -void EditBoxImplIOS::refreshInactiveText() -{ - const char* text = getText(); - if(_systemControl.textField.hidden == YES) - { - setInactiveText(text); - if(strlen(text) == 0) - { - _label->setVisible(false); - _labelPlaceHolder->setVisible(true); - } - else - { - _label->setVisible(true); - _labelPlaceHolder->setVisible(false); - } - } -} - -void EditBoxImplIOS::setText(const char* text) -{ - NSString* nsText =[NSString stringWithUTF8String:text]; - if ([nsText compare:_systemControl.textField.text] != NSOrderedSame) - { - _systemControl.textField.text = nsText; - } - - refreshInactiveText(); -} - -NSString* removeSiriString(NSString* str) -{ - NSString* siriString = @"\xef\xbf\xbc"; - return [str stringByReplacingOccurrencesOfString:siriString withString:@""]; -} - -const char* EditBoxImplIOS::getText(void) -{ - return [removeSiriString(_systemControl.textField.text) UTF8String]; -} - -void EditBoxImplIOS::setPlaceHolder(const char* pText) -{ - _systemControl.textField.placeholder = [NSString stringWithUTF8String:pText]; - _labelPlaceHolder->setString(pText); -} - -static CGPoint convertDesignCoordToScreenCoord(const Vec2& designCoord, bool bInRetinaMode) -{ - auto glview = cocos2d::Director::getInstance()->getOpenGLView(); - CCEAGLView *eaglview = (CCEAGLView *) glview->getEAGLView(); - - float viewH = (float)[eaglview getHeight]; - - Vec2 visiblePos = Vec2(designCoord.x * glview->getScaleX(), designCoord.y * glview->getScaleY()); - Vec2 screenGLPos = visiblePos + glview->getViewPortRect().origin; - - CGPoint screenPos = CGPointMake(screenGLPos.x, viewH - screenGLPos.y); - - if (bInRetinaMode) - { - screenPos.x = screenPos.x / 2.0f; - screenPos.y = screenPos.y / 2.0f; - } - CCLOGINFO("[EditBox] pos x = %f, y = %f", screenGLPos.x, screenGLPos.y); - return screenPos; -} - -void EditBoxImplIOS::setPosition(const Vec2& pos) -{ - _position = pos; - adjustTextFieldPosition(); -} - -void EditBoxImplIOS::setVisible(bool visible) -{ -// _systemControl.textField.hidden = !visible; -} - -void EditBoxImplIOS::setContentSize(const Size& size) -{ - _contentSize = size; - CCLOG("[Edit text] content size = (%f, %f)", size.width, size.height); - placeInactiveLabels(); - auto glview = cocos2d::Director::getInstance()->getOpenGLView(); - CGSize controlSize = CGSizeMake(size.width * glview->getScaleX(),size.height * glview->getScaleY()); - - if (_inRetinaMode) - { - controlSize.width /= 2.0f; - controlSize.height /= 2.0f; - } - [_systemControl setContentSize:controlSize]; -} - -void EditBoxImplIOS::setAnchorPoint(const Vec2& anchorPoint) -{ - CCLOG("[Edit text] anchor point = (%f, %f)", anchorPoint.x, anchorPoint.y); - _anchorPoint = anchorPoint; - setPosition(_position); -} - -void EditBoxImplIOS::visit(void) -{ -} - -void EditBoxImplIOS::onEnter(void) -{ - adjustTextFieldPosition(); - const char* pText = getText(); - if (pText) { - setInactiveText(pText); - } -} - -void EditBoxImplIOS::updatePosition(float dt) -{ - if (nullptr != _systemControl) { - this->adjustTextFieldPosition(); - } -} - - - -void EditBoxImplIOS::adjustTextFieldPosition() -{ - Size contentSize = _editBox->getContentSize(); - Rect rect = Rect(0, 0, contentSize.width, contentSize.height); - rect = RectApplyAffineTransform(rect, _editBox->nodeToWorldTransform()); - - Vec2 designCoord = Vec2(rect.origin.x, rect.origin.y + rect.size.height); - [_systemControl setPosition:convertDesignCoordToScreenCoord(designCoord, _inRetinaMode)]; -} - -void EditBoxImplIOS::openKeyboard() -{ - _label->setVisible(false); - _labelPlaceHolder->setVisible(false); - - _systemControl.textField.hidden = NO; - [_systemControl openKeyboard]; -} - -void EditBoxImplIOS::closeKeyboard() -{ - [_systemControl closeKeyboard]; -} - -void EditBoxImplIOS::onEndEditing() -{ - _systemControl.textField.hidden = YES; - if(strlen(getText()) == 0) - { - _label->setVisible(false); - _labelPlaceHolder->setVisible(true); - } - else - { - _label->setVisible(true); - _labelPlaceHolder->setVisible(false); - setInactiveText(getText()); - } -} - -NS_CC_EXT_END - -#endif /* #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) */ - - diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h b/extensions/GUI/CCEditBox/CCEditBoxImplMac.h deleted file mode 100644 index 34085e8278..0000000000 --- a/extensions/GUI/CCEditBox/CCEditBoxImplMac.h +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2012 Jozef Pridavok - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCEditBoxIMPLMAC_H__ -#define __CCEditBoxIMPLMAC_H__ - -#include "cocos2d.h" - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) - -#import -#import - -#include "extensions/ExtensionMacros.h" -#include "CCEditBoxImpl.h" - - -@interface CCEditBoxImplMac : NSObject -{ - NSTextField* textField_; - NSSecureTextField* secureTextField_; - void* editBox_; - BOOL editState_; - NSMutableDictionary* placeholderAttributes_; -} - -@property(nonatomic, retain) NSTextField* textField; -@property(nonatomic, retain) NSSecureTextField* secureTextField; -@property(nonatomic, retain) NSMutableDictionary* placeholderAttributes; -@property(nonatomic, readonly, getter = isEditState) BOOL editState; -@property(nonatomic, assign) void* editBox; - --(id) initWithFrame: (NSRect) frameRect editBox: (void*) editBox; --(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance; --(void) setPosition:(NSPoint) pos; --(void) setContentSize:(NSSize) size; --(void) visit; --(void) openKeyboard; --(void) closeKeyboard; - -@end - -NS_CC_EXT_BEGIN - -class EditBox; - -class EditBoxImplMac : public EditBoxImpl -{ -public: - /** - * @js NA - */ - EditBoxImplMac(EditBox* pEditText); - /** - * @js NA - * @lua NA - */ - virtual ~EditBoxImplMac(); - - virtual bool initWithSize(const Size& size); - virtual void setFont(const char* pFontName, int fontSize); - virtual void setFontColor(const Color3B& color); - virtual void setPlaceholderFont(const char* pFontName, int fontSize); - virtual void setPlaceholderFontColor(const Color3B& color); - virtual void setInputMode(EditBox::InputMode inputMode); - virtual void setInputFlag(EditBox::InputFlag inputFlag); - virtual void setMaxLength(int maxLength); - virtual int getMaxLength(); - virtual void setReturnType(EditBox::KeyboardReturnType returnType); - virtual bool isEditing(); - - virtual void setText(const char* pText); - virtual const char* getText(void); - virtual void setPlaceHolder(const char* pText); - virtual void setPosition(const Vec2& pos); - virtual void setVisible(bool visible); - virtual void setContentSize(const Size& size); - virtual void setAnchorPoint(const Vec2& anchorPoint); - /** - * @js NA - * @lua NA - */ - virtual void visit(void); - virtual void doAnimationWhenKeyboardMove(float duration, float distance); - virtual void openKeyboard(); - virtual void closeKeyboard(); - virtual void updatePosition(float dt) override; - /** - * @js NA - * @lua NA - */ - virtual void onEnter(void); -private: - NSPoint convertDesignCoordToScreenCoord(const Vec2& designCoord, bool bInRetinaMode); - void adjustTextFieldPosition(); - Size _contentSize; - Vec2 _position; - Vec2 _anchorPoint; - int _maxTextLength; - bool _inRetinaMode; - CCEditBoxImplMac* _sysEdit; -}; - - -NS_CC_EXT_END - -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) - -#endif /* __CCEditBoxIMPLMAC_H__ */ - diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm b/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm deleted file mode 100644 index 47063b2907..0000000000 --- a/extensions/GUI/CCEditBox/CCEditBoxImplMac.mm +++ /dev/null @@ -1,520 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2012 Jozef Pridavok - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "CCEditBoxImplMac.h" -#include "base/CCDirector.h" - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) - -#include "CCEditBox.h" - - -#define getEditBoxImplMac() ((cocos2d::extension::EditBoxImplMac*)editBox_) - - - -@implementation CCEditBoxImplMac - -@synthesize textField = textField_; -@synthesize secureTextField = secureTextField_; -@synthesize placeholderAttributes = placeholderAttributes_; -@synthesize editState = editState_; -@synthesize editBox = editBox_; - -- (id) getNSWindow -{ - auto glview = cocos2d::Director::getInstance()->getOpenGLView(); - return glview->getCocoaWindow(); -} - -- (void)dealloc -{ - [textField_ resignFirstResponder]; - [textField_ removeFromSuperview]; - [textField_ release]; - - [secureTextField_ resignFirstResponder]; - [secureTextField_ removeFromSuperview]; - [secureTextField_ release]; - - [placeholderAttributes_ release]; - [super dealloc]; -} - --(id) initWithFrame: (NSRect) frameRect editBox: (void*) editBox -{ - self = [super init]; - - if (self) - { - editState_ = NO; - self.textField = [[[NSTextField alloc] initWithFrame:frameRect] autorelease]; - self.secureTextField = [[[NSSecureTextField alloc] initWithFrame:frameRect] autorelease]; - - NSFont *font = [NSFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here. - textField_.font = font; - secureTextField_.font = font; - - [self setupTextField:textField_]; - [self setupTextField:secureTextField_]; - - self.editBox = editBox; - self.placeholderAttributes = [NSMutableDictionary dictionaryWithObjectsAndKeys: - font, NSFontAttributeName, - [NSColor grayColor], NSForegroundColorAttributeName, - nil]; - - [[[self getNSWindow] contentView] addSubview:textField_]; - } - - return self; -} - -- (void)setupTextField:(NSTextField *)textField -{ - [textField setTextColor:[NSColor whiteColor]]; - [textField setBackgroundColor:[NSColor clearColor]]; - [textField setBordered:NO]; - [textField setHidden:NO]; - [textField setWantsLayer:YES]; - [textField setDelegate:self]; -} - --(void) doAnimationWhenKeyboardMoveWithDuration:(float)duration distance:(float)distance -{ - [[[self getNSWindow] contentView] doAnimationWhenKeyboardMoveWithDuration:duration distance:distance]; -} - --(void) setPosition:(NSPoint) pos -{ - NSRect frame = [textField_ frame]; - frame.origin = pos; - [textField_ setFrame:frame]; - [secureTextField_ setFrame:frame]; -} - --(void) setContentSize:(NSSize) size -{ - -} - --(void) visit -{ - -} - --(void) openKeyboard -{ - if ([textField_ superview]) { - [textField_ becomeFirstResponder]; - } - else { - [secureTextField_ becomeFirstResponder]; - } -} - --(void) closeKeyboard -{ - if ([textField_ superview]) { - [textField_ resignFirstResponder]; - [textField_ removeFromSuperview]; - } - else { - [secureTextField_ resignFirstResponder]; - [secureTextField_ removeFromSuperview]; - } -} - -- (BOOL)textFieldShouldReturn:(NSTextField *)sender -{ - if (sender == textField_ || sender == secureTextField_) { - [sender resignFirstResponder]; - } - return NO; -} - --(void)animationSelector -{ -} - -- (void)controlTextDidBeginEditing:(NSNotification *)notification -{ - editState_ = YES; - cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate(); - if (pDelegate != NULL) - { - pDelegate->editBoxEditingDidBegin(getEditBoxImplMac()->getEditBox()); - } - -#if CC_ENABLE_SCRIPT_BINDING - cocos2d::extension::EditBox* pEditBox= getEditBoxImplMac()->getEditBox(); - if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) - { - cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); - cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); - cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - } -#endif -} - -- (void)controlTextDidEndEditing:(NSNotification *)notification -{ - editState_ = NO; - cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate(); - if (pDelegate != NULL) - { - pDelegate->editBoxEditingDidEnd(getEditBoxImplMac()->getEditBox()); - pDelegate->editBoxReturn(getEditBoxImplMac()->getEditBox()); - } - -#if CC_ENABLE_SCRIPT_BINDING - cocos2d::extension::EditBox* pEditBox= getEditBoxImplMac()->getEditBox(); - if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) - { - cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "ended",pEditBox); - cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); - cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - memset(data.eventName, 0, sizeof(data.eventName)); - strncpy(data.eventName, "return", sizeof(data.eventName)); - event.data = (void*)&data; - cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - } -#endif -} - -/** - * Delegate method called before the text has been changed. - * @param textField The text field containing the text. - * @param range The range of characters to be replaced. - * @param string The replacement string. - * @return YES if the specified text range should be replaced; otherwise, NO to keep the old text. - */ -- (BOOL)textField:(NSTextField *) textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string -{ - if (getEditBoxImplMac()->getMaxLength() < 0) - { - return YES; - } - - NSUInteger oldLength = [[textField stringValue] length]; - NSUInteger replacementLength = [string length]; - NSUInteger rangeLength = range.length; - - NSUInteger newLength = oldLength - rangeLength + replacementLength; - - return newLength <= getEditBoxImplMac()->getMaxLength(); -} - -/** - * Called each time when the text field's text has changed. - */ -- (void)controlTextDidChange:(NSNotification *)notification -{ - cocos2d::extension::EditBoxDelegate* pDelegate = getEditBoxImplMac()->getDelegate(); - if (pDelegate != NULL) - { - pDelegate->editBoxTextChanged(getEditBoxImplMac()->getEditBox(), getEditBoxImplMac()->getText()); - } - -#if CC_ENABLE_SCRIPT_BINDING - cocos2d::extension::EditBox* pEditBox= getEditBoxImplMac()->getEditBox(); - if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) - { - cocos2d::CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "changed",pEditBox); - cocos2d::ScriptEvent event(cocos2d::kCommonEvent,(void*)&data); - cocos2d::ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - } -#endif -} - -@end - -NS_CC_EXT_BEGIN - -EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) -{ - return new EditBoxImplMac(pEditBox); -} - -EditBoxImplMac::EditBoxImplMac(EditBox* pEditText) -: EditBoxImpl(pEditText) -, _anchorPoint(Vec2(0.5f, 0.5f)) -, _maxTextLength(-1) -, _sysEdit(nullptr) -{ - //! TODO: Retina on Mac - //! _inRetinaMode = [[CCEAGLView sharedEGLView] contentScaleFactor] == 2.0f ? true : false; - _inRetinaMode = false; -} - -EditBoxImplMac::~EditBoxImplMac() -{ - [_sysEdit release]; -} - -void EditBoxImplMac::doAnimationWhenKeyboardMove(float duration, float distance) -{ - if ([_sysEdit isEditState] || distance < 0.0f) - [_sysEdit doAnimationWhenKeyboardMoveWithDuration:duration distance:distance]; -} - -bool EditBoxImplMac::initWithSize(const Size& size) -{ - GLView* eglView = Director::getInstance()->getOpenGLView(); - - NSRect rect = NSMakeRect(0, 0, size.width * eglView->getScaleX(),size.height * eglView->getScaleY()); - - if (_inRetinaMode) { - rect.size.width /= 2.0f; - rect.size.height /= 2.0f; - } - - _sysEdit = [[CCEditBoxImplMac alloc] initWithFrame:rect editBox:this]; - - if (!_sysEdit) - return false; - - return true; -} - -void EditBoxImplMac::setFont(const char* pFontName, int fontSize) -{ - NSString * fntName = [NSString stringWithUTF8String:pFontName]; - float retinaFactor = _inRetinaMode ? 2.0f : 1.0f; - auto glview = cocos2d::Director::getInstance()->getOpenGLView(); - float scaleFactor = glview->getScaleX(); - NSFont *textFont = [NSFont fontWithName:fntName size:fontSize * scaleFactor / retinaFactor]; - if (textFont != nil) { - [_sysEdit.textField setFont:textFont]; - [_sysEdit.secureTextField setFont:textFont]; - } -} - -void EditBoxImplMac::setPlaceholderFont(const char* pFontName, int fontSize) -{ - NSString *fontName = [NSString stringWithUTF8String:pFontName]; - float retinaFactor = _inRetinaMode ? 2.0f : 1.0f; - auto glview = cocos2d::Director::getInstance()->getOpenGLView(); - float scaleFactor = glview->getScaleX(); - NSFont *font = [NSFont fontWithName:fontName size:fontSize * scaleFactor / retinaFactor]; - - if (!font) { - CCLOGWARN("Font not found: %s", pFontName); - return; - } - - [_sysEdit.placeholderAttributes setObject:font forKey:NSFontAttributeName]; - - /* reload placeholder */ - const char *placeholder = [_sysEdit.textField.cell placeholderAttributedString].string.UTF8String; - if (placeholder) { - setPlaceHolder(placeholder); - } -} - -void EditBoxImplMac::setFontColor(const Color3B& color) -{ - NSColor *newColor = [NSColor colorWithCalibratedRed:color.r / 255.0f green:color.g / 255.0f blue:color.b / 255.0f alpha:1.0f]; - _sysEdit.textField.textColor = newColor; - _sysEdit.secureTextField.textColor = newColor; -} - -void EditBoxImplMac::setPlaceholderFontColor(const Color3B& color) -{ - NSColor *nsColor = [NSColor colorWithCalibratedRed:color.r/255.f green:color.g / 255.f blue:color.b / 255.f alpha:1.0f]; - [_sysEdit.placeholderAttributes setObject:nsColor forKey:NSForegroundColorAttributeName]; - - /* reload placeholder */ - const char *placeholder = [_sysEdit.textField.cell placeholderAttributedString].string.UTF8String; - if (placeholder) { - setPlaceHolder(placeholder); - } -} - -void EditBoxImplMac::setInputMode(EditBox::InputMode inputMode) -{ -} - -void EditBoxImplMac::setMaxLength(int maxLength) -{ - _maxTextLength = maxLength; -} - -int EditBoxImplMac::getMaxLength() -{ - return _maxTextLength; -} - -void EditBoxImplMac::setInputFlag(EditBox::InputFlag inputFlag) -{ - switch (inputFlag) - { - case EditBox::InputFlag::PASSWORD: - [_sysEdit.textField.superview addSubview:_sysEdit.secureTextField]; - [_sysEdit.textField removeFromSuperview]; - break; - case EditBox::InputFlag::INITIAL_CAPS_WORD: - CCLOGWARN("INITIAL_CAPS_WORD not implemented"); - break; - case EditBox::InputFlag::INITIAL_CAPS_SENTENCE: - CCLOGWARN("INITIAL_CAPS_SENTENCE not implemented"); - break; - case EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS: - CCLOGWARN("INTIAL_CAPS_ALL_CHARACTERS not implemented"); - break; - case EditBox::InputFlag::SENSITIVE: - CCLOGWARN("SENSITIVE not implemented"); - break; - default: - break; - } -} - -void EditBoxImplMac::setReturnType(EditBox::KeyboardReturnType returnType) -{ -} - -bool EditBoxImplMac::isEditing() -{ - return [_sysEdit isEditState] ? true : false; -} - -void EditBoxImplMac::setText(const char* pText) -{ - NSString *string = [NSString stringWithUTF8String:pText]; - _sysEdit.textField.stringValue = string; - _sysEdit.secureTextField.stringValue = string; -} - -const char* EditBoxImplMac::getText(void) -{ - if (_sysEdit.secureTextField.superview) { - return [_sysEdit.secureTextField.stringValue UTF8String]; - } - - return [_sysEdit.textField.stringValue UTF8String]; -} - -void EditBoxImplMac::setPlaceHolder(const char* pText) -{ - NSAttributedString *as = [[NSAttributedString alloc] initWithString:[NSString stringWithUTF8String:pText] - attributes:_sysEdit.placeholderAttributes]; - - [[_sysEdit.textField cell] setPlaceholderAttributedString:as]; - [[_sysEdit.secureTextField cell] setPlaceholderAttributedString:as]; - [as release]; -} - -NSPoint EditBoxImplMac::convertDesignCoordToScreenCoord(const Vec2& designCoord, bool bInRetinaMode) -{ - NSRect frame = [_sysEdit.textField frame]; - CGFloat height = frame.size.height; - - GLView* eglView = Director::getInstance()->getOpenGLView(); - - Vec2 visiblePos = Vec2(designCoord.x * eglView->getScaleX(), designCoord.y * eglView->getScaleY()); - Vec2 screenGLPos = visiblePos + eglView->getViewPortRect().origin; - - //TODO: I don't know why here needs to substract `height`. - NSPoint screenPos = NSMakePoint(screenGLPos.x, screenGLPos.y-height); - - if (bInRetinaMode) { - screenPos.x = screenPos.x / 2.0f; - screenPos.y = screenPos.y / 2.0f; - } - - CCLOGINFO("[EditBox] pos x = %f, y = %f", screenGLPos.x, screenGLPos.y); - return screenPos; -} - -void EditBoxImplMac::updatePosition(float dt) -{ - if(nullptr != _sysEdit) - { - adjustTextFieldPosition(); - } -} - -void EditBoxImplMac::adjustTextFieldPosition() -{ - Size contentSize = _editBox->getContentSize(); - Rect rect = Rect(0, 0, contentSize.width, contentSize.height); - - rect = RectApplyAffineTransform(rect, _editBox->nodeToWorldTransform()); - - Vec2 designCoord = Vec2(rect.origin.x, rect.origin.y + rect.size.height); - [_sysEdit setPosition:convertDesignCoordToScreenCoord(designCoord, _inRetinaMode)]; -} - -void EditBoxImplMac::setPosition(const Vec2& pos) -{ - _position = pos; - adjustTextFieldPosition(); -} - -void EditBoxImplMac::setVisible(bool visible) -{ - [_sysEdit.textField setHidden:!visible]; - [_sysEdit.secureTextField setHidden:!visible]; -} - -void EditBoxImplMac::setContentSize(const Size& size) -{ - _contentSize = size; - CCLOG("[Edit text] content size = (%f, %f)", size.width, size.height); -} - -void EditBoxImplMac::setAnchorPoint(const Vec2& anchorPoint) -{ - CCLOG("[Edit text] anchor point = (%f, %f)", anchorPoint.x, anchorPoint.y); - _anchorPoint = anchorPoint; - setPosition(_position); -} - -void EditBoxImplMac::visit(void) -{ - -} - -void EditBoxImplMac::openKeyboard() -{ - [_sysEdit openKeyboard]; -} - -void EditBoxImplMac::closeKeyboard() -{ - [_sysEdit closeKeyboard]; -} - -void EditBoxImplMac::onEnter(void) -{ - adjustTextFieldPosition(); -} - -NS_CC_EXT_END - -#endif // #if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) - - diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplNone.cpp b/extensions/GUI/CCEditBox/CCEditBoxImplNone.cpp deleted file mode 100644 index 5cac865d3d..0000000000 --- a/extensions/GUI/CCEditBox/CCEditBoxImplNone.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "CCEditBox.h" - -#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID ) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS ) && (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) && (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) && (CC_TARGET_PLATFORM != CC_PLATFORM_TIZEN) - -NS_CC_EXT_BEGIN - -EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) -{ - return NULL; -} - -NS_CC_EXT_END - -#endif /* #if (..) */ diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp b/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp deleted file mode 100644 index 2259e4dda0..0000000000 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp +++ /dev/null @@ -1,298 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2013 Jozef Pridavok - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#include "CCEditBoxImplWin.h" - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) - -#include "CCEditBox.h" -#include "proj.win32/Win32InputBox.h" - -NS_CC_EXT_BEGIN - -EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) -{ - return new EditBoxImplWin(pEditBox); -} - -EditBoxImplWin::EditBoxImplWin(EditBox* pEditText) -: EditBoxImpl(pEditText) -, _label(nullptr) -, _labelPlaceHolder(nullptr) -, _editBoxInputMode(EditBox::InputMode::SINGLE_LINE) -, _editBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS) -, _keyboardReturnType(EditBox::KeyboardReturnType::DEFAULT) -, _colText(Color3B::WHITE) -, _colPlaceHolder(Color3B::GRAY) -, _maxLength(-1) -{ - -} - -EditBoxImplWin::~EditBoxImplWin() -{ -} - -void EditBoxImplWin::doAnimationWhenKeyboardMove(float duration, float distance) -{ -} - -bool EditBoxImplWin::initWithSize(const Size& size) -{ - //! int fontSize = getFontSizeAccordingHeightJni(size.height-12); - _label = Label::create(); - _label->setSystemFontSize(size.height-12); - // align the text vertically center - _label->setAnchorPoint(Vec2(0, 0.5f)); - _label->setPosition(Vec2(5, size.height / 2.0f)); - _label->setColor(_colText); - _editBox->addChild(_label); - - _labelPlaceHolder = Label::create(); - _labelPlaceHolder->setSystemFontSize(size.height-12); - // align the text vertically center - _labelPlaceHolder->setAnchorPoint(Vec2(0, 0.5f)); - _labelPlaceHolder->setPosition(Vec2(5, size.height / 2.0f)); - _labelPlaceHolder->setVisible(false); - _labelPlaceHolder->setColor(_colPlaceHolder); - _editBox->addChild(_labelPlaceHolder); - - _editSize = size; - return true; -} - -void EditBoxImplWin::setFont(const char* pFontName, int fontSize) -{ - if(_label != nullptr) { - _label->setSystemFontName(pFontName); - _label->setSystemFontSize(fontSize); - } - - if(_labelPlaceHolder != nullptr) { - _labelPlaceHolder->setSystemFontName(pFontName); - _labelPlaceHolder->setSystemFontSize(fontSize); - } -} - -void EditBoxImplWin::setFontColor(const Color3B& color) -{ - _colText = color; - _label->setColor(color); -} - -void EditBoxImplWin::setPlaceholderFont(const char* pFontName, int fontSize) -{ - if(_labelPlaceHolder != nullptr) { - _labelPlaceHolder->setSystemFontName(pFontName); - _labelPlaceHolder->setSystemFontSize(fontSize); - } -} - -void EditBoxImplWin::setPlaceholderFontColor(const Color3B& color) -{ - _colPlaceHolder = color; - _labelPlaceHolder->setColor(color); -} - -void EditBoxImplWin::setInputMode(EditBox::InputMode inputMode) -{ - _editBoxInputMode = inputMode; -} - -void EditBoxImplWin::setMaxLength(int maxLength) -{ - _maxLength = maxLength; -} - -int EditBoxImplWin::getMaxLength() -{ - return _maxLength; -} - -void EditBoxImplWin::setInputFlag(EditBox::InputFlag inputFlag) -{ - _editBoxInputFlag = inputFlag; -} - -void EditBoxImplWin::setReturnType(EditBox::KeyboardReturnType returnType) -{ - _keyboardReturnType = returnType; -} - -bool EditBoxImplWin::isEditing() -{ - return false; -} - -void EditBoxImplWin::setText(const char* pText) -{ - if (pText != nullptr) - { - _text = pText; - - if (_text.length() > 0) - { - _labelPlaceHolder->setVisible(false); - - std::string strToShow; - - if (EditBox::InputFlag::PASSWORD == _editBoxInputFlag) - { - long length = cc_utf8_strlen(_text.c_str(), -1); - for (long i = 0; i < length; i++) - { - strToShow.append("*"); - } - } - else - { - strToShow = _text; - } - - //! std::string strWithEllipsis = getStringWithEllipsisJni(strToShow.c_str(), _editSize.width, _editSize.height-12); - //! _label->setString(strWithEllipsis.c_str()); - _label->setString(strToShow.c_str()); - } - else - { - _labelPlaceHolder->setVisible(true); - _label->setString(""); - } - - } -} - -const char* EditBoxImplWin::getText(void) -{ - return _text.c_str(); -} - -void EditBoxImplWin::setPlaceHolder(const char* pText) -{ - if (pText != nullptr) - { - _placeHolder = pText; - if (_placeHolder.length() > 0 && _text.length() == 0) - { - _labelPlaceHolder->setVisible(true); - } - - _labelPlaceHolder->setString(_placeHolder.c_str()); - } -} - -void EditBoxImplWin::setPosition(const Vec2& pos) -{ - //_label->setPosition(pos); - //_labelPlaceHolder->setPosition(pos); -} - -void EditBoxImplWin::setVisible(bool visible) -{ // don't need to be implemented on win32 platform. -} - -void EditBoxImplWin::setContentSize(const Size& size) -{ -} - -void EditBoxImplWin::setAnchorPoint(const Vec2& anchorPoint) -{ // don't need to be implemented on win32 platform. - -} - -void EditBoxImplWin::visit(void) -{ -} - -void EditBoxImplWin::openKeyboard() -{ - if (_delegate != nullptr) - { - _delegate->editBoxEditingDidBegin(_editBox); - } - - EditBox* pEditBox = this->getEditBox(); - if (nullptr != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) - { - CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); - ScriptEvent event(kCommonEvent,(void*)&data); - ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - } - - std::string placeHolder = _labelPlaceHolder->getString(); - if (placeHolder.length() == 0) - placeHolder = "Enter value"; - - char pText[100]= {0}; - std::string text = getText(); - if (text.length()) - strncpy(pText, text.c_str(), 100); - auto glView = Director::getInstance()->getOpenGLView(); - HWND hwnd = glView->getWin32Window(); - bool didChange = CWin32InputBox::InputBox("Input", placeHolder.c_str(), pText, 100, false, hwnd) == IDOK; - - if (didChange) - setText(pText); - - if (_delegate != nullptr) { - if (didChange) - _delegate->editBoxTextChanged(_editBox, getText()); - _delegate->editBoxEditingDidEnd(_editBox); - _delegate->editBoxReturn(_editBox); - } - -#if CC_ENABLE_SCRIPT_BINDING - if (nullptr != _editBox && 0 != _editBox->getScriptEditBoxHandler()) - { - CommonScriptData data(_editBox->getScriptEditBoxHandler(), "changed",_editBox); - ScriptEvent event(kCommonEvent,(void*)&data); - if (didChange) - { - ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - } - memset(data.eventName,0,sizeof(data.eventName)); - strncpy(data.eventName,"ended",sizeof(data.eventName)); - event.data = (void*)&data; - ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - memset(data.eventName,0,sizeof(data.eventName)); - strncpy(data.eventName,"return",sizeof(data.eventName)); - event.data = (void*)&data; - ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - } -#endif // #if CC_ENABLE_SCRIPT_BINDING -} - -void EditBoxImplWin::closeKeyboard() -{ - -} - -void EditBoxImplWin::onEnter(void) -{ - -} - -NS_CC_EXT_END - -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWin.h b/extensions/GUI/CCEditBox/CCEditBoxImplWin.h deleted file mode 100644 index 4d04fb6cce..0000000000 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWin.h +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2013 Jozef Pridavok - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef __CCEditBoxIMPLWIN_H__ -#define __CCEditBoxIMPLWIN_H__ - -#include "cocos2d.h" - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) - -#include "extensions/ExtensionMacros.h" -#include "CCEditBoxImpl.h" -#include "extensions/ExtensionExport.h" - -NS_CC_EXT_BEGIN - -class EditBox; - -class CC_EX_DLL EditBoxImplWin : public EditBoxImpl -{ -public: - /** - * @js NA - */ - EditBoxImplWin(EditBox* pEditText); - /** - * @js NA - * @lua NA - */ - virtual ~EditBoxImplWin(); - - virtual bool initWithSize(const Size& size); - virtual void setFont(const char* pFontName, int fontSize); - virtual void setFontColor(const Color3B& color); - virtual void setPlaceholderFont(const char* pFontName, int fontSize); - virtual void setPlaceholderFontColor(const Color3B& color); - virtual void setInputMode(EditBox::InputMode inputMode); - virtual void setInputFlag(EditBox::InputFlag inputFlag); - virtual void setMaxLength(int maxLength); - virtual int getMaxLength(); - virtual void setReturnType(EditBox::KeyboardReturnType returnType); - virtual bool isEditing(); - - virtual void setText(const char* pText); - virtual const char* getText(void); - virtual void setPlaceHolder(const char* pText); - virtual void setPosition(const Vec2& pos); - virtual void setVisible(bool visible); - virtual void setContentSize(const Size& size); - virtual void setAnchorPoint(const Vec2& anchorPoint); - /** - * @js NA - * @lua NA - */ - virtual void visit(void); - virtual void doAnimationWhenKeyboardMove(float duration, float distance); - virtual void openKeyboard(); - virtual void closeKeyboard(); - /** - * @js NA - * @lua NA - */ - virtual void onEnter(void); -private: - - Label* _label; - Label* _labelPlaceHolder; - EditBox::InputMode _editBoxInputMode; - EditBox::InputFlag _editBoxInputFlag; - EditBox::KeyboardReturnType _keyboardReturnType; - - std::string _text; - std::string _placeHolder; - - Color3B _colText; - Color3B _colPlaceHolder; - - int _maxLength; - Size _editSize; - - /* - Size _contentSize; - HWND _sysEdit; - int _maxTextLength; - */ -}; - - -NS_CC_EXT_END - -#endif /* (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) */ - -#endif /* __CCEditBoxIMPLWIN_H__ */ - diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp b/extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp deleted file mode 100644 index 245149d164..0000000000 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/**************************************************************************** -Copyright (c) 2014 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#include "CCEditBoxImplWp8.h" -#include "CCEditBox.h" -#include "CCGLViewImpl.h" -#include "base/CCScriptSupport.h" -#include "base/ccUTF8.h" - -NS_CC_EXT_BEGIN - -EditBoxImpl* __createSystemEditBox(EditBox* pEditBox) -{ - return new CCEditBoxImplWp8(pEditBox); -} - -CCEditBoxImplWp8::CCEditBoxImplWp8( EditBox* pEditText ) - : EditBoxImpl(pEditText) - , m_pLabel(NULL) - , m_pLabelPlaceHolder(NULL) - , m_eEditBoxInputMode(EditBox::InputMode::SINGLE_LINE) - , m_eEditBoxInputFlag(EditBox::InputFlag::INTIAL_CAPS_ALL_CHARACTERS) - , m_eKeyboardReturnType(EditBox::KeyboardReturnType::DEFAULT) - , m_colText(Color3B::WHITE) - , m_colPlaceHolder(Color3B::GRAY) - , m_nMaxLength(-1) -{ - -} - -CCEditBoxImplWp8::~CCEditBoxImplWp8() -{ - -} - -void CCEditBoxImplWp8::openKeyboard() -{ - if (_delegate != NULL) - { - _delegate->editBoxEditingDidBegin(_editBox); - } - - EditBox* pEditBox = this->getEditBox(); - if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler()) - { - CommonScriptData data(pEditBox->getScriptEditBoxHandler(), "began",pEditBox); - ScriptEvent event(kCommonEvent,(void*)&data); - ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); - } - - std::string placeHolder = m_pLabelPlaceHolder->getString(); - if (placeHolder.length() == 0) - placeHolder = "Enter value"; - - char pText[100]= {0}; - std::string text = getText(); - if (text.length()) - strncpy(pText, text.c_str(), 100); - - Windows::Foundation::EventHandler^ receiveHandler = ref new Windows::Foundation::EventHandler( - [this](Platform::Object^ sender, Platform::String^ arg) - { - setText(PlatformStringTostring(arg).c_str()); - if (_delegate != NULL) { - _delegate->editBoxTextChanged(_editBox, getText()); - _delegate->editBoxEditingDidEnd(_editBox); - _delegate->editBoxReturn(_editBox); - } - }); - - GLViewImpl::sharedOpenGLView()->OpenXamlEditBox(stringToPlatformString(placeHolder), stringToPlatformString(getText()), m_nMaxLength, (int)m_eEditBoxInputMode, (int)m_eEditBoxInputFlag, receiveHandler); -} - -bool CCEditBoxImplWp8::initWithSize( const Size& size ) -{ - //! int fontSize = getFontSizeAccordingHeightJni(size.height-12); - m_pLabel = Label::createWithSystemFont("", "", size.height-12); - // align the text vertically center - m_pLabel->setAnchorPoint(Vec2(0.0f, 0.5f)); - m_pLabel->setPosition(Vec2(5.0, size.height / 2.0f)); - m_pLabel->setColor(m_colText); - _editBox->addChild(m_pLabel); - - m_pLabelPlaceHolder = Label::createWithSystemFont("", "", size.height-12); - // align the text vertically center - m_pLabelPlaceHolder->setAnchorPoint(Vec2(0.0f, 0.5f)); - m_pLabelPlaceHolder->setPosition(Vec2(5.0f, size.height / 2.0f)); - m_pLabelPlaceHolder->setVisible(false); - m_pLabelPlaceHolder->setColor(m_colPlaceHolder); - _editBox->addChild(m_pLabelPlaceHolder); - - m_EditSize = size; - return true; -} - -void CCEditBoxImplWp8::setFont( const char* pFontName, int fontSize ) -{ - if(m_pLabel != NULL) { - m_pLabel->setSystemFontName(pFontName); - m_pLabel->setSystemFontSize(fontSize); - } - - if(m_pLabelPlaceHolder != NULL) { - m_pLabelPlaceHolder->setSystemFontName(pFontName); - m_pLabelPlaceHolder->setSystemFontSize(fontSize); - } -} - -void CCEditBoxImplWp8::setFontColor( const Color3B& color ) -{ - m_colText = color; - m_pLabel->setColor(color); -} - -void CCEditBoxImplWp8::setPlaceholderFont( const char* pFontName, int fontSize ) -{ - if(m_pLabelPlaceHolder != NULL) { - m_pLabelPlaceHolder->setSystemFontName(pFontName); - m_pLabelPlaceHolder->setSystemFontSize(fontSize); - } -} - -void CCEditBoxImplWp8::setPlaceholderFontColor( const Color3B& color ) -{ - m_colPlaceHolder = color; - m_pLabelPlaceHolder->setColor(color); -} - -void CCEditBoxImplWp8::setInputMode( EditBox::InputMode inputMode ) -{ - m_eEditBoxInputMode = inputMode; -} - -void CCEditBoxImplWp8::setInputFlag(EditBox::InputFlag inputFlag ) -{ - m_eEditBoxInputFlag = inputFlag; -} - -void CCEditBoxImplWp8::setMaxLength( int maxLength ) -{ - m_nMaxLength = maxLength; -} - -int CCEditBoxImplWp8::getMaxLength() -{ - return m_nMaxLength; -} - -void CCEditBoxImplWp8::setReturnType( EditBox::KeyboardReturnType returnType ) -{ - m_eKeyboardReturnType = returnType; -} - -bool CCEditBoxImplWp8::isEditing() -{ - return false; -} - -void CCEditBoxImplWp8::setText( const char* pText ) -{ - if (pText != NULL) - { - m_strText = pText; - - if (m_strText.length() > 0) - { - m_pLabelPlaceHolder->setVisible(false); - - std::string strToShow; - - if (EditBox::InputFlag::PASSWORD == m_eEditBoxInputFlag) - { - long length = cc_utf8_strlen(m_strText.c_str(), -1); - for (long i = 0; i < length; i++) - { - strToShow.append("*"); - } - } - else - { - strToShow = m_strText; - } - - //! std::string strWithEllipsis = getStringWithEllipsisJni(strToShow.c_str(), m_EditSize.width, m_EditSize.height-12); - //! m_pLabel->setString(strWithEllipsis.c_str()); - m_pLabel->setString(strToShow.c_str()); - } - else - { - m_pLabelPlaceHolder->setVisible(true); - m_pLabel->setString(""); - } - - } -} - -const char* CCEditBoxImplWp8::getText( void ) -{ - return m_strText.c_str(); -} - -void CCEditBoxImplWp8::setPlaceHolder( const char* pText ) -{ - if (pText != NULL) - { - m_strPlaceHolder = pText; - if (m_strPlaceHolder.length() > 0 && m_strText.length() == 0) - { - m_pLabelPlaceHolder->setVisible(true); - } - - m_pLabelPlaceHolder->setString(m_strPlaceHolder.c_str()); - } -} - -void CCEditBoxImplWp8::setPosition( const Vec2& pos ) -{ - -} - -void CCEditBoxImplWp8::setVisible( bool visible ) -{ - -} - -void CCEditBoxImplWp8::setContentSize( const Size& size ) -{ - -} - -void CCEditBoxImplWp8::setAnchorPoint( const Vec2& anchorPoint ) -{ - -} - -void CCEditBoxImplWp8::visit( void ) -{ - -} - -void CCEditBoxImplWp8::doAnimationWhenKeyboardMove( float duration, float distance ) -{ - -} - -void CCEditBoxImplWp8::closeKeyboard() -{ - -} - -void CCEditBoxImplWp8::onEnter( void ) -{ - -} - -Platform::String^ CCEditBoxImplWp8::stringToPlatformString( std::string strSrc ) -{ - // to wide char - int nStrLen = MultiByteToWideChar(CP_UTF8, 0, strSrc.c_str(), -1, NULL, 0); - wchar_t* pWStr = new wchar_t[nStrLen + 1]; - memset(pWStr, 0, nStrLen + 1); - MultiByteToWideChar(CP_UTF8, 0, strSrc.c_str(), -1, pWStr, nStrLen); - Platform::String^ strDst = ref new Platform::String(pWStr); - delete[] pWStr; - return strDst; -} - -std::string CCEditBoxImplWp8::PlatformStringTostring( Platform::String^ strSrc ) -{ - const wchar_t* pWStr = strSrc->Data(); - int nStrLen = WideCharToMultiByte(CP_UTF8, 0, pWStr, -1, NULL, 0, NULL, NULL); - char* pStr = new char[nStrLen + 1]; - memset(pStr, 0, nStrLen + 1); - WideCharToMultiByte(CP_UTF8, 0, pWStr, -1, pStr, nStrLen, NULL, NULL); ; - - std::string strDst = std::string(pStr); - - delete[] pStr; - return strDst; -} - -NS_CC_EXT_END diff --git a/extensions/GUI/CCEditBox/CCEditBoxImplWp8.h b/extensions/GUI/CCEditBox/CCEditBoxImplWp8.h deleted file mode 100644 index 4513ec6dfd..0000000000 --- a/extensions/GUI/CCEditBox/CCEditBoxImplWp8.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -Copyright (c) 2014 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ -#ifndef __CCEditBoxIMPLWP8_H__ -#define __CCEditBoxIMPLWP8_H__ - -#include "ExtensionMacros.h" -#include "CCEditBoxImpl.h" - -NS_CC_EXT_BEGIN - -class CCEditBox; - -class CCEditBoxImplWp8 : public EditBoxImpl -{ -public: - CCEditBoxImplWp8(EditBox* pEditText); - virtual ~CCEditBoxImplWp8(); - - virtual bool initWithSize(const Size& size); - virtual void setFont(const char* pFontName, int fontSize); - virtual void setFontColor(const Color3B& color); - virtual void setPlaceholderFont(const char* pFontName, int fontSize); - virtual void setPlaceholderFontColor(const Color3B& color); - virtual void setInputMode(EditBox::InputMode inputMode); - virtual void setInputFlag(EditBox::InputFlag inputFlag); - virtual void setMaxLength(int maxLength); - virtual int getMaxLength(); - virtual void setReturnType(EditBox::KeyboardReturnType returnType); - virtual bool isEditing(); - - virtual void setText(const char* pText); - virtual const char* getText(void); - virtual void setPlaceHolder(const char* pText); - virtual void setPosition(const Vec2& pos); - virtual void setVisible(bool visible); - virtual void setContentSize(const Size& size); - virtual void setAnchorPoint(const Vec2& anchorPoint); - virtual void visit(void); - virtual void doAnimationWhenKeyboardMove(float duration, float distance); - virtual void openKeyboard(); - virtual void closeKeyboard(); - virtual void onEnter(void); -private: - Platform::String^ stringToPlatformString(std::string strSrc); - std::string PlatformStringTostring(Platform::String^ strSrc); -private: - - Label* m_pLabel; - Label* m_pLabelPlaceHolder; - EditBox::InputMode m_eEditBoxInputMode; - EditBox::InputFlag m_eEditBoxInputFlag; - (EditBox::KeyboardReturnType m_eKeyboardReturnType; - - std::string m_strText; - std::string m_strPlaceHolder; - - Color3B m_colText; - Color3B m_colPlaceHolder; - - int m_nMaxLength; - Size m_EditSize; -}; - -NS_CC_EXT_END - -#endif diff --git a/extensions/cocos-ext.h b/extensions/cocos-ext.h index a204f40e43..695077d628 100644 --- a/extensions/cocos-ext.h +++ b/extensions/cocos-ext.h @@ -7,7 +7,7 @@ #include "GUI/CCControlExtension/CCControlExtensions.h" #include "GUI/CCScrollView/CCScrollView.h" #include "GUI/CCScrollView/CCTableView.h" -#include "GUI/CCEditBox/CCEditBox.h" +#include "ui/UIEditBox/UIEditBox.h" // Physics integration #include "physics-nodes/CCPhysicsDebugNode.h" diff --git a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp index b54a42aa32..a84855b7b8 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp @@ -11,6 +11,7 @@ USING_NS_CC; USING_NS_CC_EXT; +using namespace ui; EditBoxTest::EditBoxTest() @@ -37,7 +38,7 @@ EditBoxTest::EditBoxTest() auto editBoxSize = Size(visibleSize.width - 100, 60); // top - _editName = EditBox::create(editBoxSize, Scale9Sprite::create("extensions/green_edit.png")); + _editName = EditBox::create(editBoxSize, ui::Scale9Sprite::create("extensions/green_edit.png")); _editName->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height*3/4)); _editName->setFontName("Paint Boy"); _editName->setFontSize(25); @@ -50,7 +51,7 @@ EditBoxTest::EditBoxTest() addChild(_editName); // middle - _editPassword = EditBox::create(editBoxSize, Scale9Sprite::create("extensions/orange_edit.png")); + _editPassword = EditBox::create(editBoxSize, ui::Scale9Sprite::create("extensions/orange_edit.png")); _editPassword->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2)); #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) _editPassword->setFont("American Typewriter", 30); @@ -67,7 +68,7 @@ EditBoxTest::EditBoxTest() addChild(_editPassword); // bottom - _editEmail = EditBox::create(Size(editBoxSize.width, editBoxSize.height), Scale9Sprite::create("extensions/yellow_edit.png")); + _editEmail = EditBox::create(Size(editBoxSize.width, editBoxSize.height), ui::Scale9Sprite::create("extensions/yellow_edit.png")); _editEmail->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/4)); _editEmail->setAnchorPoint(Vec2(0.5, 1.0f)); _editEmail->setPlaceHolder("Email:"); @@ -90,17 +91,17 @@ void EditBoxTest::toExtensionsMainLayer(cocos2d::Ref *sender) scene->release(); } -void EditBoxTest::editBoxEditingDidBegin(cocos2d::extension::EditBox* editBox) +void EditBoxTest::editBoxEditingDidBegin(cocos2d::ui::EditBox* editBox) { log("editBox %p DidBegin !", editBox); } -void EditBoxTest::editBoxEditingDidEnd(cocos2d::extension::EditBox* editBox) +void EditBoxTest::editBoxEditingDidEnd(cocos2d::ui::EditBox* editBox) { log("editBox %p DidEnd !", editBox); } -void EditBoxTest::editBoxTextChanged(cocos2d::extension::EditBox* editBox, const std::string& text) +void EditBoxTest::editBoxTextChanged(cocos2d::ui::EditBox* editBox, const std::string& text) { log("editBox %p TextChanged, text: %s ", editBox, text.c_str()); } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h b/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h index 3cef026dbd..2de0e0642f 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h @@ -12,22 +12,22 @@ #include "cocos2d.h" #include "extensions/cocos-ext.h" -class EditBoxTest : public cocos2d::Layer, public cocos2d::extension::EditBoxDelegate +class EditBoxTest : public cocos2d::Layer, public cocos2d::ui::EditBoxDelegate { public: EditBoxTest(); virtual ~EditBoxTest(); void toExtensionsMainLayer(cocos2d::Ref *sender); - virtual void editBoxEditingDidBegin(cocos2d::extension::EditBox* editBox); - virtual void editBoxEditingDidEnd(cocos2d::extension::EditBox* editBox); - virtual void editBoxTextChanged(cocos2d::extension::EditBox* editBox, const std::string& text); - virtual void editBoxReturn(cocos2d::extension::EditBox* editBox); + virtual void editBoxEditingDidBegin(cocos2d::ui::EditBox* editBox); + virtual void editBoxEditingDidEnd(cocos2d::ui::EditBox* editBox); + virtual void editBoxTextChanged(cocos2d::ui::EditBox* editBox, const std::string& text); + virtual void editBoxReturn(cocos2d::ui::EditBox* editBox); private: cocos2d::Label* _TTFShowEditReturn; - cocos2d::extension::EditBox* _editName; - cocos2d::extension::EditBox* _editPassword; - cocos2d::extension::EditBox* _editEmail; + cocos2d::ui::EditBox* _editName; + cocos2d::ui::EditBox* _editPassword; + cocos2d::ui::EditBox* _editEmail; }; void runEditBoxTest(); From c136e8e07954119f902cd7dbb321fbe77298bef1 Mon Sep 17 00:00:00 2001 From: lite3 Date: Thu, 21 Aug 2014 02:15:27 +0800 Subject: [PATCH 09/45] fix indent --- cocos/base/ObjectFactory.cpp | 10 +- .../SampleUIAnimation.ExportJson | 1682 +++++++++++++++++ .../SampleUIAnimation0.plist | 84 + .../SampleUIAnimation/SampleUIAnimation0.png | Bin 0 -> 28378 bytes .../SampleUIAnimation.ExportJson | 1368 ++++++++++++++ .../SampleUIAnimation0.plist | 84 + .../SampleUIAnimation/SampleUIAnimation0.png | Bin 0 -> 28378 bytes 7 files changed, 3223 insertions(+), 5 deletions(-) create mode 100644 tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation.ExportJson create mode 100644 tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation0.plist create mode 100644 tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation0.png create mode 100644 tests/cpp-tests/Resources/SampleUIAnimation/SampleUIAnimation.ExportJson create mode 100644 tests/cpp-tests/Resources/SampleUIAnimation/SampleUIAnimation0.plist create mode 100644 tests/cpp-tests/Resources/SampleUIAnimation/SampleUIAnimation0.png diff --git a/cocos/base/ObjectFactory.cpp b/cocos/base/ObjectFactory.cpp index 8baebbf4e9..5cff373cb3 100644 --- a/cocos/base/ObjectFactory.cpp +++ b/cocos/base/ObjectFactory.cpp @@ -102,10 +102,10 @@ void ObjectFactory::destroyInstance() Ref* ObjectFactory::createObject(const std::string &name) { - Ref *o = nullptr; - do - { - const TInfo t = _typeMap[name]; + Ref *o = nullptr; + do + { + const TInfo t = _typeMap[name]; if (t._fun != nullptr) { o = t._fun(); @@ -113,7 +113,7 @@ Ref* ObjectFactory::createObject(const std::string &name) { o = t._func(); } - } while (0); + } while (0); return o; } diff --git a/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation.ExportJson b/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation.ExportJson new file mode 100644 index 0000000000..c38743cf4e --- /dev/null +++ b/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation.ExportJson @@ -0,0 +1,1682 @@ +{ + "classname": null, + "name": null, + "animation": { + "classname": null, + "name": "AnimationManager", + "actionlist": [ + { + "classname": null, + "name": "Animation1", + "actionnodelist": [ + { + "classname": null, + "name": "ImageView", + "ActionTag": 27, + "actionframelist": [ + { + "classname": null, + "name": null, + "colorb": 255, + "colorg": 255, + "colorr": 255, + "frameid": 0, + "opacity": 255, + "positionx": 39, + "positiony": 165.920044, + "rotation": 0, + "scalex": 1, + "scaley": 1, + "starttime": 1.77505913E+30, + "tweenParameter": [ + 0, + 0, + 1, + 1 + ], + "tweenType": 0, + "visible": false + }, + { + "classname": null, + "name": null, + "colorb": 255, + "colorg": 255, + "colorr": 255, + "frameid": 10, + "opacity": 255, + "positionx": 150, + "positiony": 42.9200439, + "rotation": 90, + "scalex": 1, + "scaley": 1, + "starttime": 1.401298E-42, + "tweenParameter": [ + 0, + 0, + 1, + 1 + ], + "tweenType": 0, + "visible": false + }, + { + "classname": null, + "name": null, + "colorb": 255, + "colorg": 255, + "colorr": 255, + "frameid": 15, + "opacity": 255, + "positionx": 190, + "positiony": 14.9200287, + "rotation": 90, + "scalex": 0.3, + "scaley": 1.6, + "starttime": 7.163279E-39, + "tweenParameter": [ + 0, + 0, + 1, + 1 + ], + "tweenType": 0, + "visible": false + }, + { + "classname": null, + "name": null, + "colorb": 52, + "colorg": 49, + "colorr": 196, + "frameid": 20, + "opacity": 255, + "positionx": 266, + "positiony": 91.92003, + "rotation": 272, + "scalex": 1, + "scaley": 1, + "starttime": 4.224576E-39, + "tweenParameter": [ + 0, + 0, + 1, + 1 + ], + "tweenType": 0, + "visible": false + }, + { + "classname": null, + "name": null, + "colorb": 255, + "colorg": 255, + "colorr": 255, + "frameid": 30, + "opacity": 0, + "positionx": 346.7685, + "positiony": 150.259537, + "rotation": -10.2989807, + "scalex": 1, + "scaley": 1, + "starttime": 7.163279E-39, + "tweenParameter": [ + 0, + 0, + 1, + 1 + ], + "tweenType": 0, + "visible": false + }, + { + "classname": null, + "name": null, + "colorb": 255, + "colorg": 255, + "colorr": 255, + "frameid": 40, + "opacity": 255, + "positionx": 235, + "positiony": 204.000015, + "rotation": 270, + "scalex": 1, + "scaley": 1, + "starttime": 1.401298E-45, + "tweenParameter": [ + 0, + 0, + 1, + 1 + ], + "tweenType": 0, + "visible": false + }, + { + "classname": null, + "name": null, + "colorb": 255, + "colorg": 255, + "colorr": 255, + "frameid": 50, + "opacity": 255, + "positionx": 312, + "positiony": 231.000015, + "rotation": 349.701019, + "scalex": -1, + "scaley": 0.9754356, + "starttime": 4.224576E-39, + "tweenParameter": [ + 0, + 0, + 1, + 1 + ], + "tweenType": 0, + "visible": false + }, + { + "classname": null, + "name": null, + "colorb": 255, + "colorg": 255, + "colorr": 255, + "frameid": 60, + "opacity": 255, + "positionx": 312, + "positiony": 231.000015, + "rotation": -10.2989807, + "scalex": 1, + "scaley": 0.9754356, + "starttime": 0, + "tweenParameter": [ + 0, + 0, + 1, + 1 + ], + "tweenType": 0, + "visible": false + }, + { + "classname": null, + "name": null, + "colorb": 255, + "colorg": 255, + "colorr": 255, + "frameid": 70, + "opacity": 255, + "positionx": 312, + "positiony": 231.000015, + "rotation": -10.2989807, + "scalex": -1, + "scaley": 0.9754356, + "starttime": 9.64289E-39, + "tweenParameter": [ + 0, + 0, + 1, + 1 + ], + "tweenType": 0, + "visible": false + } + ] + } + ], + "loop": false, + "unittime": 0.1 + } + ] + }, + "dataScale": 1, + "designHeight": 320, + "designWidth": 480, + "textures": [ + "SampleUIAnimation0.plist" + ], + "texturesPng": [ + "SampleUIAnimation0.png" + ], + "version": "1.5.0.0", + "widgetTree": { + "classname": "Panel", + "name": null, + "children": [ + { + "classname": "Button", + "name": null, + "children": [], + "options": { + "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "Button", + "name": "TextButton", + "ZOrder": 2, + "actiontag": 24, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSButton", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 30, + "ignoreSize": true, + "layoutParameter": null, + "opacity": 255, + "positionPercentX": 0.25, + "positionPercentY": 0.0609375, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.104166664, + "sizePercentY": 0.046875, + "sizeType": 0, + "tag": 4, + "touchAble": true, + "useMergedTexture": true, + "visible": true, + "width": 100, + "x": 240, + "y": 39, + "capInsetsHeight": 0, + "capInsetsWidth": 0, + "capInsetsX": 0, + "capInsetsY": 0, + "disabled": null, + "disabledData": { + "path": "backtotopnormal.png", + "plistFile": "", + "resourceType": 1 + }, + "fontName": "宋体", + "fontSize": 14, + "fontType": 0, + "normal": null, + "normalData": { + "path": "backtotopnormal.png", + "plistFile": "", + "resourceType": 1 + }, + "pressed": null, + "pressedData": { + "path": "backtotoppressed.png", + "plistFile": "", + "resourceType": 1 + }, + "scale9Enable": false, + "scale9Height": 30, + "scale9Width": 100, + "text": "start anim", + "textColorB": 255, + "textColorG": 255, + "textColorR": 255 + } + }, + { + "classname": "ImageView", + "name": null, + "children": [], + "options": { + "__type": "ImageViewSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "ImageView", + "name": "ImageView", + "ZOrder": 1, + "actiontag": 27, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSImageView", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 84, + "ignoreSize": true, + "layoutParameter": null, + "opacity": 255, + "positionPercentX": 0.040625, + "positionPercentY": 0.2578125, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.0791666657, + "sizePercentY": 0.13125, + "sizeType": 0, + "tag": 5, + "touchAble": false, + "useMergedTexture": true, + "visible": true, + "width": 76, + "x": 39, + "y": 165, + "capInsetsHeight": 0, + "capInsetsWidth": 0, + "capInsetsX": 0, + "capInsetsY": 0, + "fileName": null, + "fileNameData": { + "path": "CocoStudio_UIEditor.png", + "plistFile": "", + "resourceType": 1 + }, + "scale9Enable": false, + "scale9Height": 84, + "scale9Width": 76 + } + }, + { + "classname": "LoadingBar", + "name": null, + "children": [], + "options": { + "__type": "LoadingBarSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "LoadingBar", + "name": "ProgressBar_4", + "ZOrder": 0, + "actiontag": 36022812, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSLoadingBar", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 30, + "ignoreSize": true, + "layoutParameter": null, + "opacity": 255, + "positionPercentX": 0.0791666657, + "positionPercentY": 0.4453125, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.104166664, + "sizePercentY": 0.046875, + "sizeType": 0, + "tag": 7, + "touchAble": false, + "useMergedTexture": false, + "visible": true, + "width": 100, + "x": 76, + "y": 285, + "capInsetsHeight": 1, + "capInsetsWidth": 1, + "capInsetsX": 0, + "capInsetsY": 0, + "direction": 0, + "percent": 71, + "scale9Enable": false, + "texture": null, + "textureData": { + "path": "backtotopnormal.png", + "plistFile": "", + "resourceType": 1 + } + } + }, + { + "classname": "ListView", + "name": null, + "children": [ + { + "classname": "Button", + "name": null, + "children": [], + "options": { + "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "Button", + "name": "Button_6", + "ZOrder": 0, + "actiontag": 35532643, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSButton", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 30, + "ignoreSize": true, + "layoutParameter": { + "classname": null, + "name": null, + "align": 0, + "gravity": 2, + "layoutEageType": 0, + "layoutNormalHorizontal": 0, + "layoutNormalVertical": 0, + "layoutParentHorizontal": 0, + "layoutParentVertical": 0, + "marginDown": 0, + "marginLeft": 0, + "marginRight": 0, + "marginTop": 0, + "relativeName": "Button_6", + "relativeToName": "ListView_5", + "type": 1 + }, + "opacity": 255, + "positionPercentX": 0.25, + "positionPercentY": 0.95714283, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.5, + "sizePercentY": 0.15, + "sizeType": 0, + "tag": 9, + "touchAble": true, + "useMergedTexture": true, + "visible": true, + "width": 100, + "x": 50, + "y": 335, + "capInsetsHeight": 1, + "capInsetsWidth": 1, + "capInsetsX": 0, + "capInsetsY": 0, + "disabled": null, + "disabledData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "fontName": "微软雅黑", + "fontSize": 14, + "fontType": 0, + "normal": null, + "normalData": { + "path": "backtotoppressed.png", + "plistFile": "", + "resourceType": 1 + }, + "pressed": null, + "pressedData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "scale9Enable": false, + "scale9Height": 30, + "scale9Width": 100, + "text": "", + "textColorB": 255, + "textColorG": 255, + "textColorR": 255 + } + }, + { + "classname": "Button", + "name": null, + "children": [], + "options": { + "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "Button", + "name": "Button_6_0", + "ZOrder": 1, + "actiontag": 56999240, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSButton", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 30, + "ignoreSize": true, + "layoutParameter": { + "classname": null, + "name": null, + "align": 0, + "gravity": 2, + "layoutEageType": 0, + "layoutNormalHorizontal": 0, + "layoutNormalVertical": 0, + "layoutParentHorizontal": 0, + "layoutParentVertical": 0, + "marginDown": 0, + "marginLeft": -100, + "marginRight": 0, + "marginTop": -200, + "relativeName": "Button_6_0", + "relativeToName": "ListView_5", + "type": 1 + }, + "opacity": 255, + "positionPercentX": 0.25, + "positionPercentY": 0.8428571, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.5, + "sizePercentY": 0.15, + "sizeType": 0, + "tag": 11, + "touchAble": true, + "useMergedTexture": true, + "visible": true, + "width": 100, + "x": 50, + "y": 295, + "capInsetsHeight": 1, + "capInsetsWidth": 1, + "capInsetsX": 0, + "capInsetsY": 0, + "disabled": null, + "disabledData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "fontName": "微软雅黑", + "fontSize": 14, + "fontType": 0, + "normal": null, + "normalData": { + "path": "backtotoppressed.png", + "plistFile": "", + "resourceType": 1 + }, + "pressed": null, + "pressedData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "scale9Enable": false, + "scale9Height": 30, + "scale9Width": 100, + "text": "", + "textColorB": 255, + "textColorG": 255, + "textColorR": 255 + } + }, + { + "classname": "Button", + "name": null, + "children": [], + "options": { + "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "Button", + "name": "Button_6_0_1", + "ZOrder": 2, + "actiontag": 66472916, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSButton", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 30, + "ignoreSize": true, + "layoutParameter": { + "classname": null, + "name": null, + "align": 0, + "gravity": 2, + "layoutEageType": 0, + "layoutNormalHorizontal": 0, + "layoutNormalVertical": 0, + "layoutParentHorizontal": 0, + "layoutParentVertical": 0, + "marginDown": 0, + "marginLeft": -100, + "marginRight": 0, + "marginTop": -160, + "relativeName": "Button_6_0_1", + "relativeToName": "ListView_5", + "type": 1 + }, + "opacity": 255, + "positionPercentX": 0.25, + "positionPercentY": 0.7285714, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.5, + "sizePercentY": 0.15, + "sizeType": 0, + "tag": 13, + "touchAble": true, + "useMergedTexture": true, + "visible": true, + "width": 100, + "x": 50, + "y": 255, + "capInsetsHeight": 1, + "capInsetsWidth": 1, + "capInsetsX": 0, + "capInsetsY": 0, + "disabled": null, + "disabledData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "fontName": "微软雅黑", + "fontSize": 14, + "fontType": 0, + "normal": null, + "normalData": { + "path": "backtotoppressed.png", + "plistFile": "", + "resourceType": 1 + }, + "pressed": null, + "pressedData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "scale9Enable": false, + "scale9Height": 30, + "scale9Width": 100, + "text": "", + "textColorB": 255, + "textColorG": 255, + "textColorR": 255 + } + }, + { + "classname": "Button", + "name": null, + "children": [], + "options": { + "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "Button", + "name": "Button_6_0_2", + "ZOrder": 3, + "actiontag": 29143545, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSButton", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 30, + "ignoreSize": true, + "layoutParameter": { + "classname": null, + "name": null, + "align": 0, + "gravity": 2, + "layoutEageType": 0, + "layoutNormalHorizontal": 0, + "layoutNormalVertical": 0, + "layoutParentHorizontal": 0, + "layoutParentVertical": 0, + "marginDown": 0, + "marginLeft": -100, + "marginRight": 0, + "marginTop": -160, + "relativeName": "Button_6_0_2", + "relativeToName": "ListView_5", + "type": 1 + }, + "opacity": 255, + "positionPercentX": 0.25, + "positionPercentY": 0.6142857, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.5, + "sizePercentY": 0.15, + "sizeType": 0, + "tag": 14, + "touchAble": true, + "useMergedTexture": true, + "visible": true, + "width": 100, + "x": 50, + "y": 215, + "capInsetsHeight": 1, + "capInsetsWidth": 1, + "capInsetsX": 0, + "capInsetsY": 0, + "disabled": null, + "disabledData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "fontName": "微软雅黑", + "fontSize": 14, + "fontType": 0, + "normal": null, + "normalData": { + "path": "backtotoppressed.png", + "plistFile": "", + "resourceType": 1 + }, + "pressed": null, + "pressedData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "scale9Enable": false, + "scale9Height": 30, + "scale9Width": 100, + "text": "", + "textColorB": 255, + "textColorG": 255, + "textColorR": 255 + } + }, + { + "classname": "Button", + "name": null, + "children": [], + "options": { + "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "Button", + "name": "Button_6_0_3", + "ZOrder": 4, + "actiontag": 1842679, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSButton", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 30, + "ignoreSize": true, + "layoutParameter": { + "classname": null, + "name": null, + "align": 0, + "gravity": 2, + "layoutEageType": 0, + "layoutNormalHorizontal": 0, + "layoutNormalVertical": 0, + "layoutParentHorizontal": 0, + "layoutParentVertical": 0, + "marginDown": 0, + "marginLeft": -100, + "marginRight": 0, + "marginTop": -160, + "relativeName": "Button_6_0_3", + "relativeToName": "ListView_5", + "type": 1 + }, + "opacity": 255, + "positionPercentX": 0.25, + "positionPercentY": 0.5, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.5, + "sizePercentY": 0.15, + "sizeType": 0, + "tag": 15, + "touchAble": true, + "useMergedTexture": true, + "visible": true, + "width": 100, + "x": 50, + "y": 175, + "capInsetsHeight": 1, + "capInsetsWidth": 1, + "capInsetsX": 0, + "capInsetsY": 0, + "disabled": null, + "disabledData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "fontName": "微软雅黑", + "fontSize": 14, + "fontType": 0, + "normal": null, + "normalData": { + "path": "backtotoppressed.png", + "plistFile": "", + "resourceType": 1 + }, + "pressed": null, + "pressedData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "scale9Enable": false, + "scale9Height": 30, + "scale9Width": 100, + "text": "", + "textColorB": 255, + "textColorG": 255, + "textColorR": 255 + } + }, + { + "classname": "Button", + "name": null, + "children": [], + "options": { + "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "Button", + "name": "Button_6_0_4", + "ZOrder": 5, + "actiontag": 37105032, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSButton", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 30, + "ignoreSize": true, + "layoutParameter": { + "classname": null, + "name": null, + "align": 0, + "gravity": 2, + "layoutEageType": 0, + "layoutNormalHorizontal": 0, + "layoutNormalVertical": 0, + "layoutParentHorizontal": 0, + "layoutParentVertical": 0, + "marginDown": 0, + "marginLeft": -100, + "marginRight": 0, + "marginTop": -160, + "relativeName": "Button_6_0_4", + "relativeToName": "ListView_5", + "type": 1 + }, + "opacity": 255, + "positionPercentX": 0.25, + "positionPercentY": 0.3857143, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.5, + "sizePercentY": 0.15, + "sizeType": 0, + "tag": 16, + "touchAble": true, + "useMergedTexture": true, + "visible": true, + "width": 100, + "x": 50, + "y": 135, + "capInsetsHeight": 1, + "capInsetsWidth": 1, + "capInsetsX": 0, + "capInsetsY": 0, + "disabled": null, + "disabledData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "fontName": "微软雅黑", + "fontSize": 14, + "fontType": 0, + "normal": null, + "normalData": { + "path": "backtotoppressed.png", + "plistFile": "", + "resourceType": 1 + }, + "pressed": null, + "pressedData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "scale9Enable": false, + "scale9Height": 30, + "scale9Width": 100, + "text": "", + "textColorB": 255, + "textColorG": 255, + "textColorR": 255 + } + }, + { + "classname": "Button", + "name": null, + "children": [], + "options": { + "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "Button", + "name": "Button_6_0_5", + "ZOrder": 6, + "actiontag": 36874222, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSButton", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 30, + "ignoreSize": true, + "layoutParameter": { + "classname": null, + "name": null, + "align": 0, + "gravity": 2, + "layoutEageType": 0, + "layoutNormalHorizontal": 0, + "layoutNormalVertical": 0, + "layoutParentHorizontal": 0, + "layoutParentVertical": 0, + "marginDown": 0, + "marginLeft": -100, + "marginRight": 0, + "marginTop": -160, + "relativeName": "Button_6_0_5", + "relativeToName": "ListView_5", + "type": 1 + }, + "opacity": 255, + "positionPercentX": 0.25, + "positionPercentY": 0.271428585, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.5, + "sizePercentY": 0.15, + "sizeType": 0, + "tag": 17, + "touchAble": true, + "useMergedTexture": true, + "visible": true, + "width": 100, + "x": 50, + "y": 95, + "capInsetsHeight": 1, + "capInsetsWidth": 1, + "capInsetsX": 0, + "capInsetsY": 0, + "disabled": null, + "disabledData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "fontName": "微软雅黑", + "fontSize": 14, + "fontType": 0, + "normal": null, + "normalData": { + "path": "backtotoppressed.png", + "plistFile": "", + "resourceType": 1 + }, + "pressed": null, + "pressedData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "scale9Enable": false, + "scale9Height": 30, + "scale9Width": 100, + "text": "", + "textColorB": 255, + "textColorG": 255, + "textColorR": 255 + } + }, + { + "classname": "Button", + "name": null, + "children": [], + "options": { + "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "Button", + "name": "Button_6_0_6", + "ZOrder": 7, + "actiontag": 11303491, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSButton", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 30, + "ignoreSize": true, + "layoutParameter": { + "classname": null, + "name": null, + "align": 0, + "gravity": 2, + "layoutEageType": 0, + "layoutNormalHorizontal": 0, + "layoutNormalVertical": 0, + "layoutParentHorizontal": 0, + "layoutParentVertical": 0, + "marginDown": 0, + "marginLeft": -100, + "marginRight": 0, + "marginTop": -160, + "relativeName": "Button_6_0_6", + "relativeToName": "ListView_5", + "type": 1 + }, + "opacity": 255, + "positionPercentX": 0.25, + "positionPercentY": 0.157142863, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.5, + "sizePercentY": 0.15, + "sizeType": 0, + "tag": 18, + "touchAble": true, + "useMergedTexture": true, + "visible": true, + "width": 100, + "x": 50, + "y": 55, + "capInsetsHeight": 1, + "capInsetsWidth": 1, + "capInsetsX": 0, + "capInsetsY": 0, + "disabled": null, + "disabledData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "fontName": "微软雅黑", + "fontSize": 14, + "fontType": 0, + "normal": null, + "normalData": { + "path": "backtotoppressed.png", + "plistFile": "", + "resourceType": 1 + }, + "pressed": null, + "pressedData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "scale9Enable": false, + "scale9Height": 30, + "scale9Width": 100, + "text": "", + "textColorB": 255, + "textColorG": 255, + "textColorR": 255 + } + }, + { + "classname": "Button", + "name": null, + "children": [], + "options": { + "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "Button", + "name": "Button_6_0_7", + "ZOrder": 8, + "actiontag": 21667656, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSButton", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 30, + "ignoreSize": true, + "layoutParameter": { + "classname": null, + "name": null, + "align": 0, + "gravity": 2, + "layoutEageType": 0, + "layoutNormalHorizontal": 0, + "layoutNormalVertical": 0, + "layoutParentHorizontal": 0, + "layoutParentVertical": 0, + "marginDown": 0, + "marginLeft": -100, + "marginRight": 0, + "marginTop": -160, + "relativeName": "Button_6_0_7", + "relativeToName": "ListView_5", + "type": 1 + }, + "opacity": 255, + "positionPercentX": 0.25, + "positionPercentY": 0.042857144, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.5, + "sizePercentY": 0.15, + "sizeType": 0, + "tag": 19, + "touchAble": true, + "useMergedTexture": true, + "visible": true, + "width": 100, + "x": 50, + "y": 15, + "capInsetsHeight": 1, + "capInsetsWidth": 1, + "capInsetsX": 0, + "capInsetsY": 0, + "disabled": null, + "disabledData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "fontName": "微软雅黑", + "fontSize": 14, + "fontType": 0, + "normal": null, + "normalData": { + "path": "backtotoppressed.png", + "plistFile": "", + "resourceType": 1 + }, + "pressed": null, + "pressedData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "scale9Enable": false, + "scale9Height": 30, + "scale9Width": 100, + "text": "", + "textColorB": 255, + "textColorG": 255, + "textColorR": 255 + } + } + ], + "options": { + "__type": "ListViewSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "ListView", + "name": "ListView_5", + "ZOrder": 0, + "actiontag": 38723810, + "anchorPointX": 0, + "anchorPointY": 0, + "classType": "CocoStudio.EngineAdapterWrap.CSListView", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 200, + "ignoreSize": false, + "layoutParameter": null, + "opacity": 255, + "positionPercentX": 0.17916666, + "positionPercentY": 0.1390625, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.208333328, + "sizePercentY": 0.3125, + "sizeType": 0, + "tag": 8, + "touchAble": false, + "useMergedTexture": true, + "visible": true, + "width": 200, + "x": 172, + "y": 89, + "backGroundImage": null, + "backGroundImageData": null, + "backGroundScale9Enable": false, + "bgColorB": 255, + "bgColorG": 150, + "bgColorOpacity": 100, + "bgColorR": 150, + "bgEndColorB": 255, + "bgEndColorG": 150, + "bgEndColorR": 150, + "bgStartColorB": 255, + "bgStartColorG": 255, + "bgStartColorR": 255, + "bounceEnable": true, + "capInsetsHeight": 1, + "capInsetsWidth": 1, + "capInsetsX": 0, + "capInsetsY": 0, + "clipAble": true, + "colorType": 1, + "direction": 1, + "editorClipAble": true, + "gravity": 0, + "innerHeight": 0, + "innerWidth": 0, + "itemMargin": 10, + "vectorX": 0, + "vectorY": -0.5 + } + }, + { + "classname": "Panel", + "name": null, + "children": [ + { + "classname": "Button", + "name": null, + "children": [], + "options": { + "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "Button", + "name": "Button_18", + "ZOrder": 0, + "actiontag": 36753709, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSButton", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 30, + "ignoreSize": true, + "layoutParameter": { + "classname": null, + "name": null, + "align": 1, + "gravity": 4, + "layoutEageType": 0, + "layoutNormalHorizontal": 0, + "layoutNormalVertical": 0, + "layoutParentHorizontal": 0, + "layoutParentVertical": 0, + "marginDown": 0, + "marginLeft": -1, + "marginRight": 0, + "marginTop": 164, + "relativeName": "Button_18", + "relativeToName": "Panel_17", + "type": 2 + }, + "opacity": 255, + "positionPercentX": 0.154574126, + "positionPercentY": 0.105, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.324921131, + "sizePercentY": 0.2, + "sizeType": 0, + "tag": 23, + "touchAble": true, + "useMergedTexture": true, + "visible": true, + "width": 100, + "x": 49, + "y": 21, + "capInsetsHeight": 1, + "capInsetsWidth": 1, + "capInsetsX": 0, + "capInsetsY": 0, + "disabled": null, + "disabledData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "fontName": "微软雅黑", + "fontSize": 14, + "fontType": 0, + "normal": null, + "normalData": { + "path": "backtotopnormal.png", + "plistFile": "", + "resourceType": 1 + }, + "pressed": null, + "pressedData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "scale9Enable": false, + "scale9Height": 30, + "scale9Width": 100, + "text": "", + "textColorB": 255, + "textColorG": 255, + "textColorR": 255 + } + }, + { + "classname": "Button", + "name": null, + "children": [], + "options": { + "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "Button", + "name": "Button_18_0", + "ZOrder": 0, + "actiontag": 58260049, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSButton", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 30, + "ignoreSize": true, + "layoutParameter": { + "classname": null, + "name": null, + "align": 1, + "gravity": 4, + "layoutEageType": 0, + "layoutNormalHorizontal": 0, + "layoutNormalVertical": 0, + "layoutParentHorizontal": 0, + "layoutParentVertical": 0, + "marginDown": 0, + "marginLeft": 105, + "marginRight": 0, + "marginTop": 164, + "relativeName": "Button_18_0", + "relativeToName": "Panel_17", + "type": 2 + }, + "opacity": 255, + "positionPercentX": 0.488958985, + "positionPercentY": 0.105, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.324921131, + "sizePercentY": 0.2, + "sizeType": 0, + "tag": 25, + "touchAble": true, + "useMergedTexture": true, + "visible": true, + "width": 100, + "x": 155, + "y": 21, + "capInsetsHeight": 1, + "capInsetsWidth": 1, + "capInsetsX": 0, + "capInsetsY": 0, + "disabled": null, + "disabledData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "fontName": "微软雅黑", + "fontSize": 14, + "fontType": 0, + "normal": null, + "normalData": { + "path": "backtotopnormal.png", + "plistFile": "", + "resourceType": 1 + }, + "pressed": null, + "pressedData": { + "path": null, + "plistFile": null, + "resourceType": 0 + }, + "scale9Enable": false, + "scale9Height": 30, + "scale9Width": 100, + "text": "", + "textColorB": 255, + "textColorG": 255, + "textColorR": 255 + } + }, + { + "classname": "TextField", + "name": null, + "children": [], + "options": { + "__type": "TextFieldSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "TextField", + "name": "TextField_21", + "ZOrder": 0, + "actiontag": 18483046, + "anchorPointX": 0.5, + "anchorPointY": 0.5, + "classType": "CocoStudio.EngineAdapterWrap.CSTextField", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 27, + "ignoreSize": true, + "layoutParameter": { + "classname": null, + "name": null, + "align": 1, + "gravity": 0, + "layoutEageType": 0, + "layoutNormalHorizontal": 0, + "layoutNormalVertical": 0, + "layoutParentHorizontal": 0, + "layoutParentVertical": 0, + "marginDown": 0, + "marginLeft": 93, + "marginRight": 0, + "marginTop": 49, + "relativeName": "TextField_21", + "relativeToName": "Panel_17", + "type": 2 + }, + "opacity": 255, + "positionPercentX": 0.4873817, + "positionPercentY": 0.6875, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.283911675, + "sizePercentY": 0.135, + "sizeType": 0, + "tag": 26, + "touchAble": true, + "useMergedTexture": true, + "visible": true, + "width": 123, + "x": 154, + "y": 137, + "areaHeight": 0, + "areaWidth": 0, + "fontFile": null, + "fontName": "微软雅黑", + "fontSize": 20, + "maxLength": 10, + "maxLengthEnable": false, + "passwordEnable": false, + "passwordStyleText": "*", + "placeHolder": "fdsafdsafdsa", + "text": "Text Fielddsa" + } + } + ], + "options": { + "__type": "PanelSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "Panel", + "name": "Panel_17", + "ZOrder": 0, + "actiontag": 53887349, + "anchorPointX": 0, + "anchorPointY": 0, + "classType": "CocoStudio.EngineAdapterWrap.CSPanel", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 200, + "ignoreSize": false, + "layoutParameter": null, + "opacity": 255, + "positionPercentX": 0.180109158, + "positionPercentY": 0.4951139, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0.330208331, + "sizePercentY": 0.3125, + "sizeType": 0, + "tag": 22, + "touchAble": true, + "useMergedTexture": true, + "visible": true, + "width": 317, + "x": 172, + "y": 316, + "adaptScreen": false, + "backGroundImage": null, + "backGroundImageData": null, + "backGroundScale9Enable": false, + "bgColorB": 255, + "bgColorG": 200, + "bgColorOpacity": 100, + "bgColorR": 150, + "bgEndColorB": 255, + "bgEndColorG": 200, + "bgEndColorR": 150, + "bgStartColorB": 255, + "bgStartColorG": 255, + "bgStartColorR": 255, + "capInsetsHeight": 1, + "capInsetsWidth": 1, + "capInsetsX": 0, + "capInsetsY": 0, + "clipAble": false, + "colorType": 1, + "layoutType": 3, + "vectorX": 0, + "vectorY": -0.5 + } + } + ], + "options": { + "__type": "PanelSurrogate:#EditorCommon.JsonModel.Component.GUI", + "classname": "Panel", + "name": "Panel", + "ZOrder": 0, + "actiontag": -1, + "anchorPointX": 0, + "anchorPointY": 0, + "classType": "CocoStudio.EngineAdapterWrap.CSPanel", + "colorB": 255, + "colorG": 255, + "colorR": 255, + "customProperty": "", + "flipX": false, + "flipY": false, + "height": 640, + "ignoreSize": false, + "layoutParameter": null, + "opacity": 255, + "positionPercentX": 0, + "positionPercentY": 0, + "positionType": 0, + "rotation": 0, + "scaleX": 1, + "scaleY": 1, + "sizePercentX": 0, + "sizePercentY": 0, + "sizeType": 0, + "tag": 4, + "touchAble": false, + "useMergedTexture": true, + "visible": true, + "width": 960, + "x": 0, + "y": 0, + "adaptScreen": false, + "backGroundImage": null, + "backGroundImageData": null, + "backGroundScale9Enable": false, + "bgColorB": 255, + "bgColorG": 200, + "bgColorOpacity": 0, + "bgColorR": 150, + "bgEndColorB": 255, + "bgEndColorG": 0, + "bgEndColorR": 0, + "bgStartColorB": 255, + "bgStartColorG": 255, + "bgStartColorR": 255, + "capInsetsHeight": 0, + "capInsetsWidth": 0, + "capInsetsX": 0, + "capInsetsY": 0, + "clipAble": false, + "colorType": 1, + "layoutType": 0, + "vectorX": 0, + "vectorY": -0.5 + } + } +} \ No newline at end of file diff --git a/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation0.plist b/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation0.plist new file mode 100644 index 0000000000..1acdeec8fd --- /dev/null +++ b/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation0.plist @@ -0,0 +1,84 @@ + + + + + frames + + backtotopnormal.png + + width + 100 + height + 30 + originalWidth + 100 + originalHeight + 30 + x + 0 + y + 0 + offsetX + 0 + offsetY + 0 + + backtotoppressed.png + + width + 100 + height + 30 + originalWidth + 100 + originalHeight + 30 + x + 102 + y + 0 + offsetX + 0 + offsetY + 0 + + CocoStudio_UIEditor.png + + width + 76 + height + 84 + originalWidth + 76 + originalHeight + 84 + x + 204 + y + 0 + offsetX + 0 + offsetY + 0 + + + metadata + + format + 0 + textureFileName + SampleUIAnimation0.png + realTextureFileName + SampleUIAnimation0.png + size + {1024,1024} + + texture + + width + 1024 + height + 1024 + + + \ No newline at end of file diff --git a/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation0.png b/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation0.png new file mode 100644 index 0000000000000000000000000000000000000000..76d1d69e09d0060d8d7ba8450c51cd2b30b226bf GIT binary patch literal 28378 zcmV*MKx4m&P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>DZf{9MK~#8N?Y#$B zR#(0?PSjYaf@1GI_TCjMg1t~wu=j!mML|TAB3MwcQ3a(pk*1*76?@lcVtO)3CUr8I znVX`rzV+Mh`x+;A=HASF-~WGSyn8**%I^E@bI9Xbd!K#wYxcJQ;5B2^?CZb$rQsLf zeB<+$i&pAG)> z(@)Linf|kX7Yz*!jaLFMi_AwK{ciC`AAb0|@4x$&+0RLhe+JK={){g_{|p~~@Zr@@ zKL5OrJX>a0RuB0%g7shgU9R7J==ae_AAR=ypT1Z9Yy5L~Uhy1Xe)T0j{E&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m%iR4ya#eM{GA@WIIQs>PY+}CN#J`3#kjkj&vW0@`D3xUerX;tvR*Y5Z<^Ise* zlggQWM}IsF^(Vja9GX`@Z{;EgKfiRXJR>Y3oEbnXetxY28v=bdC5!FGpn%e8kMrR7 zC7ehTneJe=<3ZQcBoO^-gUBpIcHSNNth&+J;X}c-%?DQMN&MU zR*3~dfN7Q^gGh1U-^7XGJKUZEOz7VpL)L;&jCyAHv7svGd)ux7r;Yh`!P(w=&EMSX zTC+rsOI)+Ggx|NWA$SJScXMplPD+fIYYEkPcGQjVtrC~KD^KUb#9HTOr^PEv>5OYf z?D2j?cYsj9C-!60qznOgraGOXB@o}@gFfl-0s6G(ncuWV@Gg3K>dr`#4kb<0nD0zH zN`nxvugh8E!r6Ec0DWrB9X%Hua6%y{$eSm&)k@?`@P;>}&ui?})qcv|crbF>3D$9+ zUAtB4N6*5qH2l74v$NVRb2j=5Sk))o>HcZOYs-Jo?jC7I9n#``x z?fUeNX#LWM*w$}CpmYiYE;oZ4iO$7=r>y5(ZLe7E*!zMU|K~K*vqiGSmKH^;$J7W?(>eMpzZ=0*uJ(h6%`E%iOm4i=Hsp+S=y1KJ(FL$@*zal0M z4AZzi?Ro9}JpUAot=c00eRf?xCN)j&lYU#jfth}nTrySrC`VequRGY79xTioTugxR z)DxE&$ilDL5oEwv|3=7T{@OESgylyNSCfvr1UNX? zu)^?Og}>LU=4rD4P4P8C8}IkF&=AdjZBBhPiW8;c=1v-mWKJ6?a~!$&bjQAcAe5eh zA?NMaB5JeEl1b@H;wi%kvX4;1*t63*uhK!&`}iRGKcv}4!IoKyzgWnSSk&%zT z0{e)r;JPX_&`v%o{SB7ihCtKa`h;RZSJZ34b+#EjpIf{EBt2 + + + + frames + + backtotopnormal.png + + width + 100 + height + 30 + originalWidth + 100 + originalHeight + 30 + x + 0 + y + 0 + offsetX + 0 + offsetY + 0 + + backtotoppressed.png + + width + 100 + height + 30 + originalWidth + 100 + originalHeight + 30 + x + 102 + y + 0 + offsetX + 0 + offsetY + 0 + + CocoStudio_UIEditor.png + + width + 76 + height + 84 + originalWidth + 76 + originalHeight + 84 + x + 204 + y + 0 + offsetX + 0 + offsetY + 0 + + + metadata + + format + 0 + textureFileName + SampleUIAnimation0.png + realTextureFileName + SampleUIAnimation0.png + size + {1024,1024} + + texture + + width + 1024 + height + 1024 + + + \ No newline at end of file diff --git a/tests/cpp-tests/Resources/SampleUIAnimation/SampleUIAnimation0.png b/tests/cpp-tests/Resources/SampleUIAnimation/SampleUIAnimation0.png new file mode 100644 index 0000000000000000000000000000000000000000..76d1d69e09d0060d8d7ba8450c51cd2b30b226bf GIT binary patch literal 28378 zcmV*MKx4m&P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>DZf{9MK~#8N?Y#$B zR#(0?PSjYaf@1GI_TCjMg1t~wu=j!mML|TAB3MwcQ3a(pk*1*76?@lcVtO)3CUr8I znVX`rzV+Mh`x+;A=HASF-~WGSyn8**%I^E@bI9Xbd!K#wYxcJQ;5B2^?CZb$rQsLf zeB<+$i&pAG)> z(@)Linf|kX7Yz*!jaLFMi_AwK{ciC`AAb0|@4x$&+0RLhe+JK={){g_{|p~~@Zr@@ zKL5OrJX>a0RuB0%g7shgU9R7J==ae_AAR=ypT1Z9Yy5L~Uhy1Xe)T0j{E&Z_PyV^T zi-v}V#w!EUKY$;6^wE;vef%-r`RF5*K6npVSKda>rN_v<_z1Zd9#t5LBNrbdzx*u} zUVeh2EAOEA>OaCKM*fmlboEJv@a4S!H&j9;0c@>`(RiHVQ7kg}h6A z78f2O=lp|;oD1Z|hsY+g%E=pV4n_Uzdz62AA| zhs!?u>~p;R&ig1VxPY|y0%Rr?A?r{PvJVwiFsxvRoWsX(B=tCsrk5f=^8^YqPof~} zzhSnp%ov*D|DUmf*C78^nd$m}YYhL@xPEDupLGIxnWe~0JC5wsVq~T8*`$(b#mG!8 zLV9u`Qd5rM^tqe(^s~?KmR*ZVRr3Kh1u2H6=qj%RhV7AN#3Y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ncuWV@Gg3K>dr`#4kb<0nD0zH zN`nxvugh8E!r6Ec0DWrB9X%Hua6%y{$eSm&)k@?`@P;>}&ui?})qcv|crbF>3D$9+ zUAtB4N6*5qH2l74v$NVRb2j=5Sk))o>HcZOYs-Jo?jC7I9n#``x z?fUeNX#LWM*w$}CpmYiYE;oZ4iO$7=r>y5(ZLe7E*!zMU|K~K*vqiGSmKH^;$J7W?(>eMpzZ=0*uJ(h6%`E%iOm4i=Hsp+S=y1KJ(FL$@*zal0M z4AZzi?Ro9}JpUAot=c00eRf?xCN)j&lYU#jfth}nTrySrC`VequRGY79xTioTugxR z)DxE&$ilDL5oEwv|3=7T{@OESgylyNSCfvr1UNX? zu)^?Og}>LU=4rD4P4P8C8}IkF&=AdjZBBhPiW8;c=1v-mWKJ6?a~!$&bjQAcAe5eh zA?NMaB5JeEl1b@H;wi%kvX4;1*t63*uhK!&`}iRGKcv}4!IoKyzgWnSSk&%zT z0{e)r;JPX_&`v%o{SB7ihCtKa`h;RZSJZ34b+#EjpIf{EBt2 Date: Thu, 21 Aug 2014 02:23:25 +0800 Subject: [PATCH 10/45] remove resources for unused. --- .../SampleUIAnimation.ExportJson | 1682 ----------------- .../SampleUIAnimation0.plist | 84 - .../SampleUIAnimation/SampleUIAnimation0.png | Bin 28378 -> 0 bytes .../SampleUIAnimation.ExportJson | 1368 -------------- .../SampleUIAnimation0.plist | 84 - .../SampleUIAnimation/SampleUIAnimation0.png | Bin 28378 -> 0 bytes 6 files changed, 3218 deletions(-) delete mode 100644 tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation.ExportJson delete mode 100644 tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation0.plist delete mode 100644 tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation0.png delete mode 100644 tests/cpp-tests/Resources/SampleUIAnimation/SampleUIAnimation.ExportJson delete mode 100644 tests/cpp-tests/Resources/SampleUIAnimation/SampleUIAnimation0.plist delete mode 100644 tests/cpp-tests/Resources/SampleUIAnimation/SampleUIAnimation0.png diff --git a/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation.ExportJson b/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation.ExportJson deleted file mode 100644 index c38743cf4e..0000000000 --- a/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation.ExportJson +++ /dev/null @@ -1,1682 +0,0 @@ -{ - "classname": null, - "name": null, - "animation": { - "classname": null, - "name": "AnimationManager", - "actionlist": [ - { - "classname": null, - "name": "Animation1", - "actionnodelist": [ - { - "classname": null, - "name": "ImageView", - "ActionTag": 27, - "actionframelist": [ - { - "classname": null, - "name": null, - "colorb": 255, - "colorg": 255, - "colorr": 255, - "frameid": 0, - "opacity": 255, - "positionx": 39, - "positiony": 165.920044, - "rotation": 0, - "scalex": 1, - "scaley": 1, - "starttime": 1.77505913E+30, - "tweenParameter": [ - 0, - 0, - 1, - 1 - ], - "tweenType": 0, - "visible": false - }, - { - "classname": null, - "name": null, - "colorb": 255, - "colorg": 255, - "colorr": 255, - "frameid": 10, - "opacity": 255, - "positionx": 150, - "positiony": 42.9200439, - "rotation": 90, - "scalex": 1, - "scaley": 1, - "starttime": 1.401298E-42, - "tweenParameter": [ - 0, - 0, - 1, - 1 - ], - "tweenType": 0, - "visible": false - }, - { - "classname": null, - "name": null, - "colorb": 255, - "colorg": 255, - "colorr": 255, - "frameid": 15, - "opacity": 255, - "positionx": 190, - "positiony": 14.9200287, - "rotation": 90, - "scalex": 0.3, - "scaley": 1.6, - "starttime": 7.163279E-39, - "tweenParameter": [ - 0, - 0, - 1, - 1 - ], - "tweenType": 0, - "visible": false - }, - { - "classname": null, - "name": null, - "colorb": 52, - "colorg": 49, - "colorr": 196, - "frameid": 20, - "opacity": 255, - "positionx": 266, - "positiony": 91.92003, - "rotation": 272, - "scalex": 1, - "scaley": 1, - "starttime": 4.224576E-39, - "tweenParameter": [ - 0, - 0, - 1, - 1 - ], - "tweenType": 0, - "visible": false - }, - { - "classname": null, - "name": null, - "colorb": 255, - "colorg": 255, - "colorr": 255, - "frameid": 30, - "opacity": 0, - "positionx": 346.7685, - "positiony": 150.259537, - "rotation": -10.2989807, - "scalex": 1, - "scaley": 1, - "starttime": 7.163279E-39, - "tweenParameter": [ - 0, - 0, - 1, - 1 - ], - "tweenType": 0, - "visible": false - }, - { - "classname": null, - "name": null, - "colorb": 255, - "colorg": 255, - "colorr": 255, - "frameid": 40, - "opacity": 255, - "positionx": 235, - "positiony": 204.000015, - "rotation": 270, - "scalex": 1, - "scaley": 1, - "starttime": 1.401298E-45, - "tweenParameter": [ - 0, - 0, - 1, - 1 - ], - "tweenType": 0, - "visible": false - }, - { - "classname": null, - "name": null, - "colorb": 255, - "colorg": 255, - "colorr": 255, - "frameid": 50, - "opacity": 255, - "positionx": 312, - "positiony": 231.000015, - "rotation": 349.701019, - "scalex": -1, - "scaley": 0.9754356, - "starttime": 4.224576E-39, - "tweenParameter": [ - 0, - 0, - 1, - 1 - ], - "tweenType": 0, - "visible": false - }, - { - "classname": null, - "name": null, - "colorb": 255, - "colorg": 255, - "colorr": 255, - "frameid": 60, - "opacity": 255, - "positionx": 312, - "positiony": 231.000015, - "rotation": -10.2989807, - "scalex": 1, - "scaley": 0.9754356, - "starttime": 0, - "tweenParameter": [ - 0, - 0, - 1, - 1 - ], - "tweenType": 0, - "visible": false - }, - { - "classname": null, - "name": null, - "colorb": 255, - "colorg": 255, - "colorr": 255, - "frameid": 70, - "opacity": 255, - "positionx": 312, - "positiony": 231.000015, - "rotation": -10.2989807, - "scalex": -1, - "scaley": 0.9754356, - "starttime": 9.64289E-39, - "tweenParameter": [ - 0, - 0, - 1, - 1 - ], - "tweenType": 0, - "visible": false - } - ] - } - ], - "loop": false, - "unittime": 0.1 - } - ] - }, - "dataScale": 1, - "designHeight": 320, - "designWidth": 480, - "textures": [ - "SampleUIAnimation0.plist" - ], - "texturesPng": [ - "SampleUIAnimation0.png" - ], - "version": "1.5.0.0", - "widgetTree": { - "classname": "Panel", - "name": null, - "children": [ - { - "classname": "Button", - "name": null, - "children": [], - "options": { - "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "Button", - "name": "TextButton", - "ZOrder": 2, - "actiontag": 24, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSButton", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 30, - "ignoreSize": true, - "layoutParameter": null, - "opacity": 255, - "positionPercentX": 0.25, - "positionPercentY": 0.0609375, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.104166664, - "sizePercentY": 0.046875, - "sizeType": 0, - "tag": 4, - "touchAble": true, - "useMergedTexture": true, - "visible": true, - "width": 100, - "x": 240, - "y": 39, - "capInsetsHeight": 0, - "capInsetsWidth": 0, - "capInsetsX": 0, - "capInsetsY": 0, - "disabled": null, - "disabledData": { - "path": "backtotopnormal.png", - "plistFile": "", - "resourceType": 1 - }, - "fontName": "宋体", - "fontSize": 14, - "fontType": 0, - "normal": null, - "normalData": { - "path": "backtotopnormal.png", - "plistFile": "", - "resourceType": 1 - }, - "pressed": null, - "pressedData": { - "path": "backtotoppressed.png", - "plistFile": "", - "resourceType": 1 - }, - "scale9Enable": false, - "scale9Height": 30, - "scale9Width": 100, - "text": "start anim", - "textColorB": 255, - "textColorG": 255, - "textColorR": 255 - } - }, - { - "classname": "ImageView", - "name": null, - "children": [], - "options": { - "__type": "ImageViewSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "ImageView", - "name": "ImageView", - "ZOrder": 1, - "actiontag": 27, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSImageView", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 84, - "ignoreSize": true, - "layoutParameter": null, - "opacity": 255, - "positionPercentX": 0.040625, - "positionPercentY": 0.2578125, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.0791666657, - "sizePercentY": 0.13125, - "sizeType": 0, - "tag": 5, - "touchAble": false, - "useMergedTexture": true, - "visible": true, - "width": 76, - "x": 39, - "y": 165, - "capInsetsHeight": 0, - "capInsetsWidth": 0, - "capInsetsX": 0, - "capInsetsY": 0, - "fileName": null, - "fileNameData": { - "path": "CocoStudio_UIEditor.png", - "plistFile": "", - "resourceType": 1 - }, - "scale9Enable": false, - "scale9Height": 84, - "scale9Width": 76 - } - }, - { - "classname": "LoadingBar", - "name": null, - "children": [], - "options": { - "__type": "LoadingBarSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "LoadingBar", - "name": "ProgressBar_4", - "ZOrder": 0, - "actiontag": 36022812, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSLoadingBar", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 30, - "ignoreSize": true, - "layoutParameter": null, - "opacity": 255, - "positionPercentX": 0.0791666657, - "positionPercentY": 0.4453125, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.104166664, - "sizePercentY": 0.046875, - "sizeType": 0, - "tag": 7, - "touchAble": false, - "useMergedTexture": false, - "visible": true, - "width": 100, - "x": 76, - "y": 285, - "capInsetsHeight": 1, - "capInsetsWidth": 1, - "capInsetsX": 0, - "capInsetsY": 0, - "direction": 0, - "percent": 71, - "scale9Enable": false, - "texture": null, - "textureData": { - "path": "backtotopnormal.png", - "plistFile": "", - "resourceType": 1 - } - } - }, - { - "classname": "ListView", - "name": null, - "children": [ - { - "classname": "Button", - "name": null, - "children": [], - "options": { - "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "Button", - "name": "Button_6", - "ZOrder": 0, - "actiontag": 35532643, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSButton", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 30, - "ignoreSize": true, - "layoutParameter": { - "classname": null, - "name": null, - "align": 0, - "gravity": 2, - "layoutEageType": 0, - "layoutNormalHorizontal": 0, - "layoutNormalVertical": 0, - "layoutParentHorizontal": 0, - "layoutParentVertical": 0, - "marginDown": 0, - "marginLeft": 0, - "marginRight": 0, - "marginTop": 0, - "relativeName": "Button_6", - "relativeToName": "ListView_5", - "type": 1 - }, - "opacity": 255, - "positionPercentX": 0.25, - "positionPercentY": 0.95714283, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.5, - "sizePercentY": 0.15, - "sizeType": 0, - "tag": 9, - "touchAble": true, - "useMergedTexture": true, - "visible": true, - "width": 100, - "x": 50, - "y": 335, - "capInsetsHeight": 1, - "capInsetsWidth": 1, - "capInsetsX": 0, - "capInsetsY": 0, - "disabled": null, - "disabledData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "fontName": "微软雅黑", - "fontSize": 14, - "fontType": 0, - "normal": null, - "normalData": { - "path": "backtotoppressed.png", - "plistFile": "", - "resourceType": 1 - }, - "pressed": null, - "pressedData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "scale9Enable": false, - "scale9Height": 30, - "scale9Width": 100, - "text": "", - "textColorB": 255, - "textColorG": 255, - "textColorR": 255 - } - }, - { - "classname": "Button", - "name": null, - "children": [], - "options": { - "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "Button", - "name": "Button_6_0", - "ZOrder": 1, - "actiontag": 56999240, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSButton", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 30, - "ignoreSize": true, - "layoutParameter": { - "classname": null, - "name": null, - "align": 0, - "gravity": 2, - "layoutEageType": 0, - "layoutNormalHorizontal": 0, - "layoutNormalVertical": 0, - "layoutParentHorizontal": 0, - "layoutParentVertical": 0, - "marginDown": 0, - "marginLeft": -100, - "marginRight": 0, - "marginTop": -200, - "relativeName": "Button_6_0", - "relativeToName": "ListView_5", - "type": 1 - }, - "opacity": 255, - "positionPercentX": 0.25, - "positionPercentY": 0.8428571, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.5, - "sizePercentY": 0.15, - "sizeType": 0, - "tag": 11, - "touchAble": true, - "useMergedTexture": true, - "visible": true, - "width": 100, - "x": 50, - "y": 295, - "capInsetsHeight": 1, - "capInsetsWidth": 1, - "capInsetsX": 0, - "capInsetsY": 0, - "disabled": null, - "disabledData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "fontName": "微软雅黑", - "fontSize": 14, - "fontType": 0, - "normal": null, - "normalData": { - "path": "backtotoppressed.png", - "plistFile": "", - "resourceType": 1 - }, - "pressed": null, - "pressedData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "scale9Enable": false, - "scale9Height": 30, - "scale9Width": 100, - "text": "", - "textColorB": 255, - "textColorG": 255, - "textColorR": 255 - } - }, - { - "classname": "Button", - "name": null, - "children": [], - "options": { - "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "Button", - "name": "Button_6_0_1", - "ZOrder": 2, - "actiontag": 66472916, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSButton", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 30, - "ignoreSize": true, - "layoutParameter": { - "classname": null, - "name": null, - "align": 0, - "gravity": 2, - "layoutEageType": 0, - "layoutNormalHorizontal": 0, - "layoutNormalVertical": 0, - "layoutParentHorizontal": 0, - "layoutParentVertical": 0, - "marginDown": 0, - "marginLeft": -100, - "marginRight": 0, - "marginTop": -160, - "relativeName": "Button_6_0_1", - "relativeToName": "ListView_5", - "type": 1 - }, - "opacity": 255, - "positionPercentX": 0.25, - "positionPercentY": 0.7285714, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.5, - "sizePercentY": 0.15, - "sizeType": 0, - "tag": 13, - "touchAble": true, - "useMergedTexture": true, - "visible": true, - "width": 100, - "x": 50, - "y": 255, - "capInsetsHeight": 1, - "capInsetsWidth": 1, - "capInsetsX": 0, - "capInsetsY": 0, - "disabled": null, - "disabledData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "fontName": "微软雅黑", - "fontSize": 14, - "fontType": 0, - "normal": null, - "normalData": { - "path": "backtotoppressed.png", - "plistFile": "", - "resourceType": 1 - }, - "pressed": null, - "pressedData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "scale9Enable": false, - "scale9Height": 30, - "scale9Width": 100, - "text": "", - "textColorB": 255, - "textColorG": 255, - "textColorR": 255 - } - }, - { - "classname": "Button", - "name": null, - "children": [], - "options": { - "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "Button", - "name": "Button_6_0_2", - "ZOrder": 3, - "actiontag": 29143545, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSButton", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 30, - "ignoreSize": true, - "layoutParameter": { - "classname": null, - "name": null, - "align": 0, - "gravity": 2, - "layoutEageType": 0, - "layoutNormalHorizontal": 0, - "layoutNormalVertical": 0, - "layoutParentHorizontal": 0, - "layoutParentVertical": 0, - "marginDown": 0, - "marginLeft": -100, - "marginRight": 0, - "marginTop": -160, - "relativeName": "Button_6_0_2", - "relativeToName": "ListView_5", - "type": 1 - }, - "opacity": 255, - "positionPercentX": 0.25, - "positionPercentY": 0.6142857, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.5, - "sizePercentY": 0.15, - "sizeType": 0, - "tag": 14, - "touchAble": true, - "useMergedTexture": true, - "visible": true, - "width": 100, - "x": 50, - "y": 215, - "capInsetsHeight": 1, - "capInsetsWidth": 1, - "capInsetsX": 0, - "capInsetsY": 0, - "disabled": null, - "disabledData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "fontName": "微软雅黑", - "fontSize": 14, - "fontType": 0, - "normal": null, - "normalData": { - "path": "backtotoppressed.png", - "plistFile": "", - "resourceType": 1 - }, - "pressed": null, - "pressedData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "scale9Enable": false, - "scale9Height": 30, - "scale9Width": 100, - "text": "", - "textColorB": 255, - "textColorG": 255, - "textColorR": 255 - } - }, - { - "classname": "Button", - "name": null, - "children": [], - "options": { - "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "Button", - "name": "Button_6_0_3", - "ZOrder": 4, - "actiontag": 1842679, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSButton", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 30, - "ignoreSize": true, - "layoutParameter": { - "classname": null, - "name": null, - "align": 0, - "gravity": 2, - "layoutEageType": 0, - "layoutNormalHorizontal": 0, - "layoutNormalVertical": 0, - "layoutParentHorizontal": 0, - "layoutParentVertical": 0, - "marginDown": 0, - "marginLeft": -100, - "marginRight": 0, - "marginTop": -160, - "relativeName": "Button_6_0_3", - "relativeToName": "ListView_5", - "type": 1 - }, - "opacity": 255, - "positionPercentX": 0.25, - "positionPercentY": 0.5, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.5, - "sizePercentY": 0.15, - "sizeType": 0, - "tag": 15, - "touchAble": true, - "useMergedTexture": true, - "visible": true, - "width": 100, - "x": 50, - "y": 175, - "capInsetsHeight": 1, - "capInsetsWidth": 1, - "capInsetsX": 0, - "capInsetsY": 0, - "disabled": null, - "disabledData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "fontName": "微软雅黑", - "fontSize": 14, - "fontType": 0, - "normal": null, - "normalData": { - "path": "backtotoppressed.png", - "plistFile": "", - "resourceType": 1 - }, - "pressed": null, - "pressedData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "scale9Enable": false, - "scale9Height": 30, - "scale9Width": 100, - "text": "", - "textColorB": 255, - "textColorG": 255, - "textColorR": 255 - } - }, - { - "classname": "Button", - "name": null, - "children": [], - "options": { - "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "Button", - "name": "Button_6_0_4", - "ZOrder": 5, - "actiontag": 37105032, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSButton", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 30, - "ignoreSize": true, - "layoutParameter": { - "classname": null, - "name": null, - "align": 0, - "gravity": 2, - "layoutEageType": 0, - "layoutNormalHorizontal": 0, - "layoutNormalVertical": 0, - "layoutParentHorizontal": 0, - "layoutParentVertical": 0, - "marginDown": 0, - "marginLeft": -100, - "marginRight": 0, - "marginTop": -160, - "relativeName": "Button_6_0_4", - "relativeToName": "ListView_5", - "type": 1 - }, - "opacity": 255, - "positionPercentX": 0.25, - "positionPercentY": 0.3857143, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.5, - "sizePercentY": 0.15, - "sizeType": 0, - "tag": 16, - "touchAble": true, - "useMergedTexture": true, - "visible": true, - "width": 100, - "x": 50, - "y": 135, - "capInsetsHeight": 1, - "capInsetsWidth": 1, - "capInsetsX": 0, - "capInsetsY": 0, - "disabled": null, - "disabledData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "fontName": "微软雅黑", - "fontSize": 14, - "fontType": 0, - "normal": null, - "normalData": { - "path": "backtotoppressed.png", - "plistFile": "", - "resourceType": 1 - }, - "pressed": null, - "pressedData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "scale9Enable": false, - "scale9Height": 30, - "scale9Width": 100, - "text": "", - "textColorB": 255, - "textColorG": 255, - "textColorR": 255 - } - }, - { - "classname": "Button", - "name": null, - "children": [], - "options": { - "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "Button", - "name": "Button_6_0_5", - "ZOrder": 6, - "actiontag": 36874222, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSButton", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 30, - "ignoreSize": true, - "layoutParameter": { - "classname": null, - "name": null, - "align": 0, - "gravity": 2, - "layoutEageType": 0, - "layoutNormalHorizontal": 0, - "layoutNormalVertical": 0, - "layoutParentHorizontal": 0, - "layoutParentVertical": 0, - "marginDown": 0, - "marginLeft": -100, - "marginRight": 0, - "marginTop": -160, - "relativeName": "Button_6_0_5", - "relativeToName": "ListView_5", - "type": 1 - }, - "opacity": 255, - "positionPercentX": 0.25, - "positionPercentY": 0.271428585, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.5, - "sizePercentY": 0.15, - "sizeType": 0, - "tag": 17, - "touchAble": true, - "useMergedTexture": true, - "visible": true, - "width": 100, - "x": 50, - "y": 95, - "capInsetsHeight": 1, - "capInsetsWidth": 1, - "capInsetsX": 0, - "capInsetsY": 0, - "disabled": null, - "disabledData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "fontName": "微软雅黑", - "fontSize": 14, - "fontType": 0, - "normal": null, - "normalData": { - "path": "backtotoppressed.png", - "plistFile": "", - "resourceType": 1 - }, - "pressed": null, - "pressedData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "scale9Enable": false, - "scale9Height": 30, - "scale9Width": 100, - "text": "", - "textColorB": 255, - "textColorG": 255, - "textColorR": 255 - } - }, - { - "classname": "Button", - "name": null, - "children": [], - "options": { - "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "Button", - "name": "Button_6_0_6", - "ZOrder": 7, - "actiontag": 11303491, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSButton", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 30, - "ignoreSize": true, - "layoutParameter": { - "classname": null, - "name": null, - "align": 0, - "gravity": 2, - "layoutEageType": 0, - "layoutNormalHorizontal": 0, - "layoutNormalVertical": 0, - "layoutParentHorizontal": 0, - "layoutParentVertical": 0, - "marginDown": 0, - "marginLeft": -100, - "marginRight": 0, - "marginTop": -160, - "relativeName": "Button_6_0_6", - "relativeToName": "ListView_5", - "type": 1 - }, - "opacity": 255, - "positionPercentX": 0.25, - "positionPercentY": 0.157142863, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.5, - "sizePercentY": 0.15, - "sizeType": 0, - "tag": 18, - "touchAble": true, - "useMergedTexture": true, - "visible": true, - "width": 100, - "x": 50, - "y": 55, - "capInsetsHeight": 1, - "capInsetsWidth": 1, - "capInsetsX": 0, - "capInsetsY": 0, - "disabled": null, - "disabledData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "fontName": "微软雅黑", - "fontSize": 14, - "fontType": 0, - "normal": null, - "normalData": { - "path": "backtotoppressed.png", - "plistFile": "", - "resourceType": 1 - }, - "pressed": null, - "pressedData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "scale9Enable": false, - "scale9Height": 30, - "scale9Width": 100, - "text": "", - "textColorB": 255, - "textColorG": 255, - "textColorR": 255 - } - }, - { - "classname": "Button", - "name": null, - "children": [], - "options": { - "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "Button", - "name": "Button_6_0_7", - "ZOrder": 8, - "actiontag": 21667656, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSButton", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 30, - "ignoreSize": true, - "layoutParameter": { - "classname": null, - "name": null, - "align": 0, - "gravity": 2, - "layoutEageType": 0, - "layoutNormalHorizontal": 0, - "layoutNormalVertical": 0, - "layoutParentHorizontal": 0, - "layoutParentVertical": 0, - "marginDown": 0, - "marginLeft": -100, - "marginRight": 0, - "marginTop": -160, - "relativeName": "Button_6_0_7", - "relativeToName": "ListView_5", - "type": 1 - }, - "opacity": 255, - "positionPercentX": 0.25, - "positionPercentY": 0.042857144, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.5, - "sizePercentY": 0.15, - "sizeType": 0, - "tag": 19, - "touchAble": true, - "useMergedTexture": true, - "visible": true, - "width": 100, - "x": 50, - "y": 15, - "capInsetsHeight": 1, - "capInsetsWidth": 1, - "capInsetsX": 0, - "capInsetsY": 0, - "disabled": null, - "disabledData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "fontName": "微软雅黑", - "fontSize": 14, - "fontType": 0, - "normal": null, - "normalData": { - "path": "backtotoppressed.png", - "plistFile": "", - "resourceType": 1 - }, - "pressed": null, - "pressedData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "scale9Enable": false, - "scale9Height": 30, - "scale9Width": 100, - "text": "", - "textColorB": 255, - "textColorG": 255, - "textColorR": 255 - } - } - ], - "options": { - "__type": "ListViewSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "ListView", - "name": "ListView_5", - "ZOrder": 0, - "actiontag": 38723810, - "anchorPointX": 0, - "anchorPointY": 0, - "classType": "CocoStudio.EngineAdapterWrap.CSListView", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 200, - "ignoreSize": false, - "layoutParameter": null, - "opacity": 255, - "positionPercentX": 0.17916666, - "positionPercentY": 0.1390625, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.208333328, - "sizePercentY": 0.3125, - "sizeType": 0, - "tag": 8, - "touchAble": false, - "useMergedTexture": true, - "visible": true, - "width": 200, - "x": 172, - "y": 89, - "backGroundImage": null, - "backGroundImageData": null, - "backGroundScale9Enable": false, - "bgColorB": 255, - "bgColorG": 150, - "bgColorOpacity": 100, - "bgColorR": 150, - "bgEndColorB": 255, - "bgEndColorG": 150, - "bgEndColorR": 150, - "bgStartColorB": 255, - "bgStartColorG": 255, - "bgStartColorR": 255, - "bounceEnable": true, - "capInsetsHeight": 1, - "capInsetsWidth": 1, - "capInsetsX": 0, - "capInsetsY": 0, - "clipAble": true, - "colorType": 1, - "direction": 1, - "editorClipAble": true, - "gravity": 0, - "innerHeight": 0, - "innerWidth": 0, - "itemMargin": 10, - "vectorX": 0, - "vectorY": -0.5 - } - }, - { - "classname": "Panel", - "name": null, - "children": [ - { - "classname": "Button", - "name": null, - "children": [], - "options": { - "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "Button", - "name": "Button_18", - "ZOrder": 0, - "actiontag": 36753709, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSButton", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 30, - "ignoreSize": true, - "layoutParameter": { - "classname": null, - "name": null, - "align": 1, - "gravity": 4, - "layoutEageType": 0, - "layoutNormalHorizontal": 0, - "layoutNormalVertical": 0, - "layoutParentHorizontal": 0, - "layoutParentVertical": 0, - "marginDown": 0, - "marginLeft": -1, - "marginRight": 0, - "marginTop": 164, - "relativeName": "Button_18", - "relativeToName": "Panel_17", - "type": 2 - }, - "opacity": 255, - "positionPercentX": 0.154574126, - "positionPercentY": 0.105, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.324921131, - "sizePercentY": 0.2, - "sizeType": 0, - "tag": 23, - "touchAble": true, - "useMergedTexture": true, - "visible": true, - "width": 100, - "x": 49, - "y": 21, - "capInsetsHeight": 1, - "capInsetsWidth": 1, - "capInsetsX": 0, - "capInsetsY": 0, - "disabled": null, - "disabledData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "fontName": "微软雅黑", - "fontSize": 14, - "fontType": 0, - "normal": null, - "normalData": { - "path": "backtotopnormal.png", - "plistFile": "", - "resourceType": 1 - }, - "pressed": null, - "pressedData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "scale9Enable": false, - "scale9Height": 30, - "scale9Width": 100, - "text": "", - "textColorB": 255, - "textColorG": 255, - "textColorR": 255 - } - }, - { - "classname": "Button", - "name": null, - "children": [], - "options": { - "__type": "ButtonSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "Button", - "name": "Button_18_0", - "ZOrder": 0, - "actiontag": 58260049, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSButton", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 30, - "ignoreSize": true, - "layoutParameter": { - "classname": null, - "name": null, - "align": 1, - "gravity": 4, - "layoutEageType": 0, - "layoutNormalHorizontal": 0, - "layoutNormalVertical": 0, - "layoutParentHorizontal": 0, - "layoutParentVertical": 0, - "marginDown": 0, - "marginLeft": 105, - "marginRight": 0, - "marginTop": 164, - "relativeName": "Button_18_0", - "relativeToName": "Panel_17", - "type": 2 - }, - "opacity": 255, - "positionPercentX": 0.488958985, - "positionPercentY": 0.105, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.324921131, - "sizePercentY": 0.2, - "sizeType": 0, - "tag": 25, - "touchAble": true, - "useMergedTexture": true, - "visible": true, - "width": 100, - "x": 155, - "y": 21, - "capInsetsHeight": 1, - "capInsetsWidth": 1, - "capInsetsX": 0, - "capInsetsY": 0, - "disabled": null, - "disabledData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "fontName": "微软雅黑", - "fontSize": 14, - "fontType": 0, - "normal": null, - "normalData": { - "path": "backtotopnormal.png", - "plistFile": "", - "resourceType": 1 - }, - "pressed": null, - "pressedData": { - "path": null, - "plistFile": null, - "resourceType": 0 - }, - "scale9Enable": false, - "scale9Height": 30, - "scale9Width": 100, - "text": "", - "textColorB": 255, - "textColorG": 255, - "textColorR": 255 - } - }, - { - "classname": "TextField", - "name": null, - "children": [], - "options": { - "__type": "TextFieldSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "TextField", - "name": "TextField_21", - "ZOrder": 0, - "actiontag": 18483046, - "anchorPointX": 0.5, - "anchorPointY": 0.5, - "classType": "CocoStudio.EngineAdapterWrap.CSTextField", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 27, - "ignoreSize": true, - "layoutParameter": { - "classname": null, - "name": null, - "align": 1, - "gravity": 0, - "layoutEageType": 0, - "layoutNormalHorizontal": 0, - "layoutNormalVertical": 0, - "layoutParentHorizontal": 0, - "layoutParentVertical": 0, - "marginDown": 0, - "marginLeft": 93, - "marginRight": 0, - "marginTop": 49, - "relativeName": "TextField_21", - "relativeToName": "Panel_17", - "type": 2 - }, - "opacity": 255, - "positionPercentX": 0.4873817, - "positionPercentY": 0.6875, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.283911675, - "sizePercentY": 0.135, - "sizeType": 0, - "tag": 26, - "touchAble": true, - "useMergedTexture": true, - "visible": true, - "width": 123, - "x": 154, - "y": 137, - "areaHeight": 0, - "areaWidth": 0, - "fontFile": null, - "fontName": "微软雅黑", - "fontSize": 20, - "maxLength": 10, - "maxLengthEnable": false, - "passwordEnable": false, - "passwordStyleText": "*", - "placeHolder": "fdsafdsafdsa", - "text": "Text Fielddsa" - } - } - ], - "options": { - "__type": "PanelSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "Panel", - "name": "Panel_17", - "ZOrder": 0, - "actiontag": 53887349, - "anchorPointX": 0, - "anchorPointY": 0, - "classType": "CocoStudio.EngineAdapterWrap.CSPanel", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 200, - "ignoreSize": false, - "layoutParameter": null, - "opacity": 255, - "positionPercentX": 0.180109158, - "positionPercentY": 0.4951139, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0.330208331, - "sizePercentY": 0.3125, - "sizeType": 0, - "tag": 22, - "touchAble": true, - "useMergedTexture": true, - "visible": true, - "width": 317, - "x": 172, - "y": 316, - "adaptScreen": false, - "backGroundImage": null, - "backGroundImageData": null, - "backGroundScale9Enable": false, - "bgColorB": 255, - "bgColorG": 200, - "bgColorOpacity": 100, - "bgColorR": 150, - "bgEndColorB": 255, - "bgEndColorG": 200, - "bgEndColorR": 150, - "bgStartColorB": 255, - "bgStartColorG": 255, - "bgStartColorR": 255, - "capInsetsHeight": 1, - "capInsetsWidth": 1, - "capInsetsX": 0, - "capInsetsY": 0, - "clipAble": false, - "colorType": 1, - "layoutType": 3, - "vectorX": 0, - "vectorY": -0.5 - } - } - ], - "options": { - "__type": "PanelSurrogate:#EditorCommon.JsonModel.Component.GUI", - "classname": "Panel", - "name": "Panel", - "ZOrder": 0, - "actiontag": -1, - "anchorPointX": 0, - "anchorPointY": 0, - "classType": "CocoStudio.EngineAdapterWrap.CSPanel", - "colorB": 255, - "colorG": 255, - "colorR": 255, - "customProperty": "", - "flipX": false, - "flipY": false, - "height": 640, - "ignoreSize": false, - "layoutParameter": null, - "opacity": 255, - "positionPercentX": 0, - "positionPercentY": 0, - "positionType": 0, - "rotation": 0, - "scaleX": 1, - "scaleY": 1, - "sizePercentX": 0, - "sizePercentY": 0, - "sizeType": 0, - "tag": 4, - "touchAble": false, - "useMergedTexture": true, - "visible": true, - "width": 960, - "x": 0, - "y": 0, - "adaptScreen": false, - "backGroundImage": null, - "backGroundImageData": null, - "backGroundScale9Enable": false, - "bgColorB": 255, - "bgColorG": 200, - "bgColorOpacity": 0, - "bgColorR": 150, - "bgEndColorB": 255, - "bgEndColorG": 0, - "bgEndColorR": 0, - "bgStartColorB": 255, - "bgStartColorG": 255, - "bgStartColorR": 255, - "capInsetsHeight": 0, - "capInsetsWidth": 0, - "capInsetsX": 0, - "capInsetsY": 0, - "clipAble": false, - "colorType": 1, - "layoutType": 0, - "vectorX": 0, - "vectorY": -0.5 - } - } -} \ No newline at end of file diff --git a/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation0.plist b/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation0.plist deleted file mode 100644 index 1acdeec8fd..0000000000 --- a/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation0.plist +++ /dev/null @@ -1,84 +0,0 @@ - - - - - frames - - backtotopnormal.png - - width - 100 - height - 30 - originalWidth - 100 - originalHeight - 30 - x - 0 - y - 0 - offsetX - 0 - offsetY - 0 - - backtotoppressed.png - - width - 100 - height - 30 - originalWidth - 100 - originalHeight - 30 - x - 102 - y - 0 - offsetX - 0 - offsetY - 0 - - CocoStudio_UIEditor.png - - width - 76 - height - 84 - originalWidth - 76 - originalHeight - 84 - x - 204 - y - 0 - offsetX - 0 - offsetY - 0 - - - metadata - - format - 0 - textureFileName - SampleUIAnimation0.png - realTextureFileName - SampleUIAnimation0.png - size - {1024,1024} - - texture - - width - 1024 - height - 1024 - - - \ No newline at end of file diff --git a/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation0.png b/tests/cpp-empty-test/Resources/SampleUIAnimation/SampleUIAnimation0.png deleted file mode 100644 index 76d1d69e09d0060d8d7ba8450c51cd2b30b226bf..0000000000000000000000000000000000000000 GIT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Y79xTioTugxR z)DxE&$ilDL5oEwv|3=7T{@OESgylyNSCfvr1UNX? zu)^?Og}>LU=4rD4P4P8C8}IkF&=AdjZBBhPiW8;c=1v-mWKJ6?a~!$&bjQAcAe5eh zA?NMaB5JeEl1b@H;wi%kvX4;1*t63*uhK!&`}iRGKcv}4!IoKyzgWnSSk&%zT z0{e)r;JPX_&`v%o{SB7ihCtKa`h;RZSJZ34b+#EjpIf{EBt2 - - - - frames - - backtotopnormal.png - - width - 100 - height - 30 - originalWidth - 100 - originalHeight - 30 - x - 0 - y - 0 - offsetX - 0 - offsetY - 0 - - backtotoppressed.png - - width - 100 - height - 30 - originalWidth - 100 - originalHeight - 30 - x - 102 - y - 0 - offsetX - 0 - offsetY - 0 - - CocoStudio_UIEditor.png - - width - 76 - height - 84 - originalWidth - 76 - originalHeight - 84 - x - 204 - y - 0 - offsetX - 0 - offsetY - 0 - - - metadata - - format - 0 - textureFileName - SampleUIAnimation0.png - realTextureFileName - SampleUIAnimation0.png - size - {1024,1024} - - texture - - width - 1024 - height - 1024 - - - \ No newline at end of file diff --git a/tests/cpp-tests/Resources/SampleUIAnimation/SampleUIAnimation0.png b/tests/cpp-tests/Resources/SampleUIAnimation/SampleUIAnimation0.png deleted file mode 100644 index 76d1d69e09d0060d8d7ba8450c51cd2b30b226bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 28378 zcmV*MKx4m&P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>DZf{9MK~#8N?Y#$B zR#(0?PSjYaf@1GI_TCjMg1t~wu=j!mML|TAB3MwcQ3a(pk*1*76?@lcVtO)3CUr8I znVX`rzV+Mh`x+;A=HASF-~WGSyn8**%I^E@bI9Xbd!K#wYxcJQ;5B2^?CZb$rQsLf zeB<+$i&pAG)> z(@)Linf|kX7Yz*!jaLFMi_AwK{ciC`AAb0|@4x$&+0RLhe+JK={){g_{|p~~@Zr@@ zKL5OrJX>a0RuB0%g7shgU9R7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ustomGUIReader.h | 34 ++++++++ .../lua_cocos2dx_coco_studio_manual.cpp | 63 ++++++++++++++ .../proj.win32/libluacocos2d.vcxproj | 2 + .../proj.win32/libluacocos2d.vcxproj.filters | 6 ++ 5 files changed, 192 insertions(+) create mode 100644 cocos/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp create mode 100644 cocos/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.h diff --git a/cocos/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp b/cocos/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp new file mode 100644 index 0000000000..fa0bcb1832 --- /dev/null +++ b/cocos/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp @@ -0,0 +1,87 @@ +#include "CustomGUIReader.h" +#include "CCLuaEngine.h" +#include "base/ObjectFactory.h" +#include "json/document.h" +#include "json/writer.h" +#include "json/stringbuffer.h" + +USING_NS_CC; + +namespace cocostudio +{ + + CustomGUIReader* CustomGUIReader::create(std::string &className, int createFunc, int setPropsFunc) + { + auto reader = new CustomGUIReader(); + reader->init(className, createFunc, setPropsFunc); + return reader; + } + + Ref* CustomGUIReader::createInstance() + { + Ref* result = nullptr; + LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); + stack->executeFunction(_createFunc, 0, 1, [&result](lua_State* L,int numReturn){ + result = static_cast(tolua_tousertype(L, -1, nullptr)); + lua_pop(L, 1); + }); + return result; + } + + CustomGUIReader::CustomGUIReader() + :_className() + ,_createFunc(0) + ,_setPropsFunc(0) + { + + } + + CustomGUIReader::~CustomGUIReader() + { + if (_createFunc) + { + LuaEngine::getInstance()->removeScriptHandler(_createFunc); + _createFunc = 0; + } + if (_setPropsFunc) + { + LuaEngine::getInstance()->removeScriptHandler(_setPropsFunc); + _setPropsFunc = 0; + } + } + + void CustomGUIReader::init(std::string &className, int createFunc, int setPropsFunc) + { + _className = className; + _createFunc = createFunc; + _setPropsFunc = setPropsFunc; + + ObjectFactory* factoryCreate = ObjectFactory::getInstance(); + ObjectFactory::TInfo t; + t._class = className; + t._func = CC_CALLBACK_0(CustomGUIReader::createInstance, this); + factoryCreate->registerType(t); + + auto guiReader = GUIReader::getInstance(); + auto objMap = guiReader->getParseObjectMap(); + (*objMap)[className] = this; + auto callbackMap = guiReader->getParseCallBackMap(); + (*callbackMap)[className] = parseselector(CustomGUIReader::setCustomProps); + } + + void CustomGUIReader::setCustomProps(const std::string &classType, cocos2d::Ref *widget, const rapidjson::Value &customOptions) + { + if (_setPropsFunc != 0) + { + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + customOptions.Accept(writer); + + auto stack = LuaEngine::getInstance()->getLuaStack(); + stack->pushString(classType.c_str(), classType.size()); + stack->pushObject(widget, "cc.Ref"); + stack->pushString(buffer.GetString(), buffer.Size()); + stack->executeFunctionByHandler(_setPropsFunc, 3); + } + } +} diff --git a/cocos/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.h b/cocos/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.h new file mode 100644 index 0000000000..b82ddd65aa --- /dev/null +++ b/cocos/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.h @@ -0,0 +1,34 @@ +#ifndef COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_CUSTOM_GUI_READER_H +#define COCOS_SCRIPTING_LUA_BINDINGS_LUA_COCOS2DX_CUSTOM_GUI_READER_H + +#include "cocostudio/WidgetReader/WidgetReader.h" + +USING_NS_CC; + +namespace cocostudio +{ + class CustomGUIReader : public Ref + { + public: + + CustomGUIReader(); + virtual ~CustomGUIReader(); + + static CustomGUIReader* create(std::string &className, int createFunc, int setPropsFunc); + + void init(std::string &className, int createFunc, int setPropsFunc); + + Ref* createInstance(); + + void setCustomProps(const std::string &classType, cocos2d::Ref *widget, const rapidjson::Value &customOptions); + + private: + std::string _className; + int _createFunc; + int _setPropsFunc; + }; +} + + + +#endif diff --git a/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp b/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp index a8bca1e5dc..013784aee7 100644 --- a/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp @@ -30,6 +30,7 @@ #include "CCLuaValue.h" #include "CocoStudio.h" #include "CCLuaEngine.h" +#include "CustomGUIReader.h" using namespace cocostudio; @@ -554,6 +555,53 @@ static void extendActionTimeline(lua_State* L) lua_pop(L, 1); } +int lua_cocos2dx_CustomGUIReader_create(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertable(tolua_S,1,"ccs.CustomGUIReader",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S)-1; + + do + { + if (argc == 3) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccs.CustomGUIReader:create"); + if (!ok) { break; } +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(tolua_S,3,"LUA_FUNCTION",0,&tolua_err)) { + goto tolua_lerror; + } +#endif + LUA_FUNCTION arg1 = toluafix_ref_function(tolua_S,3,0); +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(tolua_S,4,"LUA_FUNCTION",0,&tolua_err)) { + goto tolua_lerror; + } +#endif + LUA_FUNCTION arg2 = toluafix_ref_function(tolua_S,4,0); + + cocostudio::CustomGUIReader* ret = cocostudio::CustomGUIReader::create(arg0, arg1, arg2); + object_to_luaval(tolua_S, "ccs.CustomGUIReader",(cocostudio::CustomGUIReader*)ret); + return 1; + } + } while (0); + CCLOG("%s has wrong number of arguments: %d, was expecting %d", "ccs.CustomGUIReader:create",argc, 1); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_CustomGUIReader_create'.",&tolua_err); +#endif + return 0; +} int register_all_cocos2dx_coco_studio_manual(lua_State* L) { @@ -569,6 +617,20 @@ int register_all_cocos2dx_coco_studio_manual(lua_State* L) return 0; } +int lua_register_cocos2dx_coco_studio_CustomGUIReader(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"ccs.CustomGUIReader"); + tolua_cclass(tolua_S,"CustomGUIReader","ccs.CustomGUIReader","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"CustomGUIReader"); + tolua_function(tolua_S,"create",lua_cocos2dx_CustomGUIReader_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(cocostudio::CustomGUIReader).name(); + g_luaType[typeName] = "ccs.CustomGUIReader"; + g_typeCast["CustomGUIReader"] = "ccs.CustomGUIReader"; + return 1; +} + int register_cocostudio_module(lua_State* L) { lua_getglobal(L, "_G"); @@ -576,6 +638,7 @@ int register_cocostudio_module(lua_State* L) { register_all_cocos2dx_studio(L); register_all_cocos2dx_coco_studio_manual(L); + lua_register_cocos2dx_coco_studio_CustomGUIReader(L); } lua_pop(L, 1); diff --git a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj index a627dd490e..f1c52743e9 100644 --- a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj +++ b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj @@ -56,6 +56,7 @@ + @@ -117,6 +118,7 @@ + diff --git a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj.filters b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj.filters index 11d3df728e..1f8c61573d 100644 --- a/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj.filters +++ b/cocos/scripting/lua-bindings/proj.win32/libluacocos2d.vcxproj.filters @@ -243,6 +243,9 @@ luasocket + + manual\cocostudio + @@ -422,6 +425,9 @@ luasocket + + manual\cocostudio + From 18464825271ae5bae257a2a4697f8811e50e3bba Mon Sep 17 00:00:00 2001 From: lite3 Date: Sat, 30 Aug 2014 00:46:38 +0800 Subject: [PATCH 12/45] skip GUIReader::registerTypeAndCallBack for lua bindings --- tools/tolua/cocos2dx_studio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tolua/cocos2dx_studio.ini b/tools/tolua/cocos2dx_studio.ini index 32baa60dae..a25e3b67b9 100644 --- a/tools/tolua/cocos2dx_studio.ini +++ b/tools/tolua/cocos2dx_studio.ini @@ -48,7 +48,7 @@ skip = *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType .* ActionManagerEx::[initWithDictionary initWithBinary], DisplayManager::[initDisplayList (s|g)etCurrentDecorativeDisplay getDecorativeDisplayByIndex], Tween::[(s|g)etMovementBoneData], - GUIReader::[storeFileDesignSize getFileDesignSize getParseCallBackMap getParseObjectMap], + GUIReader::[registerTypeAndCallBack storeFileDesignSize getFileDesignSize getParseCallBackMap getParseObjectMap], ActionNode::[initWithDictionary], ActionObject::[initWithDictionary initWithBinary], BaseData::[copy subtract], From 6d462c5013faea7c14f066e942f8f94a98345397 Mon Sep 17 00:00:00 2001 From: lite3 Date: Sat, 30 Aug 2014 12:23:03 +0800 Subject: [PATCH 13/45] fix ccs.CustomGUIReader not in ccs table --- .../manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp b/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp index 013784aee7..eabfb21ac0 100644 --- a/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp @@ -619,6 +619,10 @@ int register_all_cocos2dx_coco_studio_manual(lua_State* L) int lua_register_cocos2dx_coco_studio_CustomGUIReader(lua_State* tolua_S) { + tolua_module(tolua_S,"ccs",0); + tolua_beginmodule(tolua_S,"ccs"); + + tolua_usertype(tolua_S,"ccs.CustomGUIReader"); tolua_cclass(tolua_S,"CustomGUIReader","ccs.CustomGUIReader","cc.Ref",nullptr); @@ -628,6 +632,8 @@ int lua_register_cocos2dx_coco_studio_CustomGUIReader(lua_State* tolua_S) std::string typeName = typeid(cocostudio::CustomGUIReader).name(); g_luaType[typeName] = "ccs.CustomGUIReader"; g_typeCast["CustomGUIReader"] = "ccs.CustomGUIReader"; + + tolua_endmodule(tolua_S); return 1; } From 0076953f97f8fec2dee2ca679cffc3b53eb929f5 Mon Sep 17 00:00:00 2001 From: andyque Date: Mon, 1 Sep 2014 15:55:09 +0800 Subject: [PATCH 14/45] fix iOS compile error --- build/cocos2d_libs.xcodeproj/project.pbxproj | 120 ++++++++++-------- .../CocoStudioGUITest/CocosGUIScene.cpp | 12 ++ 2 files changed, 80 insertions(+), 52 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index c49581a417..6e12365842 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -1008,16 +1008,6 @@ 15AE1C0419AAE01E00C27E9E /* CCTableView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168631807AF4E005B8026 /* CCTableView.h */; }; 15AE1C0519AAE01E00C27E9E /* CCTableViewCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168641807AF4E005B8026 /* CCTableViewCell.cpp */; }; 15AE1C0619AAE01E00C27E9E /* CCTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168651807AF4E005B8026 /* CCTableViewCell.h */; }; - 15AE1C0719AAE02500C27E9E /* CCEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684F1807AF4E005B8026 /* CCEditBox.cpp */; }; - 15AE1C0819AAE02500C27E9E /* CCEditBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168501807AF4E005B8026 /* CCEditBox.h */; }; - 15AE1C0919AAE02500C27E9E /* CCEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684F1807AF4E005B8026 /* CCEditBox.cpp */; }; - 15AE1C0A19AAE02500C27E9E /* CCEditBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168501807AF4E005B8026 /* CCEditBox.h */; }; - 15AE1C0B19AAE02D00C27E9E /* CCEditBoxImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168511807AF4E005B8026 /* CCEditBoxImpl.h */; }; - 15AE1C0C19AAE02D00C27E9E /* CCEditBoxImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168511807AF4E005B8026 /* CCEditBoxImpl.h */; }; - 15AE1C0D19AAE03400C27E9E /* CCEditBoxImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B282B47C1980E02B00666787 /* CCEditBoxImplMac.mm */; }; - 15AE1C0E19AAE03400C27E9E /* CCEditBoxImplMac.h in Headers */ = {isa = PBXBuildFile; fileRef = B282B47D1980E02B00666787 /* CCEditBoxImplMac.h */; }; - 15AE1C0F19AAE03E00C27E9E /* CCEditBoxImplIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */; }; - 15AE1C1019AAE03E00C27E9E /* CCEditBoxImplIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */; }; 15AE1C1119AAE2C600C27E9E /* CCPhysicsDebugNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71EEC180E27CF00808F54 /* CCPhysicsDebugNode.cpp */; }; 15AE1C1219AAE2C600C27E9E /* CCPhysicsDebugNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD71EED180E27CF00808F54 /* CCPhysicsDebugNode.h */; }; 15AE1C1319AAE2C600C27E9E /* CCPhysicsSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD71EEE180E27CF00808F54 /* CCPhysicsSprite.cpp */; }; @@ -1350,6 +1340,26 @@ 1ABA68B11888D700007D1BB4 /* CCFontCharMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ABA68AD1888D700007D1BB4 /* CCFontCharMap.h */; }; 1AC0269C1914068200FA920D /* ConvertUTF.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC026991914068200FA920D /* ConvertUTF.h */; }; 1AC0269D1914068200FA920D /* ConvertUTF.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC026991914068200FA920D /* ConvertUTF.h */; }; + 292DB13D19B4574100A80320 /* UIEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292DB12F19B4574100A80320 /* UIEditBox.cpp */; }; + 292DB13E19B4574100A80320 /* UIEditBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292DB12F19B4574100A80320 /* UIEditBox.cpp */; }; + 292DB13F19B4574100A80320 /* UIEditBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 292DB13019B4574100A80320 /* UIEditBox.h */; }; + 292DB14019B4574100A80320 /* UIEditBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 292DB13019B4574100A80320 /* UIEditBox.h */; }; + 292DB14119B4574100A80320 /* UIEditBoxImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 292DB13119B4574100A80320 /* UIEditBoxImpl.h */; }; + 292DB14219B4574100A80320 /* UIEditBoxImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 292DB13119B4574100A80320 /* UIEditBoxImpl.h */; }; + 292DB14319B4574100A80320 /* UIEditBoxImplAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292DB13219B4574100A80320 /* UIEditBoxImplAndroid.cpp */; }; + 292DB14419B4574100A80320 /* UIEditBoxImplAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292DB13219B4574100A80320 /* UIEditBoxImplAndroid.cpp */; }; + 292DB14519B4574100A80320 /* UIEditBoxImplAndroid.h in Headers */ = {isa = PBXBuildFile; fileRef = 292DB13319B4574100A80320 /* UIEditBoxImplAndroid.h */; }; + 292DB14619B4574100A80320 /* UIEditBoxImplAndroid.h in Headers */ = {isa = PBXBuildFile; fileRef = 292DB13319B4574100A80320 /* UIEditBoxImplAndroid.h */; }; + 292DB14719B4574100A80320 /* UIEditBoxImplIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 292DB13419B4574100A80320 /* UIEditBoxImplIOS.h */; }; + 292DB14819B4574100A80320 /* UIEditBoxImplIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 292DB13419B4574100A80320 /* UIEditBoxImplIOS.h */; }; + 292DB14919B4574100A80320 /* UIEditBoxImplIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 292DB13519B4574100A80320 /* UIEditBoxImplIOS.mm */; }; + 292DB14A19B4574100A80320 /* UIEditBoxImplIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 292DB13519B4574100A80320 /* UIEditBoxImplIOS.mm */; }; + 292DB14B19B4574100A80320 /* UIEditBoxImplMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 292DB13619B4574100A80320 /* UIEditBoxImplMac.h */; }; + 292DB14C19B4574100A80320 /* UIEditBoxImplMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 292DB13619B4574100A80320 /* UIEditBoxImplMac.h */; }; + 292DB14D19B4574100A80320 /* UIEditBoxImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 292DB13719B4574100A80320 /* UIEditBoxImplMac.mm */; }; + 292DB14E19B4574100A80320 /* UIEditBoxImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 292DB13719B4574100A80320 /* UIEditBoxImplMac.mm */; }; + 292DB14F19B4574100A80320 /* UIEditBoxImplNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292DB13819B4574100A80320 /* UIEditBoxImplNone.cpp */; }; + 292DB15019B4574100A80320 /* UIEditBoxImplNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292DB13819B4574100A80320 /* UIEditBoxImplNone.cpp */; }; 29394CF019B01DBA00D2DE1A /* UIWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = 29394CEC19B01DBA00D2DE1A /* UIWebView.h */; }; 29394CF119B01DBA00D2DE1A /* UIWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = 29394CEC19B01DBA00D2DE1A /* UIWebView.h */; }; 29394CF219B01DBA00D2DE1A /* UIWebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29394CED19B01DBA00D2DE1A /* UIWebView.mm */; }; @@ -2304,6 +2314,16 @@ 2905FA1318CF08D100240AA3 /* UIWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIWidget.cpp; sourceTree = ""; }; 2905FA1418CF08D100240AA3 /* UIWidget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWidget.h; sourceTree = ""; }; 29080DEB191B82CE0066F8DF /* UIDeprecated.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIDeprecated.h; sourceTree = ""; }; + 292DB12F19B4574100A80320 /* UIEditBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIEditBox.cpp; sourceTree = ""; }; + 292DB13019B4574100A80320 /* UIEditBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBox.h; sourceTree = ""; }; + 292DB13119B4574100A80320 /* UIEditBoxImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBoxImpl.h; sourceTree = ""; }; + 292DB13219B4574100A80320 /* UIEditBoxImplAndroid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIEditBoxImplAndroid.cpp; sourceTree = ""; }; + 292DB13319B4574100A80320 /* UIEditBoxImplAndroid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBoxImplAndroid.h; sourceTree = ""; }; + 292DB13419B4574100A80320 /* UIEditBoxImplIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBoxImplIOS.h; sourceTree = ""; }; + 292DB13519B4574100A80320 /* UIEditBoxImplIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIEditBoxImplIOS.mm; sourceTree = ""; }; + 292DB13619B4574100A80320 /* UIEditBoxImplMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBoxImplMac.h; sourceTree = ""; }; + 292DB13719B4574100A80320 /* UIEditBoxImplMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIEditBoxImplMac.mm; sourceTree = ""; }; + 292DB13819B4574100A80320 /* UIEditBoxImplNone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIEditBoxImplNone.cpp; sourceTree = ""; }; 29394CEC19B01DBA00D2DE1A /* UIWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWebView.h; sourceTree = ""; }; 29394CED19B01DBA00D2DE1A /* UIWebView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIWebView.mm; sourceTree = ""; }; 29394CEE19B01DBA00D2DE1A /* UIWebViewImpl_iOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWebViewImpl_iOS.h; sourceTree = ""; }; @@ -2407,16 +2427,6 @@ 46A1684B1807AF4E005B8026 /* CCInvocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCInvocation.h; sourceTree = ""; }; 46A1684C1807AF4E005B8026 /* CCScale9Sprite.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCScale9Sprite.cpp; sourceTree = ""; }; 46A1684D1807AF4E005B8026 /* CCScale9Sprite.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCScale9Sprite.h; sourceTree = ""; }; - 46A1684F1807AF4E005B8026 /* CCEditBox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBox.cpp; sourceTree = ""; }; - 46A168501807AF4E005B8026 /* CCEditBox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBox.h; sourceTree = ""; }; - 46A168511807AF4E005B8026 /* CCEditBoxImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImpl.h; sourceTree = ""; }; - 46A168521807AF4E005B8026 /* CCEditBoxImplAndroid.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplAndroid.cpp; sourceTree = ""; }; - 46A168531807AF4E005B8026 /* CCEditBoxImplAndroid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplAndroid.h; sourceTree = ""; }; - 46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplIOS.h; sourceTree = ""; }; - 46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEditBoxImplIOS.mm; sourceTree = ""; }; - 46A168581807AF4E005B8026 /* CCEditBoxImplNone.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplNone.cpp; sourceTree = ""; }; - 46A1685B1807AF4E005B8026 /* CCEditBoxImplWin.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCEditBoxImplWin.cpp; sourceTree = ""; }; - 46A1685C1807AF4E005B8026 /* CCEditBoxImplWin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplWin.h; sourceTree = ""; }; 46A1685E1807AF4E005B8026 /* CCScrollView.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCScrollView.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 46A1685F1807AF4E005B8026 /* CCScrollView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCScrollView.h; sourceTree = ""; }; 46A168621807AF4E005B8026 /* CCTableView.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCTableView.cpp; sourceTree = ""; }; @@ -2867,8 +2877,6 @@ B276EF5C1988D1D500CD400F /* CCVertexIndexData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCVertexIndexData.cpp; sourceTree = ""; }; B276EF5D1988D1D500CD400F /* CCVertexIndexBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCVertexIndexBuffer.h; sourceTree = ""; }; B276EF5E1988D1D500CD400F /* CCVertexIndexBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCVertexIndexBuffer.cpp; sourceTree = ""; }; - B282B47C1980E02B00666787 /* CCEditBoxImplMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CCEditBoxImplMac.mm; sourceTree = ""; }; - B282B47D1980E02B00666787 /* CCEditBoxImplMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCEditBoxImplMac.h; sourceTree = ""; }; B29594AF1926D5D9003EEF37 /* ccShader_3D_Color.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_Color.frag; sourceTree = ""; }; B29594B01926D5D9003EEF37 /* ccShader_3D_ColorTex.frag */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_ColorTex.frag; sourceTree = ""; }; B29594B11926D5D9003EEF37 /* ccShader_3D_PositionTex.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_3D_PositionTex.vert; sourceTree = ""; }; @@ -3979,6 +3987,23 @@ path = ../cocos/ui; sourceTree = ""; }; + 292DB12E19B4574100A80320 /* UIEditBox */ = { + isa = PBXGroup; + children = ( + 292DB12F19B4574100A80320 /* UIEditBox.cpp */, + 292DB13019B4574100A80320 /* UIEditBox.h */, + 292DB13119B4574100A80320 /* UIEditBoxImpl.h */, + 292DB13219B4574100A80320 /* UIEditBoxImplAndroid.cpp */, + 292DB13319B4574100A80320 /* UIEditBoxImplAndroid.h */, + 292DB13419B4574100A80320 /* UIEditBoxImplIOS.h */, + 292DB13519B4574100A80320 /* UIEditBoxImplIOS.mm */, + 292DB13619B4574100A80320 /* UIEditBoxImplMac.h */, + 292DB13719B4574100A80320 /* UIEditBoxImplMac.mm */, + 292DB13819B4574100A80320 /* UIEditBoxImplNone.cpp */, + ); + path = UIEditBox; + sourceTree = ""; + }; 29CB8F501929D63600C841D6 /* layout */ = { isa = PBXGroup; children = ( @@ -4030,6 +4055,7 @@ 29CB8F531929D67D00C841D6 /* widgets */ = { isa = PBXGroup; children = ( + 292DB12E19B4574100A80320 /* UIEditBox */, 2905F9FE18CF08D000240AA3 /* UIListView.cpp */, 2905F9FF18CF08D000240AA3 /* UIListView.h */, 2905FA0018CF08D000240AA3 /* UILoadingBar.cpp */, @@ -4143,7 +4169,6 @@ isa = PBXGroup; children = ( 46A168341807AF4E005B8026 /* CCControlExtension */, - 46A1684E1807AF4E005B8026 /* CCEditBox */, 46A1685D1807AF4E005B8026 /* CCScrollView */, ); path = GUI; @@ -4181,25 +4206,6 @@ path = CCControlExtension; sourceTree = ""; }; - 46A1684E1807AF4E005B8026 /* CCEditBox */ = { - isa = PBXGroup; - children = ( - B282B47C1980E02B00666787 /* CCEditBoxImplMac.mm */, - B282B47D1980E02B00666787 /* CCEditBoxImplMac.h */, - 46A1684F1807AF4E005B8026 /* CCEditBox.cpp */, - 46A168501807AF4E005B8026 /* CCEditBox.h */, - 46A168511807AF4E005B8026 /* CCEditBoxImpl.h */, - 46A168521807AF4E005B8026 /* CCEditBoxImplAndroid.cpp */, - 46A168531807AF4E005B8026 /* CCEditBoxImplAndroid.h */, - 46A168541807AF4E005B8026 /* CCEditBoxImplIOS.h */, - 46A168551807AF4E005B8026 /* CCEditBoxImplIOS.mm */, - 46A168581807AF4E005B8026 /* CCEditBoxImplNone.cpp */, - 46A1685B1807AF4E005B8026 /* CCEditBoxImplWin.cpp */, - 46A1685C1807AF4E005B8026 /* CCEditBoxImplWin.h */, - ); - path = CCEditBox; - sourceTree = ""; - }; 46A1685D1807AF4E005B8026 /* CCScrollView */ = { isa = PBXGroup; children = ( @@ -4943,9 +4949,11 @@ 50ABBE851925AB6F00A911A9 /* ccFPSImages.h in Headers */, 15AE1A5319AAD40300C27E9E /* b2Draw.h in Headers */, 5034CA39191D591100CE6051 /* ccShader_PositionColorLengthTexture.frag in Headers */, + 292DB14B19B4574100A80320 /* UIEditBoxImplMac.h in Headers */, 50ABBE891925AB6F00A911A9 /* CCMap.h in Headers */, 50ABBE8D1925AB6F00A911A9 /* CCNS.h in Headers */, 50ABBEA51925AB6F00A911A9 /* CCScriptSupport.h in Headers */, + 292DB14519B4574100A80320 /* UIEditBoxImplAndroid.h in Headers */, 15AE1B9A19AADFDF00C27E9E /* UIHBox.h in Headers */, 15AE18EB19AAD35000C27E9E /* CCActionNode.h in Headers */, 15AE1A3819AAD3D500C27E9E /* b2Shape.h in Headers */, @@ -5020,7 +5028,6 @@ 15AE199919AAD39600C27E9E /* LoadingBarReader.h in Headers */, 15AE1A8F19AAD40300C27E9E /* b2RopeJoint.h in Headers */, 15AE18ED19AAD35000C27E9E /* CCActionObject.h in Headers */, - 15AE1C0C19AAE02D00C27E9E /* CCEditBoxImpl.h in Headers */, ED9C6A9618599AD8000A5232 /* CCNodeGrid.h in Headers */, 15AE18A719AAD33D00C27E9E /* CCScrollViewLoader.h in Headers */, 15AE184819AAD2F700C27E9E /* cocos3d.h in Headers */, @@ -5175,6 +5182,7 @@ 15AE188519AAD33D00C27E9E /* CCBSequence.h in Headers */, 15AE1AE219AAD42500C27E9E /* cpDampedRotarySpring.h in Headers */, 5034CA49191D591100CE6051 /* ccShader_Label_df.frag in Headers */, + 292DB14119B4574100A80320 /* UIEditBoxImpl.h in Headers */, 1A01C68C18F57BE800EFE3A6 /* CCDeprecated.h in Headers */, 50ABBD561925AB0000A911A9 /* TransformUtils.h in Headers */, 299754F6193EC95400A54AC3 /* ObjectFactory.h in Headers */, @@ -5183,6 +5191,7 @@ 15AE18FB19AAD35000C27E9E /* CCColliderDetector.h in Headers */, 15AE19E119AAD3A700C27E9E /* Skeleton.h in Headers */, 1A570280180BCC900088DEC7 /* CCSprite.h in Headers */, + 292DB14719B4574100A80320 /* UIEditBoxImplIOS.h in Headers */, 15AE1A9119AAD40300C27E9E /* b2WeldJoint.h in Headers */, 15AE1A5419AAD40300C27E9E /* b2GrowableStack.h in Headers */, 15AE1B4E19AADA9900C27E9E /* UIListView.h in Headers */, @@ -5286,7 +5295,6 @@ 15AE1BCA19AAE01E00C27E9E /* CCControl.h in Headers */, 50ABBDBF1925AB4100A911A9 /* CCTextureCache.h in Headers */, 15AE186719AAD31D00C27E9E /* CDXMacOSXSupport.h in Headers */, - 15AE1C0A19AAE02500C27E9E /* CCEditBox.h in Headers */, B37510741823AC9F00B3BA6A /* CCPhysicsContactInfo_chipmunk.h in Headers */, 15AE1ADF19AAD42500C27E9E /* chipmunk_types.h in Headers */, 5034CA35191D591100CE6051 /* ccShader_PositionTexture.frag in Headers */, @@ -5365,6 +5373,7 @@ 15AE1AEC19AAD42500C27E9E /* util.h in Headers */, 15AE19DD19AAD3A700C27E9E /* Json.h in Headers */, 15AE191A19AAD35000C27E9E /* CCSSceneReader.h in Headers */, + 292DB13F19B4574100A80320 /* UIEditBox.h in Headers */, 50ABBE671925AB6F00A911A9 /* CCEventListenerCustom.h in Headers */, 15AE18E219AAD35000C27E9E /* TriggerMng.h in Headers */, 15AE1B2B19AAD43700C27E9E /* prime.h in Headers */, @@ -5417,7 +5426,6 @@ 50ABBE771925AB6F00A911A9 /* CCEventListenerTouch.h in Headers */, 5034CA33191D591100CE6051 /* ccShader_PositionTexture_uColor.frag in Headers */, 50ABC0171926664800A911A9 /* CCImage.h in Headers */, - 15AE1C0E19AAE03400C27E9E /* CCEditBoxImplMac.h in Headers */, 15AE1AED19AAD42500C27E9E /* cpArbiter.h in Headers */, 50ABBDA91925AB4100A911A9 /* CCRenderCommand.h in Headers */, 50ABBD951925AB4100A911A9 /* CCGLProgramState.h in Headers */, @@ -5448,6 +5456,7 @@ 15AE183319AAD2F700C27E9E /* CCOBB.h in Headers */, 15AE18B119AAD33D00C27E9E /* CCBMemberVariableAssigner.h in Headers */, 15AE1AFA19AAD42500C27E9E /* cpConstraint.h in Headers */, + 292DB14019B4574100A80320 /* UIEditBox.h in Headers */, 50ABBD3B1925AB0000A911A9 /* CCAffineTransform.h in Headers */, 15AE1A0A19AAD3A700C27E9E /* CCSkeleton.h in Headers */, 5034CA38191D591100CE6051 /* ccShader_PositionColorLengthTexture.vert in Headers */, @@ -5543,6 +5552,7 @@ 15AE19F819AAD3A700C27E9E /* Animation.h in Headers */, 1A5700A1180BC5D20088DEC7 /* CCNode.h in Headers */, 15AE181919AAD2F700C27E9E /* CCAttachNode.h in Headers */, + 292DB14C19B4574100A80320 /* UIEditBoxImplMac.h in Headers */, 15AE1BF019AAE01E00C27E9E /* CCControlHuePicker.h in Headers */, 15AE18B819AAD33D00C27E9E /* CCBSequenceProperty.h in Headers */, 503DD8E41926736A00CD74DD /* CCDirectorCaller.h in Headers */, @@ -5572,6 +5582,7 @@ 50ABBD5B1925AB0000A911A9 /* Vec2.h in Headers */, 50ABBD411925AB0000A911A9 /* CCMath.h in Headers */, 1A5701A0180BCB590088DEC7 /* CCFont.h in Headers */, + 292DB14819B4574100A80320 /* UIEditBoxImplIOS.h in Headers */, 15AE1A0819AAD3A700C27E9E /* BoneData.h in Headers */, 50ABBD9A1925AB4100A911A9 /* CCGLProgramStateCache.h in Headers */, 15AE181D19AAD2F700C27E9E /* CCBundle3D.h in Headers */, @@ -5603,6 +5614,7 @@ 15AE196B19AAD35100C27E9E /* DictionaryHelper.h in Headers */, 15AE1AA619AAD40300C27E9E /* b2Fixture.h in Headers */, 15AE1BBA19AADFF000C27E9E /* HttpClient.h in Headers */, + 292DB14619B4574100A80320 /* UIEditBoxImplAndroid.h in Headers */, 15AE1AF819AAD42500C27E9E /* chipmunk_types.h in Headers */, 15AE1B9419AADA9A00C27E9E /* GUIDefine.h in Headers */, 15AE183B19AAD2F700C27E9E /* CCRay.h in Headers */, @@ -5745,6 +5757,7 @@ 15AE1B8D19AADA9A00C27E9E /* UIScale9Sprite.h in Headers */, 15AE18AC19AAD33D00C27E9E /* CCBAnimationManager.h in Headers */, 15AE1A1A19AAD3A700C27E9E /* Skin.h in Headers */, + 292DB14219B4574100A80320 /* UIEditBoxImpl.h in Headers */, 1A570303180BCE890088DEC7 /* CCParallaxNode.h in Headers */, 50ABBE2A1925AB6F00A911A9 /* CCAutoreleasePool.h in Headers */, 1A57030F180BCF190088DEC7 /* CCComponent.h in Headers */, @@ -5766,7 +5779,6 @@ 15AE1BFE19AAE01E00C27E9E /* CCInvocation.h in Headers */, 15AE1A9E19AAD40300C27E9E /* b2StackAllocator.h in Headers */, 1A570357180BD0B00088DEC7 /* ioapi.h in Headers */, - 15AE1C0F19AAE03E00C27E9E /* CCEditBoxImplIOS.h in Headers */, 15AE1A1619AAD3A700C27E9E /* SkeletonData.h in Headers */, 50ABBD4B1925AB0000A911A9 /* Mat4.h in Headers */, 15AE1BBE19AADFF000C27E9E /* SocketIO.h in Headers */, @@ -5883,13 +5895,11 @@ B276EF641988D1D500CD400F /* CCVertexIndexBuffer.h in Headers */, 15AE1A0619AAD3A700C27E9E /* Bone.h in Headers */, ED9C6A9718599AD8000A5232 /* CCNodeGrid.h in Headers */, - 15AE1C0819AAE02500C27E9E /* CCEditBox.h in Headers */, 50ABC0201926664800A911A9 /* CCThread.h in Headers */, 15AE1B8519AADA9A00C27E9E /* UITextField.h in Headers */, 1A01C69318F57BE800EFE3A6 /* CCDouble.h in Headers */, 15AE184B19AAD30500C27E9E /* Export.h in Headers */, 15AE196019AAD35100C27E9E /* CCSpriteFrameCacheHelper.h in Headers */, - 15AE1C0B19AAE02D00C27E9E /* CCEditBoxImpl.h in Headers */, 50ABBE221925AB6F00A911A9 /* atitc.h in Headers */, 15AE1AB719AAD40300C27E9E /* b2ContactSolver.h in Headers */, 15AE193319AAD35100C27E9E /* CCActionNode.h in Headers */, @@ -6002,6 +6012,7 @@ 15AE1B1E19AAD43700C27E9E /* cpBody.c in Sources */, 15AE1BDE19AAE01E00C27E9E /* CCInvocation.cpp in Sources */, 3EA3EDBC1991CDFA00645534 /* CCCamera.cpp in Sources */, + 292DB14F19B4574100A80320 /* UIEditBoxImplNone.cpp in Sources */, 15AE199419AAD39600C27E9E /* LayoutReader.cpp in Sources */, 1A01C68A18F57BE800EFE3A6 /* CCDeprecated.cpp in Sources */, 1A1645B0191B726C008C7C7F /* ConvertUTF.c in Sources */, @@ -6033,7 +6044,6 @@ 15AE186319AAD31D00C27E9E /* CDAudioManager.m in Sources */, 15AE1B2219AAD43700C27E9E /* cpShape.c in Sources */, ED9C6A9418599AD8000A5232 /* CCNodeGrid.cpp in Sources */, - 15AE1C0D19AAE03400C27E9E /* CCEditBoxImplMac.mm in Sources */, 15AE1A2C19AAD3D500C27E9E /* b2DynamicTree.cpp in Sources */, 15AE184019AAD2F700C27E9E /* CCSprite3D.cpp in Sources */, 46A170E61807CECA005B8026 /* CCPhysicsBody.cpp in Sources */, @@ -6045,7 +6055,6 @@ 50ABBEBB1925AB6F00A911A9 /* ccUtils.cpp in Sources */, 15AE186A19AAD31D00C27E9E /* CocosDenshion.m in Sources */, 15AE198C19AAD36E00C27E9E /* CheckBoxReader.cpp in Sources */, - 15AE1C0919AAE02500C27E9E /* CCEditBox.cpp in Sources */, 15AE1B6319AADA9900C27E9E /* UICheckBox.cpp in Sources */, 15EFA211198A2BB5000C57D3 /* CCProtectedNode.cpp in Sources */, 50ABBEB71925AB6F00A911A9 /* ccUTF8.cpp in Sources */, @@ -6122,6 +6131,7 @@ 50ABBE391925AB6F00A911A9 /* CCData.cpp in Sources */, 1A57010E180BC8EE0088DEC7 /* CCDrawingPrimitives.cpp in Sources */, 50ABBED71925AB6F00A911A9 /* ZipUtils.cpp in Sources */, + 292DB14919B4574100A80320 /* UIEditBoxImplIOS.mm in Sources */, 15AE181019AAD2F700C27E9E /* CCAnimation3D.cpp in Sources */, 1A01C68418F57BE800EFE3A6 /* CCArray.cpp in Sources */, 1A570112180BC8EE0088DEC7 /* CCDrawNode.cpp in Sources */, @@ -6152,6 +6162,7 @@ 15AE1B5319AADA9900C27E9E /* UIRichText.cpp in Sources */, 15AE19DC19AAD3A700C27E9E /* Json.cpp in Sources */, 15AE1B2419AAD43700C27E9E /* cpSpaceComponent.c in Sources */, + 292DB13D19B4574100A80320 /* UIEditBox.cpp in Sources */, 50ABBE551925AB6F00A911A9 /* CCEventFocus.cpp in Sources */, 15AE1A8819AAD40300C27E9E /* b2PrismaticJoint.cpp in Sources */, 50ABBE491925AB6F00A911A9 /* CCEventAcceleration.cpp in Sources */, @@ -6200,6 +6211,7 @@ 1A570202180BCBD40088DEC7 /* CCClippingNode.cpp in Sources */, 1A570208180BCBDF0088DEC7 /* CCMotionStreak.cpp in Sources */, 1A570210180BCBF40088DEC7 /* CCProgressTimer.cpp in Sources */, + 292DB14D19B4574100A80320 /* UIEditBoxImplMac.mm in Sources */, 50ABBDB51925AB4100A911A9 /* CCTexture2D.cpp in Sources */, 1A570214180BCBF40088DEC7 /* CCRenderTexture.cpp in Sources */, 15AE1BD019AAE01E00C27E9E /* CCControlHuePicker.cpp in Sources */, @@ -6338,6 +6350,7 @@ 50ABC0631926664800A911A9 /* CCDevice.mm in Sources */, 15AE1A2819AAD3D500C27E9E /* b2Collision.cpp in Sources */, 15AE1B6719AADA9900C27E9E /* UIScale9Sprite.cpp in Sources */, + 292DB14319B4574100A80320 /* UIEditBoxImplAndroid.cpp in Sources */, 15AE1A5219AAD40300C27E9E /* b2Draw.cpp in Sources */, 50ABBE1F1925AB6F00A911A9 /* atitc.cpp in Sources */, 1A01C69818F57BE800EFE3A6 /* CCSet.cpp in Sources */, @@ -6451,6 +6464,7 @@ 46A171031807CECB005B8026 /* CCPhysicsShape.cpp in Sources */, 50ABC0161926664800A911A9 /* CCImage.cpp in Sources */, 1A01C6A518F58F7500EFE3A6 /* CCNotificationCenter.cpp in Sources */, + 292DB14E19B4574100A80320 /* UIEditBoxImplMac.mm in Sources */, 15AE1BFB19AAE01E00C27E9E /* CCControlUtils.cpp in Sources */, 15AE1B9019AADA9A00C27E9E /* UIWidget.cpp in Sources */, ED9C6A9518599AD8000A5232 /* CCNodeGrid.cpp in Sources */, @@ -6502,6 +6516,7 @@ 15AE198E19AAD36E00C27E9E /* CheckBoxReader.cpp in Sources */, 50ABBE621925AB6F00A911A9 /* CCEventListenerAcceleration.cpp in Sources */, 15AE1AB619AAD40300C27E9E /* b2ContactSolver.cpp in Sources */, + 292DB13E19B4574100A80320 /* UIEditBox.cpp in Sources */, 3E6176681960F89B00DE83F5 /* CCController-iOS.mm in Sources */, 15AE19EF19AAD3A700C27E9E /* SkeletonBounds.cpp in Sources */, 15AE18B219AAD33D00C27E9E /* CCBReader.cpp in Sources */, @@ -6547,6 +6562,7 @@ 15AE1B4319AAD43700C27E9E /* cpSpaceHash.c in Sources */, 15AE1A1D19AAD3A700C27E9E /* SlotData.cpp in Sources */, 50ABBD551925AB0000A911A9 /* TransformUtils.cpp in Sources */, + 292DB14419B4574100A80320 /* UIEditBoxImplAndroid.cpp in Sources */, 15AE193619AAD35100C27E9E /* CCArmature.cpp in Sources */, 1A57007A180BC5A10088DEC7 /* CCActionInstant.cpp in Sources */, 15AE1AC419AAD40300C27E9E /* b2FrictionJoint.cpp in Sources */, @@ -6566,7 +6582,6 @@ 1A570086180BC5A10088DEC7 /* CCActionPageTurn3D.cpp in Sources */, 15AE1AB819AAD40300C27E9E /* b2EdgeAndCircleContact.cpp in Sources */, 15AE19FF19AAD3A700C27E9E /* AtlasAttachmentLoader.cpp in Sources */, - 15AE1C0719AAE02500C27E9E /* CCEditBox.cpp in Sources */, 1A57008A180BC5A10088DEC7 /* CCActionProgressTimer.cpp in Sources */, 15AE18AF19AAD33D00C27E9E /* CCBKeyframe.cpp in Sources */, 15AE19FB19AAD3A700C27E9E /* AnimationStateData.cpp in Sources */, @@ -6596,6 +6611,7 @@ 15AE195F19AAD35100C27E9E /* CCSpriteFrameCacheHelper.cpp in Sources */, 15AE193019AAD35100C27E9E /* CCActionManagerEx.cpp in Sources */, 503DD8E21926736A00CD74DD /* CCCommon.mm in Sources */, + 292DB14A19B4574100A80320 /* UIEditBoxImplIOS.mm in Sources */, 15AE1A9419AAD40300C27E9E /* b2BlockAllocator.cpp in Sources */, 15AE1B4419AAD43700C27E9E /* cpSpaceQuery.c in Sources */, 15AE1A4D19AAD3D500C27E9E /* b2PolygonShape.cpp in Sources */, @@ -6672,6 +6688,7 @@ 15AE194019AAD35100C27E9E /* CCBone.cpp in Sources */, 1A570215180BCBF40088DEC7 /* CCRenderTexture.cpp in Sources */, 1A570222180BCC1A0088DEC7 /* CCParticleBatchNode.cpp in Sources */, + 292DB15019B4574100A80320 /* UIEditBoxImplNone.cpp in Sources */, 15AE19F119AAD3A700C27E9E /* Event.cpp in Sources */, 15AE185F19AAD31200C27E9E /* SimpleAudioEngine.mm in Sources */, 15AE1BE819AAE01E00C27E9E /* CCControl.cpp in Sources */, @@ -6715,7 +6732,6 @@ 15AE19AE19AAD39700C27E9E /* PageViewReader.cpp in Sources */, 3EA3EDBD1991CDFA00645534 /* CCCamera.cpp in Sources */, 1A570297180BCCAB0088DEC7 /* CCAnimationCache.cpp in Sources */, - 15AE1C1019AAE03E00C27E9E /* CCEditBoxImplIOS.mm in Sources */, 50ABBE321925AB6F00A911A9 /* CCConfiguration.cpp in Sources */, 15AE1A9F19AAD40300C27E9E /* b2Timer.cpp in Sources */, 15AE1AD419AAD40300C27E9E /* b2WeldJoint.cpp in Sources */, diff --git a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp index 6905ba7701..de96938730 100644 --- a/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp +++ b/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/CocosGUIScene.cpp @@ -44,6 +44,18 @@ g_guisTests[] = } }, #endif + { + "EditBox Test", + [](Ref* sender) + { + UISceneManager* sceneManager = UISceneManager::sharedUISceneManager(); + sceneManager->setCurrentUISceneId(kUIEditBoxTest); + sceneManager->setMinUISceneId(kUIEditBoxTest); + sceneManager->setMaxUISceneId(kUIEditBoxTest); + Scene* scene = sceneManager->currentUIScene(); + Director::getInstance()->replaceScene(scene); + } + }, { "focus test", [](Ref* sender) From 85ce801fdd37dfe72f22ab6b06bc28e8f87ad4ac Mon Sep 17 00:00:00 2001 From: andyque Date: Mon, 1 Sep 2014 17:06:22 +0800 Subject: [PATCH 15/45] remove ccscale9sprite , cceditBox --- build/cocos2d_libs.xcodeproj/project.pbxproj | 26 +- build/cocos2d_tests.xcodeproj/project.pbxproj | 32 - .../cocosbuilder/CCScale9SpriteLoader.cpp | 16 +- .../cocosbuilder/CCScale9SpriteLoader.h | 6 +- cocos/ui/Android.mk | 3 + cocos/ui/UIScale9Sprite.cpp | 19 +- cocos/ui/UIScale9Sprite.h | 6 + extensions/ExtensionDeprecated.cpp | 25 + extensions/ExtensionDeprecated.h | 39 + .../CCControlExtension/CCControlButton.cpp | 1 - .../GUI/CCControlExtension/CCControlButton.h | 3 +- .../CCControlExtension/CCControlExtensions.h | 1 - .../GUI/CCControlExtension/CCScale9Sprite.cpp | 816 ------------------ .../GUI/CCControlExtension/CCScale9Sprite.h | 323 ------- extensions/cocos-ext.h | 2 +- .../EditBoxTest/EditBoxTest.cpp | 135 --- .../ExtensionsTest/EditBoxTest/EditBoxTest.h | 35 - .../Classes/ExtensionsTest/ExtensionsTest.cpp | 19 +- .../Scale9SpriteTest/Scale9SpriteTest.cpp | 784 ----------------- .../Scale9SpriteTest/Scale9SpriteTest.h | 255 ------ 20 files changed, 118 insertions(+), 2428 deletions(-) create mode 100644 extensions/ExtensionDeprecated.cpp create mode 100644 extensions/ExtensionDeprecated.h delete mode 100644 extensions/GUI/CCControlExtension/CCScale9Sprite.cpp delete mode 100644 extensions/GUI/CCControlExtension/CCScale9Sprite.h delete mode 100644 tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp delete mode 100644 tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h delete mode 100644 tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp delete mode 100644 tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.h diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 6e12365842..9482485163 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -948,7 +948,7 @@ 15AE1BC819AAE00000C27E9E /* AssetsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5352180E3060000584C8 /* AssetsManager.h */; }; 15AE1BC919AAE01E00C27E9E /* CCControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168351807AF4E005B8026 /* CCControl.cpp */; }; 15AE1BCA19AAE01E00C27E9E /* CCControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168361807AF4E005B8026 /* CCControl.h */; }; - 15AE1BCB19AAE01E00C27E9E /* CCControlButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168371807AF4E005B8026 /* CCControlButton.cpp */; }; + 15AE1BCB19AAE01E00C27E9E /* CCControlButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168371807AF4E005B8026 /* CCControlButton.cpp */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker"; }; }; 15AE1BCC19AAE01E00C27E9E /* CCControlButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168381807AF4E005B8026 /* CCControlButton.h */; }; 15AE1BCD19AAE01E00C27E9E /* CCControlColourPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168391807AF4E005B8026 /* CCControlColourPicker.cpp */; }; 15AE1BCE19AAE01E00C27E9E /* CCControlColourPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683A1807AF4E005B8026 /* CCControlColourPicker.h */; }; @@ -969,8 +969,6 @@ 15AE1BDD19AAE01E00C27E9E /* CCControlUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168491807AF4E005B8026 /* CCControlUtils.h */; }; 15AE1BDE19AAE01E00C27E9E /* CCInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684A1807AF4E005B8026 /* CCInvocation.cpp */; }; 15AE1BDF19AAE01E00C27E9E /* CCInvocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1684B1807AF4E005B8026 /* CCInvocation.h */; }; - 15AE1BE019AAE01E00C27E9E /* CCScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684C1807AF4E005B8026 /* CCScale9Sprite.cpp */; }; - 15AE1BE119AAE01E00C27E9E /* CCScale9Sprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1684D1807AF4E005B8026 /* CCScale9Sprite.h */; }; 15AE1BE219AAE01E00C27E9E /* CCScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1685E1807AF4E005B8026 /* CCScrollView.cpp */; }; 15AE1BE319AAE01E00C27E9E /* CCScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1685F1807AF4E005B8026 /* CCScrollView.h */; }; 15AE1BE419AAE01E00C27E9E /* CCTableView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168621807AF4E005B8026 /* CCTableView.cpp */; }; @@ -1000,8 +998,6 @@ 15AE1BFC19AAE01E00C27E9E /* CCControlUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168491807AF4E005B8026 /* CCControlUtils.h */; }; 15AE1BFD19AAE01E00C27E9E /* CCInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684A1807AF4E005B8026 /* CCInvocation.cpp */; }; 15AE1BFE19AAE01E00C27E9E /* CCInvocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1684B1807AF4E005B8026 /* CCInvocation.h */; }; - 15AE1BFF19AAE01E00C27E9E /* CCScale9Sprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1684C1807AF4E005B8026 /* CCScale9Sprite.cpp */; }; - 15AE1C0019AAE01E00C27E9E /* CCScale9Sprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1684D1807AF4E005B8026 /* CCScale9Sprite.h */; }; 15AE1C0119AAE01E00C27E9E /* CCScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A1685E1807AF4E005B8026 /* CCScrollView.cpp */; }; 15AE1C0219AAE01E00C27E9E /* CCScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1685F1807AF4E005B8026 /* CCScrollView.h */; }; 15AE1C0319AAE01E00C27E9E /* CCTableView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168621807AF4E005B8026 /* CCTableView.cpp */; }; @@ -1360,6 +1356,10 @@ 292DB14E19B4574100A80320 /* UIEditBoxImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 292DB13719B4574100A80320 /* UIEditBoxImplMac.mm */; }; 292DB14F19B4574100A80320 /* UIEditBoxImplNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292DB13819B4574100A80320 /* UIEditBoxImplNone.cpp */; }; 292DB15019B4574100A80320 /* UIEditBoxImplNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292DB13819B4574100A80320 /* UIEditBoxImplNone.cpp */; }; + 292DB15F19B461CA00A80320 /* ExtensionDeprecated.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292DB15D19B461CA00A80320 /* ExtensionDeprecated.cpp */; }; + 292DB16019B461CA00A80320 /* ExtensionDeprecated.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 292DB15D19B461CA00A80320 /* ExtensionDeprecated.cpp */; }; + 292DB16119B461CA00A80320 /* ExtensionDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 292DB15E19B461CA00A80320 /* ExtensionDeprecated.h */; }; + 292DB16219B461CA00A80320 /* ExtensionDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 292DB15E19B461CA00A80320 /* ExtensionDeprecated.h */; }; 29394CF019B01DBA00D2DE1A /* UIWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = 29394CEC19B01DBA00D2DE1A /* UIWebView.h */; }; 29394CF119B01DBA00D2DE1A /* UIWebView.h in Headers */ = {isa = PBXBuildFile; fileRef = 29394CEC19B01DBA00D2DE1A /* UIWebView.h */; }; 29394CF219B01DBA00D2DE1A /* UIWebView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29394CED19B01DBA00D2DE1A /* UIWebView.mm */; }; @@ -2324,6 +2324,8 @@ 292DB13619B4574100A80320 /* UIEditBoxImplMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEditBoxImplMac.h; sourceTree = ""; }; 292DB13719B4574100A80320 /* UIEditBoxImplMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIEditBoxImplMac.mm; sourceTree = ""; }; 292DB13819B4574100A80320 /* UIEditBoxImplNone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIEditBoxImplNone.cpp; sourceTree = ""; }; + 292DB15D19B461CA00A80320 /* ExtensionDeprecated.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExtensionDeprecated.cpp; sourceTree = ""; }; + 292DB15E19B461CA00A80320 /* ExtensionDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtensionDeprecated.h; sourceTree = ""; }; 29394CEC19B01DBA00D2DE1A /* UIWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWebView.h; sourceTree = ""; }; 29394CED19B01DBA00D2DE1A /* UIWebView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIWebView.mm; sourceTree = ""; }; 29394CEE19B01DBA00D2DE1A /* UIWebViewImpl_iOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWebViewImpl_iOS.h; sourceTree = ""; }; @@ -2425,8 +2427,6 @@ 46A168491807AF4E005B8026 /* CCControlUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCControlUtils.h; sourceTree = ""; }; 46A1684A1807AF4E005B8026 /* CCInvocation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCInvocation.cpp; sourceTree = ""; }; 46A1684B1807AF4E005B8026 /* CCInvocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCInvocation.h; sourceTree = ""; }; - 46A1684C1807AF4E005B8026 /* CCScale9Sprite.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCScale9Sprite.cpp; sourceTree = ""; }; - 46A1684D1807AF4E005B8026 /* CCScale9Sprite.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCScale9Sprite.h; sourceTree = ""; }; 46A1685E1807AF4E005B8026 /* CCScrollView.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = CCScrollView.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 46A1685F1807AF4E005B8026 /* CCScrollView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CCScrollView.h; sourceTree = ""; }; 46A168621807AF4E005B8026 /* CCTableView.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CCTableView.cpp; sourceTree = ""; }; @@ -4155,6 +4155,8 @@ 46A167981807AF4D005B8026 /* extensions */ = { isa = PBXGroup; children = ( + 292DB15D19B461CA00A80320 /* ExtensionDeprecated.cpp */, + 292DB15E19B461CA00A80320 /* ExtensionDeprecated.h */, 46A167D21807AF4D005B8026 /* cocos-ext.h */, 46A168321807AF4E005B8026 /* ExtensionMacros.h */, 1AAF5350180E305F000584C8 /* assets-manager */, @@ -4200,8 +4202,6 @@ 46A168491807AF4E005B8026 /* CCControlUtils.h */, 46A1684A1807AF4E005B8026 /* CCInvocation.cpp */, 46A1684B1807AF4E005B8026 /* CCInvocation.h */, - 46A1684C1807AF4E005B8026 /* CCScale9Sprite.cpp */, - 46A1684D1807AF4E005B8026 /* CCScale9Sprite.h */, ); path = CCControlExtension; sourceTree = ""; @@ -5037,7 +5037,6 @@ 50ABBEA11925AB6F00A911A9 /* CCScheduler.h in Headers */, 15AE1B6219AADA9900C27E9E /* UIButton.h in Headers */, 50ABBDB71925AB4100A911A9 /* CCTexture2D.h in Headers */, - 15AE1BE119AAE01E00C27E9E /* CCScale9Sprite.h in Headers */, 50ABBE811925AB6F00A911A9 /* CCEventType.h in Headers */, 1A57008F180BC5A10088DEC7 /* CCActionTiledGrid.h in Headers */, 15AE19A319AAD39600C27E9E /* TextBMFontReader.h in Headers */, @@ -5344,6 +5343,7 @@ 15AE18A919AAD33D00C27E9E /* CCSpriteLoader.h in Headers */, 15AE198419AAD36400C27E9E /* WidgetReaderProtocol.h in Headers */, 50ABBEC91925AB6F00A911A9 /* firePngData.h in Headers */, + 292DB16119B461CA00A80320 /* ExtensionDeprecated.h in Headers */, 503DD8F51926B0DB00CD74DD /* CCIMEDelegate.h in Headers */, 50ABBD5A1925AB0000A911A9 /* Vec2.h in Headers */, 15AE1BDB19AAE01E00C27E9E /* CCControlSwitch.h in Headers */, @@ -5465,6 +5465,7 @@ 46A171011807CECB005B8026 /* CCPhysicsJoint.h in Headers */, 46A170FD1807CECB005B8026 /* CCPhysicsBody.h in Headers */, 50ABBE9C1925AB6F00A911A9 /* CCRef.h in Headers */, + 292DB16219B461CA00A80320 /* ExtensionDeprecated.h in Headers */, 50ABBD961925AB4100A911A9 /* CCGLProgramState.h in Headers */, 46A171061807CECB005B8026 /* CCPhysicsWorld.h in Headers */, 50ABBDB41925AB4100A911A9 /* ccShaders.h in Headers */, @@ -5839,7 +5840,6 @@ 15AE198019AAD35700C27E9E /* CCTimeLine.h in Headers */, 50ABBD4F1925AB0000A911A9 /* MathUtil.h in Headers */, 1A01C69718F57BE800EFE3A6 /* CCInteger.h in Headers */, - 15AE1C0019AAE01E00C27E9E /* CCScale9Sprite.h in Headers */, 15AE1C0619AAE01E00C27E9E /* CCTableViewCell.h in Headers */, 15AE19AB19AAD39700C27E9E /* ListViewReader.h in Headers */, 50ABBEBE1925AB6F00A911A9 /* ccUtils.h in Headers */, @@ -6211,6 +6211,7 @@ 1A570202180BCBD40088DEC7 /* CCClippingNode.cpp in Sources */, 1A570208180BCBDF0088DEC7 /* CCMotionStreak.cpp in Sources */, 1A570210180BCBF40088DEC7 /* CCProgressTimer.cpp in Sources */, + 292DB15F19B461CA00A80320 /* ExtensionDeprecated.cpp in Sources */, 292DB14D19B4574100A80320 /* UIEditBoxImplMac.mm in Sources */, 50ABBDB51925AB4100A911A9 /* CCTexture2D.cpp in Sources */, 1A570214180BCBF40088DEC7 /* CCRenderTexture.cpp in Sources */, @@ -6230,7 +6231,6 @@ 1A570286180BCC900088DEC7 /* CCSpriteFrame.cpp in Sources */, B24AA989195A675C007B4522 /* CCFastTMXTiledMap.cpp in Sources */, 15AE199619AAD39600C27E9E /* ListViewReader.cpp in Sources */, - 15AE1BE019AAE01E00C27E9E /* CCScale9Sprite.cpp in Sources */, 50ABC0191926664800A911A9 /* CCSAXParser.cpp in Sources */, 15AE1B1419AAD43700C27E9E /* cpPinJoint.c in Sources */, 15AE189219AAD33D00C27E9E /* CCLayerGradientLoader.cpp in Sources */, @@ -6628,6 +6628,7 @@ 15AE1AB019AAD40300C27E9E /* b2ChainAndPolygonContact.cpp in Sources */, 1A5701B2180BCB590088DEC7 /* CCFontFNT.cpp in Sources */, 1A5701B6180BCB590088DEC7 /* CCFontFreeType.cpp in Sources */, + 292DB16019B461CA00A80320 /* ExtensionDeprecated.cpp in Sources */, 50ABBEAC1925AB6F00A911A9 /* ccTypes.cpp in Sources */, 15AE196A19AAD35100C27E9E /* DictionaryHelper.cpp in Sources */, 15AE1A3F19AAD3D500C27E9E /* b2Collision.cpp in Sources */, @@ -6698,7 +6699,6 @@ 15AE182919AAD2F700C27E9E /* CCMeshSkin.cpp in Sources */, 15AE1BBD19AADFF000C27E9E /* SocketIO.cpp in Sources */, 15AE1A4319AAD3D500C27E9E /* b2DynamicTree.cpp in Sources */, - 15AE1BFF19AAE01E00C27E9E /* CCScale9Sprite.cpp in Sources */, 15AE1A3A19AAD3D500C27E9E /* b2BroadPhase.cpp in Sources */, 15AE19B619AAD39700C27E9E /* TextBMFontReader.cpp in Sources */, 15AE1BFD19AAE01E00C27E9E /* CCInvocation.cpp in Sources */, diff --git a/build/cocos2d_tests.xcodeproj/project.pbxproj b/build/cocos2d_tests.xcodeproj/project.pbxproj index cd6916594b..dec67dde2c 100644 --- a/build/cocos2d_tests.xcodeproj/project.pbxproj +++ b/build/cocos2d_tests.xcodeproj/project.pbxproj @@ -472,8 +472,6 @@ 1AC35BEE18CECF0C00F37B72 /* CCControlStepperTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A7318CECF0B00F37B72 /* CCControlStepperTest.cpp */; }; 1AC35BEF18CECF0C00F37B72 /* CCControlSwitchTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A7618CECF0B00F37B72 /* CCControlSwitchTest.cpp */; }; 1AC35BF018CECF0C00F37B72 /* CCControlSwitchTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A7618CECF0B00F37B72 /* CCControlSwitchTest.cpp */; }; - 1AC35BF118CECF0C00F37B72 /* EditBoxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A7918CECF0B00F37B72 /* EditBoxTest.cpp */; }; - 1AC35BF218CECF0C00F37B72 /* EditBoxTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A7918CECF0B00F37B72 /* EditBoxTest.cpp */; }; 1AC35BF318CECF0C00F37B72 /* ExtensionsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A7B18CECF0B00F37B72 /* ExtensionsTest.cpp */; }; 1AC35BF418CECF0C00F37B72 /* ExtensionsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A7B18CECF0B00F37B72 /* ExtensionsTest.cpp */; }; 1AC35BF518CECF0C00F37B72 /* HttpClientTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A7E18CECF0B00F37B72 /* HttpClientTest.cpp */; }; @@ -484,8 +482,6 @@ 1AC35BFA18CECF0C00F37B72 /* WebSocketTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A8218CECF0B00F37B72 /* WebSocketTest.cpp */; }; 1AC35BFB18CECF0C00F37B72 /* NotificationCenterTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A8518CECF0B00F37B72 /* NotificationCenterTest.cpp */; }; 1AC35BFC18CECF0C00F37B72 /* NotificationCenterTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A8518CECF0B00F37B72 /* NotificationCenterTest.cpp */; }; - 1AC35BFD18CECF0C00F37B72 /* Scale9SpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A8818CECF0B00F37B72 /* Scale9SpriteTest.cpp */; }; - 1AC35BFE18CECF0C00F37B72 /* Scale9SpriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A8818CECF0B00F37B72 /* Scale9SpriteTest.cpp */; }; 1AC35BFF18CECF0C00F37B72 /* CustomTableViewCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A8B18CECF0B00F37B72 /* CustomTableViewCell.cpp */; }; 1AC35C0018CECF0C00F37B72 /* CustomTableViewCell.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A8B18CECF0B00F37B72 /* CustomTableViewCell.cpp */; }; 1AC35C0118CECF0C00F37B72 /* TableViewTestScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC35A8D18CECF0B00F37B72 /* TableViewTestScene.cpp */; }; @@ -2557,8 +2553,6 @@ 1AC35A7418CECF0B00F37B72 /* CCControlStepperTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlStepperTest.h; sourceTree = ""; }; 1AC35A7618CECF0B00F37B72 /* CCControlSwitchTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCControlSwitchTest.cpp; sourceTree = ""; }; 1AC35A7718CECF0B00F37B72 /* CCControlSwitchTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlSwitchTest.h; sourceTree = ""; }; - 1AC35A7918CECF0B00F37B72 /* EditBoxTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditBoxTest.cpp; sourceTree = ""; }; - 1AC35A7A18CECF0B00F37B72 /* EditBoxTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EditBoxTest.h; sourceTree = ""; }; 1AC35A7B18CECF0B00F37B72 /* ExtensionsTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExtensionsTest.cpp; sourceTree = ""; }; 1AC35A7C18CECF0B00F37B72 /* ExtensionsTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtensionsTest.h; sourceTree = ""; }; 1AC35A7E18CECF0B00F37B72 /* HttpClientTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpClientTest.cpp; sourceTree = ""; }; @@ -2569,8 +2563,6 @@ 1AC35A8318CECF0B00F37B72 /* WebSocketTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketTest.h; sourceTree = ""; }; 1AC35A8518CECF0B00F37B72 /* NotificationCenterTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NotificationCenterTest.cpp; sourceTree = ""; }; 1AC35A8618CECF0B00F37B72 /* NotificationCenterTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationCenterTest.h; sourceTree = ""; }; - 1AC35A8818CECF0B00F37B72 /* Scale9SpriteTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Scale9SpriteTest.cpp; sourceTree = ""; }; - 1AC35A8918CECF0B00F37B72 /* Scale9SpriteTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scale9SpriteTest.h; sourceTree = ""; }; 1AC35A8B18CECF0B00F37B72 /* CustomTableViewCell.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomTableViewCell.cpp; sourceTree = ""; }; 1AC35A8C18CECF0B00F37B72 /* CustomTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomTableViewCell.h; sourceTree = ""; }; 1AC35A8D18CECF0B00F37B72 /* TableViewTestScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TableViewTestScene.cpp; sourceTree = ""; }; @@ -5777,12 +5769,10 @@ 1AC359DF18CECF0B00F37B72 /* CocoStudioComponentsTest */, 1AC35A5818CECF0B00F37B72 /* CocoStudioSceneTest */, 1AC35A6118CECF0B00F37B72 /* ControlExtensionTest */, - 1AC35A7818CECF0B00F37B72 /* EditBoxTest */, 1AC35A7B18CECF0B00F37B72 /* ExtensionsTest.cpp */, 1AC35A7C18CECF0B00F37B72 /* ExtensionsTest.h */, 1AC35A7D18CECF0B00F37B72 /* NetworkTest */, 1AC35A8418CECF0B00F37B72 /* NotificationCenterTest */, - 1AC35A8718CECF0B00F37B72 /* Scale9SpriteTest */, 1AC35A8A18CECF0B00F37B72 /* TableViewTest */, ); path = ExtensionsTest; @@ -6024,15 +6014,6 @@ path = CCControlSwitchTest; sourceTree = ""; }; - 1AC35A7818CECF0B00F37B72 /* EditBoxTest */ = { - isa = PBXGroup; - children = ( - 1AC35A7918CECF0B00F37B72 /* EditBoxTest.cpp */, - 1AC35A7A18CECF0B00F37B72 /* EditBoxTest.h */, - ); - path = EditBoxTest; - sourceTree = ""; - }; 1AC35A7D18CECF0B00F37B72 /* NetworkTest */ = { isa = PBXGroup; children = ( @@ -6055,15 +6036,6 @@ path = NotificationCenterTest; sourceTree = ""; }; - 1AC35A8718CECF0B00F37B72 /* Scale9SpriteTest */ = { - isa = PBXGroup; - children = ( - 1AC35A8818CECF0B00F37B72 /* Scale9SpriteTest.cpp */, - 1AC35A8918CECF0B00F37B72 /* Scale9SpriteTest.h */, - ); - path = Scale9SpriteTest; - sourceTree = ""; - }; 1AC35A8A18CECF0B00F37B72 /* TableViewTest */ = { isa = PBXGroup; children = ( @@ -7976,7 +7948,6 @@ 1AC35B6718CECF0C00F37B72 /* AnimationsTestLayer.cpp in Sources */, 29080DB7191B595E0066F8DF /* UIListViewTest_Editor.cpp in Sources */, 1AC35BF918CECF0C00F37B72 /* WebSocketTest.cpp in Sources */, - 1AC35BF118CECF0C00F37B72 /* EditBoxTest.cpp in Sources */, 1AC35B3918CECF0C00F37B72 /* Bug-1174.cpp in Sources */, 1AC35BE318CECF0C00F37B72 /* CCControlColourPickerTest.cpp in Sources */, 29080DB1191B595E0066F8DF /* UILayoutTest.cpp in Sources */, @@ -8027,7 +7998,6 @@ 29080DD1191B595E0066F8DF /* UISliderTest_Editor.cpp in Sources */, 1AC35B2718CECF0C00F37B72 /* ActionsTest.cpp in Sources */, 1AC35C4918CECF0C00F37B72 /* ShaderTest.cpp in Sources */, - 1AC35BFD18CECF0C00F37B72 /* Scale9SpriteTest.cpp in Sources */, 1AC35B4318CECF0C00F37B72 /* Bug-624.cpp in Sources */, 1AC35BF718CECF0C00F37B72 /* SocketIOTest.cpp in Sources */, 1AC35C4F18CECF0C00F37B72 /* SpriteTest.cpp in Sources */, @@ -8173,7 +8143,6 @@ 1AC35B6818CECF0C00F37B72 /* AnimationsTestLayer.cpp in Sources */, 29080D8E191B595E0066F8DF /* CocosGUIScene.cpp in Sources */, 1AC35BFA18CECF0C00F37B72 /* WebSocketTest.cpp in Sources */, - 1AC35BF218CECF0C00F37B72 /* EditBoxTest.cpp in Sources */, 38FA2E74194AEBE100FF2BE4 /* ActionTimelineTestScene.cpp in Sources */, 2958245A1987415900F9746D /* UIScale9SpriteTest.cpp in Sources */, 1AC35B3A18CECF0C00F37B72 /* Bug-1174.cpp in Sources */, @@ -8231,7 +8200,6 @@ 292CF01519A1965E00E8E6A0 /* UIEditBoxTest.cpp in Sources */, 1AC35B2818CECF0C00F37B72 /* ActionsTest.cpp in Sources */, 1AC35C4A18CECF0C00F37B72 /* ShaderTest.cpp in Sources */, - 1AC35BFE18CECF0C00F37B72 /* Scale9SpriteTest.cpp in Sources */, C04F935B1941B05400E9FEAB /* TileMapTest2.cpp in Sources */, 1AC35B4418CECF0C00F37B72 /* Bug-624.cpp in Sources */, 1AC35BF818CECF0C00F37B72 /* SocketIOTest.cpp in Sources */, diff --git a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp index 2089898058..186708fc34 100644 --- a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp +++ b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.cpp @@ -19,7 +19,7 @@ namespace cocosbuilder { void Scale9SpriteLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParent, const char * pPropertyName, SpriteFrame * pSpriteFrame, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_SPRITEFRAME) == 0) { - ((Scale9Sprite *)pNode)->setSpriteFrame(pSpriteFrame); + ((cocos2d::ui::Scale9Sprite *)pNode)->setSpriteFrame(pSpriteFrame); } else { NodeLoader::onHandlePropTypeSpriteFrame(pNode, pParent, pPropertyName, pSpriteFrame, ccbReader); } @@ -27,7 +27,7 @@ void Scale9SpriteLoader::onHandlePropTypeSpriteFrame(Node * pNode, Node * pParen void Scale9SpriteLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, const char * pPropertyName, Color3B pColor3B, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_COLOR) == 0) { - ((Scale9Sprite *)pNode)->setColor(pColor3B); + ((cocos2d::ui::Scale9Sprite *)pNode)->setColor(pColor3B); } else { NodeLoader::onHandlePropTypeColor3(pNode, pParent, pPropertyName, pColor3B, ccbReader); } @@ -35,7 +35,7 @@ void Scale9SpriteLoader::onHandlePropTypeColor3(Node * pNode, Node * pParent, co void Scale9SpriteLoader::onHandlePropTypeByte(Node * pNode, Node * pParent, const char * pPropertyName, unsigned char pByte, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_OPACITY) == 0) { - ((Scale9Sprite *)pNode)->setOpacity(pByte); + ((cocos2d::ui::Scale9Sprite *)pNode)->setOpacity(pByte); } else { NodeLoader::onHandlePropTypeByte(pNode, pParent, pPropertyName, pByte, ccbReader); } @@ -54,7 +54,7 @@ void Scale9SpriteLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, cons if(strcmp(pPropertyName, PROPERTY_CONTENTSIZE) == 0) { //((Scale9Sprite *)pNode)->setContentSize(pSize); } else if(strcmp(pPropertyName, PROPERTY_PREFEREDSIZE) == 0) { - ((Scale9Sprite *)pNode)->setPreferredSize(pSize); + ((cocos2d::ui::Scale9Sprite *)pNode)->setPreferredSize(pSize); } else { NodeLoader::onHandlePropTypeSize(pNode, pParent, pPropertyName, pSize, ccbReader); } @@ -62,13 +62,13 @@ void Scale9SpriteLoader::onHandlePropTypeSize(Node * pNode, Node * pParent, cons void Scale9SpriteLoader::onHandlePropTypeFloat(Node * pNode, Node * pParent, const char * pPropertyName, float pFloat, CCBReader * ccbReader) { if(strcmp(pPropertyName, PROPERTY_INSETLEFT) == 0) { - ((Scale9Sprite *)pNode)->setInsetLeft(pFloat); + ((cocos2d::ui::Scale9Sprite *)pNode)->setInsetLeft(pFloat); } else if(strcmp(pPropertyName, PROPERTY_INSETTOP) == 0) { - ((Scale9Sprite *)pNode)->setInsetTop(pFloat); + ((cocos2d::ui::Scale9Sprite *)pNode)->setInsetTop(pFloat); } else if(strcmp(pPropertyName, PROPERTY_INSETRIGHT) == 0) { - ((Scale9Sprite *)pNode)->setInsetRight(pFloat); + ((cocos2d::ui::Scale9Sprite *)pNode)->setInsetRight(pFloat); } else if(strcmp(pPropertyName, PROPERTY_INSETBOTTOM) == 0) { - ((Scale9Sprite *)pNode)->setInsetBottom(pFloat); + ((cocos2d::ui::Scale9Sprite *)pNode)->setInsetBottom(pFloat); } else { NodeLoader::onHandlePropTypeFloat(pNode, pParent, pPropertyName, pFloat, ccbReader); } diff --git a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h index 70f7e1816b..35bf229776 100644 --- a/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h +++ b/cocos/editor-support/cocosbuilder/CCScale9SpriteLoader.h @@ -3,7 +3,7 @@ #include "CCNodeLoader.h" #include "CCScale9SpriteLoader.h" -#include "extensions/GUI/CCControlExtension/CCScale9Sprite.h" +#include "ui/UIScale9Sprite.h" namespace cocosbuilder { @@ -28,8 +28,8 @@ protected: * @js NA * @lua NA */ - virtual cocos2d::extension::Scale9Sprite * createNode(cocos2d::Node * pParent, cocosbuilder::CCBReader * ccbReader) { - cocos2d::extension::Scale9Sprite* pNode = cocos2d::extension::Scale9Sprite::create(); + virtual cocos2d::ui::Scale9Sprite * createNode(cocos2d::Node * pParent, cocosbuilder::CCBReader * ccbReader) { + cocos2d::ui::Scale9Sprite* pNode = cocos2d::ui::Scale9Sprite::create(); pNode->setAnchorPoint(cocos2d::Vec2::ZERO); diff --git a/cocos/ui/Android.mk b/cocos/ui/Android.mk index 221315e578..a76af6d91a 100644 --- a/cocos/ui/Android.mk +++ b/cocos/ui/Android.mk @@ -33,6 +33,9 @@ UIDeprecated.cpp \ UIScale9Sprite.cpp \ UIWebView.cpp \ UIWebViewImpl_android.cpp \ +UIEditBox/UIEditBox.cpp \ +UIEditBox/UIEditBoxImplAndroid.cpp \ + LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \ $(LOCAL_PATH)/../editor-support diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index a7071c3729..13f6f2f92d 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -140,11 +140,28 @@ namespace ui { return true; } + bool Scale9Sprite::initWithBatchNode(cocos2d::SpriteBatchNode *batchnode, const cocos2d::Rect &rect, bool rotated, const cocos2d::Rect &capInsets) + { + Sprite *sprite = Sprite::createWithTexture(batchnode->getTexture()); + return init(sprite, rect, rotated, capInsets); + } + + bool Scale9Sprite::initWithBatchNode(cocos2d::SpriteBatchNode *batchnode, const cocos2d::Rect &rect, const cocos2d::Rect &capInsets) + { + return initWithBatchNode(batchnode, rect, false, capInsets); + } + #define TRANSLATE_X(x, y, xtranslate) \ x+=xtranslate; \ #define TRANSLATE_Y(x, y, ytranslate) \ -y+=ytranslate; \ +y+=ytranslate; \ + + bool Scale9Sprite::updateWithBatchNode(cocos2d::SpriteBatchNode *batchnode, const cocos2d::Rect &originalRect, bool rotated, const cocos2d::Rect &capInsets) + { + Sprite *sprite = Sprite::createWithTexture(batchnode->getTexture()); + return this->updateWithSprite(sprite, originalRect, rotated, capInsets); + } bool Scale9Sprite::updateWithSprite(Sprite* sprite, const Rect& originalRect, bool rotated, const Rect& capInsets) { diff --git a/cocos/ui/UIScale9Sprite.h b/cocos/ui/UIScale9Sprite.h index da54df5de0..6a0d8b7e4f 100644 --- a/cocos/ui/UIScale9Sprite.h +++ b/cocos/ui/UIScale9Sprite.h @@ -69,6 +69,7 @@ namespace ui { */ static Scale9Sprite* create(const std::string& file, const Rect& rect, const Rect& capInsets); + /** * Creates a 9-slice sprite with a texture file. The whole texture will be * broken down into a 3×3 grid of equal blocks. @@ -233,6 +234,9 @@ namespace ui { virtual bool init(); virtual bool init(Sprite* sprite, const Rect& rect, bool rotated, const Rect& capInsets); virtual bool init(Sprite* sprite, const Rect& rect, const Rect& capInsets); + CC_DEPRECATED_ATTRIBUTE virtual bool initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, bool rotated, const Rect& capInsets); + CC_DEPRECATED_ATTRIBUTE virtual bool initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, const Rect& capInsets); + /** * Creates and returns a new sprite object with the specified cap insets. * You use this method to add cap insets to a sprite or to change the existing @@ -244,6 +248,8 @@ namespace ui { Scale9Sprite* resizableSpriteWithCapInsets(const Rect& capInsets); virtual bool updateWithSprite(Sprite* sprite, const Rect& rect, bool rotated, const Rect& capInsets); + CC_DEPRECATED_ATTRIBUTE bool updateWithBatchNode(SpriteBatchNode* batchnode, const Rect& originalRect, bool rotated, const Rect& capInsets); + virtual void setSpriteFrame(SpriteFrame * spriteFrame); // overrides diff --git a/extensions/ExtensionDeprecated.cpp b/extensions/ExtensionDeprecated.cpp new file mode 100644 index 0000000000..d3e3e65e5d --- /dev/null +++ b/extensions/ExtensionDeprecated.cpp @@ -0,0 +1,25 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#include "ExtensionDeprecated.h" diff --git a/extensions/ExtensionDeprecated.h b/extensions/ExtensionDeprecated.h new file mode 100644 index 0000000000..8abdf919b6 --- /dev/null +++ b/extensions/ExtensionDeprecated.h @@ -0,0 +1,39 @@ +/**************************************************************************** + Copyright (c) 2013-2014 Chukong Technologies Inc. + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + +#ifndef __cocos2d_libs__ExtensionDeprecated__ +#define __cocos2d_libs__ExtensionDeprecated__ + +#include "ui/UIEditBox/UIEditBox.h" +#include "ExtensionMacros.h" + +NS_CC_EXT_BEGIN + +CC_DEPRECATED_ATTRIBUTE typedef ui::EditBox EditBox; +CC_DEPRECATED_ATTRIBUTE typedef ui::EditBoxDelegate EditBoxDelegate; +CC_DEPRECATED_ATTRIBUTE typedef ui::Scale9Sprite Scale9Sprite; + +NS_CC_EXT_END + +#endif /* defined(__cocos2d_libs__ExtensionDeprecated__) */ diff --git a/extensions/GUI/CCControlExtension/CCControlButton.cpp b/extensions/GUI/CCControlExtension/CCControlButton.cpp index f7cc5b71b6..91599ae386 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -26,7 +26,6 @@ */ #include "CCControlButton.h" -#include "CCScale9Sprite.h" #include "2d/CCLabel.h" #include "2d/CCAction.h" #include "2d/CCActionInterval.h" diff --git a/extensions/GUI/CCControlExtension/CCControlButton.h b/extensions/GUI/CCControlExtension/CCControlButton.h index f7484e2172..2c58a59311 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.h +++ b/extensions/GUI/CCControlExtension/CCControlButton.h @@ -32,9 +32,8 @@ #include "CCControl.h" #include "CCInvocation.h" -#include "CCScale9Sprite.h" +#include "ExtensionDeprecated.h" #include "base/CCMap.h" -#include "extensions/ExtensionExport.h" NS_CC_EXT_BEGIN diff --git a/extensions/GUI/CCControlExtension/CCControlExtensions.h b/extensions/GUI/CCControlExtension/CCControlExtensions.h index c4548bf535..2cbae97035 100644 --- a/extensions/GUI/CCControlExtension/CCControlExtensions.h +++ b/extensions/GUI/CCControlExtension/CCControlExtensions.h @@ -25,7 +25,6 @@ THE SOFTWARE. #ifndef __CCCONTROL_EXTENSIONS_H__ #define __CCCONTROL_EXTENSIONS_H__ -#include "CCScale9Sprite.h" #include "CCControl.h" #include "CCControlButton.h" #include "CCControlColourPicker.h" diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp deleted file mode 100644 index 021de0489e..0000000000 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp +++ /dev/null @@ -1,816 +0,0 @@ -/**************************************************************************** -Copyright (c) 2012 cocos2d-x.org - -http://www.cocos2d-x.org - -Created by Jung Sang-Taik on 12. 3. 16.. -Copyright (c) 2012 Neofect. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#include "CCScale9Sprite.h" -#include "base/CCPlatformMacros.h" -#include "2d/CCSprite.h" -#include "2d/CCSpriteFrameCache.h" - -NS_CC_EXT_BEGIN - -Scale9Sprite::Scale9Sprite() -: _spritesGenerated(false) -, _spriteFrameRotated(false) -, _positionsAreDirty(false) -, _scale9Image(nullptr) -, _topLeft(nullptr) -, _top(nullptr) -, _topRight(nullptr) -, _left(nullptr) -, _centre(nullptr) -, _right(nullptr) -, _bottomLeft(nullptr) -, _bottom(nullptr) -, _bottomRight(nullptr) -, _opacityModifyRGB(false) -, _insetLeft(0) -, _insetTop(0) -, _insetRight(0) -, _insetBottom(0) -{ - -} - -Scale9Sprite::~Scale9Sprite() -{ - CC_SAFE_RELEASE(_topLeft); - CC_SAFE_RELEASE(_top); - CC_SAFE_RELEASE(_topRight); - CC_SAFE_RELEASE(_left); - CC_SAFE_RELEASE(_centre); - CC_SAFE_RELEASE(_right); - CC_SAFE_RELEASE(_bottomLeft); - CC_SAFE_RELEASE(_bottom); - CC_SAFE_RELEASE(_bottomRight); - CC_SAFE_RELEASE(_scale9Image); -} - -bool Scale9Sprite::init() -{ - return this->initWithBatchNode(nullptr, Rect::ZERO, Rect::ZERO); -} - -bool Scale9Sprite::initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, const Rect& capInsets) -{ - return this->initWithBatchNode(batchnode, rect, false, capInsets); -} - -bool Scale9Sprite::initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, bool rotated, const Rect& capInsets) -{ - if(batchnode) - { - this->updateWithBatchNode(batchnode, rect, rotated, capInsets); - } - this->setCascadeColorEnabled(true); - this->setCascadeOpacityEnabled(true); - this->setAnchorPoint(Vec2(0.5f, 0.5f)); - this->_positionsAreDirty = true; - - return true; -} - -#define TRANSLATE_X(x, y, xtranslate) \ - x+=xtranslate; \ - -#define TRANSLATE_Y(x, y, ytranslate) \ - y+=ytranslate; \ - -bool Scale9Sprite::updateWithBatchNode(SpriteBatchNode* batchnode, const Rect& originalRect, bool rotated, const Rect& capInsets) -{ - GLubyte opacity = getOpacity(); - Color3B color = getColor(); - Rect rect(originalRect); - - // Release old sprites - this->removeAllChildrenWithCleanup(true); - - CC_SAFE_RELEASE(this->_centre); - CC_SAFE_RELEASE(this->_top); - CC_SAFE_RELEASE(this->_topLeft); - CC_SAFE_RELEASE(this->_topRight); - CC_SAFE_RELEASE(this->_left); - CC_SAFE_RELEASE(this->_right); - CC_SAFE_RELEASE(this->_bottomLeft); - CC_SAFE_RELEASE(this->_bottom); - CC_SAFE_RELEASE(this->_bottomRight); - - - if(this->_scale9Image != batchnode) - { - CC_SAFE_RELEASE(this->_scale9Image); - _scale9Image = batchnode; - CC_SAFE_RETAIN(_scale9Image); - } - - if (!_scale9Image) - { - return false; - } - - _capInsets = capInsets; - _spriteFrameRotated = rotated; - - // If there is no given rect - if ( rect.equals(Rect::ZERO) ) - { - // Get the texture size as original - Size textureSize = _scale9Image->getTextureAtlas()->getTexture()->getContentSize(); - - rect = Rect(0, 0, textureSize.width, textureSize.height); - } - - // Set the given rect's size as original size - _spriteRect = rect; - _originalSize = rect.size; - _preferredSize = _originalSize; - _capInsetsInternal = capInsets; - - float w = rect.size.width; - float h = rect.size.height; - - // If there is no specified center region - if ( _capInsetsInternal.equals(Rect::ZERO) ) - { - // log("... cap insets not specified : using default cap insets ..."); - _capInsetsInternal = Rect(w/3, h/3, w/3, h/3); - } - - float left_w = _capInsetsInternal.origin.x; - float center_w = _capInsetsInternal.size.width; - float right_w = rect.size.width - (left_w + center_w); - - float top_h = _capInsetsInternal.origin.y; - float center_h = _capInsetsInternal.size.height; - float bottom_h = rect.size.height - (top_h + center_h); - - // calculate rects - - // ... top row - float x = 0.0; - float y = 0.0; - - // top left - Rect lefttopbounds = Rect(x, y, left_w, top_h); - - // top center - TRANSLATE_X(x, y, left_w); - Rect centertopbounds = Rect(x, y, center_w, top_h); - - // top right - TRANSLATE_X(x, y, center_w); - Rect righttopbounds = Rect(x, y, right_w, top_h); - - // ... center row - x = 0.0; - y = 0.0; - TRANSLATE_Y(x, y, top_h); - - // center left - Rect leftcenterbounds = Rect(x, y, left_w, center_h); - - // center center - TRANSLATE_X(x, y, left_w); - Rect centerbounds = Rect(x, y, center_w, center_h); - - // center right - TRANSLATE_X(x, y, center_w); - Rect rightcenterbounds = Rect(x, y, right_w, center_h); - - // ... bottom row - x = 0.0; - y = 0.0; - TRANSLATE_Y(x, y, top_h); - TRANSLATE_Y(x, y, center_h); - - // bottom left - Rect leftbottombounds = Rect(x, y, left_w, bottom_h); - - // bottom center - TRANSLATE_X(x, y, left_w); - Rect centerbottombounds = Rect(x, y, center_w, bottom_h); - - // bottom right - TRANSLATE_X(x, y, center_w); - Rect rightbottombounds = Rect(x, y, right_w, bottom_h); - - if (!rotated) { - // log("!rotated"); - - AffineTransform t = AffineTransform::IDENTITY; - t = AffineTransformTranslate(t, rect.origin.x, rect.origin.y); - - centerbounds = RectApplyAffineTransform(centerbounds, t); - rightbottombounds = RectApplyAffineTransform(rightbottombounds, t); - leftbottombounds = RectApplyAffineTransform(leftbottombounds, t); - righttopbounds = RectApplyAffineTransform(righttopbounds, t); - lefttopbounds = RectApplyAffineTransform(lefttopbounds, t); - rightcenterbounds = RectApplyAffineTransform(rightcenterbounds, t); - leftcenterbounds = RectApplyAffineTransform(leftcenterbounds, t); - centerbottombounds = RectApplyAffineTransform(centerbottombounds, t); - centertopbounds = RectApplyAffineTransform(centertopbounds, t); - - // Centre - _centre = Sprite::createWithTexture(_scale9Image->getTexture(), centerbounds); - _centre->retain(); - this->addChild(_centre); - - - // Top - _top = Sprite::createWithTexture(_scale9Image->getTexture(), centertopbounds); - _top->retain(); - this->addChild(_top); - - // Bottom - _bottom = Sprite::createWithTexture(_scale9Image->getTexture(), centerbottombounds); - _bottom->retain(); - this->addChild(_bottom); - - // Left - _left = Sprite::createWithTexture(_scale9Image->getTexture(), leftcenterbounds); - _left->retain(); - this->addChild(_left); - - // Right - _right = Sprite::createWithTexture(_scale9Image->getTexture(), rightcenterbounds); - _right->retain(); - this->addChild(_right); - - // Top left - _topLeft = Sprite::createWithTexture(_scale9Image->getTexture(), lefttopbounds); - _topLeft->retain(); - this->addChild(_topLeft); - - // Top right - _topRight = Sprite::createWithTexture(_scale9Image->getTexture(), righttopbounds); - _topRight->retain(); - this->addChild(_topRight); - - // Bottom left - _bottomLeft = Sprite::createWithTexture(_scale9Image->getTexture(), leftbottombounds); - _bottomLeft->retain(); - this->addChild(_bottomLeft); - - // Bottom right - _bottomRight = Sprite::createWithTexture(_scale9Image->getTexture(), rightbottombounds); - _bottomRight->retain(); - this->addChild(_bottomRight); - } else { - // set up transformation of coordinates - // to handle the case where the sprite is stored rotated - // in the spritesheet - // log("rotated"); - - AffineTransform t = AffineTransform::IDENTITY; - - Rect rotatedcenterbounds = centerbounds; - Rect rotatedrightbottombounds = rightbottombounds; - Rect rotatedleftbottombounds = leftbottombounds; - Rect rotatedrighttopbounds = righttopbounds; - Rect rotatedlefttopbounds = lefttopbounds; - Rect rotatedrightcenterbounds = rightcenterbounds; - Rect rotatedleftcenterbounds = leftcenterbounds; - Rect rotatedcenterbottombounds = centerbottombounds; - Rect rotatedcentertopbounds = centertopbounds; - - t = AffineTransformTranslate(t, rect.size.height+rect.origin.x, rect.origin.y); - t = AffineTransformRotate(t, 1.57079633f); - - centerbounds = RectApplyAffineTransform(centerbounds, t); - rightbottombounds = RectApplyAffineTransform(rightbottombounds, t); - leftbottombounds = RectApplyAffineTransform(leftbottombounds, t); - righttopbounds = RectApplyAffineTransform(righttopbounds, t); - lefttopbounds = RectApplyAffineTransform(lefttopbounds, t); - rightcenterbounds = RectApplyAffineTransform(rightcenterbounds, t); - leftcenterbounds = RectApplyAffineTransform(leftcenterbounds, t); - centerbottombounds = RectApplyAffineTransform(centerbottombounds, t); - centertopbounds = RectApplyAffineTransform(centertopbounds, t); - - rotatedcenterbounds.origin = centerbounds.origin; - rotatedrightbottombounds.origin = rightbottombounds.origin; - rotatedleftbottombounds.origin = leftbottombounds.origin; - rotatedrighttopbounds.origin = righttopbounds.origin; - rotatedlefttopbounds.origin = lefttopbounds.origin; - rotatedrightcenterbounds.origin = rightcenterbounds.origin; - rotatedleftcenterbounds.origin = leftcenterbounds.origin; - rotatedcenterbottombounds.origin = centerbottombounds.origin; - rotatedcentertopbounds.origin = centertopbounds.origin; - - // Centre - _centre = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedcenterbounds, true); - _centre->retain(); - this->addChild(_centre, 0); - - // Top - _top = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedcentertopbounds, true); - _top->retain(); - this->addChild(_top); - - // Bottom - _bottom = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedcenterbottombounds, true); - _bottom->retain(); - this->addChild(_bottom); - - // Left - _left = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedleftcenterbounds, true); - _left->retain(); - this->addChild(_left); - - // Right - _right = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrightcenterbounds, true); - _right->retain(); - this->addChild(_right); - - // Top left - _topLeft = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedlefttopbounds, true); - _topLeft->retain(); - this->addChild(_topLeft); - - // Top right - _topRight = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrighttopbounds, true); - _topRight->retain(); - this->addChild(_topRight); - - // Bottom left - _bottomLeft = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedleftbottombounds, true); - _bottomLeft->retain(); - this->addChild(_bottomLeft); - - // Bottom right - _bottomRight = Sprite::createWithTexture(_scale9Image->getTexture(), rotatedrightbottombounds, true); - _bottomRight->retain(); - this->addChild(_bottomRight); - } - - this->setContentSize(rect.size); -// this->addChild(_scale9Image); - - if (_spritesGenerated) - { - // Restore color and opacity - this->setOpacity(opacity); - this->setColor(color); - } - _spritesGenerated = true; - - return true; -} - -void Scale9Sprite::setContentSize(const Size &size) -{ - Node::setContentSize(size); - this->_positionsAreDirty = true; -} - -void Scale9Sprite::updatePositions() -{ - // Check that instances are non-nullptr - if(!((_topLeft) && - (_topRight) && - (_bottomRight) && - (_bottomLeft) && - (_centre))) { - // if any of the above sprites are nullptr, return - return; - } - - Size size = this->_contentSize; - - float sizableWidth = size.width - _topLeft->getContentSize().width - _topRight->getContentSize().width; - float sizableHeight = size.height - _topLeft->getContentSize().height - _bottomRight->getContentSize().height; - - float horizontalScale = sizableWidth/_centre->getContentSize().width; - float verticalScale = sizableHeight/_centre->getContentSize().height; - - _centre->setScaleX(horizontalScale); - _centre->setScaleY(verticalScale); - - float rescaledWidth = _centre->getContentSize().width * horizontalScale; - float rescaledHeight = _centre->getContentSize().height * verticalScale; - - float leftWidth = _bottomLeft->getContentSize().width; - float bottomHeight = _bottomLeft->getContentSize().height; - - _bottomLeft->setAnchorPoint(Vec2(0,0)); - _bottomRight->setAnchorPoint(Vec2(0,0)); - _topLeft->setAnchorPoint(Vec2(0,0)); - _topRight->setAnchorPoint(Vec2(0,0)); - _left->setAnchorPoint(Vec2(0,0)); - _right->setAnchorPoint(Vec2(0,0)); - _top->setAnchorPoint(Vec2(0,0)); - _bottom->setAnchorPoint(Vec2(0,0)); - _centre->setAnchorPoint(Vec2(0,0)); - - // Position corners - _bottomLeft->setPosition(0,0); - _bottomRight->setPosition(leftWidth+rescaledWidth,0); - _topLeft->setPosition(0, bottomHeight+rescaledHeight); - _topRight->setPosition(leftWidth+rescaledWidth, bottomHeight+rescaledHeight); - - // Scale and position borders - _left->setPosition(0, bottomHeight); - _left->setScaleY(verticalScale); - _right->setPosition(leftWidth+rescaledWidth,bottomHeight); - _right->setScaleY(verticalScale); - _bottom->setPosition(leftWidth,0); - _bottom->setScaleX(horizontalScale); - _top->setPosition(leftWidth,bottomHeight+rescaledHeight); - _top->setScaleX(horizontalScale); - - // Position centre - _centre->setPosition(leftWidth, bottomHeight); -} - -bool Scale9Sprite::initWithFile(const std::string& file, const Rect& rect, const Rect& capInsets) -{ - SpriteBatchNode *batchnode = SpriteBatchNode::create(file, 9); - bool pReturn = this->initWithBatchNode(batchnode, rect, capInsets); - return pReturn; -} - -Scale9Sprite* Scale9Sprite::create(const std::string& file, const Rect& rect, const Rect& capInsets) -{ - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithFile(file, rect, capInsets) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return nullptr; -} - -bool Scale9Sprite::initWithFile(const std::string& file, const Rect& rect) -{ - bool pReturn = this->initWithFile(file, rect, Rect::ZERO); - return pReturn; -} - -Scale9Sprite* Scale9Sprite::create(const std::string& file, const Rect& rect) -{ - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithFile(file, rect) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return nullptr; -} - - -bool Scale9Sprite::initWithFile(const Rect& capInsets, const std::string& file) -{ - bool pReturn = this->initWithFile(file, Rect::ZERO, capInsets); - return pReturn; -} - -Scale9Sprite* Scale9Sprite::create(const Rect& capInsets, const std::string& file) -{ - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithFile(capInsets, file) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return nullptr; -} - -bool Scale9Sprite::initWithFile(const std::string& file) -{ - bool pReturn = this->initWithFile(file, Rect::ZERO); - return pReturn; - -} - -Scale9Sprite* Scale9Sprite::create(const std::string& file) -{ - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithFile(file) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return nullptr; -} - -bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets) -{ - Texture2D* texture = spriteFrame->getTexture(); - CCASSERT(texture != nullptr, "CCTexture must be not nil"); - - SpriteBatchNode *batchnode = SpriteBatchNode::createWithTexture(texture, 9); - CCASSERT(batchnode != nullptr, "CCSpriteBatchNode must be not nil"); - - bool pReturn = this->initWithBatchNode(batchnode, spriteFrame->getRect(), spriteFrame->isRotated(), capInsets); - return pReturn; -} - -Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets) -{ - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithSpriteFrame(spriteFrame, capInsets) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return nullptr; -} -bool Scale9Sprite::initWithSpriteFrame(SpriteFrame* spriteFrame) -{ - CCASSERT(spriteFrame != nullptr, "Invalid spriteFrame for sprite"); - bool pReturn = this->initWithSpriteFrame(spriteFrame, Rect::ZERO); - return pReturn; -} - -Scale9Sprite* Scale9Sprite::createWithSpriteFrame(SpriteFrame* spriteFrame) -{ - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithSpriteFrame(spriteFrame) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return nullptr; -} - -bool Scale9Sprite::initWithSpriteFrameName(const std::string& spriteFrameName, const Rect& capInsets) -{ - CCASSERT((SpriteFrameCache::getInstance()) != nullptr, "SpriteFrameCache::getInstance() must be non-nullptr"); - - SpriteFrame *frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName); - CCASSERT(frame != nullptr, "CCSpriteFrame must be non-nullptr"); - - if (nullptr == frame) return false; - - bool pReturn = this->initWithSpriteFrame(frame, capInsets); - return pReturn; -} - -Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteFrameName, const Rect& capInsets) -{ - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName, capInsets) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return nullptr; -} - -bool Scale9Sprite::initWithSpriteFrameName(const std::string& spriteFrameName) -{ - bool pReturn = this->initWithSpriteFrameName(spriteFrameName, Rect::ZERO); - return pReturn; -} - -Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteFrameName) -{ - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - - log("Could not allocate Scale9Sprite()"); - return nullptr; - -} - -Scale9Sprite* Scale9Sprite::resizableSpriteWithCapInsets(const Rect& capInsets) -{ - Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite(); - if ( pReturn && pReturn->initWithBatchNode(_scale9Image, _spriteRect, capInsets) ) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return nullptr; -} - -Scale9Sprite* Scale9Sprite::create() -{ - Scale9Sprite *pReturn = new (std::nothrow) Scale9Sprite(); - if (pReturn && pReturn->init()) - { - pReturn->autorelease(); - return pReturn; - } - CC_SAFE_DELETE(pReturn); - return nullptr; -} - -/** sets the opacity. - @warning If the the texture has premultiplied alpha then, the R, G and B channels will be modifed. - Values goes from 0 to 255, where 255 means fully opaque. - */ - -void Scale9Sprite::setPreferredSize(Size preferedSize) -{ - this->setContentSize(preferedSize); - this->_preferredSize = preferedSize; -} - -Size Scale9Sprite::getPreferredSize() -{ - return this->_preferredSize; -} - -void Scale9Sprite::setCapInsets(Rect capInsets) -{ - Size contentSize = this->_contentSize; - this->updateWithBatchNode(this->_scale9Image, this->_spriteRect, _spriteFrameRotated, capInsets); - this->setContentSize(contentSize); -} - -Rect Scale9Sprite::getCapInsets() -{ - return _capInsets; -} - -void Scale9Sprite::updateCapInset() -{ - Rect insets; - if (this->_insetLeft == 0 && this->_insetTop == 0 && this->_insetRight == 0 && this->_insetBottom == 0) - { - insets = Rect::ZERO; - } - else - { - insets = Rect(_insetLeft, - _insetTop, - _spriteRect.size.width-_insetLeft-_insetRight, - _spriteRect.size.height-_insetTop-_insetBottom); - } - this->setCapInsets(insets); -} - -void Scale9Sprite::setOpacityModifyRGB(bool var) -{ - if (!_scale9Image) - { - return; - } - _opacityModifyRGB = var; - - for(auto child : _scale9Image->getChildren()){ - child->setOpacityModifyRGB(_opacityModifyRGB); - } -} - -bool Scale9Sprite::isOpacityModifyRGB() const -{ - return _opacityModifyRGB; -} - -void Scale9Sprite::setSpriteFrame(SpriteFrame * spriteFrame) -{ - SpriteBatchNode * batchnode = SpriteBatchNode::createWithTexture(spriteFrame->getTexture(), 9); - this->updateWithBatchNode(batchnode, spriteFrame->getRect(), spriteFrame->isRotated(), Rect::ZERO); - - // Reset insets - this->_insetLeft = 0; - this->_insetTop = 0; - this->_insetRight = 0; - this->_insetBottom = 0; -} - -float Scale9Sprite::getInsetLeft() -{ - return this->_insetLeft; -} - -float Scale9Sprite::getInsetTop() -{ - return this->_insetTop; -} - -float Scale9Sprite::getInsetRight() -{ - return this->_insetRight; -} - -float Scale9Sprite::getInsetBottom() -{ - return this->_insetBottom; -} - -void Scale9Sprite::setInsetLeft(float insetLeft) -{ - this->_insetLeft = insetLeft; - this->updateCapInset(); -} - -void Scale9Sprite::setInsetTop(float insetTop) -{ - this->_insetTop = insetTop; - this->updateCapInset(); -} - -void Scale9Sprite::setInsetRight(float insetRight) -{ - this->_insetRight = insetRight; - this->updateCapInset(); -} - -void Scale9Sprite::setInsetBottom(float insetBottom) -{ - this->_insetBottom = insetBottom; - this->updateCapInset(); -} - -void Scale9Sprite::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) -{ - if(this->_positionsAreDirty) - { - this->updatePositions(); - this->_positionsAreDirty = false; - } - Node::visit(renderer, parentTransform, parentFlags); -} - -void Scale9Sprite::setColor(const Color3B& color) -{ - if (!_scale9Image) - { - return; - } - - Node::setColor(color); - - for(auto child : _scale9Image->getChildren()){ - child->setColor(color); - } -} - -void Scale9Sprite::setOpacity(GLubyte opacity) -{ - if (!_scale9Image) - { - return; - } - Node::setOpacity(opacity); - - for(auto child : _scale9Image->getChildren()){ - child->setOpacity(opacity); - } -} - -void Scale9Sprite::updateDisplayedColor(const cocos2d::Color3B &parentColor) -{ - if (!_scale9Image) - { - return; - } - Node::updateDisplayedColor(parentColor); - - for(auto child : _scale9Image->getChildren()){ - child->updateDisplayedColor(parentColor); - } -} - -void Scale9Sprite::updateDisplayedOpacity(GLubyte parentOpacity) -{ - if (!_scale9Image) - { - return; - } - Node::updateDisplayedOpacity(parentOpacity); - - for(auto child : _scale9Image->getChildren()){ - child->updateDisplayedOpacity(parentOpacity); - } -} - -NS_CC_EXT_END diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.h b/extensions/GUI/CCControlExtension/CCScale9Sprite.h deleted file mode 100644 index fc1dea95ba..0000000000 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.h +++ /dev/null @@ -1,323 +0,0 @@ -/**************************************************************************** -Copyright (c) 2012 cocos2d-x.org - -http://www.cocos2d-x.org - -Created by Jung Sang-Taik on 12. 3. 16.. -Copyright (c) 2012 Neofect. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -****************************************************************************/ - -#ifndef __CCScale9Sprite_H__ -#define __CCScale9Sprite_H__ - -#include "2d/CCNode.h" -#include "2d/CCSpriteFrame.h" -#include "2d/CCSpriteBatchNode.h" -#include "extensions/ExtensionExport.h" -#include "../../ExtensionMacros.h" - -NS_CC_EXT_BEGIN - -/** - * @addtogroup GUI - * @{ - * @addtogroup control_extension - * @{ - */ - -/** - * A 9-slice sprite for cocos2d. - * - * 9-slice scaling allows you to specify how scaling is applied - * to specific areas of a sprite. With 9-slice scaling (3x3 grid), - * you can ensure that the sprite does not become distorted when - * scaled. - * - * @see http://yannickloriot.com/library/ios/cccontrolextension/Classes/CCScale9Sprite.html - */ -class CC_EX_DLL Scale9Sprite : public Node -{ -public: - /** - * @js ctor - */ - Scale9Sprite(); - /** - * @js NA - * @lua NA - */ - virtual ~Scale9Sprite(); - -public: - static Scale9Sprite* create(); - - /** - * Creates a 9-slice sprite with a texture file, a delimitation zone and - * with the specified cap insets. - * - * @see initWithFile(const char *file, const Rect& rect, const Rect& capInsets) - */ - static Scale9Sprite* create(const std::string& file, const Rect& rect, const Rect& capInsets); - - /** - * Creates a 9-slice sprite with a texture file. The whole texture will be - * broken down into a 3×3 grid of equal blocks. - * - * @see initWithFile(const Rect& capInsets, const char *file) - */ - static Scale9Sprite* create(const Rect& capInsets, const std::string& file); - - /** - * Creates a 9-slice sprite with a texture file and a delimitation zone. The - * texture will be broken down into a 3×3 grid of equal blocks. - * - * @see initWithFile(const char *file, const Rect& rect) - */ - static Scale9Sprite* create(const std::string& file, const Rect& rect); - - /** - * Creates a 9-slice sprite with a texture file. The whole texture will be - * broken down into a 3×3 grid of equal blocks. - * - * @see initWithFile(const char *file) - */ - static Scale9Sprite* create(const std::string& file); - - /** - * Creates a 9-slice sprite with an sprite frame. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @see initWithSpriteFrame(SpriteFrame *spriteFrame) - */ - static Scale9Sprite* createWithSpriteFrame(SpriteFrame* spriteFrame); - - /** - * Creates a 9-slice sprite with an sprite frame and the centre of its zone. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @see initWithSpriteFrame(SpriteFrame *spriteFrame, const Rect& capInsets) - */ - static Scale9Sprite* createWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets); - - /** - * Creates a 9-slice sprite with an sprite frame name. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @see initWithSpriteFrameName(const char *spriteFrameName) - */ - static Scale9Sprite* createWithSpriteFrameName(const std::string& spriteFrameName); - - /** - * Creates a 9-slice sprite with an sprite frame name and the centre of its - * zone. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @see initWithSpriteFrameName(const char *spriteFrameName, const Rect& capInsets) - */ - static Scale9Sprite* createWithSpriteFrameName(const std::string& spriteFrameName, const Rect& capInsets); - - /** - * Initializes a 9-slice sprite with a texture file, a delimitation zone and - * with the specified cap insets. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @param file The name of the texture file. - * @param rect The rectangle that describes the sub-part of the texture that - * is the whole image. If the shape is the whole texture, set this to the - * texture's full rect. - * @param capInsets The values to use for the cap insets. - */ - virtual bool initWithFile(const std::string& file, const Rect& rect, const Rect& capInsets); - - /** - * Initializes a 9-slice sprite with a texture file and a delimitation zone. The - * texture will be broken down into a 3×3 grid of equal blocks. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @param file The name of the texture file. - * @param rect The rectangle that describes the sub-part of the texture that - * is the whole image. If the shape is the whole texture, set this to the - * texture's full rect. - */ - virtual bool initWithFile(const std::string& file, const Rect& rect); - - /** - * Initializes a 9-slice sprite with a texture file and with the specified cap - * insets. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @param file The name of the texture file. - * @param capInsets The values to use for the cap insets. - */ - virtual bool initWithFile(const Rect& capInsets, const std::string& file); - - /** - * Initializes a 9-slice sprite with a texture file. The whole texture will be - * broken down into a 3×3 grid of equal blocks. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @param file The name of the texture file. - */ - virtual bool initWithFile(const std::string& file); - - /** - * Initializes a 9-slice sprite with an sprite frame and with the specified - * cap insets. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @param spriteFrame The sprite frame object. - * @param capInsets The values to use for the cap insets. - */ - virtual bool initWithSpriteFrame(SpriteFrame* spriteFrame, const Rect& capInsets); - - /** - * Initializes a 9-slice sprite with an sprite frame. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @param spriteFrame The sprite frame object. - */ - virtual bool initWithSpriteFrame(SpriteFrame* spriteFrame); - - /** - * Initializes a 9-slice sprite with an sprite frame name and with the specified - * cap insets. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @param spriteFrameName The sprite frame name. - * @param capInsets The values to use for the cap insets. - */ - virtual bool initWithSpriteFrameName(const std::string& spriteFrameName, const Rect& capInsets); - - /** - * Initializes a 9-slice sprite with an sprite frame name. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @param spriteFrameName The sprite frame name. - */ - virtual bool initWithSpriteFrameName(const std::string& spriteFrameName); - - virtual bool init(); - virtual bool initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, bool rotated, const Rect& capInsets); - virtual bool initWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, const Rect& capInsets); - - /** - * Creates and returns a new sprite object with the specified cap insets. - * You use this method to add cap insets to a sprite or to change the existing - * cap insets of a sprite. In both cases, you get back a new image and the - * original sprite remains untouched. - * - * @param capInsets The values to use for the cap insets. - */ - Scale9Sprite* resizableSpriteWithCapInsets(const Rect& capInsets); - - virtual bool updateWithBatchNode(SpriteBatchNode* batchnode, const Rect& rect, bool rotated, const Rect& capInsets); - virtual void setSpriteFrame(SpriteFrame * spriteFrame); - - // overrides - virtual void setContentSize(const Size & size) override; - /** - * @js NA - * @lua NA - */ - virtual void visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override; - virtual void setOpacityModifyRGB(bool bValue) override; - virtual bool isOpacityModifyRGB(void) const override; - virtual void setOpacity(GLubyte opacity) override; - virtual void setColor(const Color3B& color) override; - virtual void updateDisplayedOpacity(GLubyte parentOpacity) override; - virtual void updateDisplayedColor(const Color3B& parentColor) override; - -protected: - void updateCapInset(); - void updatePositions(); - - bool _spritesGenerated; - Rect _spriteRect; - bool _spriteFrameRotated; - Rect _capInsetsInternal; - bool _positionsAreDirty; - - SpriteBatchNode* _scale9Image; - Sprite* _topLeft; - Sprite* _top; - Sprite* _topRight; - Sprite* _left; - Sprite* _centre; - Sprite* _right; - Sprite* _bottomLeft; - Sprite* _bottom; - Sprite* _bottomRight; - - bool _opacityModifyRGB; - - /** Original sprite's size. */ - CC_SYNTHESIZE_READONLY(Size, _originalSize, OriginalSize); - /** Prefered sprite's size. By default the prefered size is the original size. */ - - //if the preferredSize component is given as -1, it is ignored - CC_PROPERTY(Size, _preferredSize, PreferredSize); - /** - * The end-cap insets. - * On a non-resizeable sprite, this property is set to CGRect::ZERO; the sprite - * does not use end caps and the entire sprite is subject to stretching. - */ - CC_PROPERTY(Rect, _capInsets, CapInsets); - /** Sets the left side inset */ - CC_PROPERTY(float, _insetLeft, InsetLeft); - /** Sets the top side inset */ - CC_PROPERTY(float, _insetTop, InsetTop); - /** Sets the right side inset */ - CC_PROPERTY(float, _insetRight, InsetRight); - /** Sets the bottom side inset */ - CC_PROPERTY(float, _insetBottom, InsetBottom); -}; - -// end of GUI group -/// @} -/// @} - -NS_CC_EXT_END - -#endif // __CCScale9Sprite_H__ diff --git a/extensions/cocos-ext.h b/extensions/cocos-ext.h index 695077d628..6f742b7046 100644 --- a/extensions/cocos-ext.h +++ b/extensions/cocos-ext.h @@ -7,12 +7,12 @@ #include "GUI/CCControlExtension/CCControlExtensions.h" #include "GUI/CCScrollView/CCScrollView.h" #include "GUI/CCScrollView/CCTableView.h" -#include "ui/UIEditBox/UIEditBox.h" // Physics integration #include "physics-nodes/CCPhysicsDebugNode.h" #include "physics-nodes/CCPhysicsSprite.h" #include "assets-manager/AssetsManager.h" +#include "ExtensionDeprecated.h" #endif /* __COCOS2D_EXT_H__ */ diff --git a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp deleted file mode 100644 index dfa40086aa..0000000000 --- a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp +++ /dev/null @@ -1,135 +0,0 @@ -// -// EditBoxTest.cpp -// TestCpp -// -// Created by James on 8/14/12. -// -// - -#include "EditBoxTest.h" -#include "../ExtensionsTest.h" - -USING_NS_CC; -USING_NS_CC_EXT; -using namespace ui; - - -EditBoxTest::EditBoxTest() -{ - auto glview = Director::getInstance()->getOpenGLView(); - auto visibleOrigin = glview->getVisibleOrigin(); - auto visibleSize = glview->getVisibleSize(); - - auto pBg = Sprite::create("Images/HelloWorld.png"); - pBg->setPosition(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2); - addChild(pBg); - - _TTFShowEditReturn = Label::createWithSystemFont("No edit control return!", "", 30); - _TTFShowEditReturn->setPosition(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y + visibleSize.height - 50); - addChild(_TTFShowEditReturn); - - // Back Menu - auto itemBack = MenuItemFont::create("Back", CC_CALLBACK_1(EditBoxTest::toExtensionsMainLayer, this)); - itemBack->setPosition(visibleOrigin.x+visibleSize.width - 50, visibleOrigin.y+25); - auto menuBack = Menu::create(itemBack, nullptr); - menuBack->setPosition(Vec2::ZERO); - addChild(menuBack); - - auto editBoxSize = Size(visibleSize.width - 100, 60); - - // top - _editName = EditBox::create(editBoxSize, ui::Scale9Sprite::create("extensions/green_edit.png")); - _editName->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height*3/4)); - _editName->setFontName("Paint Boy"); - _editName->setFontSize(25); - _editName->setFontColor(Color3B::RED); - _editName->setPlaceHolder("Name:"); - _editName->setPlaceholderFontColor(Color3B::WHITE); - _editName->setMaxLength(8); - _editName->setReturnType(EditBox::KeyboardReturnType::DONE); - _editName->setDelegate(this); - addChild(_editName); - - // middle - _editPassword = EditBox::create(editBoxSize, ui::Scale9Sprite::create("extensions/orange_edit.png")); - _editPassword->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2)); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - _editPassword->setFont("American Typewriter", 30); -#else - _editPassword->setFont("American Typewriter", 80); - _editPassword->setPlaceholderFont("American Typewriter", 80); -#endif - _editPassword->setFontColor(Color3B::GREEN); - _editPassword->setPlaceHolder("Password:"); - _editPassword->setMaxLength(6); - _editPassword->setInputFlag(EditBox::InputFlag::PASSWORD); - _editPassword->setInputMode(EditBox::InputMode::SINGLE_LINE); - _editPassword->setDelegate(this); - addChild(_editPassword); - - // bottom - _editEmail = EditBox::create(Size(editBoxSize.width, editBoxSize.height), ui::Scale9Sprite::create("extensions/yellow_edit.png")); - _editEmail->setPosition(Vec2(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/4)); - _editEmail->setAnchorPoint(Vec2(0.5, 1.0f)); - _editEmail->setPlaceHolder("Email:"); - _editEmail->setInputMode(EditBox::InputMode::EMAIL_ADDRESS); - _editEmail->setDelegate(this); - addChild(_editEmail); - - this->setPosition(10, 20); -} - -EditBoxTest::~EditBoxTest() -{ - -} - -void EditBoxTest::toExtensionsMainLayer(cocos2d::Ref *sender) -{ - auto scene = new (std::nothrow) ExtensionsTestScene(); - scene->runThisTest(); - scene->release(); -} - -void EditBoxTest::editBoxEditingDidBegin(cocos2d::ui::EditBox* editBox) -{ - log("editBox %p DidBegin !", editBox); -} - -void EditBoxTest::editBoxEditingDidEnd(cocos2d::ui::EditBox* editBox) -{ - log("editBox %p DidEnd !", editBox); -} - -void EditBoxTest::editBoxTextChanged(cocos2d::ui::EditBox* editBox, const std::string& text) -{ - log("editBox %p TextChanged, text: %s ", editBox, text.c_str()); -} - -void EditBoxTest::editBoxReturn(EditBox* editBox) -{ - log("editBox %p was returned !",editBox); - - if (_editName == editBox) - { - _TTFShowEditReturn->setString("Name EditBox return !"); - } - else if (_editPassword == editBox) - { - _TTFShowEditReturn->setString("Password EditBox return !"); - } - else if (_editEmail == editBox) - { - _TTFShowEditReturn->setString("Email EditBox return !"); - } -} - -void runEditBoxTest() -{ - auto scene = Scene::create(); - EditBoxTest *layer = new (std::nothrow) EditBoxTest(); - scene->addChild(layer); - - Director::getInstance()->replaceScene(scene); - layer->release(); -} diff --git a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h b/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h deleted file mode 100644 index 2de0e0642f..0000000000 --- a/tests/cpp-tests/Classes/ExtensionsTest/EditBoxTest/EditBoxTest.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// EditBoxTest.h -// TestCpp -// -// Created by James on 8/14/12. -// -// - -#ifndef __TestCpp__CCEditBoxTest__ -#define __TestCpp__CCEditBoxTest__ - -#include "cocos2d.h" -#include "extensions/cocos-ext.h" - -class EditBoxTest : public cocos2d::Layer, public cocos2d::ui::EditBoxDelegate -{ -public: - EditBoxTest(); - virtual ~EditBoxTest(); - void toExtensionsMainLayer(cocos2d::Ref *sender); - - virtual void editBoxEditingDidBegin(cocos2d::ui::EditBox* editBox); - virtual void editBoxEditingDidEnd(cocos2d::ui::EditBox* editBox); - virtual void editBoxTextChanged(cocos2d::ui::EditBox* editBox, const std::string& text); - virtual void editBoxReturn(cocos2d::ui::EditBox* editBox); -private: - cocos2d::Label* _TTFShowEditReturn; - cocos2d::ui::EditBox* _editName; - cocos2d::ui::EditBox* _editPassword; - cocos2d::ui::EditBox* _editEmail; -}; - -void runEditBoxTest(); - -#endif /* defined(__TestCpp__CCEditBoxTest__) */ diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.cpp index 3a09e2da85..10d31a2900 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ExtensionsTest.cpp @@ -18,11 +18,6 @@ #include "NetworkTest/SocketIOTest.h" #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) -#include "EditBoxTest/EditBoxTest.h" -#endif - -#include "Scale9SpriteTest/Scale9SpriteTest.h" enum { @@ -36,15 +31,6 @@ static struct { } g_extensionsTests[] = { { "NotificationCenterTest", [](Ref* sender) { runNotificationCenterTest(); } }, - { "Scale9SpriteTest", [](Ref* sender) { - auto scene = new (std::nothrow) S9SpriteTestScene(); - if (scene) - { - scene->runThisTest(); - scene->release(); - } - } - }, { "CCControlButtonTest", [](Ref *sender){ ControlSceneManager* pManager = ControlSceneManager::sharedControlSceneManager(); auto scene = pManager->currentControlScene(); @@ -68,10 +54,7 @@ static struct { { "SocketIOTest", [](Ref *sender){ runSocketIOTest();} }, #endif -#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_TIZEN) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) - { "EditBoxTest", [](Ref *sender){ runEditBoxTest();} - }, -#endif + { "TableViewTest", [](Ref *sender){ runTableViewTest();} }, { "CocoStudioArmatureTest", [](Ref *sender) { ArmatureTestScene *scene = new (std::nothrow) ArmatureTestScene(); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp deleted file mode 100644 index c8cc71acbf..0000000000 --- a/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp +++ /dev/null @@ -1,784 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011 Zynga Inc. - Copyright (c) 2013 Surith Thekkiam - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "Scale9SpriteTest.h" -#include "testResource.h" -#include "cocos2d.h" -#include "extensions/cocos-ext.h" - -USING_NS_CC_EXT; - -static std::function createFunctions[] = { - CL(S9BatchNodeBasic), - CL(S9FrameNameSpriteSheet), - CL(S9FrameNameSpriteSheetRotated), - CL(S9BatchNodeScaledNoInsets), - CL(S9FrameNameSpriteSheetScaledNoInsets), - CL(S9FrameNameSpriteSheetRotatedScaledNoInsets), - CL(S9BatchNodeScaleWithCapInsets), - CL(S9FrameNameSpriteSheetInsets), - CL(S9FrameNameSpriteSheetInsetsScaled), - CL(S9FrameNameSpriteSheetRotatedInsets), - CL(S9_TexturePacker), - CL(S9FrameNameSpriteSheetRotatedInsetsScaled), - CL(S9FrameNameSpriteSheetRotatedSetCapInsetLater), - CL(S9CascadeOpacityAndColor), - CL(S9ZOrder), - CL(S9Flip) -}; - -static int sceneIdx=-1; -#define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0])) - -static Layer* nextAction() -{ - sceneIdx++; - sceneIdx = sceneIdx % MAX_LAYER; - - auto layer = (createFunctions[sceneIdx])(); - return layer; -} - -static Layer* backAction() -{ - sceneIdx--; - int total = MAX_LAYER; - if( sceneIdx < 0 ) - sceneIdx += total; - - auto layer = (createFunctions[sceneIdx])(); - return layer; -} - -static Layer* restartAction() -{ - auto layer = (createFunctions[sceneIdx])(); - return layer; -} - -void S9SpriteTestScene::runThisTest() -{ - sceneIdx = -1; - addChild(nextAction()); - - Director::getInstance()->replaceScene(this); -} - -//------------------------------------------------------------------ -// -// S9SpriteTestDemo -// -//------------------------------------------------------------------ - -void S9SpriteTestDemo::onEnter() -{ - BaseTest::onEnter(); - SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist); - CCLOG("sprite frames added to sprite frame cache..."); -} - -void S9SpriteTestDemo::restartCallback(Ref* sender) -{ - auto s = new (std::nothrow) S9SpriteTestScene(); - s->addChild( restartAction() ); - Director::getInstance()->replaceScene(s); - s->release(); -} - -void S9SpriteTestDemo::nextCallback(Ref* sender) -{ - auto s = new (std::nothrow) S9SpriteTestScene(); - s->addChild( nextAction() ); - Director::getInstance()->replaceScene(s); - s->release(); -} - -void S9SpriteTestDemo::backCallback(Ref* sender) -{ - auto s = new (std::nothrow) S9SpriteTestScene(); - s->addChild( backAction() ); - Director::getInstance()->replaceScene(s); - s->release(); -} - - -// S9BatchNodeBasic - -void S9BatchNodeBasic::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - log("S9BatchNodeBasic ..."); - - auto batchNode = SpriteBatchNode::create("Images/blocks9.png"); - log("batchNode created with : Images/blocks9.png"); - - auto blocks = Scale9Sprite::create(); - log("... created"); - - blocks->updateWithBatchNode(batchNode, Rect(0, 0, 96, 96), false, Rect(0, 0, 96, 96)); - log("... updateWithBatchNode"); - - blocks->setPosition(Vec2(x, y)); - log("... setPosition"); - - this->addChild(blocks); - log("this->addChild"); - - log("... S9BatchNodeBasic done."); -} - -std::string S9BatchNodeBasic::title() const -{ - return "Scale9Sprite created empty and updated from SpriteBatchNode"; -} - -std::string S9BatchNodeBasic::subtitle() const -{ - return "updateWithBatchNode(); capInsets=full size"; -} - - -// S9FrameNameSpriteSheet - -void S9FrameNameSpriteSheet::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - log("S9FrameNameSpriteSheet ..."); - - auto blocks = Scale9Sprite::createWithSpriteFrameName("blocks9.png"); - log("... created"); - - blocks->setPosition(Vec2(x, y)); - log("... setPosition"); - - this->addChild(blocks); - log("this->addChild"); - - log("... S9FrameNameSpriteSheet done."); -} - -std::string S9FrameNameSpriteSheet::title() const -{ - return "Scale9Sprite from sprite sheet"; -} - -std::string S9FrameNameSpriteSheet::subtitle() const -{ - return "createWithSpriteFrameName(); default cap insets"; -} - -// -//// S9FrameNameSpriteSheetRotated -// -void S9FrameNameSpriteSheetRotated::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - log("S9FrameNameSpriteSheetRotated ..."); - - auto blocks = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); - log("... created"); - - blocks->setPosition(Vec2(x, y)); - log("... setPosition"); - - this->addChild(blocks); - log("this->addChild"); - - log("... S9FrameNameSpriteSheetRotated done."); -} - -std::string S9FrameNameSpriteSheetRotated::title() const -{ - return "Scale9Sprite from sprite sheet (stored rotated)"; -} - -std::string S9FrameNameSpriteSheetRotated::subtitle() const -{ - return "createWithSpriteFrameName(); default cap insets"; -} - -// -//// S9BatchNodeScaledNoInsets -// - -void S9BatchNodeScaledNoInsets::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - log("S9BatchNodeScaledNoInsets ..."); - - // scaled without insets - auto batchNode_scaled = SpriteBatchNode::create("Images/blocks9.png"); - log("batchNode_scaled created with : Images/blocks9.png"); - - auto blocks_scaled = Scale9Sprite::create(); - log("... created"); - blocks_scaled->updateWithBatchNode(batchNode_scaled, Rect(0, 0, 96, 96), false, Rect(0, 0, 96, 96)); - log("... updateWithBatchNode"); - - blocks_scaled->setPosition(Vec2(x, y)); - log("... setPosition"); - - blocks_scaled->setContentSize(Size(96 * 4, 96*2)); - log("... setContentSize"); - - this->addChild(blocks_scaled); - log("this->addChild"); - - log("... S9BtchNodeScaledNoInsets done."); -} - -std::string S9BatchNodeScaledNoInsets::title() const -{ - return "Scale9Sprite created empty and updated from SpriteBatchNode"; -} - -std::string S9BatchNodeScaledNoInsets::subtitle() const -{ - return "updateWithBatchNode(); capInsets=full size; rendered 4 X width, 2 X height"; -} - -// -//// S9FrameNameSpriteSheetScaledNoInsets -// - -void S9FrameNameSpriteSheetScaledNoInsets::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - log("S9FrameNameSpriteSheetScaledNoInsets ..."); - - auto blocks_scaled = Scale9Sprite::createWithSpriteFrameName("blocks9.png"); - log("... created"); - - blocks_scaled->setPosition(Vec2(x, y)); - log("... setPosition"); - - blocks_scaled->setContentSize(Size(96 * 4, 96*2)); - log("... setContentSize"); - - this->addChild(blocks_scaled); - log("this->addChild"); - - log("... S9FrameNameSpriteSheetScaledNoInsets done."); -} - -std::string S9FrameNameSpriteSheetScaledNoInsets::title() const -{ - return "Scale9Sprite from sprite sheet"; -} - -std::string S9FrameNameSpriteSheetScaledNoInsets::subtitle() const -{ - return "createWithSpriteFrameName(); default cap insets; rendered 4 X width, 2 X height"; -} - - -// -//// S9FrameNameSpriteSheetRotatedScaledNoInsets -// - -void S9FrameNameSpriteSheetRotatedScaledNoInsets::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - log("S9FrameNameSpriteSheetRotatedScaledNoInsets ..."); - - auto blocks_scaled = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); - log("... created"); - - blocks_scaled->setPosition(Vec2(x, y)); - log("... setPosition"); - - blocks_scaled->setContentSize(Size(96 * 4, 96*2)); - log("... setContentSize"); - - this->addChild(blocks_scaled); - log("this->addChild"); - - log("... S9FrameNameSpriteSheetRotatedScaledNoInsets done."); -} - -std::string S9FrameNameSpriteSheetRotatedScaledNoInsets::title() const -{ - return "Scale9Sprite from sprite sheet (stored rotated)"; -} - -std::string S9FrameNameSpriteSheetRotatedScaledNoInsets::subtitle() const -{ - return "createWithSpriteFrameName(); default cap insets; rendered 4 X width, 2 X height"; -} - -// -// -//// S9BatchNodeScaleWithCapInsets -// - -void S9BatchNodeScaleWithCapInsets::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - log("S9BatchNodeScaleWithCapInsets ..."); - - auto batchNode_scaled_with_insets = SpriteBatchNode::create("Images/blocks9.png"); - log("batchNode_scaled_with_insets created with : Images/blocks9.png"); - - auto blocks_scaled_with_insets = Scale9Sprite::create(); - log("... created"); - - blocks_scaled_with_insets->updateWithBatchNode(batchNode_scaled_with_insets, Rect(0, 0, 96, 96), false, Rect(32, 32, 32, 32)); - log("... updateWithBatchNode"); - - blocks_scaled_with_insets->setContentSize(Size(96 * 4.5, 96 * 2.5)); - log("... setContentSize"); - - blocks_scaled_with_insets->setPosition(Vec2(x, y)); - log("... setPosition"); - - this->addChild(blocks_scaled_with_insets); - log("this->addChild"); - - log("... S9BatchNodeScaleWithCapInsets done."); -} - -std::string S9BatchNodeScaleWithCapInsets::title() const -{ - return "Scale9Sprite created empty and updated from SpriteBatchNode"; -} - -std::string S9BatchNodeScaleWithCapInsets::subtitle() const -{ - return "updateWithBatchNode(); capInsets=(32, 32, 32, 32)"; -} - -// -//// S9FrameNameSpriteSheetInsets -// - -void S9FrameNameSpriteSheetInsets::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - log("S9FrameNameSpriteSheetInsets ..."); - - auto blocks_with_insets = Scale9Sprite::createWithSpriteFrameName("blocks9.png", Rect(32, 32, 32, 32)); - log("... created"); - - blocks_with_insets->setPosition(Vec2(x, y)); - log("... setPosition"); - - this->addChild(blocks_with_insets); - log("this->addChild"); - - log("... S9FrameNameSpriteSheetInsets done."); -} - -std::string S9FrameNameSpriteSheetInsets::title() const -{ - return "Scale9Sprite scaled with insets sprite sheet"; -} - -std::string S9FrameNameSpriteSheetInsets::subtitle() const -{ - return "createWithSpriteFrameName(); cap insets=(32, 32, 32, 32)"; -} - -// -//// S9FrameNameSpriteSheetInsetsScaled -// -void S9FrameNameSpriteSheetInsetsScaled::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - log("S9FrameNameSpriteSheetInsetsScaled ..."); - - auto blocks_scaled_with_insets = Scale9Sprite::createWithSpriteFrameName("blocks9.png", Rect(32, 32, 32, 32)); - log("... created"); - - blocks_scaled_with_insets->setContentSize(Size(96 * 4.5, 96 * 2.5)); - log("... setContentSize"); - - blocks_scaled_with_insets->setPosition(Vec2(x, y)); - log("... setPosition"); - - this->addChild(blocks_scaled_with_insets); - log("this->addChild"); - - log("... S9FrameNameSpriteSheetInsetsScaled done."); -} - -std::string S9FrameNameSpriteSheetInsetsScaled::title() const -{ - return "Scale9Sprite scaled with insets sprite sheet"; -} - -std::string S9FrameNameSpriteSheetInsetsScaled::subtitle() const -{ - return "createWithSpriteFrameName(); default cap insets; rendered scaled 4.5 X width, 2.5 X height"; -} - -//// S9FrameNameSpriteSheetRotatedInsets -// - -void S9FrameNameSpriteSheetRotatedInsets::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - log("S9FrameNameSpriteSheetRotatedInsets ..."); - - auto blocks_with_insets = Scale9Sprite::createWithSpriteFrameName("blocks9r.png", Rect(32, 32, 32, 32)); - log("... created"); - - blocks_with_insets->setPosition(Vec2(x, y)); - log("... setPosition"); - - this->addChild(blocks_with_insets); - log("this->addChild"); - - log("... S9FrameNameSpriteSheetRotatedInsets done."); -} - -std::string S9FrameNameSpriteSheetRotatedInsets::title() const -{ - return "Scale9Sprite scaled with insets sprite sheet (stored rotated)"; -} - -std::string S9FrameNameSpriteSheetRotatedInsets::subtitle() const -{ - return "createWithSpriteFrameName(); cap insets=(32, 32, 32, 32)"; -} - -// -//// S9_TexturePacker -// - -void S9_TexturePacker::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_ui_plist); - - float x = winSize.width / 4; - float y = 0 + (winSize.height / 2); - - log("S9_TexturePacker ..."); - - auto s = Scale9Sprite::createWithSpriteFrameName("button_normal.png"); - log("... created"); - - s->setPosition(Vec2(x, y)); - log("... setPosition"); - - s->setContentSize(Size(14 * 16, 10 * 16)); - log("... setContentSize"); - - this->addChild(s); - log("this->addChild"); - - x = winSize.width * 3/4; - - auto s2 = Scale9Sprite::createWithSpriteFrameName("button_actived.png"); - log("... created"); - - s2->setPosition(Vec2(x, y)); - log("... setPosition"); - - s2->setContentSize(Size(14 * 16, 10 * 16)); - log("... setContentSize"); - - this->addChild(s2); - log("this->addChild"); - - log("... S9_TexturePacker done."); -} - -std::string S9_TexturePacker::title() const -{ - return "Scale9Sprite from a spritesheet created with TexturePacker"; -} - -std::string S9_TexturePacker::subtitle() const -{ - return "createWithSpriteFrameName('button_normal.png');createWithSpriteFrameName('button_actived.png');"; -} - -// -//// S9FrameNameSpriteSheetRotatedInsetsScaled -// - -void S9FrameNameSpriteSheetRotatedInsetsScaled::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - log("S9FrameNameSpriteSheetRotatedInsetsScaled ..."); - - auto blocks_scaled_with_insets = Scale9Sprite::createWithSpriteFrameName("blocks9.png", Rect(32, 32, 32, 32)); - log("... created"); - - blocks_scaled_with_insets->setContentSize(Size(96 * 4.5, 96 * 2.5)); - log("... setContentSize"); - - blocks_scaled_with_insets->setPosition(Vec2(x, y)); - log("... setPosition"); - - this->addChild(blocks_scaled_with_insets); - log("this->addChild"); - - log("... S9FrameNameSpriteSheetRotatedInsetsScaled done."); -} - -std::string S9FrameNameSpriteSheetRotatedInsetsScaled::title() const -{ - return "Scale9Sprite scaled with insets sprite sheet (stored rotated)"; -} - -std::string S9FrameNameSpriteSheetRotatedInsetsScaled::subtitle() const -{ - return "createWithSpriteFrameName(); default cap insets; rendered scaled 4.5 X width, 2.5 X height"; -} - -// -//// Scale9FrameNameSpriteSheetRotatedSetCapInsetLater -// - -void S9FrameNameSpriteSheetRotatedSetCapInsetLater::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - log("Scale9FrameNameSpriteSheetRotatedSetCapInsetLater ..."); - - auto blocks_scaled_with_insets = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); - log("... created"); - - blocks_scaled_with_insets->setInsetLeft(32); - blocks_scaled_with_insets->setInsetRight(32); - - blocks_scaled_with_insets->setPreferredSize(Size(32*5.5f, 32*4)); - blocks_scaled_with_insets->setPosition(Vec2(x, y)); - log("... setPosition"); - - this->addChild(blocks_scaled_with_insets); - log("this->addChild"); - - log("... Scale9FrameNameSpriteSheetRotatedSetCapInsetLater done."); -} - -std::string S9FrameNameSpriteSheetRotatedSetCapInsetLater::title() const -{ - return "Scale9Sprite from sprite sheet (stored rotated), with setting CapInset later"; -} - -std::string S9FrameNameSpriteSheetRotatedSetCapInsetLater::subtitle() const -{ - return "createWithSpriteFrameName(); setInsetLeft(32); setInsetRight(32);"; -} - -// -//// S9CascadeOpacityAndColor -// - -void S9CascadeOpacityAndColor::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - auto rgba = Layer::create(); - rgba->setCascadeColorEnabled(true); - rgba->setCascadeOpacityEnabled(true); - this->addChild(rgba); - - log("S9CascadeOpacityAndColor ..."); - - auto blocks_scaled_with_insets = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); - log("... created"); - - blocks_scaled_with_insets->setPosition(Vec2(x, y)); - log("... setPosition"); - - rgba->addChild(blocks_scaled_with_insets); - auto actions = Sequence::create(FadeIn::create(1), - TintTo::create(1, 0, 255, 0), - TintTo::create(1, 255, 255, 255), - FadeOut::create(1), - nullptr); - auto repeat = RepeatForever::create(actions); - rgba->runAction(repeat); - log("this->addChild"); - - log("... S9CascadeOpacityAndColor done."); -} - -std::string S9CascadeOpacityAndColor::title() const -{ - return "Scale9Sprite and a Layer parent with setCascadeOpacityEnable(true) and setCascadeColorEnable(true)"; -} - -std::string S9CascadeOpacityAndColor::subtitle() const -{ - return "when parent change color/opacity, Scale9Sprite should also change"; -} - -// -//// S9ZOrder -// - -void S9ZOrder::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - auto blocks_scaled_with_insets = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); - - blocks_scaled_with_insets->setPosition(Vec2(x, y)); - this->addChild(blocks_scaled_with_insets); - - Sprite *normalSprite = Sprite::createWithSpriteFrameName("blocks9r.png"); - normalSprite->setColor(Color3B::RED); - blocks_scaled_with_insets->addChild(normalSprite); - - auto topLabel = Label::createWithSystemFont("I Must be On the Top", "Arial", 15); - topLabel->setPosition(Vec2(20,20)); - blocks_scaled_with_insets->addChild(topLabel); - - auto bottomLabel = Label::createWithSystemFont("I Must be On the Bottom", "Arial", 15); - bottomLabel->setPosition(Vec2(80,80)); - bottomLabel->setColor(Color3B::BLUE); - blocks_scaled_with_insets->addChild(bottomLabel,-1); - -} - -std::string S9ZOrder::title() const -{ - return "Scale9Sprite ZOrder issue"; -} - -std::string S9ZOrder::subtitle() const -{ - return "When adding nodes to Scale9Sprite, it should be added on top itself"; -} - -// -//// S9Flip -// - -void S9Flip::onEnter() -{ - S9SpriteTestDemo::onEnter(); - auto winSize = Director::getInstance()->getWinSize(); - float x = winSize.width / 2; - float y = 0 + (winSize.height / 2); - - - auto normalSprite = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); - - normalSprite->setPosition(Vec2(x, y )); - this->addChild(normalSprite); - - - auto normalLabel = Label::createWithSystemFont("Normal Sprite","Airal",10); - normalLabel->setPosition(normalSprite->getPosition() + Vec2(0, normalSprite->getContentSize().height/2 + 10)); - this->addChild(normalLabel); - - - - auto flipXSprite = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); - - flipXSprite->setPosition(Vec2(x - 120, y )); - this->addChild(flipXSprite); - - flipXSprite->setScaleX(-1); - - auto flipXLabel = Label::createWithSystemFont("Sprite FlipX","Airal",10); - flipXLabel->setPosition(flipXSprite->getPosition() + Vec2(0, flipXSprite->getContentSize().height/2 + 10)); - this->addChild(flipXLabel); - - - auto flipYSprite = Scale9Sprite::createWithSpriteFrameName("blocks9r.png"); - - flipYSprite->setPosition(Vec2(x + 120, y)); - this->addChild(flipYSprite); - - flipYSprite->setScaleY(-1); - - auto flipYLabel = Label::createWithSystemFont("Sprite FlipY","Airal",10); - flipYLabel->setPosition(flipYSprite->getPosition() + Vec2(0, flipYSprite->getContentSize().height/2 + 10)); - this->addChild(flipYLabel); - - -} - -std::string S9Flip::title() const -{ - return "Scale9Sprite Flip issue"; -} - -std::string S9Flip::subtitle() const -{ - return "When Flipped, the scale9Sprite should behavior like a normal node"; -} diff --git a/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.h b/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.h deleted file mode 100644 index a5448fb86e..0000000000 --- a/tests/cpp-tests/Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.h +++ /dev/null @@ -1,255 +0,0 @@ -/**************************************************************************** - Copyright (c) 2010-2012 cocos2d-x.org - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011 Zynga Inc. - Copyright (c) 2013 Surith Thekkiam - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "testBasic.h" -#include "BaseTest.h" - - -class S9SpriteTestScene : public TestScene -{ -public: - virtual void runThisTest(); -}; - -class S9SpriteTestDemo : public BaseTest -{ -public: - virtual void onEnter() override; - - virtual void restartCallback(Ref* sender); - virtual void nextCallback(Ref* sender); - virtual void backCallback(Ref* sender); -}; - -// S9BatchNodeBasic - -class S9BatchNodeBasic : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9BatchNodeBasic); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - -// S9FrameNameSpriteSheet - -class S9FrameNameSpriteSheet : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9FrameNameSpriteSheet); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - -// S9FrameNameSpriteSheetRotated - -class S9FrameNameSpriteSheetRotated : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9FrameNameSpriteSheetRotated); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - -// S9BatchNodeScaledNoInsets - -class S9BatchNodeScaledNoInsets : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9BatchNodeScaledNoInsets); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - -// S9FrameNameSpriteSheetScaledNoInsets - -class S9FrameNameSpriteSheetScaledNoInsets : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9FrameNameSpriteSheetScaledNoInsets); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - -// S9FrameNameSpriteSheetRotatedScaledNoInsets - -class S9FrameNameSpriteSheetRotatedScaledNoInsets : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9FrameNameSpriteSheetRotatedScaledNoInsets); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - - -// S9BatchNodeScaleWithCapInsets - -class S9BatchNodeScaleWithCapInsets : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9BatchNodeScaleWithCapInsets); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - -// S9FrameNameSpriteSheetInsets - -class S9FrameNameSpriteSheetInsets : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9FrameNameSpriteSheetInsets); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - -// S9FrameNameSpriteSheetInsetsScaled - -class S9FrameNameSpriteSheetInsetsScaled : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9FrameNameSpriteSheetInsetsScaled); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - -// S9FrameNameSpriteSheetRotatedInsets - -class S9FrameNameSpriteSheetRotatedInsets : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9FrameNameSpriteSheetRotatedInsets); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - -// S9_TexturePacker - -class S9_TexturePacker : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9_TexturePacker); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - -// S9FrameNameSpriteSheetRotatedInsetsScaled - -class S9FrameNameSpriteSheetRotatedInsetsScaled : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9FrameNameSpriteSheetRotatedInsetsScaled); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - -// S9FrameNameSpriteSheetRotatedInsetsScaled - -class S9FrameNameSpriteSheetRotatedSetCapInsetLater : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9FrameNameSpriteSheetRotatedSetCapInsetLater); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - -// S9CascadeOpacityAndColor - -class S9CascadeOpacityAndColor : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9CascadeOpacityAndColor); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - -// Scale9Sprite ZOrder - -class S9ZOrder : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9ZOrder); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - -// Scale9Sprite Flip - -class S9Flip : public S9SpriteTestDemo -{ -public: - CREATE_FUNC(S9Flip); - - virtual void onEnter() override; - - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; From ffee7b27d43e93798607bd7a07c879b68ec4a91c Mon Sep 17 00:00:00 2001 From: andyque Date: Mon, 1 Sep 2014 17:43:40 +0800 Subject: [PATCH 16/45] fix linux and android compile error --- cocos/CMakeLists.txt | 3 -- cocos/ui/CMakeLists.txt | 50 ------------------- extensions/Android.mk | 9 ++-- .../GUI/CCControlExtension/CCControlButton.h | 2 +- tests/cpp-tests/Android.mk | 2 - 5 files changed, 5 insertions(+), 61 deletions(-) delete mode 100644 cocos/ui/CMakeLists.txt diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index c454b4f63a..ac588ab6a9 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -90,9 +90,6 @@ list(REMOVE_ITEM cocos2d_source_files "${CMAKE_CURRENT_SOURCE_DIR}/storage/local-storage/LocalStorageAndroid.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/base/CCEventController.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/base/CCEventListenerController.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/../extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/../extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/../extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/editor-support/cocostudio/proj.wp8/pch.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/../extensions/proj.wp8/pch.cpp") diff --git a/cocos/ui/CMakeLists.txt b/cocos/ui/CMakeLists.txt deleted file mode 100644 index 132f7c4635..0000000000 --- a/cocos/ui/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -set(COCOS_UI_SRC - CocosGUI.cpp - UIButton.cpp - UICheckBox.cpp - UIHBox.cpp - UIHelper.cpp - UIImageView.cpp - UILayout.cpp - UILayoutParameter.cpp - UILayoutManager.cpp - UIListView.cpp - UILoadingBar.cpp - UIPageView.cpp - UIRelativeBox.cpp - UIRichText.cpp - UIScrollView.cpp - UISlider.cpp - UITextAtlas.cpp - UITextBMFont.cpp - UIText.cpp - UITextField.cpp - UIVBox.cpp - UIWidget.cpp - UIDeprecated.cpp - UIScale9Sprite.cpp - UIEditBox/UIEditBox.cpp - UIEditBox/UIEditBoxImplAndroid.cpp - UIEditBox/UIEditBoxImplNone.cpp - UIEditBox/UIEditBoxImplWin.cpp -) - -include_directories( - ui - ../../base -) - - -add_library(ui STATIC - ${COCOS_UI_SRC} -) - -target_link_libraries(ui - cocos2d -) - -set_target_properties(ui - PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" -) diff --git a/extensions/Android.mk b/extensions/Android.mk index 89877aa54d..2603f2f3d2 100644 --- a/extensions/Android.mk +++ b/extensions/Android.mk @@ -18,11 +18,6 @@ GUI/CCControlExtension/CCControlStepper.cpp \ GUI/CCControlExtension/CCControlSwitch.cpp \ GUI/CCControlExtension/CCControlUtils.cpp \ GUI/CCControlExtension/CCInvocation.cpp \ -GUI/CCControlExtension/CCScale9Sprite.cpp \ -GUI/CCEditBox/CCEditBox.cpp \ -GUI/CCEditBox/CCEditBoxImplAndroid.cpp \ -GUI/CCEditBox/CCEditBoxImplNone.cpp \ -GUI/CCEditBox/CCEditBoxImplWin.cpp \ GUI/CCScrollView/CCScrollView.cpp \ GUI/CCScrollView/CCTableView.cpp \ GUI/CCScrollView/CCTableViewCell.cpp \ @@ -33,6 +28,10 @@ LOCAL_STATIC_LIBRARIES := cocos2dx_internal_static LOCAL_STATIC_LIBRARIES += cocos_curl_static LOCAL_STATIC_LIBRARIES += box2d_static +GU/CCEditBox/CCEditBox.cpp \ +GUI/CCEditBox/CCEditBoxImplAndroid.cpp \ +GUI/CCEditBox/CCEditBoxImplNone.cpp \ +GUI/CCEditBox/CCEditBoxImplWin.cpp \ LOCAL_CXXFLAGS += -fexceptions LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. \ diff --git a/extensions/GUI/CCControlExtension/CCControlButton.h b/extensions/GUI/CCControlExtension/CCControlButton.h index 2c58a59311..758c61d363 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.h +++ b/extensions/GUI/CCControlExtension/CCControlButton.h @@ -32,7 +32,7 @@ #include "CCControl.h" #include "CCInvocation.h" -#include "ExtensionDeprecated.h" +#include "extensions/ExtensionDeprecated.h" #include "base/CCMap.h" NS_CC_EXT_BEGIN diff --git a/tests/cpp-tests/Android.mk b/tests/cpp-tests/Android.mk index d09e7895e0..dba250329b 100644 --- a/tests/cpp-tests/Android.mk +++ b/tests/cpp-tests/Android.mk @@ -124,12 +124,10 @@ Classes/ExtensionsTest/ControlExtensionTest/CCControlPotentiometerTest/CCControl Classes/ExtensionsTest/ControlExtensionTest/CCControlSliderTest/CCControlSliderTest.cpp \ Classes/ExtensionsTest/ControlExtensionTest/CCControlStepperTest/CCControlStepperTest.cpp \ Classes/ExtensionsTest/ControlExtensionTest/CCControlSwitchTest/CCControlSwitchTest.cpp \ -Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp \ Classes/ExtensionsTest/NetworkTest/HttpClientTest.cpp \ Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp \ Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp \ Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp \ -Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp \ Classes/ExtensionsTest/TableViewTest/CustomTableViewCell.cpp \ Classes/ExtensionsTest/TableViewTest/TableViewTestScene.cpp \ Classes/FileUtilsTest/FileUtilsTest.cpp \ From e24192aeb2502656387b441c6635539f62b621a6 Mon Sep 17 00:00:00 2001 From: andyque Date: Mon, 1 Sep 2014 18:06:21 +0800 Subject: [PATCH 17/45] fix linux compile --- tests/cpp-tests/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index ec798974c6..d1ca2a1ee1 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -2,7 +2,6 @@ set(APP_NAME cpp-tests) if(WIN32) set(PLATFORM_SRC - Classes/ExtensionsTest/EditBoxTest/EditBoxTest.cpp Classes/ExtensionsTest/NetworkTest/WebSocketTest.cpp Classes/ExtensionsTest/NetworkTest/SocketIOTest.cpp proj.win32/main.cpp @@ -125,7 +124,6 @@ set(SAMPLE_SRC Classes/UITest/CocoStudioGUITest/CustomWidget/CustomReader.cpp Classes/UITest/CocoStudioGUITest/CustomTest/CustomImageTest/CustomImageTest.cpp Classes/UITest/CocoStudioGUITest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.cpp - Classes/ExtensionsTest/Scale9SpriteTest/Scale9SpriteTest.cpp Classes/NewRendererTest/NewRendererTest.cpp Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp Classes/FontTest/FontTest.cpp From fa33ab76fcd0f1409a5248cc67f5f60a8b6e760c Mon Sep 17 00:00:00 2001 From: andyque Date: Mon, 1 Sep 2014 18:23:45 +0800 Subject: [PATCH 18/45] remove UIEditBox test --- tests/cpp-tests/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/cpp-tests/CMakeLists.txt b/tests/cpp-tests/CMakeLists.txt index d1ca2a1ee1..815cfb7e43 100644 --- a/tests/cpp-tests/CMakeLists.txt +++ b/tests/cpp-tests/CMakeLists.txt @@ -81,7 +81,6 @@ set(SAMPLE_SRC Classes/UITest/CocoStudioGUITest/CustomGUIScene.cpp Classes/UITest/CocoStudioGUITest/UIScene.cpp Classes/UITest/CocoStudioGUITest/UIScale9SpriteTest.cpp - Classes/UITest/CocoStudioGUITest/UIEditBoxTest.cpp Classes/UITest/CocoStudioGUITest/UISceneManager.cpp Classes/UITest/CocoStudioGUITest/CocostudioParserTest/CocostudioParserJsonTest.cpp Classes/UITest/CocoStudioGUITest/CocostudioParserTest.cpp From 6dc45f86e41b1eb254c1b814a09d929fac1bc665 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 2 Sep 2014 10:05:22 +0800 Subject: [PATCH 19/45] fix windows compile error --- cocos/2d/libcocos2d.vcxproj | 16 +- cocos/2d/libcocos2d.vcxproj.filters | 198 +++++++++--------- tests/cpp-tests/proj.win32/cpp-tests.vcxproj | 4 - .../proj.win32/cpp-tests.vcxproj.filters | 18 -- 4 files changed, 103 insertions(+), 133 deletions(-) diff --git a/cocos/2d/libcocos2d.vcxproj b/cocos/2d/libcocos2d.vcxproj index 9fdc34eb21..69e5434274 100644 --- a/cocos/2d/libcocos2d.vcxproj +++ b/cocos/2d/libcocos2d.vcxproj @@ -192,15 +192,11 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\spine\prebuilt\release-l - - - - @@ -409,9 +405,12 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\spine\prebuilt\release-l + + + @@ -516,16 +515,11 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\spine\prebuilt\release-l - - - - - @@ -786,9 +780,13 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\spine\prebuilt\release-l + + + + diff --git a/cocos/2d/libcocos2d.vcxproj.filters b/cocos/2d/libcocos2d.vcxproj.filters index 1a5d9f9b25..d918da6cc1 100644 --- a/cocos/2d/libcocos2d.vcxproj.filters +++ b/cocos/2d/libcocos2d.vcxproj.filters @@ -76,15 +76,9 @@ {b27aba95-51a2-413c-8570-0aff9adf2b6b} - - {220cf2ee-61b0-40cf-a88a-8627e4e609f1} - {a1f539bc-d5be-4224-a4d2-01c0b6f17d6e} - - {dc45cd54-4576-4401-87b7-a276f91a45bd} - {1de7fce7-0dee-4571-8fcd-43eb617aaf8b} @@ -211,6 +205,12 @@ {8579ed15-b266-4f80-818d-a3a9251c4248} + + {89eb6312-dc7f-4fda-b9b2-ab67c31ddd55} + + + {118d80ca-ccf2-480c-b87d-25220af23440} + @@ -787,42 +787,6 @@ extension\AssetsManager - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - extension\GUI\CCScrollView @@ -832,15 +796,6 @@ extension\GUI\CCScrollView - - extension\GUI\CCEditBox - - - extension\GUI\CCEditBox - - - extension\GUI\CCEditBox - extension\physics_nodes @@ -1165,6 +1120,48 @@ cocosbuilder\Source Files + + ui\UIWidgets\EditBox + + + ui\UIWidgets\EditBox + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + ui\UIWidgets\EditBox + @@ -1825,45 +1822,6 @@ extension\AssetsManager - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - - - extension\GUI\CCControlExtension - extension\GUI\CCScrollView @@ -1873,18 +1831,6 @@ extension\GUI\CCScrollView - - extension\GUI\CCEditBox - - - extension\GUI\CCEditBox - - - extension\GUI\CCEditBox - - - extension\GUI\CCEditBox - extension\physics_nodes @@ -2290,6 +2236,54 @@ cocosbuilder\Header Files + + ui\UIWidgets\EditBox + + + ui\UIWidgets\EditBox + + + ui\UIWidgets\EditBox + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + extension\GUI\CCControlExtensions + + + ui\UIWidgets\EditBox + diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj index ed6a45c59c..8667753fd4 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj @@ -161,11 +161,9 @@ - - @@ -350,11 +348,9 @@ - - diff --git a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters index 7d7fc6199c..f0e771d566 100644 --- a/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters +++ b/tests/cpp-tests/proj.win32/cpp-tests.vcxproj.filters @@ -202,9 +202,6 @@ {a4c2111f-cf9f-492c-884d-3de24715adce} - - {18a69e7e-8ca7-475a-bfbb-7296baab16ce} - {0ef55f53-411a-4661-b5d5-13930da52e68} @@ -220,9 +217,6 @@ {81ec2355-7efd-49e0-b6cb-b1bba23fbbc8} - - {3d73aa04-d66e-43d3-921f-b867a753c113} - {a6e7d28e-46a3-46c4-9735-b39e96f776f0} @@ -594,9 +588,6 @@ Classes\FileUtilsTest - - Classes\ExtensionsTest\EditBoxTest - Classes\ExtensionsTest\CocosBuilderTest\TimelineCallbackTest @@ -618,9 +609,6 @@ Classes - - Classes\ExtensionsTest\Scale9SpriteTest - Classes\ExtensionsTest\NetworkTest @@ -1310,9 +1298,6 @@ Classes\FileUtilsTest - - Classes\ExtensionsTest\EditBoxTest - Classes\ExtensionsTest\CocosBuilderTest\TimelineCallbackTest @@ -1337,9 +1322,6 @@ Classes - - Classes\ExtensionsTest\Scale9SpriteTest - Classes\ExtensionsTest\NetworkTest From 2deeee2109b535d0203153e659dc80afe5594204 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 2 Sep 2014 01:11:50 -0700 Subject: [PATCH 20/45] remove extension luabindings --- tools/tolua/cocos2dx_extension.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/tolua/cocos2dx_extension.ini b/tools/tolua/cocos2dx_extension.ini index 03e0829edb..3b474c792f 100644 --- a/tools/tolua/cocos2dx_extension.ini +++ b/tools/tolua/cocos2dx_extension.ini @@ -27,7 +27,7 @@ headers = %(cocosdir)s/extensions/cocos-ext.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = AssetsManager.* Scale9Sprite Control.* ControlButton.* EditBox$ ScrollView$ TableView$ TableViewCell$ +classes = AssetsManager.* Control.* ControlButton.* ScrollView$ TableView$ TableViewCell$ # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -39,7 +39,6 @@ classes = AssetsManager.* Scale9Sprite Control.* ControlButton.* EditBox$ Scroll skip = .*Delegate::[*], .*Loader.*::[*], *::[^visit$ copyWith.* onEnter.* onExit.* ^description$ getObjectType (g|s)etDelegate .*HSV], - EditBox::[(g|s)etDelegate ^keyboard.* touchDownAction getScriptEditBoxHandler registerScriptEditBoxHandler unregisterScriptEditBoxHandler], AssetsManager::[(g|s)etDelegate], AssetsManagerDelegateProtocol::[*], Control::[removeHandleOfControlEvent addHandleOfControlEvent], From a0c28e49ac592adf223a68a7dec467fd7361a956 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 2 Sep 2014 16:14:07 +0800 Subject: [PATCH 21/45] remove exteion edtibox --- extensions/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt index b3c609beb5..427452a0b0 100644 --- a/extensions/CMakeLists.txt +++ b/extensions/CMakeLists.txt @@ -11,11 +11,6 @@ set(EXTENSIONS_SRC GUI/CCControlExtension/CCControlSwitch.cpp GUI/CCControlExtension/CCControlUtils.cpp GUI/CCControlExtension/CCInvocation.cpp - GUI/CCControlExtension/CCScale9Sprite.cpp - GUI/CCEditBox/CCEditBox.cpp - GUI/CCEditBox/CCEditBoxImplAndroid.cpp - GUI/CCEditBox/CCEditBoxImplNone.cpp - GUI/CCEditBox/CCEditBoxImplWin.cpp GUI/CCScrollView/CCScrollView.cpp GUI/CCScrollView/CCTableView.cpp GUI/CCScrollView/CCTableViewCell.cpp From 5d935c2cea945ffae666255f735e28a7da251437 Mon Sep 17 00:00:00 2001 From: lite3 Date: Tue, 2 Sep 2014 16:16:36 +0800 Subject: [PATCH 22/45] fix compile error on android --- cocos/scripting/lua-bindings/proj.android/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/scripting/lua-bindings/proj.android/Android.mk b/cocos/scripting/lua-bindings/proj.android/Android.mk index c61e2b6ae3..cee7f1fd53 100644 --- a/cocos/scripting/lua-bindings/proj.android/Android.mk +++ b/cocos/scripting/lua-bindings/proj.android/Android.mk @@ -66,6 +66,7 @@ LOCAL_SRC_FILES += ../manual/cocosbuilder/lua_cocos2dx_cocosbuilder_manual.cpp \ #cocostudio LOCAL_SRC_FILES += ../manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp \ + ../manual/cocostudio/CustomGUIReader.cpp \ ../auto/lua_cocos2dx_studio_auto.cpp #spine From 51e160beffc08d16ef56c35c7b402232291605b8 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 2 Sep 2014 17:37:55 +0800 Subject: [PATCH 23/45] fix EditBox lua compile error --- cocos/ui/UIEditBox/UIEditBox.cpp | 9 +++++---- cocos/ui/UIEditBox/UIEditBox.h | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cocos/ui/UIEditBox/UIEditBox.cpp b/cocos/ui/UIEditBox/UIEditBox.cpp index b5eed33b68..27e4ccc95b 100644 --- a/cocos/ui/UIEditBox/UIEditBox.cpp +++ b/cocos/ui/UIEditBox/UIEditBox.cpp @@ -68,12 +68,12 @@ void EditBox::touchDownAction(Ref *sender, TouchEventType controlEvent) } EditBox* EditBox::create(const Size& size, - const std::string& pNormal9SpriteBg, + const std::string& normalSprite, TextureResType texType /*= TextureResType::LOCAL*/) { EditBox* pRet = new EditBox(); - if (pRet != nullptr && pRet->initWithSizeAndBackgroundSprite(size, pNormal9SpriteBg, texType)) + if (pRet != nullptr && pRet->initWithSizeAndBackgroundSprite(size, normalSprite, texType)) { pRet->autorelease(); } @@ -85,11 +85,12 @@ EditBox* EditBox::create(const Size& size, return pRet; } -EditBox* EditBox::create(const cocos2d::Size &size, cocos2d::ui::Scale9Sprite *pNormal9SpriteBg) + +EditBox* EditBox::create(const cocos2d::Size &size, cocos2d::ui::Scale9Sprite *normalSprite, ui::Scale9Sprite *pressedSprite, Scale9Sprite* disabledSprite) { EditBox* pRet = new (std::nothrow) EditBox(); - if (pRet != nullptr && pRet->initWithSizeAndBackgroundSprite(size, pNormal9SpriteBg)) + if (pRet != nullptr && pRet->initWithSizeAndBackgroundSprite(size, normalSprite)) { pRet->autorelease(); } diff --git a/cocos/ui/UIEditBox/UIEditBox.h b/cocos/ui/UIEditBox/UIEditBox.h index 61bbeab965..72af4a2627 100644 --- a/cocos/ui/UIEditBox/UIEditBox.h +++ b/cocos/ui/UIEditBox/UIEditBox.h @@ -190,7 +190,10 @@ namespace ui { * @return An autorelease pointer of EditBox, you don't need to release it only if you retain it again. */ static EditBox* create(const Size& size, - Scale9Sprite* pNormal9SpriteBg); + Scale9Sprite* normalSprite, + Scale9Sprite* pressedSprite = nullptr, + Scale9Sprite* disabledSprite = nullptr); + /** * create a edit box with size. From a429959e65b90b32a92eee85bd3195942ac30e83 Mon Sep 17 00:00:00 2001 From: andyque Date: Tue, 2 Sep 2014 01:31:02 -0700 Subject: [PATCH 24/45] fix lua compile error --- .../manual/extension/lua_cocos2dx_extension_manual.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.cpp b/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.cpp index b2f2e1c8a8..80498ab073 100644 --- a/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/extension/lua_cocos2dx_extension_manual.cpp @@ -1045,7 +1045,7 @@ static void extendTableView(lua_State* L) int register_all_cocos2dx_extension_manual(lua_State* tolua_S) { extendControl(tolua_S); - extendEditBox(tolua_S); + /* extendEditBox(tolua_S); */ extendAssetsManager(tolua_S); extendScrollView(tolua_S); extendTableView(tolua_S); From 27f771744a9237defb1d5f54a56f12ded8bc8a5c Mon Sep 17 00:00:00 2001 From: lvlong Date: Tue, 2 Sep 2014 17:33:22 +0800 Subject: [PATCH 25/45] static model load problem of old version . --- cocos/3d/CCBundle3D.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cocos/3d/CCBundle3D.cpp b/cocos/3d/CCBundle3D.cpp index c28351046b..6a2a74efd2 100644 --- a/cocos/3d/CCBundle3D.cpp +++ b/cocos/3d/CCBundle3D.cpp @@ -760,7 +760,17 @@ bool Bundle3D::loadNodes(NodeDatas& nodedatas) if (_version == "0.1" || _version == "1.2" || _version == "0.2") { SkinData skinData; - loadSkinData("", &skinData); + if (!loadSkinData("", &skinData)) + { + auto node= new (std::nothrow) NodeData(); + auto modelnode = new (std::nothrow) ModelData(); + modelnode->matrialId = ""; + modelnode->subMeshId = ""; + node->modelNodeDatas.push_back(modelnode); + nodedatas.nodes.push_back(node); + return true; + } + auto nodeDatas = new (std::nothrow) NodeData*[skinData.skinBoneNames.size() + skinData.nodeBoneNames.size()]; int index = 0; size_t i; From 6ff1289aed659b6665f8739d9a28932f58915c88 Mon Sep 17 00:00:00 2001 From: lite3 Date: Tue, 2 Sep 2014 20:26:21 +0800 Subject: [PATCH 26/45] fix compile error on Xcode --- .../cocos2d_lua_bindings.xcodeproj/project.pbxproj | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj index 36cecee16a..260b98b268 100644 --- a/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj +++ b/cocos/scripting/lua-bindings/proj.ios_mac/cocos2d_lua_bindings.xcodeproj/project.pbxproj @@ -236,6 +236,10 @@ 15EFA64E198B3342000C57D3 /* lua.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ABCA1E718CD8F470087CE3A /* lua.h */; }; 15EFA64F198B3342000C57D3 /* luaconf.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ABCA1E818CD8F470087CE3A /* luaconf.h */; }; 15EFA650198B3342000C57D3 /* lualib.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ABCA1E918CD8F470087CE3A /* lualib.h */; }; + 566F015F19B5EB0F00FCA620 /* CustomGUIReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 566F015D19B5EB0F00FCA620 /* CustomGUIReader.cpp */; }; + 566F016019B5EB0F00FCA620 /* CustomGUIReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 566F015D19B5EB0F00FCA620 /* CustomGUIReader.cpp */; }; + 566F016119B5EB0F00FCA620 /* CustomGUIReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 566F015E19B5EB0F00FCA620 /* CustomGUIReader.h */; }; + 566F016219B5EB0F00FCA620 /* CustomGUIReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 566F015E19B5EB0F00FCA620 /* CustomGUIReader.h */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -364,6 +368,8 @@ 1ABCA1FF18CD8F6E0087CE3A /* tolua++.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "tolua++.h"; path = "../../../../external/lua/tolua/tolua++.h"; sourceTree = ""; }; 2905FACE18CF12E600240AA3 /* lua_cocos2dx_ui_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lua_cocos2dx_ui_auto.cpp; sourceTree = ""; }; 2905FACF18CF12E600240AA3 /* lua_cocos2dx_ui_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = lua_cocos2dx_ui_auto.hpp; sourceTree = ""; }; + 566F015D19B5EB0F00FCA620 /* CustomGUIReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomGUIReader.cpp; sourceTree = ""; }; + 566F015E19B5EB0F00FCA620 /* CustomGUIReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomGUIReader.h; sourceTree = ""; }; C0D9BAFA1974D30000EC35BB /* liblua.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblua.a; path = ../../../../external/lua/lua/prebuilt/ios/liblua.a; sourceTree = ""; }; /* End PBXFileReference section */ @@ -507,6 +513,8 @@ 15EFA400198B2AB2000C57D3 /* cocostudio */ = { isa = PBXGroup; children = ( + 566F015D19B5EB0F00FCA620 /* CustomGUIReader.cpp */, + 566F015E19B5EB0F00FCA620 /* CustomGUIReader.h */, 15EFA401198B2AB2000C57D3 /* lua_cocos2dx_coco_studio_manual.cpp */, 15EFA402198B2AB2000C57D3 /* lua_cocos2dx_coco_studio_manual.hpp */, ); @@ -738,6 +746,7 @@ 15C1C2EE19874CBE00A46ACC /* tolua_fix.h in Headers */, 155C7E2019A71CCC00F08B25 /* LuaSkeletonAnimation.h in Headers */, 15415AB719A71A53004F1E71 /* io.h in Headers */, + 566F016119B5EB0F00FCA620 /* CustomGUIReader.h in Headers */, 15C1C2DC19874B4400A46ACC /* xxtea.h in Headers */, 15415AD319A71A53004F1E71 /* timeout.h in Headers */, 15C1C2D5198749BC00A46ACC /* LuaOpengl.h in Headers */, @@ -798,6 +807,7 @@ 15EFA642198B32BB000C57D3 /* tolua_fix.h in Headers */, 155C7E2119A71CCE00F08B25 /* LuaSkeletonAnimation.h in Headers */, 15415AB819A71A53004F1E71 /* io.h in Headers */, + 566F016219B5EB0F00FCA620 /* CustomGUIReader.h in Headers */, 15EFA62B198B3220000C57D3 /* LuaOpengl.h in Headers */, 15415AD419A71A53004F1E71 /* timeout.h in Headers */, 15EFA62C198B3220000C57D3 /* lua_cocos2dx_deprecated.h in Headers */, @@ -928,6 +938,7 @@ 155C7E1E19A71CC700F08B25 /* LuaSkeletonAnimation.cpp in Sources */, 15415AB519A71A53004F1E71 /* io.c in Sources */, 15C1C2CE1987498B00A46ACC /* LuaOpengl.cpp in Sources */, + 566F015F19B5EB0F00FCA620 /* CustomGUIReader.cpp in Sources */, 15415AC119A71A53004F1E71 /* options.c in Sources */, 155C7E0A19A71C8B00F08B25 /* lua_cocos2dx_network_manual.cpp in Sources */, 15415AD119A71A53004F1E71 /* timeout.c in Sources */, @@ -995,6 +1006,7 @@ 155C7E1F19A71CC800F08B25 /* LuaSkeletonAnimation.cpp in Sources */, 15415ACA19A71A53004F1E71 /* serial.c in Sources */, 155C7DEA19A71BDA00F08B25 /* lua_cocos2dx_3d_auto.cpp in Sources */, + 566F016019B5EB0F00FCA620 /* CustomGUIReader.cpp in Sources */, 155C7DF119A71C2300F08B25 /* lua_cocos2dx_studio_auto.cpp in Sources */, 155C7E0B19A71C8D00F08B25 /* lua_cocos2dx_network_manual.cpp in Sources */, 15415AAE19A71A53004F1E71 /* except.c in Sources */, From fab9a0052bd85d62b06d05aa6d1ebb6c45ee6dc4 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 6 Aug 2014 14:38:58 +0800 Subject: [PATCH 27/45] fix normalizedPosition bug --- cocos/2d/CCNode.cpp | 22 ++++++++++++------- cocos/2d/CCNode.h | 1 + tests/cpp-tests/Classes/NodeTest/NodeTest.cpp | 6 ++++- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/cocos/2d/CCNode.cpp b/cocos/2d/CCNode.cpp index cbd4b97f31..d13cd07bc6 100644 --- a/cocos/2d/CCNode.cpp +++ b/cocos/2d/CCNode.cpp @@ -126,6 +126,7 @@ Node::Node(void) , _cascadeColorEnabled(false) , _cascadeOpacityEnabled(false) , _usingNormalizedPosition(false) +, _normalizedPositionDirty(false) , _name("") , _hashOfName(0) , _cameraMask(1) @@ -613,6 +614,7 @@ void Node::setNormalizedPosition(const Vec2& position) _normalizedPosition = position; _usingNormalizedPosition = true; + _normalizedPositionDirty = true; _transformUpdated = _transformDirty = _inverseDirty = true; } @@ -1210,17 +1212,21 @@ void Node::visit() uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFlags) { + if(_usingNormalizedPosition) { + CCASSERT(_parent, "setNormalizedPosition() doesn't work with orphan nodes"); + if ((parentFlags & FLAGS_CONTENT_SIZE_DIRTY) || _normalizedPositionDirty) { + auto s = _parent->getContentSize(); + _position.x = _normalizedPosition.x * s.width; + _position.y = _normalizedPosition.y * s.height; + _transformUpdated = _transformDirty = _inverseDirty = true; + _normalizedPositionDirty = false; + } + } + uint32_t flags = parentFlags; flags |= (_transformUpdated ? FLAGS_TRANSFORM_DIRTY : 0); flags |= (_contentSizeDirty ? FLAGS_CONTENT_SIZE_DIRTY : 0); - - if(_usingNormalizedPosition && (flags & FLAGS_CONTENT_SIZE_DIRTY)) { - CCASSERT(_parent, "setNormalizedPosition() doesn't work with orphan nodes"); - auto s = _parent->getContentSize(); - _position.x = _normalizedPosition.x * s.width; - _position.y = _normalizedPosition.y * s.height; - _transformUpdated = _transformDirty = _inverseDirty = true; - } + if(flags & FLAGS_DIRTY_MASK) _modelViewTransform = this->transform(parentTransform); diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 8f24f2d09d..96ab1118ee 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -1555,6 +1555,7 @@ protected: float _positionZ; ///< OpenGL real Z position Vec2 _normalizedPosition; bool _usingNormalizedPosition; + bool _normalizedPositionDirty; float _skewX; ///< skew angle on x-axis float _skewY; ///< skew angle on y-axis diff --git a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp index dc4bad49dd..56db085fbe 100644 --- a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp +++ b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp @@ -1198,6 +1198,7 @@ NodeNormalizedPositionTest2::NodeNormalizedPositionTest2() sprites[i] = Sprite::create("Images/grossini.png"); sprites[i]->setNormalizedPosition(positions[i]); addChild(sprites[i]); + sprites[i]->setTag(2); } scheduleUpdate(); @@ -1227,7 +1228,10 @@ void NodeNormalizedPositionTest2::update(float dt) Size s = Size(_copyContentSize.width*norm, _copyContentSize.height*norm); setContentSize(s); - + if (norm > 0.5) { + auto node = this->getChildByTag(2); + node->setNormalizedPosition(Vec2(0.2,0.2)); + } CCLOG("s: %f,%f", s.width, s.height); } From a79d35d08bc15236088919b1532ee8ace4e13515 Mon Sep 17 00:00:00 2001 From: andyque Date: Mon, 1 Sep 2014 11:16:27 +0800 Subject: [PATCH 28/45] remove NodeNormalizedPositionTest --- tests/cpp-tests/Classes/NodeTest/NodeTest.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp index 56db085fbe..6c43181c68 100644 --- a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp +++ b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp @@ -1198,7 +1198,6 @@ NodeNormalizedPositionTest2::NodeNormalizedPositionTest2() sprites[i] = Sprite::create("Images/grossini.png"); sprites[i]->setNormalizedPosition(positions[i]); addChild(sprites[i]); - sprites[i]->setTag(2); } scheduleUpdate(); @@ -1228,10 +1227,6 @@ void NodeNormalizedPositionTest2::update(float dt) Size s = Size(_copyContentSize.width*norm, _copyContentSize.height*norm); setContentSize(s); - if (norm > 0.5) { - auto node = this->getChildByTag(2); - node->setNormalizedPosition(Vec2(0.2,0.2)); - } CCLOG("s: %f,%f", s.width, s.height); } From b00a7b3b386df5eead328d279329dd9e16243cd5 Mon Sep 17 00:00:00 2001 From: andyque Date: Mon, 1 Sep 2014 11:29:40 +0800 Subject: [PATCH 29/45] add Node normalizedPosition bug test --- tests/cpp-tests/Classes/NodeTest/NodeTest.cpp | 40 +++++++++++++++++++ tests/cpp-tests/Classes/NodeTest/NodeTest.h | 15 +++++++ 2 files changed, 55 insertions(+) diff --git a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp index 6c43181c68..2790a989f5 100644 --- a/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp +++ b/tests/cpp-tests/Classes/NodeTest/NodeTest.cpp @@ -73,6 +73,7 @@ static std::function createFunctions[] = CL(NodeGlobalZValueTest), CL(NodeNormalizedPositionTest1), CL(NodeNormalizedPositionTest2), + CL(NodeNormalizedPositionBugTest), CL(NodeNameTest), }; @@ -1231,6 +1232,45 @@ void NodeNormalizedPositionTest2::update(float dt) } +//------------------------------------------------------------------ +// +// NodeNormalizedPositionBugTest +// +//------------------------------------------------------------------ +NodeNormalizedPositionBugTest::NodeNormalizedPositionBugTest() +: _accum(0) +{ + Vec2 position; + + position = Vec2(0.5,0.5); + + + sprite = Sprite::create("Images/grossini.png"); + sprite->setNormalizedPosition(position); + addChild(sprite); + + scheduleUpdate(); +} + +std::string NodeNormalizedPositionBugTest::title() const +{ + return "NodeNormalizedPositionBugTest"; +} + +std::string NodeNormalizedPositionBugTest::subtitle() const +{ + return "When changing sprite normalizedPosition, the sprite doesn't move!"; +} + +void NodeNormalizedPositionBugTest::update(float dt) +{ + _accum += dt; + + // for 5 seconds + float norm = clampf(sinf(_accum), 0, 1.0); + sprite->setNormalizedPosition(Vec2(norm,norm)); +} + std::string NodeNameTest::title() const { return "getName()/setName()/getChildByName()/enumerateChildren()"; diff --git a/tests/cpp-tests/Classes/NodeTest/NodeTest.h b/tests/cpp-tests/Classes/NodeTest/NodeTest.h index 068bdb7cfd..a7ab77894b 100644 --- a/tests/cpp-tests/Classes/NodeTest/NodeTest.h +++ b/tests/cpp-tests/Classes/NodeTest/NodeTest.h @@ -295,6 +295,21 @@ protected: float _accum; }; +class NodeNormalizedPositionBugTest : public TestCocosNodeDemo +{ +public: + CREATE_FUNC(NodeNormalizedPositionBugTest); + virtual std::string title() const override; + virtual std::string subtitle() const override; + +protected: + NodeNormalizedPositionBugTest(); + + void update(float dt); + float _accum; + Sprite *sprite; +}; + class NodeNameTest : public TestCocosNodeDemo { public: From 2dea7c3a18d2db122d178cf0d12af2b91acf7ba3 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 3 Sep 2014 03:26:30 +0000 Subject: [PATCH 30/45] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 36 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 25d6d414cb..2bd52dde25 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -997,6 +997,20 @@ "cocos/ui/UICheckBox.h", "cocos/ui/UIDeprecated.cpp", "cocos/ui/UIDeprecated.h", + "cocos/ui/UIEditBox/UIEditBox.cpp", + "cocos/ui/UIEditBox/UIEditBox.h", + "cocos/ui/UIEditBox/UIEditBoxImpl.h", + "cocos/ui/UIEditBox/UIEditBoxImplAndroid.cpp", + "cocos/ui/UIEditBox/UIEditBoxImplAndroid.h", + "cocos/ui/UIEditBox/UIEditBoxImplIOS.h", + "cocos/ui/UIEditBox/UIEditBoxImplIOS.mm", + "cocos/ui/UIEditBox/UIEditBoxImplMac.h", + "cocos/ui/UIEditBox/UIEditBoxImplMac.mm", + "cocos/ui/UIEditBox/UIEditBoxImplNone.cpp", + "cocos/ui/UIEditBox/UIEditBoxImplWin.cpp", + "cocos/ui/UIEditBox/UIEditBoxImplWin.h", + "cocos/ui/UIEditBox/UIEditBoxImplWp8.cpp", + "cocos/ui/UIEditBox/UIEditBoxImplWp8.h", "cocos/ui/UIHBox.cpp", "cocos/ui/UIHBox.h", "cocos/ui/UIHelper.cpp", @@ -1048,6 +1062,10 @@ "cocos/ui/UIWebViewImpl_iOS.mm", "cocos/ui/UIWidget.cpp", "cocos/ui/UIWidget.h", + "cocos/ui/proj.win32/Win32InputBox.cpp", + "cocos/ui/proj.win32/Win32InputBox.h", + "cocos/ui/proj.win32/libui.vcxproj", + "cocos/ui/proj.win32/libui.vcxproj.filters", "cocos/ui/proj.wp8/libGUI.vcxproj", "cocos/ui/proj.wp8/libGUI.vcxproj.filters", "docs/CODING_STYLE.md", @@ -1059,6 +1077,8 @@ "download-deps.py", "extensions/Android.mk", "extensions/CMakeLists.txt", + "extensions/ExtensionDeprecated.cpp", + "extensions/ExtensionDeprecated.h", "extensions/ExtensionExport.h", "extensions/ExtensionMacros.h", "extensions/GUI/CCControlExtension/CCControl.cpp", @@ -1084,22 +1104,6 @@ "extensions/GUI/CCControlExtension/CCControlUtils.h", "extensions/GUI/CCControlExtension/CCInvocation.cpp", "extensions/GUI/CCControlExtension/CCInvocation.h", - "extensions/GUI/CCControlExtension/CCScale9Sprite.cpp", - "extensions/GUI/CCControlExtension/CCScale9Sprite.h", - "extensions/GUI/CCEditBox/CCEditBox.cpp", - "extensions/GUI/CCEditBox/CCEditBox.h", - "extensions/GUI/CCEditBox/CCEditBoxImpl.h", - "extensions/GUI/CCEditBox/CCEditBoxImplAndroid.cpp", - "extensions/GUI/CCEditBox/CCEditBoxImplAndroid.h", - "extensions/GUI/CCEditBox/CCEditBoxImplIOS.h", - "extensions/GUI/CCEditBox/CCEditBoxImplIOS.mm", - "extensions/GUI/CCEditBox/CCEditBoxImplMac.h", - "extensions/GUI/CCEditBox/CCEditBoxImplMac.mm", - "extensions/GUI/CCEditBox/CCEditBoxImplNone.cpp", - "extensions/GUI/CCEditBox/CCEditBoxImplWin.cpp", - "extensions/GUI/CCEditBox/CCEditBoxImplWin.h", - "extensions/GUI/CCEditBox/CCEditBoxImplWp8.cpp", - "extensions/GUI/CCEditBox/CCEditBoxImplWp8.h", "extensions/GUI/CCScrollView/CCScrollView.cpp", "extensions/GUI/CCScrollView/CCScrollView.h", "extensions/GUI/CCScrollView/CCTableView.cpp", From 8fd8ba97db837d8e35288084378ac3a3a5433a00 Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 3 Sep 2014 11:27:45 +0800 Subject: [PATCH 31/45] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 78a3a19328..bfe066429f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ cocos2d-x-3.3?? ?? [NEW] Node: added stopAllActionsByTag() [NEW] UI: added `WebView` on iOS and Android + [FIX] EditBox: moved to ui:EditBox [FIX] Node: create unneeded temple `Vec2` object in `setPosition(int, int)`, `setPositionX()` and `setPositionY()` [FIX] Node: skew effect is wrong [FIX] TextureAtlas: may crash if only drawing part of it From ffb36d577eeac703ff3e726595d0f6253f0c7a1a Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 3 Sep 2014 03:29:43 +0000 Subject: [PATCH 32/45] [AUTO]: updating luabinding automatically --- .../lua-bindings/auto/api/ControlButton.lua | 12 +- .../lua-bindings/auto/api/EditBox.lua | 182 -- .../api/lua_cocos2dx_extension_auto_api.lua | 10 - .../auto/lua_cocos2dx_extension_auto.cpp | 2343 +---------------- .../auto/lua_cocos2dx_extension_auto.hpp | 47 - 5 files changed, 21 insertions(+), 2573 deletions(-) delete mode 100644 cocos/scripting/lua-bindings/auto/api/EditBox.lua diff --git a/cocos/scripting/lua-bindings/auto/api/ControlButton.lua b/cocos/scripting/lua-bindings/auto/api/ControlButton.lua index 1d965170ff..5d757d9b16 100644 --- a/cocos/scripting/lua-bindings/auto/api/ControlButton.lua +++ b/cocos/scripting/lua-bindings/auto/api/ControlButton.lua @@ -122,7 +122,7 @@ -- @function [parent=#ControlButton] getBackgroundSpriteForState -- @param self -- @param #int state --- @return Scale9Sprite#Scale9Sprite ret (return value: cc.Scale9Sprite) +-- @return Scale9Sprite#Scale9Sprite ret (return value: ccui.Scale9Sprite) -------------------------------- -- @@ -159,7 +159,7 @@ -- -- @function [parent=#ControlButton] getBackgroundSprite -- @param self --- @return Scale9Sprite#Scale9Sprite ret (return value: cc.Scale9Sprite) +-- @return Scale9Sprite#Scale9Sprite ret (return value: ccui.Scale9Sprite) -------------------------------- -- Returns the title color used for a state.
@@ -205,7 +205,7 @@ -- in "CCControlState". -- @function [parent=#ControlButton] setBackgroundSpriteForState -- @param self --- @param #cc.Scale9Sprite sprite +-- @param #ccui.Scale9Sprite sprite -- @param #int state -------------------------------- @@ -218,7 +218,7 @@ -- -- @function [parent=#ControlButton] setBackgroundSprite -- @param self --- @param #cc.Scale9Sprite var +-- @param #ccui.Scale9Sprite var -------------------------------- -- @@ -288,9 +288,9 @@ -- @return string#string ret (return value: string) -------------------------------- --- @overload self, cc.Scale9Sprite +-- @overload self, ccui.Scale9Sprite -- @overload self --- @overload self, cc.Node, cc.Scale9Sprite +-- @overload self, cc.Node, ccui.Scale9Sprite -- @overload self, string, string, float -- @function [parent=#ControlButton] create -- @param self diff --git a/cocos/scripting/lua-bindings/auto/api/EditBox.lua b/cocos/scripting/lua-bindings/auto/api/EditBox.lua deleted file mode 100644 index 7aae0b17ee..0000000000 --- a/cocos/scripting/lua-bindings/auto/api/EditBox.lua +++ /dev/null @@ -1,182 +0,0 @@ - --------------------------------- --- @module EditBox --- @extend ControlButton,IMEDelegate --- @parent_module cc - --------------------------------- --- Get the text entered in the edit box.
--- return The text entered in the edit box. --- @function [parent=#EditBox] getText --- @param self --- @return char#char ret (return value: char) - --------------------------------- --- Set the placeholder's font name.
--- param pFontName The font name. --- @function [parent=#EditBox] setPlaceholderFontName --- @param self --- @param #char pFontName - --------------------------------- --- Get a text in the edit box that acts as a placeholder when an
--- edit box is empty. --- @function [parent=#EditBox] getPlaceHolder --- @param self --- @return char#char ret (return value: char) - --------------------------------- --- Set the font name.
--- param pFontName The font name. --- @function [parent=#EditBox] setFontName --- @param self --- @param #char pFontName - --------------------------------- --- Set the placeholder's font size.
--- param fontSize The font size. --- @function [parent=#EditBox] setPlaceholderFontSize --- @param self --- @param #int fontSize - --------------------------------- --- Set the input mode of the edit box.
--- param inputMode One of the EditBox::InputMode constants. --- @function [parent=#EditBox] setInputMode --- @param self --- @param #int inputMode - --------------------------------- --- Set the font color of the placeholder text when the edit box is empty.
--- Not supported on IOS. --- @function [parent=#EditBox] setPlaceholderFontColor --- @param self --- @param #color3b_table color - --------------------------------- --- Set the font color of the widget's text. --- @function [parent=#EditBox] setFontColor --- @param self --- @param #color3b_table color - --------------------------------- --- Set the placeholder's font.
--- param pFontName The font name.
--- param fontSize The font size. --- @function [parent=#EditBox] setPlaceholderFont --- @param self --- @param #char pFontName --- @param #int fontSize - --------------------------------- --- Set the font size.
--- param fontSize The font size. --- @function [parent=#EditBox] setFontSize --- @param self --- @param #int fontSize - --------------------------------- --- Init edit box with specified size. This method should be invoked right after constructor.
--- param size The size of edit box. --- @function [parent=#EditBox] initWithSizeAndBackgroundSprite --- @param self --- @param #size_table size --- @param #cc.Scale9Sprite pNormal9SpriteBg --- @return bool#bool ret (return value: bool) - --------------------------------- --- Set a text in the edit box that acts as a placeholder when an
--- edit box is empty.
--- param pText The given text. --- @function [parent=#EditBox] setPlaceHolder --- @param self --- @param #char pText - --------------------------------- --- Set the return type that are to be applied to the edit box.
--- param returnType One of the EditBox::KeyboardReturnType constants. --- @function [parent=#EditBox] setReturnType --- @param self --- @param #int returnType - --------------------------------- --- Set the input flags that are to be applied to the edit box.
--- param inputFlag One of the EditBox::InputFlag constants. --- @function [parent=#EditBox] setInputFlag --- @param self --- @param #int inputFlag - --------------------------------- --- Gets the maximum input length of the edit box.
--- return Maximum input length. --- @function [parent=#EditBox] getMaxLength --- @param self --- @return int#int ret (return value: int) - --------------------------------- --- Set the text entered in the edit box.
--- param pText The given text. --- @function [parent=#EditBox] setText --- @param self --- @param #char pText - --------------------------------- --- Sets the maximum input length of the edit box.
--- Setting this value enables multiline input mode by default.
--- Available on Android, iOS and Windows Phone.
--- param maxLength The maximum length. --- @function [parent=#EditBox] setMaxLength --- @param self --- @param #int maxLength - --------------------------------- --- Set the font.
--- param pFontName The font name.
--- param fontSize The font size. --- @function [parent=#EditBox] setFont --- @param self --- @param #char pFontName --- @param #int fontSize - --------------------------------- --- create a edit box with size.
--- return An autorelease pointer of EditBox, you don't need to release it only if you retain it again. --- @function [parent=#EditBox] create --- @param self --- @param #size_table size --- @param #cc.Scale9Sprite pNormal9SpriteBg --- @param #cc.Scale9Sprite pPressed9SpriteBg --- @param #cc.Scale9Sprite pDisabled9SpriteBg --- @return EditBox#EditBox ret (return value: cc.EditBox) - --------------------------------- --- --- @function [parent=#EditBox] setAnchorPoint --- @param self --- @param #vec2_table anchorPoint - --------------------------------- --- --- @function [parent=#EditBox] setPosition --- @param self --- @param #vec2_table pos - --------------------------------- --- --- @function [parent=#EditBox] setVisible --- @param self --- @param #bool visible - --------------------------------- --- --- @function [parent=#EditBox] setContentSize --- @param self --- @param #size_table size - --------------------------------- --- Constructor.
--- js ctor --- @function [parent=#EditBox] EditBox --- @param self - -return nil diff --git a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_extension_auto_api.lua b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_extension_auto_api.lua index 6798a0b06d..99a0edbd12 100644 --- a/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_extension_auto_api.lua +++ b/cocos/scripting/lua-bindings/auto/api/lua_cocos2dx_extension_auto_api.lua @@ -1,11 +1,6 @@ -------------------------------- -- @module cc --------------------------------------------------------- --- the cc Scale9Sprite --- @field [parent=#cc] Scale9Sprite#Scale9Sprite Scale9Sprite preloaded module - - -------------------------------------------------------- -- the cc Control -- @field [parent=#cc] Control#Control Control preloaded module @@ -66,11 +61,6 @@ -- @field [parent=#cc] TableView#TableView TableView preloaded module --------------------------------------------------------- --- the cc EditBox --- @field [parent=#cc] EditBox#EditBox EditBox preloaded module - - -------------------------------------------------------- -- the cc AssetsManager -- @field [parent=#cc] AssetsManager#AssetsManager AssetsManager preloaded module diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp index 81f1c26626..6958a28aa3 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.cpp @@ -5,1347 +5,6 @@ -int lua_cocos2dx_extension_Scale9Sprite_resizableSpriteWithCapInsets(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_resizableSpriteWithCapInsets'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Rect arg0; - - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Scale9Sprite:resizableSpriteWithCapInsets"); - if(!ok) - return 0; - cocos2d::extension::Scale9Sprite* ret = cobj->resizableSpriteWithCapInsets(arg0); - object_to_luaval(tolua_S, "cc.Scale9Sprite",(cocos2d::extension::Scale9Sprite*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:resizableSpriteWithCapInsets",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_resizableSpriteWithCapInsets'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_setInsetBottom(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetBottom'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - double arg0; - - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Scale9Sprite:setInsetBottom"); - if(!ok) - return 0; - cobj->setInsetBottom(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:setInsetBottom",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetBottom'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrameName(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrameName'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Scale9Sprite:initWithSpriteFrameName"); - - if (!ok) { break; } - bool ret = cobj->initWithSpriteFrameName(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Scale9Sprite:initWithSpriteFrameName"); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Scale9Sprite:initWithSpriteFrameName"); - - if (!ok) { break; } - bool ret = cobj->initWithSpriteFrameName(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:initWithSpriteFrameName",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrameName'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_setInsetTop(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetTop'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - double arg0; - - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Scale9Sprite:setInsetTop"); - if(!ok) - return 0; - cobj->setInsetTop(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:setInsetTop",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetTop'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_init(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_init'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - bool ret = cobj->init(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:init",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_init'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_setPreferredSize(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_setPreferredSize'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Size arg0; - - ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.Scale9Sprite:setPreferredSize"); - if(!ok) - return 0; - cobj->setPreferredSize(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:setPreferredSize",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_setPreferredSize'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_setSpriteFrame(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_setSpriteFrame'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::SpriteFrame* arg0; - - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); - if(!ok) - return 0; - cobj->setSpriteFrame(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:setSpriteFrame",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_setSpriteFrame'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_initWithBatchNode(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_initWithBatchNode'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 3) { - cocos2d::SpriteBatchNode* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteBatchNode",&arg0); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Scale9Sprite:initWithBatchNode"); - - if (!ok) { break; } - cocos2d::Rect arg2; - ok &= luaval_to_rect(tolua_S, 4, &arg2, "cc.Scale9Sprite:initWithBatchNode"); - - if (!ok) { break; } - bool ret = cobj->initWithBatchNode(arg0, arg1, arg2); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 4) { - cocos2d::SpriteBatchNode* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteBatchNode",&arg0); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Scale9Sprite:initWithBatchNode"); - - if (!ok) { break; } - bool arg2; - ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.Scale9Sprite:initWithBatchNode"); - - if (!ok) { break; } - cocos2d::Rect arg3; - ok &= luaval_to_rect(tolua_S, 5, &arg3, "cc.Scale9Sprite:initWithBatchNode"); - - if (!ok) { break; } - bool ret = cobj->initWithBatchNode(arg0, arg1, arg2, arg3); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:initWithBatchNode",argc, 4); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_initWithBatchNode'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_getInsetBottom(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetBottom'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - double ret = cobj->getInsetBottom(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:getInsetBottom",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetBottom'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_getCapInsets(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_getCapInsets'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cocos2d::Rect ret = cobj->getCapInsets(); - rect_to_luaval(tolua_S, ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:getCapInsets",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_getCapInsets'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_updateWithBatchNode(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_updateWithBatchNode'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 4) - { - cocos2d::SpriteBatchNode* arg0; - cocos2d::Rect arg1; - bool arg2; - cocos2d::Rect arg3; - - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteBatchNode",&arg0); - - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Scale9Sprite:updateWithBatchNode"); - - ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.Scale9Sprite:updateWithBatchNode"); - - ok &= luaval_to_rect(tolua_S, 5, &arg3, "cc.Scale9Sprite:updateWithBatchNode"); - if(!ok) - return 0; - bool ret = cobj->updateWithBatchNode(arg0, arg1, arg2, arg3); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:updateWithBatchNode",argc, 4); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_updateWithBatchNode'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_getInsetRight(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetRight'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - double ret = cobj->getInsetRight(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:getInsetRight",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetRight'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_getOriginalSize(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_getOriginalSize'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cocos2d::Size ret = cobj->getOriginalSize(); - size_to_luaval(tolua_S, ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:getOriginalSize",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_getOriginalSize'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_initWithFile(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_initWithFile'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Scale9Sprite:initWithFile"); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Scale9Sprite:initWithFile"); - - if (!ok) { break; } - bool ret = cobj->initWithFile(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 3) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Scale9Sprite:initWithFile"); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Scale9Sprite:initWithFile"); - - if (!ok) { break; } - cocos2d::Rect arg2; - ok &= luaval_to_rect(tolua_S, 4, &arg2, "cc.Scale9Sprite:initWithFile"); - - if (!ok) { break; } - bool ret = cobj->initWithFile(arg0, arg1, arg2); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - cocos2d::Rect arg0; - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Scale9Sprite:initWithFile"); - - if (!ok) { break; } - std::string arg1; - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.Scale9Sprite:initWithFile"); - - if (!ok) { break; } - bool ret = cobj->initWithFile(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Scale9Sprite:initWithFile"); - - if (!ok) { break; } - bool ret = cobj->initWithFile(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:initWithFile",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_initWithFile'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_getInsetTop(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetTop'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - double ret = cobj->getInsetTop(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:getInsetTop",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetTop'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_setInsetLeft(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetLeft'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - double arg0; - - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Scale9Sprite:setInsetLeft"); - if(!ok) - return 0; - cobj->setInsetLeft(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:setInsetLeft",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetLeft'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrame(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrame'", nullptr); - return 0; - } -#endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 1) { - cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); - - if (!ok) { break; } - bool ret = cobj->initWithSpriteFrame(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); - - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Scale9Sprite:initWithSpriteFrame"); - - if (!ok) { break; } - bool ret = cobj->initWithSpriteFrame(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - }while(0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:initWithSpriteFrame",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrame'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_getPreferredSize(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_getPreferredSize'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cocos2d::Size ret = cobj->getPreferredSize(); - size_to_luaval(tolua_S, ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:getPreferredSize",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_getPreferredSize'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_setCapInsets(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_setCapInsets'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Rect arg0; - - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Scale9Sprite:setCapInsets"); - if(!ok) - return 0; - cobj->setCapInsets(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:setCapInsets",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_setCapInsets'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_getInsetLeft(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetLeft'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - double ret = cobj->getInsetLeft(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:getInsetLeft",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_getInsetLeft'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_setInsetRight(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::Scale9Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetRight'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - double arg0; - - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.Scale9Sprite:setInsetRight"); - if(!ok) - return 0; - cobj->setInsetRight(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:setInsetRight",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_setInsetRight'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S)-1; - - do - { - if (argc == 3) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Scale9Sprite:create"); - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Scale9Sprite:create"); - if (!ok) { break; } - cocos2d::Rect arg2; - ok &= luaval_to_rect(tolua_S, 4, &arg2, "cc.Scale9Sprite:create"); - if (!ok) { break; } - cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create(arg0, arg1, arg2); - object_to_luaval(tolua_S, "cc.Scale9Sprite",(cocos2d::extension::Scale9Sprite*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 0) - { - cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create(); - object_to_luaval(tolua_S, "cc.Scale9Sprite",(cocos2d::extension::Scale9Sprite*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 2) - { - cocos2d::Rect arg0; - ok &= luaval_to_rect(tolua_S, 2, &arg0, "cc.Scale9Sprite:create"); - if (!ok) { break; } - std::string arg1; - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.Scale9Sprite:create"); - if (!ok) { break; } - cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create(arg0, arg1); - object_to_luaval(tolua_S, "cc.Scale9Sprite",(cocos2d::extension::Scale9Sprite*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 2) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Scale9Sprite:create"); - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Scale9Sprite:create"); - if (!ok) { break; } - cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create(arg0, arg1); - object_to_luaval(tolua_S, "cc.Scale9Sprite",(cocos2d::extension::Scale9Sprite*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 1) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Scale9Sprite:create"); - if (!ok) { break; } - cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::create(arg0); - object_to_luaval(tolua_S, "cc.Scale9Sprite",(cocos2d::extension::Scale9Sprite*)ret); - return 1; - } - } while (0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d", "cc.Scale9Sprite:create",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_create'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_createWithSpriteFrameName(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S)-1; - - do - { - if (argc == 2) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Scale9Sprite:createWithSpriteFrameName"); - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Scale9Sprite:createWithSpriteFrameName"); - if (!ok) { break; } - cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::createWithSpriteFrameName(arg0, arg1); - object_to_luaval(tolua_S, "cc.Scale9Sprite",(cocos2d::extension::Scale9Sprite*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 1) - { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.Scale9Sprite:createWithSpriteFrameName"); - if (!ok) { break; } - cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::createWithSpriteFrameName(arg0); - object_to_luaval(tolua_S, "cc.Scale9Sprite",(cocos2d::extension::Scale9Sprite*)ret); - return 1; - } - } while (0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d", "cc.Scale9Sprite:createWithSpriteFrameName",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_createWithSpriteFrameName'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_createWithSpriteFrame(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.Scale9Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S)-1; - - do - { - if (argc == 2) - { - cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); - if (!ok) { break; } - cocos2d::Rect arg1; - ok &= luaval_to_rect(tolua_S, 3, &arg1, "cc.Scale9Sprite:createWithSpriteFrame"); - if (!ok) { break; } - cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::createWithSpriteFrame(arg0, arg1); - object_to_luaval(tolua_S, "cc.Scale9Sprite",(cocos2d::extension::Scale9Sprite*)ret); - return 1; - } - } while (0); - ok = true; - do - { - if (argc == 1) - { - cocos2d::SpriteFrame* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.SpriteFrame",&arg0); - if (!ok) { break; } - cocos2d::extension::Scale9Sprite* ret = cocos2d::extension::Scale9Sprite::createWithSpriteFrame(arg0); - object_to_luaval(tolua_S, "cc.Scale9Sprite",(cocos2d::extension::Scale9Sprite*)ret); - return 1; - } - } while (0); - ok = true; - CCLOG("%s has wrong number of arguments: %d, was expecting %d", "cc.Scale9Sprite:createWithSpriteFrame",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_createWithSpriteFrame'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_extension_Scale9Sprite_constructor(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::Scale9Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj = new cocos2d::extension::Scale9Sprite(); - cobj->autorelease(); - int ID = (int)cobj->_ID ; - int* luaID = &cobj->_luaID ; - toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.Scale9Sprite"); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.Scale9Sprite:Scale9Sprite",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_Scale9Sprite_constructor'.",&tolua_err); -#endif - - return 0; -} - -static int lua_cocos2dx_extension_Scale9Sprite_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (Scale9Sprite)"); - return 0; -} - -int lua_register_cocos2dx_extension_Scale9Sprite(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.Scale9Sprite"); - tolua_cclass(tolua_S,"Scale9Sprite","cc.Scale9Sprite","cc.Node",nullptr); - - tolua_beginmodule(tolua_S,"Scale9Sprite"); - tolua_function(tolua_S,"new",lua_cocos2dx_extension_Scale9Sprite_constructor); - tolua_function(tolua_S,"resizableSpriteWithCapInsets",lua_cocos2dx_extension_Scale9Sprite_resizableSpriteWithCapInsets); - tolua_function(tolua_S,"setInsetBottom",lua_cocos2dx_extension_Scale9Sprite_setInsetBottom); - tolua_function(tolua_S,"initWithSpriteFrameName",lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrameName); - tolua_function(tolua_S,"setInsetTop",lua_cocos2dx_extension_Scale9Sprite_setInsetTop); - tolua_function(tolua_S,"init",lua_cocos2dx_extension_Scale9Sprite_init); - tolua_function(tolua_S,"setPreferredSize",lua_cocos2dx_extension_Scale9Sprite_setPreferredSize); - tolua_function(tolua_S,"setSpriteFrame",lua_cocos2dx_extension_Scale9Sprite_setSpriteFrame); - tolua_function(tolua_S,"initWithBatchNode",lua_cocos2dx_extension_Scale9Sprite_initWithBatchNode); - tolua_function(tolua_S,"getInsetBottom",lua_cocos2dx_extension_Scale9Sprite_getInsetBottom); - tolua_function(tolua_S,"getCapInsets",lua_cocos2dx_extension_Scale9Sprite_getCapInsets); - tolua_function(tolua_S,"updateWithBatchNode",lua_cocos2dx_extension_Scale9Sprite_updateWithBatchNode); - tolua_function(tolua_S,"getInsetRight",lua_cocos2dx_extension_Scale9Sprite_getInsetRight); - tolua_function(tolua_S,"getOriginalSize",lua_cocos2dx_extension_Scale9Sprite_getOriginalSize); - tolua_function(tolua_S,"initWithFile",lua_cocos2dx_extension_Scale9Sprite_initWithFile); - tolua_function(tolua_S,"getInsetTop",lua_cocos2dx_extension_Scale9Sprite_getInsetTop); - tolua_function(tolua_S,"setInsetLeft",lua_cocos2dx_extension_Scale9Sprite_setInsetLeft); - tolua_function(tolua_S,"initWithSpriteFrame",lua_cocos2dx_extension_Scale9Sprite_initWithSpriteFrame); - tolua_function(tolua_S,"getPreferredSize",lua_cocos2dx_extension_Scale9Sprite_getPreferredSize); - tolua_function(tolua_S,"setCapInsets",lua_cocos2dx_extension_Scale9Sprite_setCapInsets); - tolua_function(tolua_S,"getInsetLeft",lua_cocos2dx_extension_Scale9Sprite_getInsetLeft); - tolua_function(tolua_S,"setInsetRight",lua_cocos2dx_extension_Scale9Sprite_setInsetRight); - tolua_function(tolua_S,"create", lua_cocos2dx_extension_Scale9Sprite_create); - tolua_function(tolua_S,"createWithSpriteFrameName", lua_cocos2dx_extension_Scale9Sprite_createWithSpriteFrameName); - tolua_function(tolua_S,"createWithSpriteFrame", lua_cocos2dx_extension_Scale9Sprite_createWithSpriteFrame); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::extension::Scale9Sprite).name(); - g_luaType[typeName] = "cc.Scale9Sprite"; - g_typeCast["Scale9Sprite"] = "cc.Scale9Sprite"; - return 1; -} - int lua_cocos2dx_extension_Control_setEnabled(lua_State* tolua_S) { int argc = 0; @@ -2927,8 +1586,8 @@ int lua_cocos2dx_extension_ControlButton_getBackgroundSpriteForState(lua_State* ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.ControlButton:getBackgroundSpriteForState"); if(!ok) return 0; - cocos2d::extension::Scale9Sprite* ret = cobj->getBackgroundSpriteForState(arg0); - object_to_luaval(tolua_S, "cc.Scale9Sprite",(cocos2d::extension::Scale9Sprite*)ret); + cocos2d::ui::Scale9Sprite* ret = cobj->getBackgroundSpriteForState(arg0); + object_to_luaval(tolua_S, "ccui.Scale9Sprite",(cocos2d::ui::Scale9Sprite*)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ControlButton:getBackgroundSpriteForState",argc, 1); @@ -3196,8 +1855,8 @@ int lua_cocos2dx_extension_ControlButton_getBackgroundSprite(lua_State* tolua_S) { if(!ok) return 0; - cocos2d::extension::Scale9Sprite* ret = cobj->getBackgroundSprite(); - object_to_luaval(tolua_S, "cc.Scale9Sprite",(cocos2d::extension::Scale9Sprite*)ret); + cocos2d::ui::Scale9Sprite* ret = cobj->getBackgroundSprite(); + object_to_luaval(tolua_S, "ccui.Scale9Sprite",(cocos2d::ui::Scale9Sprite*)ret); return 1; } CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.ControlButton:getBackgroundSprite",argc, 0); @@ -3427,10 +2086,10 @@ int lua_cocos2dx_extension_ControlButton_setBackgroundSpriteForState(lua_State* argc = lua_gettop(tolua_S)-1; if (argc == 2) { - cocos2d::extension::Scale9Sprite* arg0; + cocos2d::ui::Scale9Sprite* arg0; cocos2d::extension::Control::State arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Scale9Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Scale9Sprite",&arg0); ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.ControlButton:setBackgroundSpriteForState"); if(!ok) @@ -3522,9 +2181,9 @@ int lua_cocos2dx_extension_ControlButton_setBackgroundSprite(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::extension::Scale9Sprite* arg0; + cocos2d::ui::Scale9Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Scale9Sprite",&arg0); + ok &= luaval_to_object(tolua_S, 2, "ccui.Scale9Sprite",&arg0); if(!ok) return 0; cobj->setBackgroundSprite(arg0); @@ -3973,8 +2632,8 @@ int lua_cocos2dx_extension_ControlButton_create(lua_State* tolua_S) { if (argc == 1) { - cocos2d::extension::Scale9Sprite* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Scale9Sprite",&arg0); + cocos2d::ui::Scale9Sprite* arg0; + ok &= luaval_to_object(tolua_S, 2, "ccui.Scale9Sprite",&arg0); if (!ok) { break; } cocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(arg0); object_to_luaval(tolua_S, "cc.ControlButton",(cocos2d::extension::ControlButton*)ret); @@ -3999,8 +2658,8 @@ int lua_cocos2dx_extension_ControlButton_create(lua_State* tolua_S) cocos2d::Node* arg0; ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0); if (!ok) { break; } - cocos2d::extension::Scale9Sprite* arg1; - ok &= luaval_to_object(tolua_S, 3, "cc.Scale9Sprite",&arg1); + cocos2d::ui::Scale9Sprite* arg1; + ok &= luaval_to_object(tolua_S, 3, "ccui.Scale9Sprite",&arg1); if (!ok) { break; } cocos2d::extension::ControlButton* ret = cocos2d::extension::ControlButton::create(arg0, arg1); object_to_luaval(tolua_S, "cc.ControlButton",(cocos2d::extension::ControlButton*)ret); @@ -12160,976 +10819,6 @@ int lua_register_cocos2dx_extension_TableView(lua_State* tolua_S) return 1; } -int lua_cocos2dx_extension_EditBox_getText(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_getText'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - const char* ret = cobj->getText(); - tolua_pushstring(tolua_S,(const char*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:getText",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_getText'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_setPlaceholderFontName(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFontName'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - const char* arg0; - - std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.EditBox:setPlaceholderFontName"); arg0 = arg0_tmp.c_str(); - if(!ok) - return 0; - cobj->setPlaceholderFontName(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:setPlaceholderFontName",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFontName'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_getPlaceHolder(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_getPlaceHolder'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - const char* ret = cobj->getPlaceHolder(); - tolua_pushstring(tolua_S,(const char*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:getPlaceHolder",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_getPlaceHolder'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_setFontName(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setFontName'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - const char* arg0; - - std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.EditBox:setFontName"); arg0 = arg0_tmp.c_str(); - if(!ok) - return 0; - cobj->setFontName(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:setFontName",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_setFontName'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_setPlaceholderFontSize(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFontSize'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.EditBox:setPlaceholderFontSize"); - if(!ok) - return 0; - cobj->setPlaceholderFontSize(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:setPlaceholderFontSize",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFontSize'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_setInputMode(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setInputMode'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::extension::EditBox::InputMode arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.EditBox:setInputMode"); - if(!ok) - return 0; - cobj->setInputMode(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:setInputMode",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_setInputMode'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_setPlaceholderFontColor(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFontColor'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Color3B arg0; - - ok &= luaval_to_color3b(tolua_S, 2, &arg0, "cc.EditBox:setPlaceholderFontColor"); - if(!ok) - return 0; - cobj->setPlaceholderFontColor(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:setPlaceholderFontColor",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFontColor'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_setFontColor(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setFontColor'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::Color3B arg0; - - ok &= luaval_to_color3b(tolua_S, 2, &arg0, "cc.EditBox:setFontColor"); - if(!ok) - return 0; - cobj->setFontColor(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:setFontColor",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_setFontColor'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_setPlaceholderFont(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFont'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - const char* arg0; - int arg1; - - std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.EditBox:setPlaceholderFont"); arg0 = arg0_tmp.c_str(); - - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.EditBox:setPlaceholderFont"); - if(!ok) - return 0; - cobj->setPlaceholderFont(arg0, arg1); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:setPlaceholderFont",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_setPlaceholderFont'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_setFontSize(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setFontSize'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.EditBox:setFontSize"); - if(!ok) - return 0; - cobj->setFontSize(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:setFontSize",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_setFontSize'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_initWithSizeAndBackgroundSprite(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_initWithSizeAndBackgroundSprite'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - cocos2d::Size arg0; - cocos2d::extension::Scale9Sprite* arg1; - - ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.EditBox:initWithSizeAndBackgroundSprite"); - - ok &= luaval_to_object(tolua_S, 3, "cc.Scale9Sprite",&arg1); - if(!ok) - return 0; - bool ret = cobj->initWithSizeAndBackgroundSprite(arg0, arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:initWithSizeAndBackgroundSprite",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_initWithSizeAndBackgroundSprite'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_setPlaceHolder(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setPlaceHolder'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - const char* arg0; - - std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.EditBox:setPlaceHolder"); arg0 = arg0_tmp.c_str(); - if(!ok) - return 0; - cobj->setPlaceHolder(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:setPlaceHolder",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_setPlaceHolder'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_setReturnType(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setReturnType'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::extension::EditBox::KeyboardReturnType arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.EditBox:setReturnType"); - if(!ok) - return 0; - cobj->setReturnType(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:setReturnType",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_setReturnType'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_setInputFlag(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setInputFlag'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::extension::EditBox::InputFlag arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.EditBox:setInputFlag"); - if(!ok) - return 0; - cobj->setInputFlag(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:setInputFlag",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_setInputFlag'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_getMaxLength(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_getMaxLength'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - int ret = cobj->getMaxLength(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:getMaxLength",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_getMaxLength'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_setText(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setText'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - const char* arg0; - - std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.EditBox:setText"); arg0 = arg0_tmp.c_str(); - if(!ok) - return 0; - cobj->setText(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:setText",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_setText'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_setMaxLength(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setMaxLength'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.EditBox:setMaxLength"); - if(!ok) - return 0; - cobj->setMaxLength(arg0); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:setMaxLength",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_setMaxLength'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_setFont(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::extension::EditBox*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_extension_EditBox_setFont'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - const char* arg0; - int arg1; - - std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.EditBox:setFont"); arg0 = arg0_tmp.c_str(); - - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.EditBox:setFont"); - if(!ok) - return 0; - cobj->setFont(arg0, arg1); - return 0; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:setFont",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_setFont'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_extension_EditBox_create(lua_State* tolua_S) -{ - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertable(tolua_S,1,"cc.EditBox",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - - if (argc == 2) - { - cocos2d::Size arg0; - cocos2d::extension::Scale9Sprite* arg1; - ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.EditBox:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scale9Sprite",&arg1); - if(!ok) - return 0; - cocos2d::extension::EditBox* ret = cocos2d::extension::EditBox::create(arg0, arg1); - object_to_luaval(tolua_S, "cc.EditBox",(cocos2d::extension::EditBox*)ret); - return 1; - } - if (argc == 3) - { - cocos2d::Size arg0; - cocos2d::extension::Scale9Sprite* arg1; - cocos2d::extension::Scale9Sprite* arg2; - ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.EditBox:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scale9Sprite",&arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Scale9Sprite",&arg2); - if(!ok) - return 0; - cocos2d::extension::EditBox* ret = cocos2d::extension::EditBox::create(arg0, arg1, arg2); - object_to_luaval(tolua_S, "cc.EditBox",(cocos2d::extension::EditBox*)ret); - return 1; - } - if (argc == 4) - { - cocos2d::Size arg0; - cocos2d::extension::Scale9Sprite* arg1; - cocos2d::extension::Scale9Sprite* arg2; - cocos2d::extension::Scale9Sprite* arg3; - ok &= luaval_to_size(tolua_S, 2, &arg0, "cc.EditBox:create"); - ok &= luaval_to_object(tolua_S, 3, "cc.Scale9Sprite",&arg1); - ok &= luaval_to_object(tolua_S, 4, "cc.Scale9Sprite",&arg2); - ok &= luaval_to_object(tolua_S, 5, "cc.Scale9Sprite",&arg3); - if(!ok) - return 0; - cocos2d::extension::EditBox* ret = cocos2d::extension::EditBox::create(arg0, arg1, arg2, arg3); - object_to_luaval(tolua_S, "cc.EditBox",(cocos2d::extension::EditBox*)ret); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d\n ", "cc.EditBox:create",argc, 2); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_create'.",&tolua_err); -#endif - return 0; -} -int lua_cocos2dx_extension_EditBox_constructor(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::extension::EditBox* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - return 0; - cobj = new cocos2d::extension::EditBox(); - cobj->autorelease(); - int ID = (int)cobj->_ID ; - int* luaID = &cobj->_luaID ; - toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.EditBox"); - return 1; - } - CCLOG("%s has wrong number of arguments: %d, was expecting %d \n", "cc.EditBox:EditBox",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_extension_EditBox_constructor'.",&tolua_err); -#endif - - return 0; -} - -static int lua_cocos2dx_extension_EditBox_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (EditBox)"); - return 0; -} - -int lua_register_cocos2dx_extension_EditBox(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"cc.EditBox"); - tolua_cclass(tolua_S,"EditBox","cc.EditBox","cc.ControlButton",nullptr); - - tolua_beginmodule(tolua_S,"EditBox"); - tolua_function(tolua_S,"new",lua_cocos2dx_extension_EditBox_constructor); - tolua_function(tolua_S,"getText",lua_cocos2dx_extension_EditBox_getText); - tolua_function(tolua_S,"setPlaceholderFontName",lua_cocos2dx_extension_EditBox_setPlaceholderFontName); - tolua_function(tolua_S,"getPlaceHolder",lua_cocos2dx_extension_EditBox_getPlaceHolder); - tolua_function(tolua_S,"setFontName",lua_cocos2dx_extension_EditBox_setFontName); - tolua_function(tolua_S,"setPlaceholderFontSize",lua_cocos2dx_extension_EditBox_setPlaceholderFontSize); - tolua_function(tolua_S,"setInputMode",lua_cocos2dx_extension_EditBox_setInputMode); - tolua_function(tolua_S,"setPlaceholderFontColor",lua_cocos2dx_extension_EditBox_setPlaceholderFontColor); - tolua_function(tolua_S,"setFontColor",lua_cocos2dx_extension_EditBox_setFontColor); - tolua_function(tolua_S,"setPlaceholderFont",lua_cocos2dx_extension_EditBox_setPlaceholderFont); - tolua_function(tolua_S,"setFontSize",lua_cocos2dx_extension_EditBox_setFontSize); - tolua_function(tolua_S,"initWithSizeAndBackgroundSprite",lua_cocos2dx_extension_EditBox_initWithSizeAndBackgroundSprite); - tolua_function(tolua_S,"setPlaceHolder",lua_cocos2dx_extension_EditBox_setPlaceHolder); - tolua_function(tolua_S,"setReturnType",lua_cocos2dx_extension_EditBox_setReturnType); - tolua_function(tolua_S,"setInputFlag",lua_cocos2dx_extension_EditBox_setInputFlag); - tolua_function(tolua_S,"getMaxLength",lua_cocos2dx_extension_EditBox_getMaxLength); - tolua_function(tolua_S,"setText",lua_cocos2dx_extension_EditBox_setText); - tolua_function(tolua_S,"setMaxLength",lua_cocos2dx_extension_EditBox_setMaxLength); - tolua_function(tolua_S,"setFont",lua_cocos2dx_extension_EditBox_setFont); - tolua_function(tolua_S,"create", lua_cocos2dx_extension_EditBox_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(cocos2d::extension::EditBox).name(); - g_luaType[typeName] = "cc.EditBox"; - g_typeCast["EditBox"] = "cc.EditBox"; - return 1; -} - int lua_cocos2dx_extension_AssetsManager_setStoragePath(lua_State* tolua_S) { int argc = 0; @@ -13845,19 +11534,17 @@ TOLUA_API int register_all_cocos2dx_extension(lua_State* tolua_S) lua_register_cocos2dx_extension_Control(tolua_S); lua_register_cocos2dx_extension_TableViewCell(tolua_S); - lua_register_cocos2dx_extension_Scale9Sprite(tolua_S); + lua_register_cocos2dx_extension_ControlStepper(tolua_S); lua_register_cocos2dx_extension_ControlSwitch(tolua_S); lua_register_cocos2dx_extension_ScrollView(tolua_S); lua_register_cocos2dx_extension_TableView(tolua_S); - lua_register_cocos2dx_extension_AssetsManager(tolua_S); - lua_register_cocos2dx_extension_ControlButton(tolua_S); - lua_register_cocos2dx_extension_EditBox(tolua_S); lua_register_cocos2dx_extension_ControlSlider(tolua_S); - lua_register_cocos2dx_extension_ControlStepper(tolua_S); lua_register_cocos2dx_extension_ControlSaturationBrightnessPicker(tolua_S); lua_register_cocos2dx_extension_ControlColourPicker(tolua_S); lua_register_cocos2dx_extension_ControlPotentiometer(tolua_S); + lua_register_cocos2dx_extension_ControlButton(tolua_S); lua_register_cocos2dx_extension_ControlHuePicker(tolua_S); + lua_register_cocos2dx_extension_AssetsManager(tolua_S); tolua_endmodule(tolua_S); return 1; diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.hpp index ce1bfeebc3..cbd41e6a6b 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_extension_auto.hpp @@ -243,53 +243,6 @@ int register_all_cocos2dx_extension(lua_State* tolua_S); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From ed849a186389de4a6b82e4021732d5014bae56ab Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 3 Sep 2014 11:34:40 +0800 Subject: [PATCH 33/45] fix: win32 cpp-tests sometimes cannot display font correctly Pass FILE_SHARE_READ to the 3rd parameter of CreateFileW. Otherwise, it may fail to get date from the font file. --- cocos/platform/win32/CCFileUtilsWin32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/platform/win32/CCFileUtilsWin32.cpp b/cocos/platform/win32/CCFileUtilsWin32.cpp index c43339c8a7..1e174ef13e 100644 --- a/cocos/platform/win32/CCFileUtilsWin32.cpp +++ b/cocos/platform/win32/CCFileUtilsWin32.cpp @@ -147,7 +147,7 @@ static Data getData(const std::string& filename, bool forString) WCHAR wszBuf[CC_MAX_PATH] = {0}; MultiByteToWideChar(CP_UTF8, 0, fullPath.c_str(), -1, wszBuf, sizeof(wszBuf)/sizeof(wszBuf[0])); - HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, NULL, nullptr); + HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, nullptr); CC_BREAK_IF(fileHandle == INVALID_HANDLE_VALUE); size = ::GetFileSize(fileHandle, nullptr); @@ -222,7 +222,7 @@ unsigned char* FileUtilsWin32::getFileData(const std::string& filename, const ch WCHAR wszBuf[CC_MAX_PATH] = {0}; MultiByteToWideChar(CP_UTF8, 0, fullPath.c_str(), -1, wszBuf, sizeof(wszBuf)/sizeof(wszBuf[0])); - HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, 0, NULL, OPEN_EXISTING, NULL, nullptr); + HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, nullptr); CC_BREAK_IF(fileHandle == INVALID_HANDLE_VALUE); *size = ::GetFileSize(fileHandle, nullptr); From 278a3441cef5249010722c09692fcfe2123ec4d9 Mon Sep 17 00:00:00 2001 From: liuliang Date: Wed, 3 Sep 2014 11:43:42 +0800 Subject: [PATCH 34/45] Set the node name --- cocos/3d/CCSprite3D.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index 8d289035ab..e2f89ecb46 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -385,6 +385,7 @@ void Sprite3D::createNode(NodeData* nodedata, Node* root, const MaterialDatas& m auto sprite = createSprite3DNode(nodedata,it,matrialdatas); if (sprite) { + sprite->setName(nodedata->id); if(root) { root->addChild(sprite); @@ -399,6 +400,7 @@ void Sprite3D::createNode(NodeData* nodedata, Node* root, const MaterialDatas& m node= Node::create(); if(node) { + node->setName(nodedata->id); node->setAdditionalTransform(&nodedata->transform); if(root) { From b37ef4e1c3720a798349a8513decae3275231aae Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 3 Sep 2014 11:52:19 +0800 Subject: [PATCH 35/45] remove unneeded files --- .../org/cocos2dx/lib/Cocos2dxETCLoader.java | 109 ------------------ extensions/CMakeLists.txt | 47 -------- .../proj.android/README.md | 36 ------ tests/cpp-empty-test/proj.android/README.md | 87 -------------- tests/cpp-tests/proj.android/README.md | 87 -------------- .../proj.android/README.md | 87 -------------- 6 files changed, 453 deletions(-) delete mode 100644 cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxETCLoader.java delete mode 100644 extensions/CMakeLists.txt delete mode 100644 templates/cpp-template-default/proj.android/README.md delete mode 100644 tests/cpp-empty-test/proj.android/README.md delete mode 100644 tests/cpp-tests/proj.android/README.md delete mode 100644 tests/game-controller-test/proj.android/README.md diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxETCLoader.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxETCLoader.java deleted file mode 100644 index fd4cd81954..0000000000 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxETCLoader.java +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -Copyright (c) 2013 cocos2d-x.org - -http://www.cocos2d-x.org - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ****************************************************************************/ -package org.cocos2dx.lib; - -import java.io.FileInputStream; -import java.io.InputStream; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import android.content.Context; -import android.content.res.AssetManager; -import android.opengl.ETC1Util; -import android.util.Log; - -public class Cocos2dxETCLoader { - private static final String ASSETS_PATH = "assets/"; - private static Context context; - - public static boolean loadTexture(String filePath) { - if (! ETC1Util.isETC1Supported()) { - return false; - } - - if (filePath.length() == 0) { - return false; - } - - // Create ETC1Texture - InputStream inputStream = null; - ETC1Util.ETC1Texture texture = null; - AssetManager assetManager = null; - try { - if (filePath.charAt(0) == '/') { - // absolute path - inputStream = new FileInputStream(filePath); - } else { - // remove prefix: "assets/" - if (filePath.startsWith(ASSETS_PATH)) { - filePath = filePath.substring(ASSETS_PATH.length()); - } - assetManager = context.getAssets(); - inputStream = assetManager.open(filePath); - } - - texture = ETC1Util.createTexture(inputStream); - inputStream.close(); - } catch (Exception e) { - Log.d("Cocos2dx", "Unable to create texture for " + filePath); - - texture = null; - } - - if (texture != null) { - boolean ret = true; - - try { - final int width = texture.getWidth(); - final int height = texture.getHeight(); - final int length = texture.getData().remaining(); - - final byte[] data = new byte[length]; - final ByteBuffer buf = ByteBuffer.wrap(data); - buf.order(ByteOrder.nativeOrder()); - buf.put(texture.getData()); - - nativeSetTextureInfo(width, - height, - data, - length); - } catch (Exception e) - { - Log.d("invoke native function error", e.toString()); - ret = false; - } - - return ret; - } else { - return false; - } - } - - public static void setContext(Context context) { - Cocos2dxETCLoader.context = context; - } - - private static native void nativeSetTextureInfo(final int width, final int height, final byte[] data, - final int dataLength); -} diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt deleted file mode 100644 index 427452a0b0..0000000000 --- a/extensions/CMakeLists.txt +++ /dev/null @@ -1,47 +0,0 @@ -set(EXTENSIONS_SRC - assets-manager/AssetsManager.cpp - GUI/CCControlExtension/CCControl.cpp - GUI/CCControlExtension/CCControlButton.cpp - GUI/CCControlExtension/CCControlColourPicker.cpp - GUI/CCControlExtension/CCControlHuePicker.cpp - GUI/CCControlExtension/CCControlPotentiometer.cpp - GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp - GUI/CCControlExtension/CCControlSlider.cpp - GUI/CCControlExtension/CCControlStepper.cpp - GUI/CCControlExtension/CCControlSwitch.cpp - GUI/CCControlExtension/CCControlUtils.cpp - GUI/CCControlExtension/CCInvocation.cpp - GUI/CCScrollView/CCScrollView.cpp - GUI/CCScrollView/CCTableView.cpp - GUI/CCScrollView/CCTableViewCell.cpp - physics-nodes/CCPhysicsDebugNode.cpp - physics-nodes/CCPhysicsSprite.cpp -) - -if(WIN32) - ADD_DEFINITIONS(-DUNICODE -D_UNICODE) - - set(PLATFORM_EXTENSIONS_SRC - proj.win32/Win32InputBox.cpp - ) -elseif(APPLE) - -else() - -endif() - -include_directories( - .. -) - -add_library(extensions STATIC - ${EXTENSIONS_SRC} - ${PLATFORM_EXTENSIONS_SRC} -) - -set_target_properties(extensions - PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" -) - diff --git a/templates/cpp-template-default/proj.android/README.md b/templates/cpp-template-default/proj.android/README.md deleted file mode 100644 index ff6c44369c..0000000000 --- a/templates/cpp-template-default/proj.android/README.md +++ /dev/null @@ -1,36 +0,0 @@ -## Prerequisites: - -* Android NDK -* Android SDK **OR** Eclipse ADT Bundle -* Android AVD target installed - -## Building project - -There are two ways of building Android projects. - -1. Eclipse -2. Command Line - -### Import Project in Eclipse - -####Step 1: C/C++ Environment Variable `NDK_ROOT` - -* Eclipse->Preferences->C/C++->Build->**Environment**. -* Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory. - ![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png) -* Only for Windows: Add new variables **CYGWIN** with value `nodosfilewarning` and **SHELLOPTS** with value `igncr` - -####Step 2: Adding and running from Eclipse - -![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png) - -1. File->New->Project->Android Project From Existing Code -2. **Browse** to your project directory and Add the project -3. Click **Run as Android Application** to run on connected device or emulator. - -That's all !!! - -### Running project from Command Line - - $ cd NEW_PROJECTS_DIR/MyGame - $ cocos run -p android -j 4 diff --git a/tests/cpp-empty-test/proj.android/README.md b/tests/cpp-empty-test/proj.android/README.md deleted file mode 100644 index 312835611a..0000000000 --- a/tests/cpp-empty-test/proj.android/README.md +++ /dev/null @@ -1,87 +0,0 @@ -## Prerequisites: - -* Android NDK -* Android SDK **OR** Eclipse ADT Bundle -* Android AVD target installed - -## Building project - -There are two ways of building Android projects. - -1. Eclipse -2. Command Line - -### Import Project in Eclipse - -#### Features: - -1. Complete workflow from Eclipse, including: - * Build C++. - * Clean C++. - * Build and Run whole project. - * Logcat view. - * Debug Java code. - * Javascript editor. - * Project management. -2. True C++ editing, including: - * Code completion. - * Jump to definition. - * Refactoring tools etc. - * Quick open C++ files. - - -#### Setup Eclipse Environment (only once) - - -**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before. - -1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html) - - **OR** - - Install Eclipse with Java. Add ADT and CDT plugins. - -2. Only for Windows - 1. Install [Cygwin](http://www.cygwin.com/) with make (select make package from the list during the install). - 2. Add `Cygwin\bin` directory to system PATH variable. - 3. Add this line `none /cygdrive cygdrive binary,noacl,posix=0,user 0 0` to `Cygwin\etc\fstab` file. - -3. Set up Variables: - 1. Path Variable `COCOS2DX`: - * Eclipse->Preferences->General->Workspace->**Linked Resources** - * Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory. - ![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png) - - 2. C/C++ Environment Variable `NDK_ROOT`: - * Eclipse->Preferences->C/C++->Build->**Environment**. - * Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory. - ![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png) - * Only for Windows: Add new variables **CYGWIN** with value `nodosfilewarning` and **SHELLOPTS** with value `igncr` - -4. Import libcocos2dx library project: - 1. File->New->Project->Android Project From Existing Code. - 2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory. - 3. Click **Finish** to add project. - -#### Adding and running from Eclipse - -![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png) - -1. File->New->Project->Android Project From Existing Code -2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/` -3. Add the project -4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator. - - -### Running project from Command Line - - $ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/ - $ export NDK_ROOT=/path/to/ndk - $ ./build_native.sh - $ ant debug install - -If the last command results in sdk.dir missing error then do: - - $ android list target - $ android update project -p . -t (id from step 6) - $ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6) diff --git a/tests/cpp-tests/proj.android/README.md b/tests/cpp-tests/proj.android/README.md deleted file mode 100644 index a4670ebabc..0000000000 --- a/tests/cpp-tests/proj.android/README.md +++ /dev/null @@ -1,87 +0,0 @@ -## Prerequisites: - -* Android NDK -* Android SDK **OR** Eclipse ADT Bundle -* Android AVD target installed - -## Building project - -There are two ways of building Android projects. - -1. Eclipse -2. Command Line - -### Import Project in Eclipse - -#### Features: - -1. Complete workflow from Eclipse, including: - * Build C++. - * Clean C++. - * Build and Run whole project. - * Logcat view. - * Debug Java code. - * Javascript editor. - * Project management. -2. True C++ editing, including: - * Code completion. - * Jump to definition. - * Refactoring tools etc. - * Quick open C++ files. - - -#### Setup Eclipse Environment (only once) - - -**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before. - -1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html) - - **OR** - - Install Eclipse with Java. Add ADT and CDT plugins. - -2. Only for Windows - 1. Install [Cygwin](http://www.cygwin.com/) with make (select make package from the list during the install). - 2. Add `Cygwin\bin` directory to system PATH variable. - 3. Add this line `none /cygdrive cygdrive binary,noacl,posix=0,user 0 0` to `Cygwin\etc\fstab` file. - -3. Set up Variables: - 1. Path Variable `COCOS2DX`: - * Eclipse->Preferences->General->Workspace->**Linked Resources** - * Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory. - ![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png) - - 2. C/C++ Environment Variable `NDK_ROOT`: - * Eclipse->Preferences->C/C++->Build->**Environment**. - * Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory. - ![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png) - * Only for Windows: Add new variables **CYGWIN** with value `nodosfilewarning` and **SHELLOPTS** with value `igncr` - -4. Import libcocos2dx library project: - 1. File->New->Project->Android Project From Existing Code. - 2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory. - 3. Click **Finish** to add project. - -#### Adding and running from Eclipse - -![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png) - -1. File->New->Project->Android Project From Existing Code -2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/CppTests/proj.android/` -3. Add the project -4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator. - - -### Running project from Command Line - - $ cd cocos2d-x/samples/Cpp/CppTests/proj.android/ - $ export NDK_ROOT=/path/to/ndk - $ ./build_native.sh - $ ant debug install - -If the last command results in sdk.dir missing error then do: - - $ android list target - $ android update project -p . -t (id from step 6) - $ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6) diff --git a/tests/game-controller-test/proj.android/README.md b/tests/game-controller-test/proj.android/README.md deleted file mode 100644 index 312835611a..0000000000 --- a/tests/game-controller-test/proj.android/README.md +++ /dev/null @@ -1,87 +0,0 @@ -## Prerequisites: - -* Android NDK -* Android SDK **OR** Eclipse ADT Bundle -* Android AVD target installed - -## Building project - -There are two ways of building Android projects. - -1. Eclipse -2. Command Line - -### Import Project in Eclipse - -#### Features: - -1. Complete workflow from Eclipse, including: - * Build C++. - * Clean C++. - * Build and Run whole project. - * Logcat view. - * Debug Java code. - * Javascript editor. - * Project management. -2. True C++ editing, including: - * Code completion. - * Jump to definition. - * Refactoring tools etc. - * Quick open C++ files. - - -#### Setup Eclipse Environment (only once) - - -**NOTE:** This step needs to be done only once to setup the Eclipse environment for cocos2d-x projects. Skip this section if you've done this before. - -1. Download Eclipse ADT bundle from [Google ADT homepage](http://developer.android.com/sdk/index.html) - - **OR** - - Install Eclipse with Java. Add ADT and CDT plugins. - -2. Only for Windows - 1. Install [Cygwin](http://www.cygwin.com/) with make (select make package from the list during the install). - 2. Add `Cygwin\bin` directory to system PATH variable. - 3. Add this line `none /cygdrive cygdrive binary,noacl,posix=0,user 0 0` to `Cygwin\etc\fstab` file. - -3. Set up Variables: - 1. Path Variable `COCOS2DX`: - * Eclipse->Preferences->General->Workspace->**Linked Resources** - * Click **New** button to add a Path Variable `COCOS2DX` pointing to the root cocos2d-x directory. - ![Example](https://lh5.googleusercontent.com/-oPpk9kg3e5w/UUOYlq8n7aI/AAAAAAAAsdQ/zLA4eghBH9U/s400/cocos2d-x-eclipse-vars.png) - - 2. C/C++ Environment Variable `NDK_ROOT`: - * Eclipse->Preferences->C/C++->Build->**Environment**. - * Click **Add** button and add a new variable `NDK_ROOT` pointing to the root NDK directory. - ![Example](https://lh3.googleusercontent.com/-AVcY8IAT0_g/UUOYltoRobI/AAAAAAAAsdM/22D2J9u3sig/s400/cocos2d-x-eclipse-ndk.png) - * Only for Windows: Add new variables **CYGWIN** with value `nodosfilewarning` and **SHELLOPTS** with value `igncr` - -4. Import libcocos2dx library project: - 1. File->New->Project->Android Project From Existing Code. - 2. Click **Browse** button and open `cocos2d-x/cocos2dx/platform/android/java` directory. - 3. Click **Finish** to add project. - -#### Adding and running from Eclipse - -![Example](https://lh3.googleusercontent.com/-SLBOu6e3QbE/UUOcOXYaGqI/AAAAAAAAsdo/tYBY2SylOSM/s288/cocos2d-x-eclipse-project-from-code.png) ![Import](https://lh5.googleusercontent.com/-XzC9Pn65USc/UUOcOTAwizI/AAAAAAAAsdk/4b6YM-oim9Y/s400/cocos2d-x-eclipse-import-project.png) - -1. File->New->Project->Android Project From Existing Code -2. **Browse** to your project directory. eg: `cocos2d-x/cocos2dx/samples/Cpp/TestCpp/proj.android/` -3. Add the project -4. Click **Run** or **Debug** to compile C++ followed by Java and to run on connected device or emulator. - - -### Running project from Command Line - - $ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/ - $ export NDK_ROOT=/path/to/ndk - $ ./build_native.sh - $ ant debug install - -If the last command results in sdk.dir missing error then do: - - $ android list target - $ android update project -p . -t (id from step 6) - $ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6) From 61a3c80cb98d1967e9dad7b44afbe4c124f45570 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 3 Sep 2014 04:05:23 +0000 Subject: [PATCH 36/45] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 2bd52dde25..9cfac4e648 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -3698,7 +3698,6 @@ "cocos/scripting/lua-bindings/auto/api/EaseSineIn.lua", "cocos/scripting/lua-bindings/auto/api/EaseSineInOut.lua", "cocos/scripting/lua-bindings/auto/api/EaseSineOut.lua", - "cocos/scripting/lua-bindings/auto/api/EditBox.lua", "cocos/scripting/lua-bindings/auto/api/Event.lua", "cocos/scripting/lua-bindings/auto/api/EventAcceleration.lua", "cocos/scripting/lua-bindings/auto/api/EventController.lua", From 1ec993304558d3c69e2c01d4ac255850b034de19 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Wed, 3 Sep 2014 05:37:45 +0000 Subject: [PATCH 37/45] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index 9cfac4e648..ff4f386aa0 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -764,7 +764,6 @@ "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxAccelerometer.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxBitmap.java", - "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxETCLoader.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditBoxDialog.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxEditText.java", "cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java", @@ -1076,7 +1075,6 @@ "docs/doxygen.config", "download-deps.py", "extensions/Android.mk", - "extensions/CMakeLists.txt", "extensions/ExtensionDeprecated.cpp", "extensions/ExtensionDeprecated.h", "extensions/ExtensionExport.h", From 7493c7bf3e2a0104a1dba6a177d9f8edc9095ae2 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 3 Sep 2014 14:47:04 +0800 Subject: [PATCH 38/45] fxi compile warning --- .../GUI/CCControlExtension/CCControlButton.cpp | 18 +++++++++--------- .../GUI/CCControlExtension/CCControlButton.h | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/extensions/GUI/CCControlExtension/CCControlButton.cpp b/extensions/GUI/CCControlExtension/CCControlButton.cpp index 91599ae386..9a69de517e 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -63,10 +63,10 @@ ControlButton::~ControlButton() bool ControlButton::init() { - return this->initWithLabelAndBackgroundSprite(Label::createWithSystemFont("", "Helvetica", 12), Scale9Sprite::create()); + return this->initWithLabelAndBackgroundSprite(Label::createWithSystemFont("", "Helvetica", 12), cocos2d::ui::Scale9Sprite::create()); } -bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, Scale9Sprite* backgroundSprite) +bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, ui::Scale9Sprite* backgroundSprite) { if (Control::init()) { @@ -120,7 +120,7 @@ bool ControlButton::initWithLabelAndBackgroundSprite(Node* node, Scale9Sprite* b } } -ControlButton* ControlButton::create(Node* label, Scale9Sprite* backgroundSprite) +ControlButton* ControlButton::create(Node* label, cocos2d::ui::Scale9Sprite* backgroundSprite) { ControlButton *pRet = new (std::nothrow) ControlButton(); pRet->initWithLabelAndBackgroundSprite(label, backgroundSprite); @@ -130,7 +130,7 @@ ControlButton* ControlButton::create(Node* label, Scale9Sprite* backgroundSprite bool ControlButton::initWithTitleAndFontNameAndFontSize(const std::string& title, const std::string& fontName, float fontSize) { - return initWithLabelAndBackgroundSprite(Label::createWithSystemFont(title, fontName, fontSize), Scale9Sprite::create()); + return initWithLabelAndBackgroundSprite(Label::createWithSystemFont(title, fontName, fontSize), cocos2d::ui::Scale9Sprite::create()); } ControlButton* ControlButton::create(const std::string& title, const std::string& fontName, float fontSize) @@ -141,13 +141,13 @@ ControlButton* ControlButton::create(const std::string& title, const std::string return pRet; } -bool ControlButton::initWithBackgroundSprite(Scale9Sprite* sprite) +bool ControlButton::initWithBackgroundSprite(cocos2d::ui::Scale9Sprite* sprite) { Label *label = Label::createWithSystemFont("", "Arial", 30);// return initWithLabelAndBackgroundSprite(label, sprite); } -ControlButton* ControlButton::create(Scale9Sprite* sprite) +ControlButton* ControlButton::create(cocos2d::ui::Scale9Sprite* sprite) { ControlButton *pRet = new (std::nothrow) ControlButton(); pRet->initWithBackgroundSprite(sprite); @@ -422,7 +422,7 @@ const std::string& ControlButton::getTitleBMFontForState(State state) } -Scale9Sprite* ControlButton::getBackgroundSpriteForState(State state) +ui::Scale9Sprite* ControlButton::getBackgroundSpriteForState(State state) { auto backgroundSprite = _backgroundSpriteDispatchTable.at((int)state); if (backgroundSprite) @@ -433,7 +433,7 @@ Scale9Sprite* ControlButton::getBackgroundSpriteForState(State state) } -void ControlButton::setBackgroundSpriteForState(Scale9Sprite* sprite, State state) +void ControlButton::setBackgroundSpriteForState(ui::Scale9Sprite* sprite, State state) { Size oldPreferredSize = _preferredSize; @@ -469,7 +469,7 @@ void ControlButton::setBackgroundSpriteForState(Scale9Sprite* sprite, State stat void ControlButton::setBackgroundSpriteFrameForState(SpriteFrame * spriteFrame, State state) { - Scale9Sprite * sprite = Scale9Sprite::createWithSpriteFrame(spriteFrame); + ui::Scale9Sprite * sprite = ui::Scale9Sprite::createWithSpriteFrame(spriteFrame); this->setBackgroundSpriteForState(sprite, state); } diff --git a/extensions/GUI/CCControlExtension/CCControlButton.h b/extensions/GUI/CCControlExtension/CCControlButton.h index 758c61d363..2ead117306 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.h +++ b/extensions/GUI/CCControlExtension/CCControlButton.h @@ -32,8 +32,8 @@ #include "CCControl.h" #include "CCInvocation.h" -#include "extensions/ExtensionDeprecated.h" #include "base/CCMap.h" +#include "ui/UIScale9Sprite.h" NS_CC_EXT_BEGIN @@ -55,8 +55,8 @@ class CC_EX_DLL ControlButton : public Control { public: static ControlButton* create(); - static ControlButton* create(Scale9Sprite* sprite); - static ControlButton* create(Node* label, Scale9Sprite* backgroundSprite); + static ControlButton* create(cocos2d::ui::Scale9Sprite* sprite); + static ControlButton* create(Node* label, cocos2d::ui::Scale9Sprite* backgroundSprite); static ControlButton* create(const std::string& title, const std::string& fontName, float fontSize); virtual void needsLayout(void); @@ -148,7 +148,7 @@ public: * @param state The state that uses the background sprite. Possible values are * described in "CCControlState". */ - virtual Scale9Sprite* getBackgroundSpriteForState(State state); + virtual cocos2d::ui::Scale9Sprite* getBackgroundSpriteForState(State state); /** * Sets the background sprite to use for the specified button state. @@ -157,7 +157,7 @@ public: * @param state The state that uses the specified image. The values are described * in "CCControlState". */ - virtual void setBackgroundSpriteForState(Scale9Sprite* sprite, State state); + virtual void setBackgroundSpriteForState(cocos2d::ui::Scale9Sprite* sprite, State state); /** * Sets the background spriteFrame to use for the specified button state. @@ -202,8 +202,8 @@ CC_CONSTRUCTOR_ACCESS: virtual ~ControlButton(); virtual bool init() override; - virtual bool initWithLabelAndBackgroundSprite(Node* label, Scale9Sprite* backgroundSprite); - virtual bool initWithBackgroundSprite(Scale9Sprite* sprite); + virtual bool initWithLabelAndBackgroundSprite(Node* label, cocos2d::ui::Scale9Sprite* backgroundSprite); + virtual bool initWithBackgroundSprite(cocos2d::ui::Scale9Sprite* sprite); virtual bool initWithTitleAndFontNameAndFontSize(const std::string& title, const std::string& fontName, float fontSize); protected: @@ -221,7 +221,7 @@ protected: CC_SYNTHESIZE_RETAIN(Node*, _titleLabel, TitleLabel); /** The current background sprite. */ - CC_SYNTHESIZE_RETAIN(Scale9Sprite*, _backgroundSprite, BackgroundSprite); + CC_SYNTHESIZE_RETAIN(cocos2d::ui::Scale9Sprite*, _backgroundSprite, BackgroundSprite); /** The prefered size of the button, if label is larger it will be expanded. */ CC_PROPERTY_PASS_BY_REF(Size, _preferredSize, PreferredSize); @@ -237,7 +237,7 @@ protected: std::unordered_map _titleColorDispatchTable; Map _titleLabelDispatchTable; - Map _backgroundSpriteDispatchTable; + Map _backgroundSpriteDispatchTable; /* Define the button margin for Top/Bottom edge */ CC_SYNTHESIZE_READONLY(int, _marginV, VerticalMargin); From d681bdce92e82ae6434f8bc9c79fbda370e2f495 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Wed, 3 Sep 2014 14:54:58 +0800 Subject: [PATCH 39/45] Fix the crash of project which was created by the lua-template-runtime --- .../frameworks/runtime-src/Classes/AppDelegate.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp b/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp index 2bbc729319..8bd26e143a 100644 --- a/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp +++ b/templates/lua-template-runtime/frameworks/runtime-src/Classes/AppDelegate.cpp @@ -65,12 +65,7 @@ bool AppDelegate::applicationDidFinishLaunching() auto engine = LuaEngine::getInstance(); ScriptEngineManager::getInstance()->setScriptEngine(engine); lua_State* L = engine->getLuaStack()->getLuaState(); - lua_getglobal(L, "_G"); - if (lua_istable(L,-1))//stack:...,_G, - { - lua_module_register(L); - } - lua_pop(L, 1);//statck:... + lua_module_register(L); LuaStack* stack = engine->getLuaStack(); stack->setXXTEAKeyAndSign("2dxLua", strlen("2dxLua"), "XXTEA", strlen("XXTEA")); From 58f219fc203fe464bee26d97cc87d601b6412f58 Mon Sep 17 00:00:00 2001 From: andyque Date: Wed, 3 Sep 2014 15:00:09 +0800 Subject: [PATCH 40/45] test extension::Scale9Sprite and remove unused file compile flags --- build/cocos2d_libs.xcodeproj/project.pbxproj | 2 +- .../CCControlButtonTest/CCControlButtonTest.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index 9482485163..dcf250b68c 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -948,7 +948,7 @@ 15AE1BC819AAE00000C27E9E /* AssetsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF5352180E3060000584C8 /* AssetsManager.h */; }; 15AE1BC919AAE01E00C27E9E /* CCControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168351807AF4E005B8026 /* CCControl.cpp */; }; 15AE1BCA19AAE01E00C27E9E /* CCControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168361807AF4E005B8026 /* CCControl.h */; }; - 15AE1BCB19AAE01E00C27E9E /* CCControlButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168371807AF4E005B8026 /* CCControlButton.cpp */; settings = {COMPILER_FLAGS = "-w -Xanalyzer -analyzer-disable-checker"; }; }; + 15AE1BCB19AAE01E00C27E9E /* CCControlButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168371807AF4E005B8026 /* CCControlButton.cpp */; }; 15AE1BCC19AAE01E00C27E9E /* CCControlButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A168381807AF4E005B8026 /* CCControlButton.h */; }; 15AE1BCD19AAE01E00C27E9E /* CCControlColourPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46A168391807AF4E005B8026 /* CCControlColourPicker.cpp */; }; 15AE1BCE19AAE01E00C27E9E /* CCControlColourPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A1683A1807AF4E005B8026 /* CCControlColourPicker.h */; }; diff --git a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp index 2fef6f9aa3..6981d7c7aa 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/ControlExtensionTest/CCControlButtonTest/CCControlButtonTest.cpp @@ -91,8 +91,8 @@ bool ControlButtonTest_HelloVariableSize::init() ControlButton *ControlButtonTest_HelloVariableSize::standardButtonWithTitle(const char * title) { /** Creates and return a button with a default background and title color. */ - auto backgroundButton = Scale9Sprite::create("extensions/button.png"); - auto backgroundHighlightedButton = Scale9Sprite::create("extensions/buttonHighlighted.png"); + auto backgroundButton = cocos2d::extension::Scale9Sprite::create("extensions/button.png"); + auto backgroundHighlightedButton = cocos2d::extension::Scale9Sprite::create("extensions/buttonHighlighted.png"); auto titleButton = Label::createWithTTF(title, "fonts/Marker Felt.ttf", 30); @@ -258,7 +258,7 @@ bool ControlButtonTest_Styling::init() layer->setPosition(screenSize.width / 2.0f, screenSize.height / 2.0f); // Add the black background - auto backgroundButton = Scale9Sprite::create("extensions/buttonBackground.png"); + auto backgroundButton = cocos2d::extension::Scale9Sprite::create("extensions/buttonBackground.png"); backgroundButton->setContentSize(Size(max_w + 14, max_h + 14)); backgroundButton->setPosition(screenSize.width / 2.0f, screenSize.height / 2.0f); addChild(backgroundButton); From 45f08d54cb66e9b98a274f31a0bf1140250d2a5a Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Wed, 3 Sep 2014 15:07:31 +0800 Subject: [PATCH 41/45] Fix the member name error in the `vec4_to_luaval ` --- .../lua-bindings/manual/LuaBasicConversions.cpp | 10 +++++----- .../lua-bindings/manual/LuaBasicConversions.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp index da15b71819..e8da5290ee 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.cpp @@ -1995,23 +1995,23 @@ void vec3_to_luaval(lua_State* L,const cocos2d::Vec3& vec3) lua_rawset(L, -3); } -void vec4_to_luaval(lua_State* L,const cocos2d::Vec4& vec3) +void vec4_to_luaval(lua_State* L,const cocos2d::Vec4& vec4) { if (NULL == L) return; lua_newtable(L); /* L: table */ lua_pushstring(L, "x"); /* L: table key */ - lua_pushnumber(L, (lua_Number) vec3.x); /* L: table key value*/ + lua_pushnumber(L, (lua_Number) vec4.x); /* L: table key value*/ lua_rawset(L, -3); /* table[key] = value, L: table */ lua_pushstring(L, "y"); /* L: table key */ - lua_pushnumber(L, (lua_Number) vec3.y); /* L: table key value*/ + lua_pushnumber(L, (lua_Number) vec4.y); /* L: table key value*/ lua_rawset(L, -3); lua_pushstring(L, "z"); /* L: table key */ - lua_pushnumber(L, (lua_Number) vec3.z); /* L: table key value*/ + lua_pushnumber(L, (lua_Number) vec4.z); /* L: table key value*/ lua_rawset(L, -3); lua_pushstring(L, "w"); /* L: table key */ - lua_pushnumber(L, (lua_Number) vec3.z); /* L: table key value*/ + lua_pushnumber(L, (lua_Number) vec4.w); /* L: table key value*/ lua_rawset(L, -3); } diff --git a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h index 2d07f4a2f2..6626ecad1c 100644 --- a/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h +++ b/cocos/scripting/lua-bindings/manual/LuaBasicConversions.h @@ -240,7 +240,7 @@ extern bool luaval_to_std_vector_ushort(lua_State* L, int lo, std::vector Date: Wed, 3 Sep 2014 15:55:11 +0800 Subject: [PATCH 42/45] Set the node name --- cocos/3d/CCSprite3D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/3d/CCSprite3D.cpp b/cocos/3d/CCSprite3D.cpp index e2f89ecb46..ed9a3baf89 100644 --- a/cocos/3d/CCSprite3D.cpp +++ b/cocos/3d/CCSprite3D.cpp @@ -231,6 +231,7 @@ Sprite3D* Sprite3D::createSprite3DNode(NodeData* nodedata,ModelData* modeldata,c auto sprite = new (std::nothrow) Sprite3D(); if (sprite) { + sprite->setName(nodedata->id); auto mesh = Mesh::create(nodedata->id, getMeshIndexData(modeldata->subMeshId)); if (modeldata->matrialId == "" && matrialdatas.materials.size()) { @@ -385,7 +386,6 @@ void Sprite3D::createNode(NodeData* nodedata, Node* root, const MaterialDatas& m auto sprite = createSprite3DNode(nodedata,it,matrialdatas); if (sprite) { - sprite->setName(nodedata->id); if(root) { root->addChild(sprite); From 14853d46f28788e4c37c2be0f7fc653ddc95c5ef Mon Sep 17 00:00:00 2001 From: Sergey Date: Tue, 17 Jun 2014 14:18:37 +0400 Subject: [PATCH 43/45] setPlaceholderFontSize fix --- cocos/ui/UIEditBox/UIEditBox.cpp | 2 +- cocos/ui/UIEditBox/UIEditBoxImplIOS.mm | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cocos/ui/UIEditBox/UIEditBox.cpp b/cocos/ui/UIEditBox/UIEditBox.cpp index 27e4ccc95b..6ef69b9e74 100644 --- a/cocos/ui/UIEditBox/UIEditBox.cpp +++ b/cocos/ui/UIEditBox/UIEditBox.cpp @@ -268,7 +268,7 @@ void EditBox::setPlaceholderFontSize(int fontSize) _placeholderFontSize = fontSize; if (_editBoxImpl != nullptr && _placeholderFontName.length() > 0) { - _editBoxImpl->setPlaceholderFont(_placeholderFontName.c_str(), _fontSize); + _editBoxImpl->setPlaceholderFont(_placeholderFontName.c_str(), fontSize); } } diff --git a/cocos/ui/UIEditBox/UIEditBoxImplIOS.mm b/cocos/ui/UIEditBox/UIEditBoxImplIOS.mm index d78dd0c765..a2456ed125 100644 --- a/cocos/ui/UIEditBox/UIEditBoxImplIOS.mm +++ b/cocos/ui/UIEditBox/UIEditBoxImplIOS.mm @@ -395,8 +395,6 @@ void EditBoxImplIOS::setFont(const char* pFontName, int fontSize) _label->setSystemFontName(pFontName); _label->setSystemFontSize(fontSize); - _labelPlaceHolder->setSystemFontName(pFontName); - _labelPlaceHolder->setSystemFontSize(fontSize); } void EditBoxImplIOS::setFontColor(const Color3B& color) @@ -407,7 +405,8 @@ void EditBoxImplIOS::setFontColor(const Color3B& color) void EditBoxImplIOS::setPlaceholderFont(const char* pFontName, int fontSize) { - // TODO: need to be implemented. + _labelPlaceHolder->setSystemFontName(pFontName); + _labelPlaceHolder->setSystemFontSize(fontSize); } void EditBoxImplIOS::setPlaceholderFontColor(const Color3B& color) From cef9a21324eb862afa96aea3f99a0ba320c007c4 Mon Sep 17 00:00:00 2001 From: minggo Date: Thu, 4 Sep 2014 10:10:26 +0800 Subject: [PATCH 44/45] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index bfe066429f..58c9390ddf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,7 @@ cocos2d-x-3.3?? ?? [FIX] EditBox: moved to ui:EditBox [FIX] Node: create unneeded temple `Vec2` object in `setPosition(int, int)`, `setPositionX()` and `setPositionY()` [FIX] Node: skew effect is wrong + [FIX] Node: setNormalizedPosition can not take effect if parent position is not changed [FIX] TextureAtlas: may crash if only drawing part of it cocos2d-x-3.3alpha0 Aug.28 2014 From 071aedaa51990228e743bb96d9bda27abb1ff351 Mon Sep 17 00:00:00 2001 From: CocosRobot Date: Thu, 4 Sep 2014 02:56:25 +0000 Subject: [PATCH 45/45] [AUTO][ci skip]: updating cocos2dx_files.json --- templates/cocos2dx_files.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/cocos2dx_files.json b/templates/cocos2dx_files.json index ff4f386aa0..fce55eac65 100644 --- a/templates/cocos2dx_files.json +++ b/templates/cocos2dx_files.json @@ -4030,6 +4030,8 @@ "cocos/scripting/lua-bindings/manual/cocosbuilder/lua_cocos2dx_cocosbuilder_manual.h", "cocos/scripting/lua-bindings/manual/cocosdenshion/lua_cocos2dx_cocosdenshion_manual.cpp", "cocos/scripting/lua-bindings/manual/cocosdenshion/lua_cocos2dx_cocosdenshion_manual.h", + "cocos/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.cpp", + "cocos/scripting/lua-bindings/manual/cocostudio/CustomGUIReader.h", "cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp", "cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.hpp", "cocos/scripting/lua-bindings/manual/controller/lua_cocos2dx_controller_manual.cpp",