diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj b/build/cocos2d_libs.xcodeproj/project.pbxproj index b217e523e1..604f34f217 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -995,6 +995,8 @@ 299754F5193EC95400A54AC3 /* ObjectFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 299754F2193EC95400A54AC3 /* ObjectFactory.cpp */; }; 299754F6193EC95400A54AC3 /* ObjectFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 299754F3193EC95400A54AC3 /* ObjectFactory.h */; }; 299754F7193EC95400A54AC3 /* ObjectFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 299754F3193EC95400A54AC3 /* ObjectFactory.h */; }; + 29BDBA53195D597A003225C9 /* UIDeprecated.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29BDBA52195D597A003225C9 /* UIDeprecated.cpp */; }; + 29BDBA54195D597A003225C9 /* UIDeprecated.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29BDBA52195D597A003225C9 /* UIDeprecated.cpp */; }; 29CB8F4C1929D1BB00C841D6 /* UILayoutManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29CB8F4A1929D1BB00C841D6 /* UILayoutManager.cpp */; }; 29CB8F4D1929D1BB00C841D6 /* UILayoutManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29CB8F4A1929D1BB00C841D6 /* UILayoutManager.cpp */; }; 29CB8F4E1929D1BB00C841D6 /* UILayoutManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 29CB8F4B1929D1BB00C841D6 /* UILayoutManager.h */; }; @@ -2311,6 +2313,7 @@ 2986667918B1B079000E39CA /* CCTweenFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCTweenFunction.h; sourceTree = ""; }; 299754F2193EC95400A54AC3 /* ObjectFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ObjectFactory.cpp; path = ../base/ObjectFactory.cpp; sourceTree = ""; }; 299754F3193EC95400A54AC3 /* ObjectFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjectFactory.h; path = ../base/ObjectFactory.h; sourceTree = ""; }; + 29BDBA52195D597A003225C9 /* UIDeprecated.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UIDeprecated.cpp; sourceTree = ""; }; 29CB8F4A1929D1BB00C841D6 /* UILayoutManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UILayoutManager.cpp; sourceTree = ""; }; 29CB8F4B1929D1BB00C841D6 /* UILayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILayoutManager.h; sourceTree = ""; }; 29E99D1C1957BA7000046604 /* CocoLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CocoLoader.cpp; sourceTree = ""; }; @@ -4030,6 +4033,7 @@ isa = PBXGroup; children = ( 29080DEB191B82CE0066F8DF /* UIDeprecated.h */, + 29BDBA52195D597A003225C9 /* UIDeprecated.cpp */, 2905FA1318CF08D100240AA3 /* UIWidget.cpp */, 2905FA1418CF08D100240AA3 /* UIWidget.h */, 50E6D30C18DADB5D0051CA34 /* CCProtectedNode.cpp */, @@ -6360,6 +6364,7 @@ 503DD8F71926B0DB00CD74DD /* CCIMEDispatcher.cpp in Sources */, 1AD71EB1180E26E600808F54 /* Bone.cpp in Sources */, 1AD71EB5180E26E600808F54 /* BoneData.cpp in Sources */, + 29BDBA53195D597A003225C9 /* UIDeprecated.cpp in Sources */, 1AD71EB9180E26E600808F54 /* CCSkeleton.cpp in Sources */, 50ABBE751925AB6F00A911A9 /* CCEventListenerTouch.cpp in Sources */, 1AD71EBD180E26E600808F54 /* CCSkeletonAnimation.cpp in Sources */, @@ -6855,6 +6860,7 @@ 50ABBD5D1925AB0000A911A9 /* Vec3.cpp in Sources */, 50ABC0121926664800A911A9 /* CCGLViewProtocol.cpp in Sources */, 50ABC0021926664800A911A9 /* CCLock.cpp in Sources */, + 29BDBA54195D597A003225C9 /* UIDeprecated.cpp in Sources */, 50FCEBAC18C72017004AD434 /* PageViewReader.cpp in Sources */, 1A8C598C180E930E00EF57C3 /* CCActionFrame.cpp in Sources */, 1A8C5990180E930E00EF57C3 /* CCActionFrameEasing.cpp in Sources */, diff --git a/cocos/ui/Android.mk b/cocos/ui/Android.mk index 2441258c19..4c6e33334e 100644 --- a/cocos/ui/Android.mk +++ b/cocos/ui/Android.mk @@ -29,7 +29,8 @@ CCProtectedNode.cpp \ UIHBox.cpp \ UIVBox.cpp \ UIRelativeBox.cpp \ -UIVideoPlayerAndroid.cpp +UIVideoPlayerAndroid.cpp \ +UIDeprecated.cpp \ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/.. \ $(LOCAL_PATH)/../editor-support diff --git a/cocos/ui/CMakeLists.txt b/cocos/ui/CMakeLists.txt index 60e83f23ec..cd7066589d 100644 --- a/cocos/ui/CMakeLists.txt +++ b/cocos/ui/CMakeLists.txt @@ -22,5 +22,6 @@ set(COCOS_UI_SRC ui/UITextField.cpp ui/UIVBox.cpp ui/UIWidget.cpp + ui/UIDeprecated.cpp ) diff --git a/cocos/ui/UIDeprecated.cpp b/cocos/ui/UIDeprecated.cpp new file mode 100644 index 0000000000..2a1472daaf --- /dev/null +++ b/cocos/ui/UIDeprecated.cpp @@ -0,0 +1,33 @@ +/**************************************************************************** + 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 "ui/UIDeprecated.h" + +NS_CC_BEGIN + +namespace ui { + +const Margin MarginZero = Margin::ZERO ; + +}} diff --git a/cocos/ui/UIDeprecated.h b/cocos/ui/UIDeprecated.h index cef9f51fc2..f5ec082110 100644 --- a/cocos/ui/UIDeprecated.h +++ b/cocos/ui/UIDeprecated.h @@ -26,6 +26,12 @@ #define cocos2d_libs_UIDeprecated_h #include "base/CCPlatformMacros.h" +#include "ui/UIWidget.h" +#include "ui/UILayout.h" +#include "ui/UIListView.h" +#include "ui/UILoadingBar.h" +#include "ui/UIPageView.h" +#include "ui/UIRichText.h" NS_CC_BEGIN @@ -147,7 +153,7 @@ CC_DEPRECATED_ATTRIBUTE typedef LoadingBar::Direction LoadingBarType; CC_DEPRECATED_ATTRIBUTE typedef PageView::TouchDirection PVTouchDir; CC_DEPRECATED_ATTRIBUTE typedef RichElement::Type RichElementType; CC_DEPRECATED_ATTRIBUTE typedef ScrollView::Direction SCROLLVIEW_DIR; - +CC_DEPRECATED_ATTRIBUTE extern const Margin MarginZero; } diff --git a/cocos/ui/UILayoutParameter.cpp b/cocos/ui/UILayoutParameter.cpp index 71f78db93e..c9990491a6 100644 --- a/cocos/ui/UILayoutParameter.cpp +++ b/cocos/ui/UILayoutParameter.cpp @@ -29,6 +29,8 @@ NS_CC_BEGIN namespace ui { +const Margin Margin::ZERO = Margin(0,0,0,0); + Margin::Margin(void) : left(0), top(0), right(0), bottom(0) { } diff --git a/cocos/ui/UILayoutParameter.h b/cocos/ui/UILayoutParameter.h index 29f421cafa..4681c82d3b 100644 --- a/cocos/ui/UILayoutParameter.h +++ b/cocos/ui/UILayoutParameter.h @@ -52,9 +52,11 @@ public: Margin& operator= (const Margin& other); void setMargin(float l, float t, float r, float b); bool equals(const Margin& target) const; + + static const Margin ZERO; + }; -const Margin MarginZero = Margin(); /** * @js NA diff --git a/cocos/ui/UIListView.cpp b/cocos/ui/UIListView.cpp index da6f993446..5689f49be1 100644 --- a/cocos/ui/UIListView.cpp +++ b/cocos/ui/UIListView.cpp @@ -149,7 +149,7 @@ void ListView::remedyLayoutParameter(Widget *item) } if (getIndex(item) == 0) { - defaultLp->setMargin(MarginZero); + defaultLp->setMargin(Margin::ZERO); } else { @@ -161,7 +161,7 @@ void ListView::remedyLayoutParameter(Widget *item) { if (getIndex(item) == 0) { - llp->setMargin(MarginZero); + llp->setMargin(Margin::ZERO); } else { @@ -204,7 +204,7 @@ void ListView::remedyLayoutParameter(Widget *item) } if (getIndex(item) == 0) { - defaultLp->setMargin(MarginZero); + defaultLp->setMargin(Margin::ZERO); } else { @@ -216,7 +216,7 @@ void ListView::remedyLayoutParameter(Widget *item) { if (getIndex(item) == 0) { - llp->setMargin(MarginZero); + llp->setMargin(Margin::ZERO); } else { diff --git a/cocos/ui/proj.win32/libGUI.vcxproj b/cocos/ui/proj.win32/libGUI.vcxproj index 8ef4105661..2483ce7005 100644 --- a/cocos/ui/proj.win32/libGUI.vcxproj +++ b/cocos/ui/proj.win32/libGUI.vcxproj @@ -15,6 +15,7 @@ + @@ -40,6 +41,7 @@ + diff --git a/cocos/ui/proj.win32/libGUI.vcxproj.filters b/cocos/ui/proj.win32/libGUI.vcxproj.filters index a82d945c9f..66f11c6cdd 100644 --- a/cocos/ui/proj.win32/libGUI.vcxproj.filters +++ b/cocos/ui/proj.win32/libGUI.vcxproj.filters @@ -87,6 +87,9 @@ Layouts + + System + @@ -158,5 +161,8 @@ Layouts + + System + - + \ No newline at end of file diff --git a/cocos/ui/proj.wp8/libGUI.vcxproj b/cocos/ui/proj.wp8/libGUI.vcxproj index c58030f74b..461ca405b9 100644 --- a/cocos/ui/proj.wp8/libGUI.vcxproj +++ b/cocos/ui/proj.wp8/libGUI.vcxproj @@ -184,6 +184,7 @@ + @@ -209,8 +210,9 @@ + - + \ No newline at end of file diff --git a/cocos/ui/proj.wp8/libGUI.vcxproj.filters b/cocos/ui/proj.wp8/libGUI.vcxproj.filters index 475c39565d..0513dc6afb 100644 --- a/cocos/ui/proj.wp8/libGUI.vcxproj.filters +++ b/cocos/ui/proj.wp8/libGUI.vcxproj.filters @@ -84,6 +84,9 @@ Layouts + + System + @@ -155,5 +158,8 @@ Layouts + + System + - + \ No newline at end of file