├── .gitignore ├── CocosWidget ├── Button.cpp ├── Button.h ├── CheckBox.cpp ├── CheckBox.h ├── ColorView.cpp ├── ColorView.h ├── ControlView.cpp ├── ControlView.h ├── ExpandableListView.cpp ├── ExpandableListView.h ├── GradientView.cpp ├── GradientView.h ├── GridPageView.cpp ├── GridPageView.h ├── GridView.cpp ├── GridView.h ├── ImageView.cpp ├── ImageView.h ├── ImageViewScale9.cpp ├── ImageViewScale9.h ├── Label.cpp ├── Label.h ├── LabelAtlas.cpp ├── LabelAtlas.h ├── LabelBMFont.cpp ├── LabelBMFont.h ├── Layout.cpp ├── Layout.h ├── ListView.cpp ├── ListView.h ├── Lua_cocos2dx_widget.cpp ├── Lua_cocos2dx_widget.h ├── PageView.cpp ├── PageView.h ├── ProgressBar.cpp ├── ProgressBar.h ├── Scale9Sprite.cpp ├── Scale9Sprite.h ├── ScrollView.cpp ├── ScrollView.h ├── Slider.cpp ├── Slider.h ├── TableView.cpp ├── TableView.h ├── TextArea.cpp ├── TextArea.h ├── TextRich.cpp ├── TextRich.h ├── ToggleView.cpp ├── ToggleView.h ├── Widget.cpp ├── Widget.h ├── WidgetMacros.h ├── WidgetProtocol.cpp ├── WidgetProtocol.h ├── WidgetWindow.cpp ├── WidgetWindow.h ├── WitlsMacros.cpp ├── WitlsMacros.h └── cocos-widget.h ├── Cpp ├── Classes │ ├── AppDelegate.cpp │ ├── AppDelegate.h │ ├── MenuScene.cpp │ ├── MenuScene.h │ └── testwidget │ │ ├── ButtonTest │ │ ├── ButtonTest.cpp │ │ └── ButtonTest.h │ │ ├── CheckBoxTest │ │ ├── CheckBoxTest.cpp │ │ └── CheckBoxTest.h │ │ ├── ControlViewTest │ │ ├── ControlViewTest.cpp │ │ └── ControlViewTest.h │ │ ├── DrawOrderTest │ │ ├── DrawOrderTest.cpp │ │ └── DrawOrderTest.h │ │ ├── ExpandableListViewTest │ │ ├── ExpandableListViewTest.cpp │ │ └── ExpandableListViewTest.h │ │ ├── GridPageViewTest │ │ ├── GridPageViewTest.cpp │ │ └── GridPageViewTest.h │ │ ├── GridViewTest │ │ ├── GridViewTest.cpp │ │ └── GridViewTest.h │ │ ├── LabelTest │ │ ├── LabelTest.cpp │ │ └── LabelTest.h │ │ ├── LayoutTest │ │ ├── LayoutTest.cpp │ │ └── LayoutTest.h │ │ ├── ListViewTest │ │ ├── ListViewTest.cpp │ │ └── ListViewTest.h │ │ ├── PageViewTest │ │ ├── PageViewTest.cpp │ │ └── PageViewTest.h │ │ ├── ProgressBarTest │ │ ├── ProgressBarTest.cpp │ │ └── ProgressBarTest.h │ │ ├── ScrollViewTest │ │ ├── ScrollViewTest.cpp │ │ └── ScrollViewTest.h │ │ ├── SliderTest │ │ ├── SliderTest.cpp │ │ └── SliderTest.h │ │ ├── TableViewTest │ │ ├── TableViewTest.cpp │ │ └── TableViewTest.h │ │ ├── TextRichTest │ │ ├── TextRichTest.cpp │ │ └── TextRichTest.h │ │ └── ToggleViewTest │ │ ├── ToggleViewTest.cpp │ │ └── ToggleViewTest.h ├── Resources │ ├── CloseNormal.png │ ├── CloseSelected.png │ ├── again1.png │ ├── again2.png │ ├── arial-unicode-26.fnt │ ├── arial-unicode-26.png │ ├── back1.png │ ├── back2.png │ ├── background.png │ ├── background2.png │ ├── background3.png │ ├── btn1_1.png │ ├── btn1_2.png │ ├── btn1_3.png │ ├── circle1.png │ ├── circle2.png │ ├── ckb_disable_01.png │ ├── ckb_disable_02.png │ ├── ckb_normal_01.png │ ├── ckb_normal_02.png │ ├── ckb_selected_01.png │ ├── ckb_selected_02.png │ ├── control_baseboard.png │ ├── control_joystick.png │ ├── expandnodebg.png │ ├── icon.png │ ├── next1.png │ ├── next2.png │ ├── num.png │ ├── progress.png │ ├── progress_bg.png │ ├── progress_v.png │ ├── progress_v_bg.png │ ├── scrollcontent.png │ ├── slider.png │ ├── sprite9_btn1.png │ ├── sprite9_btn2.png │ ├── toggle1_1.png │ └── toggle1_2.png ├── proj.android │ ├── .classpath │ ├── .cproject │ ├── .externalToolBuilders │ │ └── org.eclipse.cdt.managedbuilder.core.genmakebuilder.launch │ ├── .project │ ├── .settings │ │ ├── org.eclipse.cdt.core.prefs │ │ └── org.eclipse.core.resources.prefs │ ├── AndroidManifest.xml │ ├── README.md │ ├── ant.properties │ ├── build.xml │ ├── build_native.sh │ ├── gen │ │ └── com │ │ │ └── cocoswidget │ │ │ └── testcpp │ │ │ ├── BuildConfig.java │ │ │ └── R.java │ ├── jni │ │ ├── Android.mk │ │ ├── Application.mk │ │ └── cpp │ │ │ └── main.cpp │ ├── proguard-project.txt │ ├── project.properties │ ├── res │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ └── values │ │ │ └── strings.xml │ └── src │ │ ├── com │ │ └── cocoswidget │ │ │ └── testcpp │ │ │ └── CocosWidgetTestCpp.java │ │ └── org │ │ └── cocos2dx │ │ └── lib │ │ ├── Cocos2dxAccelerometer.java │ │ ├── Cocos2dxActivity.java │ │ ├── Cocos2dxBitmap.java │ │ ├── Cocos2dxETCLoader.java │ │ ├── Cocos2dxEditBoxDialog.java │ │ ├── Cocos2dxEditText.java │ │ ├── Cocos2dxGLSurfaceView.java │ │ ├── Cocos2dxHandler.java │ │ ├── Cocos2dxHelper.java │ │ ├── Cocos2dxLocalStorage.java │ │ ├── Cocos2dxMusic.java │ │ ├── Cocos2dxRenderer.java │ │ ├── Cocos2dxSound.java │ │ ├── Cocos2dxTextInputWraper.java │ │ └── Cocos2dxTypefaces.java ├── proj.blackberry │ ├── .cproject │ ├── .project │ ├── bar-descriptor.xml │ ├── empty │ │ └── empty │ ├── icon.png │ └── main.cpp ├── proj.ios │ ├── AppController.h │ ├── AppController.mm │ ├── CocosWidgetTestCpp.xcodeproj │ │ └── project.pbxproj │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── Icon-114.png │ ├── Icon-120.png │ ├── Icon-144.png │ ├── Icon-152.png │ ├── Icon-57.png │ ├── Icon-72.png │ ├── Icon-76.png │ ├── Info.plist │ ├── Prefix.pch │ ├── RootViewController.h │ ├── RootViewController.mm │ └── main.m ├── proj.linux │ ├── .cproject │ ├── .project │ ├── Makefile │ ├── build.sh │ └── main.cpp ├── proj.mac │ ├── AppController.h │ ├── AppController.mm │ ├── CocosWidgetTestCpp.xcodeproj │ │ └── project.pbxproj │ ├── Icon.icns │ ├── Info.plist │ ├── Prefix.pch │ ├── en.lproj │ │ ├── InfoPlist.strings │ │ └── MainMenu.xib │ └── main.m ├── proj.marmalade │ ├── CocosWidgetTestCpp.mkb │ └── src │ │ ├── Main.cpp │ │ └── Main.h ├── proj.win32 │ ├── CocosWidgetTestCpp.sln │ ├── CocosWidgetTestCpp.vcxproj │ ├── CocosWidgetTestCpp.vcxproj.filters │ ├── CocosWidgetTestCpp.vcxproj.user │ ├── main.cpp │ └── main.h ├── proj.winrt │ ├── App.xaml │ ├── App.xaml.cpp │ ├── App.xaml.h │ ├── Assets │ │ ├── Logo.png │ │ ├── SmallLogo.png │ │ ├── SplashScreen.png │ │ ├── StoreLogo.png │ │ └── WideLogo.png │ ├── CocosWidgetTestCpp.sln │ ├── CocosWidgetTestCpp.vcxproj │ ├── CocosWidgetTestCpp.vcxproj.filters │ ├── CocosWidgetTestCpp_TemporaryKey.pfx │ ├── Common │ │ └── StandardStyles.xaml │ ├── MainPage.xaml │ ├── MainPage.xaml.cpp │ ├── MainPage.xaml.h │ ├── Package.appxmanifest │ ├── pch.cpp │ └── pch.h └── proj.wp8 │ ├── Assets │ ├── AlignmentGrid.png │ ├── ApplicationIcon.png │ ├── Resources │ │ └── fonts │ │ │ └── arial.ttf │ └── Tiles │ │ ├── FlipCycleTileLarge.png │ │ ├── FlipCycleTileMedium.png │ │ ├── FlipCycleTileSmall.png │ │ ├── IconicTileMediumLarge.png │ │ └── IconicTileSmall.png │ ├── CocosWidgetTestCpp.cpp │ ├── CocosWidgetTestCpp.h │ ├── CocosWidgetTestCpp.sln │ ├── CocosWidgetTestCpp.vcxproj │ ├── CocosWidgetTestCpp.vcxproj.filters │ └── WMAppManifest.xml ├── LICENSE ├── Lua ├── Classes │ ├── AppDelegate.cpp │ └── AppDelegate.h ├── Resources │ ├── AudioEngine.lua │ ├── CCBReaderLoad.lua │ ├── CloseNormal.png │ ├── CloseSelected.png │ ├── again1.png │ ├── again2.png │ ├── arial-unicode-26.fnt │ ├── arial-unicode-26.png │ ├── back1.png │ ├── back2.png │ ├── background.png │ ├── background2.png │ ├── background3.png │ ├── btn1_1.png │ ├── btn1_2.png │ ├── btn1_3.png │ ├── circle1.png │ ├── circle2.png │ ├── ckb_disable_01.png │ ├── ckb_disable_02.png │ ├── ckb_normal_01.png │ ├── ckb_normal_02.png │ ├── ckb_selected_01.png │ ├── ckb_selected_02.png │ ├── control_baseboard.png │ ├── control_joystick.png │ ├── expandnodebg.png │ ├── icon.png │ ├── luaScript │ │ ├── base.lua │ │ ├── main.lua │ │ ├── test_button.lua │ │ ├── test_checkbox.lua │ │ ├── test_controlview.lua │ │ ├── test_draworder.lua │ │ ├── test_expandablelistview.lua │ │ ├── test_gridpageview.lua │ │ ├── test_gridview.lua │ │ ├── test_label.lua │ │ ├── test_layout.lua │ │ ├── test_listview.lua │ │ ├── test_pageview.lua │ │ ├── test_progressbar.lua │ │ ├── test_scrollview.lua │ │ ├── test_slider.lua │ │ ├── test_tableview.lua │ │ ├── test_textrich.lua │ │ └── test_toggleview.lua │ ├── next1.png │ ├── next2.png │ ├── num.png │ ├── progress.png │ ├── progress_bg.png │ ├── progress_v.png │ ├── progress_v_bg.png │ ├── scrollcontent.png │ ├── slider.png │ ├── sprite9_btn1.png │ ├── sprite9_btn2.png │ ├── toggle1_1.png │ └── toggle1_2.png ├── proj.android │ ├── .classpath │ ├── .project │ ├── AndroidManifest.xml │ ├── ant.properties │ ├── build.xml │ ├── build_native.sh │ ├── jni │ │ ├── Android.mk │ │ ├── Application.mk │ │ └── hellolua │ │ │ └── main.cpp │ ├── proguard-project.txt │ ├── project.properties │ ├── res │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ └── values │ │ │ └── strings.xml │ └── src │ │ ├── com │ │ └── cocoswidget │ │ │ └── testlua │ │ │ └── CocosWidgetTestLua.java │ │ └── org │ │ └── cocos2dx │ │ └── lib │ │ ├── Cocos2dxAccelerometer.java │ │ ├── Cocos2dxActivity.java │ │ ├── Cocos2dxBitmap.java │ │ ├── Cocos2dxETCLoader.java │ │ ├── Cocos2dxEditBoxDialog.java │ │ ├── Cocos2dxEditText.java │ │ ├── Cocos2dxGLSurfaceView.java │ │ ├── Cocos2dxHandler.java │ │ ├── Cocos2dxHelper.java │ │ ├── Cocos2dxLocalStorage.java │ │ ├── Cocos2dxMusic.java │ │ ├── Cocos2dxRenderer.java │ │ ├── Cocos2dxSound.java │ │ ├── Cocos2dxTextInputWraper.java │ │ └── Cocos2dxTypefaces.java ├── proj.blackberry │ ├── .cproject │ ├── .project │ ├── bar-descriptor.xml │ ├── empty │ │ └── .gitkeep │ ├── icon.png │ └── main.cpp ├── proj.ios │ ├── AppController.h │ ├── AppController.mm │ ├── CocosWidgetTestLua.xcodeproj │ │ └── project.pbxproj │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── Icon-114.png │ ├── Icon-120.png │ ├── Icon-144.png │ ├── Icon-152.png │ ├── Icon-57.png │ ├── Icon-72.png │ ├── Icon-76.png │ ├── Info.plist │ ├── Prefix.pch │ ├── RootViewController.h │ ├── RootViewController.mm │ └── main.m ├── proj.linux │ ├── .cproject │ ├── .project │ ├── Makefile │ ├── build.sh │ └── main.cpp ├── proj.marmalade │ ├── CocosWidgetTestLua.mkb │ ├── cccopy.py │ └── src │ │ ├── Main.cpp │ │ └── Main.h ├── proj.pkgs │ ├── Button.pkg │ ├── CheckBox.pkg │ ├── ColorView.pkg │ ├── ControlView.pkg │ ├── ExpandableListView.pkg │ ├── GradientView.pkg │ ├── GridPageView.pkg │ ├── GridView.pkg │ ├── ImageView.pkg │ ├── ImageViewScale9.pkg │ ├── Label.pkg │ ├── LabelAtlas.pkg │ ├── LabelBMFont.pkg │ ├── Layout.pkg │ ├── ListView.pkg │ ├── Lua_cocos2dx_widget.cpp │ ├── Lua_cocos2dx_widget.pkg │ ├── PageView.pkg │ ├── ProgressBar.pkg │ ├── Scale9Sprite.pkg │ ├── ScrollView.pkg │ ├── Slider.pkg │ ├── TableView.pkg │ ├── TextRich.pkg │ ├── ToggleView.pkg │ ├── WidgetWindow.pkg │ ├── basic.lua │ ├── build.bat │ └── tolua++.exe └── proj.win32 │ ├── CocosWidgetTestLua.sln │ ├── CocosWidgetTestLua.vcxproj │ ├── CocosWidgetTestLua.vcxproj.filters │ ├── CocosWidgetTestLua.vcxproj.user │ ├── game.rc │ ├── main.cpp │ ├── main.h │ ├── res │ └── game.ico │ └── resource.h └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | *.tlog 15 | *.svn 16 | -------------------------------------------------------------------------------- /CocosWidget/LabelAtlas.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2014 Lijunlin - Jason lee 3 | 4 | Created by Lijunlin - Jason lee on 2014 5 | 6 | jason.lee.c@foxmail.com 7 | http://www.cocos2d-x.org 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | ****************************************************************************/ 27 | #ifndef __CCWIDGET_LABELATLAS_H__ 28 | #define __CCWIDGET_LABELATLAS_H__ 29 | 30 | #include "cocos2d.h" 31 | #include "WidgetMacros.h" 32 | #include "Widget.h" 33 | #include "WidgetProtocol.h" 34 | 35 | NS_CC_WIDGET_BEGIN 36 | 37 | /** 38 | * class : CLabelAtlas 39 | * author : Jason lee 40 | * email : jason.lee.c@foxmail.com 41 | * descpt : label atlas define 42 | */ 43 | class CLabelAtlas : public CCLabelAtlas 44 | , public CWidget 45 | , public CClickableProtocol 46 | , public CLongClickableProtocol 47 | { 48 | public: 49 | CLabelAtlas(); 50 | virtual ~CLabelAtlas(); 51 | virtual bool init(); 52 | static CLabelAtlas* create(const char* pString, const char* charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); 53 | static CLabelAtlas* create(const char* pString, const char* fntFile); 54 | 55 | public: 56 | virtual CWidgetTouchModel onTouchBegan(CCTouch* pTouch); 57 | virtual void onTouchMoved(CCTouch* pTouch, float fDuration); 58 | virtual void onTouchEnded(CCTouch* pTouch, float fDuration); 59 | virtual void onTouchCancelled(CCTouch* pTouch, float fDuration); 60 | 61 | CC_WIDGET_LONGCLICK_SCHEDULE(CLabelAtlas); 62 | }; 63 | 64 | NS_CC_WIDGET_END 65 | 66 | #endif //__CCWIDGET_LABELATLAS_H__ -------------------------------------------------------------------------------- /CocosWidget/Layout.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2014 Lijunlin - Jason lee 3 | 4 | Created by Lijunlin - Jason lee on 2014 5 | 6 | jason.lee.c@foxmail.com 7 | http://www.cocos2d-x.org 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | ****************************************************************************/ 27 | #ifndef __CCWIDGET_LAYOUT_H__ 28 | #define __CCWIDGET_LAYOUT_H__ 29 | 30 | #include "cocos2d.h" 31 | #include "WidgetMacros.h" 32 | #include "Widget.h" 33 | #include "ColorView.h" 34 | #include "GradientView.h" 35 | #include "WidgetProtocol.h" 36 | 37 | NS_CC_WIDGET_BEGIN 38 | 39 | /** 40 | * class : CLayout 41 | * author : Jason lee 42 | * email : jason.lee.c@foxmail.com 43 | * descpt : layout define 44 | */ 45 | class CLayout : public CCNodeRGBA, public CWidget, public CLayoutableProtocol 46 | { 47 | public: 48 | CLayout(); 49 | virtual ~CLayout(); 50 | virtual bool init(); 51 | static CLayout* create(); 52 | static CLayout* create(const CCSize& tContentSize); 53 | virtual void setContentSize(const CCSize& tContentSize); 54 | 55 | // find the first matching widget by id 56 | CCObject* findWidgetById(const char* id); 57 | 58 | CC_WIDGET_BACKGROUND; 59 | 60 | public: 61 | virtual CWidgetTouchModel onTouchBegan(CCTouch* pTouch); 62 | virtual void onTouchMoved(CCTouch* pTouch, float fDuration); 63 | virtual void onTouchEnded(CCTouch* pTouch, float fDuration); 64 | virtual void onTouchCancelled(CCTouch* pTouch, float fDuration); 65 | 66 | protected: 67 | CCObject* find(CCArray* pChidren, const char* id); 68 | 69 | }; 70 | 71 | NS_CC_WIDGET_END 72 | 73 | #endif //__CCWIDGET_LAYOUT_H__ -------------------------------------------------------------------------------- /CocosWidget/ListView.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2014 Lijunlin - Jason lee 3 | 4 | Created by Lijunlin - Jason lee on 2014 5 | 6 | jason.lee.c@foxmail.com 7 | http://www.cocos2d-x.org 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | ****************************************************************************/ 27 | #ifndef __CCWIDGET_LISTVIEW_H__ 28 | #define __CCWIDGET_LISTVIEW_H__ 29 | 30 | #include "cocos2d.h" 31 | #include "WidgetMacros.h" 32 | #include "Widget.h" 33 | #include "ScrollView.h" 34 | #include "WidgetProtocol.h" 35 | #include 36 | 37 | NS_CC_WIDGET_BEGIN 38 | 39 | /** 40 | * class : CListView 41 | * author : Jason lee 42 | * email : jason.lee.c@foxmail.com 43 | * descpt : list view define 44 | */ 45 | class CListView : public CScrollView 46 | { 47 | public: 48 | CListView(); 49 | virtual ~CListView(); 50 | static CListView* create(const CCSize& contentSize); 51 | 52 | void insertNodeAtLast(CCNode* pNode); 53 | void insertNodeAtFront(CCNode* pNode); 54 | void insertNode(CCNode* pNode, CCNode* pTarget); 55 | void insertNode(CCNode* pNode, unsigned int idx); 56 | 57 | void removeNodeAtIndex(unsigned int idx); 58 | void removeNode(CCNode* pNode); 59 | void removeFrontNode(); 60 | void removeLastNode(); 61 | void removeAllNodes(); 62 | 63 | CCArray* getNodes(); 64 | CCNode* getNodeAtIndex(unsigned int idx); 65 | unsigned int getNodeCount() const; 66 | void reloadData(); 67 | 68 | protected: 69 | void updateNodesPosition(); 70 | 71 | protected: 72 | std::vector m_vNodeList; 73 | float m_fLayoutIndexSize; 74 | }; 75 | 76 | NS_CC_WIDGET_END 77 | 78 | #endif //__CCWIDGET_LISTVIEW_H__ -------------------------------------------------------------------------------- /CocosWidget/Lua_cocos2dx_widget.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2014 Lijunlin - Jason lee 3 | 4 | Created by Lijunlin - Jason lee on 2014 5 | 6 | jason.lee.c@foxmail.com 7 | http://www.cocos2d-x.org 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | ****************************************************************************/ 27 | #ifndef __CCWIDGET_LUA_H__ 28 | #define __CCWIDGET_LUA_H__ 29 | 30 | #include "WidgetMacros.h" 31 | 32 | #if USING_LUA 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | #include "tolua++.h" 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | TOLUA_API int tolua_Lua_cocos2dx_widget_open(lua_State* tolua_S); 42 | #endif 43 | 44 | #endif //__CCWIDGET_LUA_H__ 45 | -------------------------------------------------------------------------------- /CocosWidget/PageView.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2014 Lijunlin - Jason lee 3 | 4 | Created by Lijunlin - Jason lee on 2014 5 | 6 | jason.lee.c@foxmail.com 7 | http://www.cocos2d-x.org 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | ****************************************************************************/ 27 | #ifndef __CCWIDGET_PAGEVIEW_H__ 28 | #define __CCWIDGET_PAGEVIEW_H__ 29 | 30 | #include "cocos2d.h" 31 | #include "WidgetMacros.h" 32 | #include "Widget.h" 33 | #include "TableView.h" 34 | #include "WidgetProtocol.h" 35 | 36 | NS_CC_WIDGET_BEGIN 37 | 38 | class CPageView; 39 | class CPageViewCell; 40 | 41 | /** 42 | * class : CPageViewCell 43 | * author : Jason lee 44 | * email : jason.lee.c@foxmail.com 45 | * descpt : page view cell define 46 | */ 47 | class CPageViewCell : public CTableViewCell 48 | { 49 | public: 50 | CPageViewCell(){}; 51 | }; 52 | 53 | /** 54 | * class : CPageView 55 | * author : Jason lee 56 | * email : jason.lee.c@foxmail.com 57 | * descpt : page view define 58 | */ 59 | class CPageView : public CTableView, public CPageChangeableProtocol 60 | { 61 | public: 62 | CPageView(); 63 | static CPageView* create(const CCSize& tPageSize); 64 | static CPageView* create(const CCSize& tPageSize, unsigned int uPageCount, 65 | CCObject* pListener, SEL_DataSoucreAdapterHandler pHandler); 66 | 67 | protected: 68 | virtual void onScrolling(); 69 | virtual void updateCellAtIndex(unsigned int idx); 70 | }; 71 | 72 | NS_CC_WIDGET_END 73 | 74 | #endif //__CCWIDGET_PAGEVIEW_H__ -------------------------------------------------------------------------------- /CocosWidget/TextArea.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2014 Lijunlin - Jason lee 3 | 4 | Created by Lijunlin - Jason lee on 2014 5 | 6 | jason.lee.c@foxmail.com 7 | http://www.cocos2d-x.org 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | ****************************************************************************/ 27 | #include "TextArea.h" 28 | 29 | NS_CC_WIDGET_BEGIN 30 | 31 | CTextArea::CTextArea() 32 | { 33 | 34 | } 35 | 36 | CTextArea::~CTextArea() 37 | { 38 | 39 | } 40 | 41 | CTextArea* CTextArea::create(const CCSize& tSize) 42 | { 43 | CTextArea* pRet = new CTextArea(); 44 | if( pRet && pRet->init() ) 45 | { 46 | pRet->setDimensions(tSize); 47 | pRet->autorelease(); 48 | return pRet; 49 | } 50 | CC_SAFE_DELETE(pRet); 51 | return NULL; 52 | } 53 | 54 | NS_CC_WIDGET_END -------------------------------------------------------------------------------- /CocosWidget/TextArea.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2014 Lijunlin - Jason lee 3 | 4 | Created by Lijunlin - Jason lee on 2014 5 | 6 | jason.lee.c@foxmail.com 7 | http://www.cocos2d-x.org 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | ****************************************************************************/ 27 | #ifndef __CCWIDGET_TEXTAREA_H__ 28 | #define __CCWIDGET_TEXTAREA_H__ 29 | 30 | #include "cocos2d.h" 31 | #include "WidgetMacros.h" 32 | #include "WidgetProtocol.h" 33 | #include "Widget.h" 34 | #include "Label.h" 35 | 36 | NS_CC_WIDGET_BEGIN 37 | 38 | /** 39 | * class : CTextArea 40 | * author : Jason lee 41 | * email : jason.lee.c@foxmail.com 42 | * descpt : text area define 43 | */ 44 | class CTextArea : public CLabel 45 | { 46 | public: 47 | CTextArea(); 48 | virtual ~CTextArea(); 49 | static CTextArea* create(const CCSize& tSize); 50 | }; 51 | 52 | NS_CC_WIDGET_END 53 | 54 | #endif //__CCWIDGET_TEXTAREA_H__ -------------------------------------------------------------------------------- /CocosWidget/ToggleView.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2014 Lijunlin - Jason lee 3 | 4 | Created by Lijunlin - Jason lee on 2014 5 | 6 | jason.lee.c@foxmail.com 7 | http://www.cocos2d-x.org 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | ****************************************************************************/ 27 | #ifndef __CCWIDGET_TOGGLEVIEW_H__ 28 | #define __CCWIDGET_TOGGLEVIEW_H__ 29 | 30 | #include "cocos2d.h" 31 | #include "WidgetMacros.h" 32 | #include "Widget.h" 33 | #include "Button.h" 34 | #include "WidgetProtocol.h" 35 | 36 | NS_CC_WIDGET_BEGIN 37 | 38 | /** 39 | * class : CToggleView 40 | * author : Jason lee 41 | * email : jason.lee.c@foxmail.com 42 | * descpt : toggle view define 43 | */ 44 | class CToggleView : public CButton, public CCheckableProtocol 45 | { 46 | public: 47 | CToggleView(); 48 | virtual ~CToggleView(); 49 | 50 | static CToggleView* create(); 51 | static CToggleView* create(const char* pNormal, const char* pSelected = NULL, const char* pDisabled = NULL); 52 | static CToggleView* createWith9Sprite(const CCSize& tSize, const char* pNormal, const char* pSelected = NULL, const char* pDisabled = NULL); 53 | virtual void setEnabled(bool bEnabled); 54 | virtual void setChecked(bool bChecked); 55 | 56 | public: 57 | virtual CWidgetTouchModel onTouchBegan(CCTouch *pTouch); 58 | virtual void onTouchMoved(CCTouch *pTouch, float fDuration); 59 | virtual void onTouchEnded(CCTouch *pTouch, float fDuration); 60 | virtual void onTouchCancelled(CCTouch *pTouch, float fDuration); 61 | }; 62 | 63 | NS_CC_WIDGET_END 64 | 65 | #endif //__CCWIDGET_TOGGLEVIEW_H__ -------------------------------------------------------------------------------- /CocosWidget/WidgetMacros.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2014 Lijunlin - Jason lee 3 | 4 | Created by Lijunlin - Jason lee on 2014 5 | 6 | jason.lee.c@foxmail.com 7 | http://www.cocos2d-x.org 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | ****************************************************************************/ 27 | #ifndef __CCWIDGET_WIDGETMACROS_H__ 28 | #define __CCWIDGET_WIDGETMACROS_H__ 29 | 30 | #ifndef USING_LUA 31 | #define USING_LUA 0 32 | #endif 33 | 34 | #define NS_CC_WIDGET_BEGIN namespace cocos2d { namespace cocoswidget { 35 | #define NS_CC_WIDGET_END }} 36 | #define USING_NS_CC_WIDGET using namespace cocos2d::cocoswidget 37 | 38 | #endif //__CCWIDGET_WIDGETMACROS_H__ -------------------------------------------------------------------------------- /CocosWidget/WitlsMacros.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2014 Lijunlin - Jason lee 3 | 4 | Created by Lijunlin - Jason lee on 2014 5 | 6 | jason.lee.c@foxmail.com 7 | http://www.cocos2d-x.org 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | ****************************************************************************/ 27 | #ifndef __CWIDGET_WITLSMACROS_H__ 28 | #define __CWIDGET_WITLSMACROS_H__ 29 | 30 | int str_utf8_char_len(unsigned char ch); 31 | 32 | int str_utf8_len(const char* p_str); 33 | 34 | char* sub_utf8_str(const char* p_str, unsigned int start, unsigned int end); 35 | 36 | #endif //__CWIDGET_WITLSMACROS_H__ -------------------------------------------------------------------------------- /Cpp/Classes/AppDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "cocos2d.h" 2 | #include "CCEGLView.h" 3 | #include "AppDelegate.h" 4 | #include "SimpleAudioEngine.h" 5 | #include "MenuScene.h" 6 | 7 | using namespace CocosDenshion; 8 | using namespace cocos2d::cocoswidget; 9 | 10 | USING_NS_CC; 11 | 12 | AppDelegate::AppDelegate() 13 | { 14 | } 15 | 16 | AppDelegate::~AppDelegate() 17 | { 18 | SimpleAudioEngine::end(); 19 | } 20 | 21 | bool AppDelegate::applicationDidFinishLaunching() 22 | { 23 | CCDirector *pDirector = CCDirector::sharedDirector(); 24 | pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); 25 | pDirector->setDisplayStats(true); 26 | pDirector->setAnimationInterval(1.0 / 60); 27 | 28 | CCEGLView::sharedOpenGLView()->setDesignResolutionSize(960, 640, kResolutionShowAll); 29 | 30 | MenuScene* pMenuScene = new MenuScene(); 31 | pMenuScene->init(); 32 | pMenuScene->autorelease(); 33 | pDirector->runWithScene(pMenuScene); 34 | 35 | return true; 36 | } 37 | 38 | // This function will be called when the app is inactive. When comes a phone call,it's be invoked too 39 | void AppDelegate::applicationDidEnterBackground() 40 | { 41 | CCDirector::sharedDirector()->stopAnimation(); 42 | 43 | SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); 44 | } 45 | 46 | // this function will be called when the app is active again 47 | void AppDelegate::applicationWillEnterForeground() 48 | { 49 | CCDirector::sharedDirector()->startAnimation(); 50 | 51 | SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); 52 | } 53 | -------------------------------------------------------------------------------- /Cpp/Classes/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef __APP_DELEGATE_H__ 2 | #define __APP_DELEGATE_H__ 3 | 4 | #include "cocos2d.h" 5 | 6 | /** 7 | @brief The cocos2d Application. 8 | 9 | The reason for implement as private inheritance is to hide some interface call by CCDirector. 10 | */ 11 | class AppDelegate : private cocos2d::CCApplication 12 | { 13 | public: 14 | AppDelegate(); 15 | virtual ~AppDelegate(); 16 | 17 | /** 18 | @brief Implement CCDirector and CCScene init code here. 19 | @return true Initialize success, app continue. 20 | @return false Initialize failed, app terminate. 21 | */ 22 | virtual bool applicationDidFinishLaunching(); 23 | 24 | /** 25 | @brief The function be called when the application enter background 26 | @param the pointer of the application 27 | */ 28 | virtual void applicationDidEnterBackground(); 29 | 30 | /** 31 | @brief The function be called when the application enter foreground 32 | @param the pointer of the application 33 | */ 34 | virtual void applicationWillEnterForeground(); 35 | }; 36 | 37 | #endif // __APP_DELEGATE_H__ 38 | 39 | -------------------------------------------------------------------------------- /Cpp/Classes/MenuScene.h: -------------------------------------------------------------------------------- 1 | #ifndef __MENUSCENE_H__ 2 | #define __MENUSCENE_H__ 3 | 4 | #include "cocos2d.h" 5 | #include "../../CocosWidget/cocos-widget.h" 6 | using namespace cocos2d; 7 | using namespace cocos2d::cocoswidget; 8 | #include 9 | using namespace std; 10 | 11 | class MenuScene : public CCScene 12 | { 13 | public: 14 | MenuScene(); 15 | virtual ~MenuScene(); 16 | virtual bool init(); 17 | 18 | private: 19 | CTableView* m_pMenuTableView; 20 | CCObject* menuTableDataSource(CCObject* pConvertCell, unsigned int idx); 21 | CWidgetTouchModel onTextTouchDown(CCObject* pSender, CCTouch* pTouch); 22 | bool onTextTouchEnd(CCObject* pSender, CCTouch* pTouch, float fDuration); 23 | bool onTextTouchCancelled(CCObject* pSender, CCTouch* pTouch, float fDuration); 24 | void onTextClick(CCObject* pSender); 25 | 26 | private: 27 | std::vector m_vMenuItems; 28 | }; 29 | 30 | class BaseTestScene : public CCScene 31 | { 32 | public: 33 | BaseTestScene(); 34 | virtual bool init(); 35 | 36 | protected: 37 | CWidgetWindow* m_pWindow; 38 | CButton* m_pNextBtn; 39 | CButton* m_pBackBtn; 40 | CButton* m_pRefBtn; 41 | CLabel* m_pTitleText; 42 | CLabel* m_pDescriptionText; 43 | CLabel* m_pMenuText; 44 | 45 | protected: 46 | virtual void setDescription(const char* str); 47 | virtual void setTitle(const char* str); 48 | virtual void onNextBtnClick(CCObject* pSender){}; 49 | virtual void onBackBtnClick(CCObject* pSender){}; 50 | virtual void onRefBtnClick(CCObject* pSender){}; 51 | virtual void onMenuBtnClick(CCObject* pSender); 52 | }; 53 | 54 | 55 | #endif //__MENUSCENE_H__ -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/CheckBoxTest/CheckBoxTest.h: -------------------------------------------------------------------------------- 1 | #ifndef __CCheckBoxTEST_H__ 2 | #define __CCheckBoxTEST_H__ 3 | 4 | #include "../../MenuScene.h" 5 | 6 | ////////////////////////////////////////////////////// 7 | 8 | class CCheckBoxTestSceneBase : public BaseTestScene 9 | { 10 | public: 11 | virtual void onNextBtnClick(CCObject* pSender); 12 | virtual void onBackBtnClick(CCObject* pSender); 13 | virtual void onRefBtnClick(CCObject* pSender); 14 | }; 15 | 16 | ////////////////////////////////////////////////////// 17 | 18 | class CCheckBoxBasicTest : public CCheckBoxTestSceneBase 19 | { 20 | public: 21 | virtual bool init(); 22 | void onClick(CCObject* pSender); 23 | CLabel* m_pText; 24 | }; 25 | 26 | ////////////////////////////////////////////////////// 27 | 28 | class CCheckBoxExclusionTest : public CCheckBoxTestSceneBase 29 | { 30 | public: 31 | virtual bool init(); 32 | void onClick(CCObject* pSender); 33 | }; 34 | 35 | ////////////////////////////////////////////////////// 36 | 37 | static int CCheckBox_test_idx; 38 | 39 | static CCScene* getCCheckBoxTestScene() 40 | { 41 | switch(CCheckBox_test_idx) 42 | { 43 | case 0: 44 | return new CCheckBoxBasicTest(); 45 | case 1: 46 | return new CCheckBoxExclusionTest(); 47 | default: 48 | CCheckBox_test_idx = 0; 49 | return new CCheckBoxBasicTest(); 50 | } 51 | return NULL; 52 | } 53 | 54 | static CCScene* pushCCheckBoxTestScene() 55 | { 56 | CCheckBox_test_idx = 0; 57 | CCScene* pScene = getCCheckBoxTestScene(); 58 | pScene->init(); 59 | pScene->autorelease(); 60 | CCDirector::sharedDirector()->pushScene(pScene); 61 | return pScene; 62 | } 63 | 64 | static void nextCCheckBoxTestScene() 65 | { 66 | CCheckBox_test_idx++; 67 | CCScene* pScene = getCCheckBoxTestScene(); 68 | pScene->init(); 69 | pScene->autorelease(); 70 | CCDirector::sharedDirector()->replaceScene(pScene); 71 | } 72 | 73 | static void backCCheckBoxTestScene() 74 | { 75 | CCheckBox_test_idx--; 76 | CCScene* pScene = getCCheckBoxTestScene(); 77 | pScene->init(); 78 | pScene->autorelease(); 79 | CCDirector::sharedDirector()->replaceScene(pScene); 80 | } 81 | 82 | static void refCCheckBoxTestScene() 83 | { 84 | CCScene* pScene = getCCheckBoxTestScene(); 85 | pScene->init(); 86 | pScene->autorelease(); 87 | CCDirector::sharedDirector()->replaceScene(pScene); 88 | } 89 | 90 | #endif //__CCheckBoxTEST_H__ -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/ControlViewTest/ControlViewTest.cpp: -------------------------------------------------------------------------------- 1 | #include "ControlViewTest.h" 2 | 3 | void CControlViewTestSceneBase::onNextBtnClick(CCObject* pSender) 4 | { 5 | nextCControlViewTestScene(); 6 | } 7 | 8 | void CControlViewTestSceneBase::onBackBtnClick(CCObject* pSender) 9 | { 10 | backCControlViewTestScene(); 11 | } 12 | 13 | void CControlViewTestSceneBase::onRefBtnClick(CCObject* pSender) 14 | { 15 | refCControlViewTestScene(); 16 | } 17 | 18 | ////////////////////////////////////////////////////// 19 | 20 | bool CControlViewBasicTest::init() 21 | { 22 | CControlViewTestSceneBase::init(); 23 | setTitle("CControlViewBasicTest"); 24 | setDescription("control the icon to move"); 25 | 26 | m_pIcon = CCSprite::create("icon.png"); 27 | m_pIcon->setPosition(CCPoint(480, 320)); 28 | m_pWindow->addChild(m_pIcon); 29 | 30 | CControlView* pView = CControlView::create( 31 | "control_baseboard.png", "control_joystick.png"); 32 | pView->setPosition(CCPoint(100, 100)); 33 | pView->setRadius(pView->getContentSize().width / 2); 34 | pView->setOnControlListener(this, ccw_control_selector(CControlViewBasicTest::onTouched)); 35 | pView->setAnchorPoint(CCPointZero); 36 | pView->setScale(1.5f); 37 | pView->setOpacity(200); 38 | m_pWindow->addChild(pView); 39 | 40 | CControlView* pView2 = CControlView::create(); 41 | pView2->setBaseBoardImage("control_baseboard.png"); 42 | pView2->setPosition(CCPoint(860, 100)); 43 | pView2->setRadius(pView2->getContentSize().width / 2); 44 | pView2->setOnControlListener(this, ccw_control_selector(CControlViewBasicTest::onTouched)); 45 | pView2->setAnchorPoint(CCPoint(1, 0)); 46 | pView2->setScale(1.5f); 47 | pView2->setOpacity(200); 48 | m_pWindow->addChild(pView2); 49 | 50 | return true; 51 | } 52 | void CControlViewBasicTest::onTouched(CCObject* pSender, float fx, float fy) 53 | { 54 | m_pIcon->setPosition(m_pIcon->getPosition() + CCPoint(fx, fy)); 55 | } 56 | 57 | 58 | ////////////////////////////////////////////////////// 59 | 60 | -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/ControlViewTest/ControlViewTest.h: -------------------------------------------------------------------------------- 1 | #ifndef __CControlViewTEST_H__ 2 | #define __CControlViewTEST_H__ 3 | 4 | #include "../../MenuScene.h" 5 | 6 | ////////////////////////////////////////////////////// 7 | 8 | class CControlViewTestSceneBase : public BaseTestScene 9 | { 10 | public: 11 | virtual void onNextBtnClick(CCObject* pSender); 12 | virtual void onBackBtnClick(CCObject* pSender); 13 | virtual void onRefBtnClick(CCObject* pSender); 14 | }; 15 | 16 | ////////////////////////////////////////////////////// 17 | 18 | class CControlViewBasicTest : public CControlViewTestSceneBase 19 | { 20 | public: 21 | virtual bool init(); 22 | void onTouched(CCObject* pSender, float fx, float fy); 23 | CCSprite* m_pIcon; 24 | }; 25 | 26 | ////////////////////////////////////////////////////// 27 | 28 | static int CControlView_test_idx; 29 | 30 | static CCScene* getCControlViewTestScene() 31 | { 32 | switch(CControlView_test_idx) 33 | { 34 | case 0: 35 | return new CControlViewBasicTest(); 36 | default: 37 | CControlView_test_idx = 0; 38 | return new CControlViewBasicTest(); 39 | } 40 | return NULL; 41 | } 42 | 43 | static CCScene* pushCControlViewTestScene() 44 | { 45 | CControlView_test_idx = 0; 46 | CCScene* pScene = getCControlViewTestScene(); 47 | pScene->init(); 48 | pScene->autorelease(); 49 | CCDirector::sharedDirector()->pushScene(pScene); 50 | return pScene; 51 | } 52 | 53 | static void nextCControlViewTestScene() 54 | { 55 | CControlView_test_idx++; 56 | CCScene* pScene = getCControlViewTestScene(); 57 | pScene->init(); 58 | pScene->autorelease(); 59 | CCDirector::sharedDirector()->replaceScene(pScene); 60 | } 61 | 62 | static void backCControlViewTestScene() 63 | { 64 | CControlView_test_idx--; 65 | CCScene* pScene = getCControlViewTestScene(); 66 | pScene->init(); 67 | pScene->autorelease(); 68 | CCDirector::sharedDirector()->replaceScene(pScene); 69 | } 70 | 71 | static void refCControlViewTestScene() 72 | { 73 | CCScene* pScene = getCControlViewTestScene(); 74 | pScene->init(); 75 | pScene->autorelease(); 76 | CCDirector::sharedDirector()->replaceScene(pScene); 77 | } 78 | 79 | #endif //__CControlViewTEST_H__ -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/DrawOrderTest/DrawOrderTest.cpp: -------------------------------------------------------------------------------- 1 | #include "DrawOrderTest.h" 2 | 3 | void DrawOrderTestSceneBase::onNextBtnClick(CCObject* pSender) 4 | { 5 | nextDrawOrderTestScene(); 6 | } 7 | 8 | void DrawOrderTestSceneBase::onBackBtnClick(CCObject* pSender) 9 | { 10 | backDrawOrderTestScene(); 11 | } 12 | 13 | void DrawOrderTestSceneBase::onRefBtnClick(CCObject* pSender) 14 | { 15 | refDrawOrderTestScene(); 16 | } 17 | 18 | ////////////////////////////////////////////////////// 19 | 20 | bool DrawOrderBasicTest::init() 21 | { 22 | DrawOrderTestSceneBase::init(); 23 | setTitle("DrawOrderBasicTest"); 24 | setDescription("swap the zorder for see event dispatch"); 25 | 26 | CButton* pSwapBtn = CButton::create(); 27 | pSwapBtn->setPosition(CCPoint(170, 320)); 28 | pSwapBtn->setScale9Enabled(true); 29 | pSwapBtn->setNormalImage("sprite9_btn1.png"); 30 | pSwapBtn->setSelectedImage("sprite9_btn2.png"); 31 | pSwapBtn->initText("swap z order", "", 30); 32 | pSwapBtn->setCascadeTextSizeEnabled(true, CCSize(50, 30)); 33 | pSwapBtn->setOnClickListener(this, ccw_click_selector(DrawOrderBasicTest::onClick)); 34 | m_pWindow->addChild(pSwapBtn); 35 | 36 | pButton1 = CButton::create("btn1_1.png", "btn1_2.png"); 37 | pButton1->setZOrder(1); 38 | pButton1->setPosition(CCPoint(480, 320)); 39 | m_pWindow->addChild(pButton1); 40 | 41 | pButton2 = CButton::create("btn1_1.png", "btn1_2.png"); 42 | pButton2->setZOrder(2); 43 | pButton2->setPosition(CCPoint(520, 350)); 44 | m_pWindow->addChild(pButton2); 45 | 46 | return true; 47 | } 48 | 49 | void DrawOrderBasicTest::onClick(CCObject* pSender) 50 | { 51 | int z = pButton2->getZOrder(); 52 | pButton2->setZOrder(pButton1->getZOrder()); 53 | pButton1->setZOrder(z); 54 | } 55 | 56 | ////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/DrawOrderTest/DrawOrderTest.h: -------------------------------------------------------------------------------- 1 | #ifndef __DrawOrderTEST_H__ 2 | #define __DrawOrderTEST_H__ 3 | 4 | #include "../../MenuScene.h" 5 | 6 | ////////////////////////////////////////////////////// 7 | 8 | class DrawOrderTestSceneBase : public BaseTestScene 9 | { 10 | public: 11 | virtual void onNextBtnClick(CCObject* pSender); 12 | virtual void onBackBtnClick(CCObject* pSender); 13 | virtual void onRefBtnClick(CCObject* pSender); 14 | }; 15 | 16 | ////////////////////////////////////////////////////// 17 | 18 | class DrawOrderBasicTest : public DrawOrderTestSceneBase 19 | { 20 | public: 21 | virtual bool init(); 22 | void onClick(CCObject* pSender); 23 | CButton* pButton1; 24 | CButton* pButton2; 25 | }; 26 | 27 | ////////////////////////////////////////////////////// 28 | 29 | static int DrawOrder_test_idx; 30 | 31 | static CCScene* getDrawOrderTestScene() 32 | { 33 | switch(DrawOrder_test_idx) 34 | { 35 | case 0: 36 | return new DrawOrderBasicTest(); 37 | default: 38 | DrawOrder_test_idx = 0; 39 | return new DrawOrderBasicTest(); 40 | } 41 | return NULL; 42 | } 43 | 44 | static CCScene* pushDrawOrderTestScene() 45 | { 46 | DrawOrder_test_idx = 0; 47 | CCScene* pScene = getDrawOrderTestScene(); 48 | pScene->init(); 49 | pScene->autorelease(); 50 | CCDirector::sharedDirector()->pushScene(pScene); 51 | return pScene; 52 | } 53 | 54 | static void nextDrawOrderTestScene() 55 | { 56 | DrawOrder_test_idx++; 57 | CCScene* pScene = getDrawOrderTestScene(); 58 | pScene->init(); 59 | pScene->autorelease(); 60 | CCDirector::sharedDirector()->replaceScene(pScene); 61 | } 62 | 63 | static void backDrawOrderTestScene() 64 | { 65 | DrawOrder_test_idx--; 66 | CCScene* pScene = getDrawOrderTestScene(); 67 | pScene->init(); 68 | pScene->autorelease(); 69 | CCDirector::sharedDirector()->replaceScene(pScene); 70 | } 71 | 72 | static void refDrawOrderTestScene() 73 | { 74 | CCScene* pScene = getDrawOrderTestScene(); 75 | pScene->init(); 76 | pScene->autorelease(); 77 | CCDirector::sharedDirector()->replaceScene(pScene); 78 | } 79 | 80 | #endif //__DrawOrderTEST_H__ -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/ExpandableListViewTest/ExpandableListViewTest.h: -------------------------------------------------------------------------------- 1 | #ifndef __CExpandableListViewTEST_H__ 2 | #define __CExpandableListViewTEST_H__ 3 | 4 | #include "../../MenuScene.h" 5 | 6 | ////////////////////////////////////////////////////// 7 | 8 | class CExpandableListViewTestSceneBase : public BaseTestScene 9 | { 10 | public: 11 | virtual void onNextBtnClick(CCObject* pSender); 12 | virtual void onBackBtnClick(CCObject* pSender); 13 | virtual void onRefBtnClick(CCObject* pSender); 14 | }; 15 | 16 | ////////////////////////////////////////////////////// 17 | 18 | class CExpandableListViewBasicTest : public CExpandableListViewTestSceneBase 19 | { 20 | public: 21 | virtual bool init(); 22 | void onClick(CCObject* pSender); 23 | CExpandableListView* pListView; 24 | }; 25 | 26 | 27 | ////////////////////////////////////////////////////// 28 | 29 | static int CExpandableListView_test_idx; 30 | 31 | static CCScene* getCExpandableListViewTestScene() 32 | { 33 | switch(CExpandableListView_test_idx) 34 | { 35 | case 0: 36 | return new CExpandableListViewBasicTest(); 37 | default: 38 | CExpandableListView_test_idx = 0; 39 | return new CExpandableListViewBasicTest(); 40 | } 41 | return NULL; 42 | } 43 | 44 | static CCScene* pushCExpandableListViewTestScene() 45 | { 46 | CExpandableListView_test_idx = 0; 47 | CCScene* pScene = getCExpandableListViewTestScene(); 48 | pScene->init(); 49 | pScene->autorelease(); 50 | CCDirector::sharedDirector()->pushScene(pScene); 51 | return pScene; 52 | } 53 | 54 | static void nextCExpandableListViewTestScene() 55 | { 56 | CExpandableListView_test_idx++; 57 | CCScene* pScene = getCExpandableListViewTestScene(); 58 | pScene->init(); 59 | pScene->autorelease(); 60 | CCDirector::sharedDirector()->replaceScene(pScene); 61 | } 62 | 63 | static void backCExpandableListViewTestScene() 64 | { 65 | CExpandableListView_test_idx--; 66 | CCScene* pScene = getCExpandableListViewTestScene(); 67 | pScene->init(); 68 | pScene->autorelease(); 69 | CCDirector::sharedDirector()->replaceScene(pScene); 70 | } 71 | 72 | static void refCExpandableListViewTestScene() 73 | { 74 | CCScene* pScene = getCExpandableListViewTestScene(); 75 | pScene->init(); 76 | pScene->autorelease(); 77 | CCDirector::sharedDirector()->replaceScene(pScene); 78 | } 79 | 80 | #endif //__CExpandableListViewTEST_H__ -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/GridViewTest/GridViewTest.cpp: -------------------------------------------------------------------------------- 1 | #include "GridViewTest.h" 2 | 3 | void CGridViewTestSceneBase::onNextBtnClick(CCObject* pSender) 4 | { 5 | nextCGridViewTestScene(); 6 | } 7 | 8 | void CGridViewTestSceneBase::onBackBtnClick(CCObject* pSender) 9 | { 10 | backCGridViewTestScene(); 11 | } 12 | 13 | void CGridViewTestSceneBase::onRefBtnClick(CCObject* pSender) 14 | { 15 | refCGridViewTestScene(); 16 | } 17 | 18 | ////////////////////////////////////////////////////// 19 | 20 | bool CGridViewBasicTest::init() 21 | { 22 | CGridViewTestSceneBase::init(); 23 | setTitle("CGridViewBasicTest"); 24 | setDescription("GridView basic test (only work in vertical)"); 25 | 26 | CCSprite* pBg = CCSprite::create("background.png"); 27 | pBg->setPosition(CCPoint(480, 320)); 28 | m_pWindow->addChild(pBg); 29 | 30 | CGridView* pGridView = CGridView::create( 31 | CCSize(480, 320), 32 | CCSize(480 / 5, 320 / 4), 33 | 96, this, 34 | ccw_datasource_adapter_selector(CGridViewBasicTest::gridviewDataSource)); 35 | pGridView->setColumns(5); 36 | pGridView->setPosition(CCPoint(480, 320)); 37 | m_pWindow->addChild(pGridView); 38 | pGridView->setAutoRelocate(true); 39 | pGridView->reloadData(); 40 | 41 | return true; 42 | } 43 | 44 | CCObject* CGridViewBasicTest::gridviewDataSource(CCObject* pConvertView, unsigned int idx) 45 | { 46 | CGridViewCell* pCell = (CGridViewCell*) pConvertView; 47 | CButton* pButton = NULL; 48 | 49 | if(!pCell) 50 | { 51 | pCell = new CGridViewCell(); 52 | pCell->autorelease(); 53 | 54 | pButton = CButton::createWith9Sprite(CCSizeMake(70, 70), "sprite9_btn1.png", "sprite9_btn2.png"); 55 | pButton->setPosition(CCPoint(480 / 5 / 2, 320 / 4 / 2)); 56 | pButton->getLabel()->setFontSize(25.0f); 57 | pButton->setTag(1); 58 | pCell->addChild(pButton); 59 | } 60 | else 61 | { 62 | pButton = (CButton*) pCell->getChildByTag(1); 63 | } 64 | 65 | char buff[64]; 66 | sprintf(buff, "%u", idx); 67 | pButton->getLabel()->setString(buff); 68 | pButton->setUserTag(idx); 69 | 70 | return pCell; 71 | } 72 | 73 | ////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/GridViewTest/GridViewTest.h: -------------------------------------------------------------------------------- 1 | #ifndef __CGridViewTEST_H__ 2 | #define __CGridViewTEST_H__ 3 | 4 | #include "../../MenuScene.h" 5 | #include 6 | #include 7 | 8 | ////////////////////////////////////////////////////// 9 | 10 | class CGridViewTestSceneBase : public BaseTestScene 11 | { 12 | public: 13 | virtual void onNextBtnClick(CCObject* pSender); 14 | virtual void onBackBtnClick(CCObject* pSender); 15 | virtual void onRefBtnClick(CCObject* pSender); 16 | }; 17 | 18 | ////////////////////////////////////////////////////// 19 | 20 | class CGridViewBasicTest : public CGridViewTestSceneBase 21 | { 22 | public: 23 | virtual bool init(); 24 | CCObject* gridviewDataSource(CCObject* pConvertView, unsigned int idx); 25 | }; 26 | 27 | ////////////////////////////////////////////////////// 28 | 29 | static int CGridView_test_idx; 30 | 31 | static CCScene* getCGridViewTestScene() 32 | { 33 | switch(CGridView_test_idx) 34 | { 35 | case 0: 36 | return new CGridViewBasicTest(); 37 | default: 38 | CGridView_test_idx = 0; 39 | return new CGridViewBasicTest(); 40 | } 41 | return NULL; 42 | } 43 | 44 | static CCScene* pushCGridViewTestScene() 45 | { 46 | CGridView_test_idx = 0; 47 | CCScene* pScene = getCGridViewTestScene(); 48 | pScene->init(); 49 | pScene->autorelease(); 50 | CCDirector::sharedDirector()->pushScene(pScene); 51 | return pScene; 52 | } 53 | 54 | static void nextCGridViewTestScene() 55 | { 56 | CGridView_test_idx++; 57 | CCScene* pScene = getCGridViewTestScene(); 58 | pScene->init(); 59 | pScene->autorelease(); 60 | CCDirector::sharedDirector()->replaceScene(pScene); 61 | } 62 | 63 | static void backCGridViewTestScene() 64 | { 65 | CGridView_test_idx--; 66 | CCScene* pScene = getCGridViewTestScene(); 67 | pScene->init(); 68 | pScene->autorelease(); 69 | CCDirector::sharedDirector()->replaceScene(pScene); 70 | } 71 | 72 | static void refCGridViewTestScene() 73 | { 74 | CCScene* pScene = getCGridViewTestScene(); 75 | pScene->init(); 76 | pScene->autorelease(); 77 | CCDirector::sharedDirector()->replaceScene(pScene); 78 | } 79 | 80 | #endif //__CGridViewTEST_H__ -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/LayoutTest/LayoutTest.cpp: -------------------------------------------------------------------------------- 1 | #include "LayoutTest.h" 2 | 3 | void CLayoutTestSceneBase::onNextBtnClick(CCObject* pSender) 4 | { 5 | nextCLayoutTestScene(); 6 | } 7 | 8 | void CLayoutTestSceneBase::onBackBtnClick(CCObject* pSender) 9 | { 10 | backCLayoutTestScene(); 11 | } 12 | 13 | void CLayoutTestSceneBase::onRefBtnClick(CCObject* pSender) 14 | { 15 | refCLayoutTestScene(); 16 | } 17 | 18 | ////////////////////////////////////////////////////// 19 | 20 | bool CLayoutBasicTest::init() 21 | { 22 | CLayoutTestSceneBase::init(); 23 | setTitle("CLayoutBasicTest"); 24 | setDescription("some things in a basic layout"); 25 | 26 | CLayout* pLayout = CLayout::create(); 27 | pLayout->setPosition(CCPoint(480 ,320)); 28 | pLayout->setContentSize(CCSize(480, 320)); 29 | pLayout->setBackgroundImage("background.png"); 30 | m_pWindow->addChild(pLayout); 31 | 32 | CButton* pButton = CButton::createWith9Sprite(CCSize(150, 50), "sprite9_btn1.png", "sprite9_btn2.png"); 33 | pButton->setPosition(CCPoint(150, 100)); 34 | pLayout->addChild(pButton); 35 | 36 | CImageView* pImage = CImageView::create("icon.png"); 37 | pImage->setPosition(CCPoint(200, 150)); 38 | pLayout->addChild(pImage); 39 | 40 | return true; 41 | } 42 | 43 | ////////////////////////////////////////////////////// 44 | 45 | bool CLayoutColorTest::init() 46 | { 47 | CLayoutTestSceneBase::init(); 48 | setTitle("CLayoutColorTest"); 49 | setDescription("color back ground"); 50 | 51 | CLayout* pLayout = CLayout::create(); 52 | pLayout->setBackgroundColor(ccc4(255, 0, 0, 255)); 53 | pLayout->setPosition(CCPoint(480 ,320)); 54 | pLayout->setContentSize(CCSize(480, 320)); 55 | m_pWindow->addChild(pLayout); 56 | 57 | return true; 58 | } 59 | 60 | ////////////////////////////////////////////////////// 61 | 62 | bool CLayoutGradientTest::init() 63 | { 64 | CLayoutTestSceneBase::init(); 65 | setTitle("CLayoutGradientTest"); 66 | setDescription("Gradient back ground"); 67 | 68 | CLayout* pLayout = CLayout::create(); 69 | pLayout->setBackgroundGradient(ccc4(255,0,0,255), ccc4(0, 255, 0, 128), CCPoint(1.0f, 0.0f)); 70 | pLayout->setPosition(CCPoint(480 ,320)); 71 | pLayout->setContentSize(CCSize(480, 320)); 72 | m_pWindow->addChild(pLayout); 73 | 74 | return true; 75 | } -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/LayoutTest/LayoutTest.h: -------------------------------------------------------------------------------- 1 | #ifndef __CLayoutTEST_H__ 2 | #define __CLayoutTEST_H__ 3 | 4 | #include "../../MenuScene.h" 5 | 6 | ////////////////////////////////////////////////////// 7 | 8 | class CLayoutTestSceneBase : public BaseTestScene 9 | { 10 | public: 11 | virtual void onNextBtnClick(CCObject* pSender); 12 | virtual void onBackBtnClick(CCObject* pSender); 13 | virtual void onRefBtnClick(CCObject* pSender); 14 | }; 15 | 16 | ////////////////////////////////////////////////////// 17 | 18 | class CLayoutBasicTest : public CLayoutTestSceneBase 19 | { 20 | public: 21 | virtual bool init(); 22 | }; 23 | 24 | ////////////////////////////////////////////////////// 25 | 26 | class CLayoutColorTest : public CLayoutTestSceneBase 27 | { 28 | public: 29 | virtual bool init(); 30 | }; 31 | 32 | ////////////////////////////////////////////////////// 33 | 34 | class CLayoutGradientTest : public CLayoutTestSceneBase 35 | { 36 | public: 37 | virtual bool init(); 38 | }; 39 | 40 | ////////////////////////////////////////////////////// 41 | 42 | static int CLayout_test_idx; 43 | 44 | static CCScene* getCLayoutTestScene() 45 | { 46 | switch(CLayout_test_idx) 47 | { 48 | case 0: 49 | return new CLayoutBasicTest(); 50 | case 1: 51 | return new CLayoutColorTest(); 52 | case 2: 53 | return new CLayoutGradientTest(); 54 | default: 55 | CLayout_test_idx = 0; 56 | return new CLayoutBasicTest(); 57 | } 58 | return NULL; 59 | } 60 | 61 | static CCScene* pushCLayoutTestScene() 62 | { 63 | CLayout_test_idx = 0; 64 | CCScene* pScene = getCLayoutTestScene(); 65 | pScene->init(); 66 | pScene->autorelease(); 67 | CCDirector::sharedDirector()->pushScene(pScene); 68 | return pScene; 69 | } 70 | 71 | static void nextCLayoutTestScene() 72 | { 73 | CLayout_test_idx++; 74 | CCScene* pScene = getCLayoutTestScene(); 75 | pScene->init(); 76 | pScene->autorelease(); 77 | CCDirector::sharedDirector()->replaceScene(pScene); 78 | } 79 | 80 | static void backCLayoutTestScene() 81 | { 82 | CLayout_test_idx--; 83 | CCScene* pScene = getCLayoutTestScene(); 84 | pScene->init(); 85 | pScene->autorelease(); 86 | CCDirector::sharedDirector()->replaceScene(pScene); 87 | } 88 | 89 | static void refCLayoutTestScene() 90 | { 91 | CCScene* pScene = getCLayoutTestScene(); 92 | pScene->init(); 93 | pScene->autorelease(); 94 | CCDirector::sharedDirector()->replaceScene(pScene); 95 | } 96 | 97 | #endif //__CLayoutTEST_H__ -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/ListViewTest/ListViewTest.h: -------------------------------------------------------------------------------- 1 | #ifndef __CListViewTEST_H__ 2 | #define __CListViewTEST_H__ 3 | 4 | #include "../../MenuScene.h" 5 | 6 | ////////////////////////////////////////////////////// 7 | 8 | class CListViewTestSceneBase : public BaseTestScene 9 | { 10 | public: 11 | virtual void onNextBtnClick(CCObject* pSender); 12 | virtual void onBackBtnClick(CCObject* pSender); 13 | virtual void onRefBtnClick(CCObject* pSender); 14 | }; 15 | 16 | ////////////////////////////////////////////////////// 17 | 18 | class CListViewBasicTest : public CListViewTestSceneBase 19 | { 20 | public: 21 | struct tagItem 22 | { 23 | CCSize tSize; 24 | ccColor3B tColor; 25 | }; 26 | public: 27 | virtual bool init(); 28 | CListView* m_pListView; 29 | list m_lDatas; 30 | void onClick(CCObject* pSender); 31 | }; 32 | 33 | ////////////////////////////////////////////////////// 34 | 35 | class CListViewOperateTest : public CListViewTestSceneBase 36 | { 37 | public: 38 | virtual bool init(); 39 | CListView* m_pListView; 40 | void onClick(CCObject* pSender); 41 | }; 42 | 43 | ////////////////////////////////////////////////////// 44 | 45 | static int CListView_test_idx; 46 | 47 | static CCScene* getCListViewTestScene() 48 | { 49 | switch(CListView_test_idx) 50 | { 51 | case 0: 52 | return new CListViewBasicTest(); 53 | case 1: 54 | return new CListViewOperateTest(); 55 | default: 56 | CListView_test_idx = 0; 57 | return new CListViewBasicTest(); 58 | } 59 | return NULL; 60 | } 61 | 62 | static CCScene* pushCListViewTestScene() 63 | { 64 | CListView_test_idx = 0; 65 | CCScene* pScene = getCListViewTestScene(); 66 | pScene->init(); 67 | pScene->autorelease(); 68 | CCDirector::sharedDirector()->pushScene(pScene); 69 | return pScene; 70 | } 71 | 72 | static void nextCListViewTestScene() 73 | { 74 | CListView_test_idx++; 75 | CCScene* pScene = getCListViewTestScene(); 76 | pScene->init(); 77 | pScene->autorelease(); 78 | CCDirector::sharedDirector()->replaceScene(pScene); 79 | } 80 | 81 | static void backCListViewTestScene() 82 | { 83 | CListView_test_idx--; 84 | CCScene* pScene = getCListViewTestScene(); 85 | pScene->init(); 86 | pScene->autorelease(); 87 | CCDirector::sharedDirector()->replaceScene(pScene); 88 | } 89 | 90 | static void refCListViewTestScene() 91 | { 92 | CCScene* pScene = getCListViewTestScene(); 93 | pScene->init(); 94 | pScene->autorelease(); 95 | CCDirector::sharedDirector()->replaceScene(pScene); 96 | } 97 | 98 | #endif //__CListViewTEST_H__ -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/PageViewTest/PageViewTest.h: -------------------------------------------------------------------------------- 1 | #ifndef __CPageViewTEST_H__ 2 | #define __CPageViewTEST_H__ 3 | 4 | #include "../../MenuScene.h" 5 | 6 | ////////////////////////////////////////////////////// 7 | 8 | class CPageViewTestSceneBase : public BaseTestScene 9 | { 10 | public: 11 | virtual void onNextBtnClick(CCObject* pSender); 12 | virtual void onBackBtnClick(CCObject* pSender); 13 | virtual void onRefBtnClick(CCObject* pSender); 14 | }; 15 | 16 | ////////////////////////////////////////////////////// 17 | 18 | class CPageViewBasicTest : public CPageViewTestSceneBase 19 | { 20 | public: 21 | virtual bool init(); 22 | CLabel* m_pText; 23 | CCObject* pageviewDataSource(CCObject* pConvertCell, unsigned int nPageIdx); 24 | void onPageChanged(CPageView* pPage, unsigned int nPageIndx); 25 | }; 26 | 27 | ////////////////////////////////////////////////////// 28 | 29 | class CPageViewVerticalTest : public CPageViewTestSceneBase 30 | { 31 | public: 32 | virtual bool init(); 33 | CLabel* m_pText; 34 | CCObject* pageviewDataSource(CCObject* pConvertCell, unsigned int nPageIdx); 35 | void onPageChanged(CPageView* pPage, unsigned int nPageIndx); 36 | }; 37 | 38 | ////////////////////////////////////////////////////// 39 | 40 | static int CPageView_test_idx; 41 | 42 | static CCScene* getCPageViewTestScene() 43 | { 44 | switch(CPageView_test_idx) 45 | { 46 | case 0: 47 | return new CPageViewBasicTest(); 48 | case 1: 49 | return new CPageViewVerticalTest(); 50 | default: 51 | CPageView_test_idx = 0; 52 | return new CPageViewBasicTest(); 53 | } 54 | return NULL; 55 | } 56 | 57 | static CCScene* pushCPageViewTestScene() 58 | { 59 | CPageView_test_idx = 0; 60 | CCScene* pScene = getCPageViewTestScene(); 61 | pScene->init(); 62 | pScene->autorelease(); 63 | CCDirector::sharedDirector()->pushScene(pScene); 64 | return pScene; 65 | } 66 | 67 | static void nextCPageViewTestScene() 68 | { 69 | CPageView_test_idx++; 70 | CCScene* pScene = getCPageViewTestScene(); 71 | pScene->init(); 72 | pScene->autorelease(); 73 | CCDirector::sharedDirector()->replaceScene(pScene); 74 | } 75 | 76 | static void backCPageViewTestScene() 77 | { 78 | CPageView_test_idx--; 79 | CCScene* pScene = getCPageViewTestScene(); 80 | pScene->init(); 81 | pScene->autorelease(); 82 | CCDirector::sharedDirector()->replaceScene(pScene); 83 | } 84 | 85 | static void refCPageViewTestScene() 86 | { 87 | CCScene* pScene = getCPageViewTestScene(); 88 | pScene->init(); 89 | pScene->autorelease(); 90 | CCDirector::sharedDirector()->replaceScene(pScene); 91 | } 92 | 93 | #endif //__CPageViewTEST_H__ -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/ProgressBarTest/ProgressBarTest.h: -------------------------------------------------------------------------------- 1 | #ifndef __CProgressBarTEST_H__ 2 | #define __CProgressBarTEST_H__ 3 | 4 | #include "../../MenuScene.h" 5 | 6 | ////////////////////////////////////////////////////// 7 | 8 | class CProgressBarTestSceneBase : public BaseTestScene 9 | { 10 | public: 11 | virtual void onNextBtnClick(CCObject* pSender); 12 | virtual void onBackBtnClick(CCObject* pSender); 13 | virtual void onRefBtnClick(CCObject* pSender); 14 | }; 15 | 16 | ////////////////////////////////////////////////////// 17 | 18 | class CProgressBarBasicTest : public CProgressBarTestSceneBase 19 | { 20 | public: 21 | virtual bool init(); 22 | void onClick(CCObject* pSender); 23 | CProgressBar* m_pProgressBar; 24 | CLabel* m_pText; 25 | void onProgressing(CCObject* pSender, int nValue); 26 | }; 27 | 28 | ////////////////////////////////////////////////////// 29 | 30 | static int CProgressBar_test_idx; 31 | 32 | static CCScene* getCProgressBarTestScene() 33 | { 34 | switch(CProgressBar_test_idx) 35 | { 36 | case 0: 37 | return new CProgressBarBasicTest(); 38 | default: 39 | CProgressBar_test_idx = 0; 40 | return new CProgressBarBasicTest(); 41 | } 42 | return NULL; 43 | } 44 | 45 | static CCScene* pushCProgressBarTestScene() 46 | { 47 | CProgressBar_test_idx = 0; 48 | CCScene* pScene = getCProgressBarTestScene(); 49 | pScene->init(); 50 | pScene->autorelease(); 51 | CCDirector::sharedDirector()->pushScene(pScene); 52 | return pScene; 53 | } 54 | 55 | static void nextCProgressBarTestScene() 56 | { 57 | CProgressBar_test_idx++; 58 | CCScene* pScene = getCProgressBarTestScene(); 59 | pScene->init(); 60 | pScene->autorelease(); 61 | CCDirector::sharedDirector()->replaceScene(pScene); 62 | } 63 | 64 | static void backCProgressBarTestScene() 65 | { 66 | CProgressBar_test_idx--; 67 | CCScene* pScene = getCProgressBarTestScene(); 68 | pScene->init(); 69 | pScene->autorelease(); 70 | CCDirector::sharedDirector()->replaceScene(pScene); 71 | } 72 | 73 | static void refCProgressBarTestScene() 74 | { 75 | CCScene* pScene = getCProgressBarTestScene(); 76 | pScene->init(); 77 | pScene->autorelease(); 78 | CCDirector::sharedDirector()->replaceScene(pScene); 79 | } 80 | 81 | #endif //__CProgressBarTEST_H__ -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/SliderTest/SliderTest.h: -------------------------------------------------------------------------------- 1 | #ifndef __CSliderTEST_H__ 2 | #define __CSliderTEST_H__ 3 | 4 | #include "../../MenuScene.h" 5 | 6 | ////////////////////////////////////////////////////// 7 | 8 | class CSliderTestSceneBase : public BaseTestScene 9 | { 10 | public: 11 | virtual void onNextBtnClick(CCObject* pSender); 12 | virtual void onBackBtnClick(CCObject* pSender); 13 | virtual void onRefBtnClick(CCObject* pSender); 14 | }; 15 | 16 | ////////////////////////////////////////////////////// 17 | 18 | class CSliderBasicTest : public CSliderTestSceneBase 19 | { 20 | public: 21 | virtual bool init(); 22 | CLabel* m_pText; 23 | CSlider* m_pSlider; 24 | void onValueChanged(CCObject* pSender, int nValue); 25 | }; 26 | 27 | ////////////////////////////////////////////////////// 28 | 29 | class CSliderWithScrollTest : public CSliderTestSceneBase 30 | { 31 | public: 32 | virtual bool init(); 33 | CScrollView* m_pScrollView; 34 | CSlider* m_pSlider; 35 | 36 | void onValueChanged(CCObject* pSender, int nValue); 37 | }; 38 | 39 | 40 | ////////////////////////////////////////////////////// 41 | 42 | static int CSlider_test_idx; 43 | 44 | static CCScene* getCSliderTestScene() 45 | { 46 | switch(CSlider_test_idx) 47 | { 48 | case 0: 49 | return new CSliderBasicTest(); 50 | case 1: 51 | return new CSliderWithScrollTest(); 52 | default: 53 | CSlider_test_idx = 0; 54 | return new CSliderBasicTest(); 55 | } 56 | return NULL; 57 | } 58 | 59 | static CCScene* pushCSliderTestScene() 60 | { 61 | CSlider_test_idx = 0; 62 | CCScene* pScene = getCSliderTestScene(); 63 | pScene->init(); 64 | pScene->autorelease(); 65 | CCDirector::sharedDirector()->pushScene(pScene); 66 | return pScene; 67 | } 68 | 69 | static void nextCSliderTestScene() 70 | { 71 | CSlider_test_idx++; 72 | CCScene* pScene = getCSliderTestScene(); 73 | pScene->init(); 74 | pScene->autorelease(); 75 | CCDirector::sharedDirector()->replaceScene(pScene); 76 | } 77 | 78 | static void backCSliderTestScene() 79 | { 80 | CSlider_test_idx--; 81 | CCScene* pScene = getCSliderTestScene(); 82 | pScene->init(); 83 | pScene->autorelease(); 84 | CCDirector::sharedDirector()->replaceScene(pScene); 85 | } 86 | 87 | static void refCSliderTestScene() 88 | { 89 | CCScene* pScene = getCSliderTestScene(); 90 | pScene->init(); 91 | pScene->autorelease(); 92 | CCDirector::sharedDirector()->replaceScene(pScene); 93 | } 94 | 95 | #endif //__CSliderTEST_H__ -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/TextRichTest/TextRichTest.h: -------------------------------------------------------------------------------- 1 | #ifndef __CTextRichTEST_H__ 2 | #define __CTextRichTEST_H__ 3 | 4 | #include "../../MenuScene.h" 5 | 6 | ////////////////////////////////////////////////////// 7 | 8 | class CTextRichTestSceneBase : public BaseTestScene 9 | { 10 | public: 11 | virtual void onNextBtnClick(CCObject* pSender); 12 | virtual void onBackBtnClick(CCObject* pSender); 13 | virtual void onRefBtnClick(CCObject* pSender); 14 | }; 15 | 16 | ////////////////////////////////////////////////////// 17 | 18 | class CTextRichBasicTest : public CTextRichTestSceneBase 19 | { 20 | public: 21 | virtual bool init(); 22 | }; 23 | 24 | ////////////////////////////////////////////////////// 25 | 26 | class CTextRichEventTest : public CTextRichTestSceneBase 27 | { 28 | public: 29 | virtual bool init(); 30 | void onClickTextRich(CCObject* pSender, const char* pDescription); 31 | CLabel* m_pLabel; 32 | }; 33 | 34 | 35 | ////////////////////////////////////////////////////// 36 | 37 | static int CTextRich_test_idx; 38 | 39 | static CCScene* getCTextRichTestScene() 40 | { 41 | switch(CTextRich_test_idx) 42 | { 43 | case 0: 44 | return new CTextRichBasicTest(); 45 | case 1: 46 | return new CTextRichEventTest(); 47 | default: 48 | CTextRich_test_idx = 0; 49 | return new CTextRichBasicTest(); 50 | } 51 | return NULL; 52 | } 53 | 54 | static CCScene* pushCTextRichTestScene() 55 | { 56 | CTextRich_test_idx = 0; 57 | CCScene* pScene = getCTextRichTestScene(); 58 | pScene->init(); 59 | pScene->autorelease(); 60 | CCDirector::sharedDirector()->pushScene(pScene); 61 | return pScene; 62 | } 63 | 64 | static void nextCTextRichTestScene() 65 | { 66 | CTextRich_test_idx++; 67 | CCScene* pScene = getCTextRichTestScene(); 68 | pScene->init(); 69 | pScene->autorelease(); 70 | CCDirector::sharedDirector()->replaceScene(pScene); 71 | } 72 | 73 | static void backCTextRichTestScene() 74 | { 75 | CTextRich_test_idx--; 76 | CCScene* pScene = getCTextRichTestScene(); 77 | pScene->init(); 78 | pScene->autorelease(); 79 | CCDirector::sharedDirector()->replaceScene(pScene); 80 | } 81 | 82 | static void refCTextRichTestScene() 83 | { 84 | CCScene* pScene = getCTextRichTestScene(); 85 | pScene->init(); 86 | pScene->autorelease(); 87 | CCDirector::sharedDirector()->replaceScene(pScene); 88 | } 89 | 90 | #endif //__CTextRichTEST_H__ -------------------------------------------------------------------------------- /Cpp/Classes/testwidget/ToggleViewTest/ToggleViewTest.h: -------------------------------------------------------------------------------- 1 | #ifndef __CToggleViewTEST_H__ 2 | #define __CToggleViewTEST_H__ 3 | 4 | #include "../../MenuScene.h" 5 | 6 | ////////////////////////////////////////////////////// 7 | 8 | class CToggleViewTestSceneBase : public BaseTestScene 9 | { 10 | public: 11 | virtual void onNextBtnClick(CCObject* pSender); 12 | virtual void onBackBtnClick(CCObject* pSender); 13 | virtual void onRefBtnClick(CCObject* pSender); 14 | }; 15 | 16 | ////////////////////////////////////////////////////// 17 | 18 | class CToggleViewBasicTest : public CToggleViewTestSceneBase 19 | { 20 | public: 21 | virtual bool init(); 22 | void onClick(CCObject* pSender); 23 | CLabel* m_pText; 24 | }; 25 | 26 | ////////////////////////////////////////////////////// 27 | 28 | class CToggleViewGroupTest : public CToggleViewTestSceneBase 29 | { 30 | public: 31 | virtual bool init(); 32 | void onCheck(CCObject* pSender, bool bChecked); 33 | }; 34 | 35 | ////////////////////////////////////////////////////// 36 | 37 | static int CToggleView_test_idx; 38 | 39 | static CCScene* getCToggleViewTestScene() 40 | { 41 | switch(CToggleView_test_idx) 42 | { 43 | case 0: 44 | return new CToggleViewBasicTest(); 45 | case 1: 46 | return new CToggleViewGroupTest(); 47 | default: 48 | CToggleView_test_idx = 0; 49 | return new CToggleViewBasicTest(); 50 | } 51 | return NULL; 52 | } 53 | 54 | static CCScene* pushCToggleViewTestScene() 55 | { 56 | CToggleView_test_idx = 0; 57 | CCScene* pScene = getCToggleViewTestScene(); 58 | pScene->init(); 59 | pScene->autorelease(); 60 | CCDirector::sharedDirector()->pushScene(pScene); 61 | return pScene; 62 | } 63 | 64 | static void nextCToggleViewTestScene() 65 | { 66 | CToggleView_test_idx++; 67 | CCScene* pScene = getCToggleViewTestScene(); 68 | pScene->init(); 69 | pScene->autorelease(); 70 | CCDirector::sharedDirector()->replaceScene(pScene); 71 | } 72 | 73 | static void backCToggleViewTestScene() 74 | { 75 | CToggleView_test_idx--; 76 | CCScene* pScene = getCToggleViewTestScene(); 77 | pScene->init(); 78 | pScene->autorelease(); 79 | CCDirector::sharedDirector()->replaceScene(pScene); 80 | } 81 | 82 | static void refCToggleViewTestScene() 83 | { 84 | CCScene* pScene = getCToggleViewTestScene(); 85 | pScene->init(); 86 | pScene->autorelease(); 87 | CCDirector::sharedDirector()->replaceScene(pScene); 88 | } 89 | 90 | #endif //__CToggleViewTEST_H__ -------------------------------------------------------------------------------- /Cpp/Resources/CloseNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/CloseNormal.png -------------------------------------------------------------------------------- /Cpp/Resources/CloseSelected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/CloseSelected.png -------------------------------------------------------------------------------- /Cpp/Resources/again1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/again1.png -------------------------------------------------------------------------------- /Cpp/Resources/again2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/again2.png -------------------------------------------------------------------------------- /Cpp/Resources/arial-unicode-26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/arial-unicode-26.png -------------------------------------------------------------------------------- /Cpp/Resources/back1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/back1.png -------------------------------------------------------------------------------- /Cpp/Resources/back2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/back2.png -------------------------------------------------------------------------------- /Cpp/Resources/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/background.png -------------------------------------------------------------------------------- /Cpp/Resources/background2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/background2.png -------------------------------------------------------------------------------- /Cpp/Resources/background3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/background3.png -------------------------------------------------------------------------------- /Cpp/Resources/btn1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/btn1_1.png -------------------------------------------------------------------------------- /Cpp/Resources/btn1_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/btn1_2.png -------------------------------------------------------------------------------- /Cpp/Resources/btn1_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/btn1_3.png -------------------------------------------------------------------------------- /Cpp/Resources/circle1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/circle1.png -------------------------------------------------------------------------------- /Cpp/Resources/circle2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/circle2.png -------------------------------------------------------------------------------- /Cpp/Resources/ckb_disable_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/ckb_disable_01.png -------------------------------------------------------------------------------- /Cpp/Resources/ckb_disable_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/ckb_disable_02.png -------------------------------------------------------------------------------- /Cpp/Resources/ckb_normal_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/ckb_normal_01.png -------------------------------------------------------------------------------- /Cpp/Resources/ckb_normal_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/ckb_normal_02.png -------------------------------------------------------------------------------- /Cpp/Resources/ckb_selected_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/ckb_selected_01.png -------------------------------------------------------------------------------- /Cpp/Resources/ckb_selected_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/ckb_selected_02.png -------------------------------------------------------------------------------- /Cpp/Resources/control_baseboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/control_baseboard.png -------------------------------------------------------------------------------- /Cpp/Resources/control_joystick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/control_joystick.png -------------------------------------------------------------------------------- /Cpp/Resources/expandnodebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/expandnodebg.png -------------------------------------------------------------------------------- /Cpp/Resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/icon.png -------------------------------------------------------------------------------- /Cpp/Resources/next1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/next1.png -------------------------------------------------------------------------------- /Cpp/Resources/next2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/next2.png -------------------------------------------------------------------------------- /Cpp/Resources/num.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/num.png -------------------------------------------------------------------------------- /Cpp/Resources/progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/progress.png -------------------------------------------------------------------------------- /Cpp/Resources/progress_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/progress_bg.png -------------------------------------------------------------------------------- /Cpp/Resources/progress_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/progress_v.png -------------------------------------------------------------------------------- /Cpp/Resources/progress_v_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/progress_v_bg.png -------------------------------------------------------------------------------- /Cpp/Resources/scrollcontent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/scrollcontent.png -------------------------------------------------------------------------------- /Cpp/Resources/slider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/slider.png -------------------------------------------------------------------------------- /Cpp/Resources/sprite9_btn1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/sprite9_btn1.png -------------------------------------------------------------------------------- /Cpp/Resources/sprite9_btn2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/sprite9_btn2.png -------------------------------------------------------------------------------- /Cpp/Resources/toggle1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/toggle1_1.png -------------------------------------------------------------------------------- /Cpp/Resources/toggle1_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/Resources/toggle1_2.png -------------------------------------------------------------------------------- /Cpp/proj.android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Cpp/proj.android/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Cpp/proj.android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | CocosWidgetTestCpp 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.ui.externaltools.ExternalToolBuilder 25 | full,incremental, 26 | 27 | 28 | LaunchConfigHandle 29 | <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder.launch 30 | 31 | 32 | 33 | 34 | com.android.ide.eclipse.adt.ApkBuilder 35 | 36 | 37 | 38 | 39 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 40 | full,incremental, 41 | 42 | 43 | 44 | 45 | 46 | com.android.ide.eclipse.adt.AndroidNature 47 | org.eclipse.jdt.core.javanature 48 | org.eclipse.cdt.core.cnature 49 | org.eclipse.cdt.core.ccnature 50 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 51 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 52 | 53 | 54 | 55 | Classes 56 | 2 57 | COCOS2DX/projects/CocosWidgetTestCpp/Classes 58 | 59 | 60 | cocos2dx 61 | 2 62 | COCOS2DX/cocos2dx 63 | 64 | 65 | extensions 66 | 2 67 | COCOS2DX/extensions 68 | 69 | 70 | scripting 71 | 2 72 | COCOS2DX/scripting 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /Cpp/proj.android/.settings/org.eclipse.cdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/project/0.756827735/append=true 3 | environment/project/0.756827735/appendContributed=true 4 | -------------------------------------------------------------------------------- /Cpp/proj.android/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /Cpp/proj.android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Cpp/proj.android/ant.properties: -------------------------------------------------------------------------------- 1 | # This file is used to override default values used by the Ant build system. 2 | # 3 | # This file must be checked into Version Control Systems, as it is 4 | # integral to the build system of your project. 5 | 6 | # This file is only used by the Ant script. 7 | 8 | # You can use this to override default values such as 9 | # 'source.dir' for the location of your java source folder and 10 | # 'out.dir' for the location of your output folder. 11 | 12 | # You can also use it define how the release builds are signed by declaring 13 | # the following properties: 14 | # 'key.store' for the location of your keystore and 15 | # 'key.alias' for the name of the key to use. 16 | # The password will be asked during the build when you use the 'release' target. 17 | 18 | -------------------------------------------------------------------------------- /Cpp/proj.android/build_native.sh: -------------------------------------------------------------------------------- 1 | APPNAME="CocosWidgetTestCpp" 2 | 3 | # options 4 | 5 | buildexternalsfromsource= 6 | 7 | usage(){ 8 | cat << EOF 9 | usage: $0 [options] 10 | 11 | Build C/C++ code for $APPNAME using Android NDK 12 | 13 | OPTIONS: 14 | -s Build externals from source 15 | -h this help 16 | EOF 17 | } 18 | 19 | while getopts "sh" OPTION; do 20 | case "$OPTION" in 21 | s) 22 | buildexternalsfromsource=1 23 | ;; 24 | h) 25 | usage 26 | exit 0 27 | ;; 28 | esac 29 | done 30 | 31 | # paths 32 | 33 | if [ -z "${NDK_ROOT+aaa}" ];then 34 | echo "please define NDK_ROOT" 35 | exit 1 36 | fi 37 | 38 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 39 | # ... use paths relative to current directory 40 | COCOS2DX_ROOT="$DIR/../../.." 41 | APP_ROOT="$DIR/.." 42 | APP_ANDROID_ROOT="$DIR" 43 | 44 | echo "NDK_ROOT = $NDK_ROOT" 45 | echo "COCOS2DX_ROOT = $COCOS2DX_ROOT" 46 | echo "APP_ROOT = $APP_ROOT" 47 | echo "APP_ANDROID_ROOT = $APP_ANDROID_ROOT" 48 | 49 | # make sure assets is exist 50 | if [ -d "$APP_ANDROID_ROOT"/assets ]; then 51 | rm -rf "$APP_ANDROID_ROOT"/assets 52 | fi 53 | 54 | mkdir "$APP_ANDROID_ROOT"/assets 55 | 56 | # copy resources 57 | for file in "$APP_ROOT"/Resources/* 58 | do 59 | if [ -d "$file" ]; then 60 | cp -rf "$file" "$APP_ANDROID_ROOT"/assets 61 | fi 62 | 63 | if [ -f "$file" ]; then 64 | cp "$file" "$APP_ANDROID_ROOT"/assets 65 | fi 66 | done 67 | 68 | # run ndk-build 69 | if [[ "$buildexternalsfromsource" ]]; then 70 | echo "Building external dependencies from source" 71 | "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ 72 | "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/source" 73 | else 74 | echo "Using prebuilt externals" 75 | "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ 76 | "NDK_MODULE_PATH=${COCOS2DX_ROOT}:${COCOS2DX_ROOT}/cocos2dx/platform/third_party/android/prebuilt" 77 | fi 78 | -------------------------------------------------------------------------------- /Cpp/proj.android/gen/com/cocoswidget/testcpp/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** Automatically generated file. DO NOT MODIFY */ 2 | package com.cocoswidget.testcpp; 3 | 4 | public final class BuildConfig { 5 | public final static boolean DEBUG = true; 6 | } -------------------------------------------------------------------------------- /Cpp/proj.android/gen/com/cocoswidget/testcpp/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package com.cocoswidget.testcpp; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class drawable { 14 | public static final int icon=0x7f020000; 15 | } 16 | public static final class string { 17 | public static final int app_name=0x7f030000; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Cpp/proj.android/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL := gnustl_static 2 | APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 3 | -------------------------------------------------------------------------------- /Cpp/proj.android/jni/cpp/main.cpp: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "cocos2d.h" 3 | #include "CCEventType.h" 4 | #include "platform/android/jni/JniHelper.h" 5 | #include 6 | #include 7 | 8 | #define LOG_TAG "main" 9 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) 10 | 11 | using namespace cocos2d; 12 | 13 | extern "C" 14 | { 15 | 16 | jint JNI_OnLoad(JavaVM *vm, void *reserved) 17 | { 18 | JniHelper::setJavaVM(vm); 19 | 20 | return JNI_VERSION_1_4; 21 | } 22 | 23 | void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thiz, jint w, jint h) 24 | { 25 | if (!CCDirector::sharedDirector()->getOpenGLView()) 26 | { 27 | CCEGLView *view = CCEGLView::sharedOpenGLView(); 28 | view->setFrameSize(w, h); 29 | 30 | AppDelegate *pAppDelegate = new AppDelegate(); 31 | CCApplication::sharedApplication()->run(); 32 | } 33 | else 34 | { 35 | ccGLInvalidateStateCache(); 36 | CCShaderCache::sharedShaderCache()->reloadDefaultShaders(); 37 | ccDrawInit(); 38 | CCTextureCache::reloadAllTextures(); 39 | CCNotificationCenter::sharedNotificationCenter()->postNotification(EVENT_COME_TO_FOREGROUND, NULL); 40 | CCDirector::sharedDirector()->setGLDefaultValues(); 41 | } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Cpp/proj.android/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /Cpp/proj.android/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-8 12 | 13 | android.library.reference.1=../../../cocos2dx/platform/android/java 14 | -------------------------------------------------------------------------------- /Cpp/proj.android/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.android/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /Cpp/proj.android/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.android/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /Cpp/proj.android/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.android/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /Cpp/proj.android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | CocosWidgetTestCpp 4 | 5 | -------------------------------------------------------------------------------- /Cpp/proj.android/src/com/cocoswidget/testcpp/CocosWidgetTestCpp.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2011 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | package com.cocoswidget.testcpp; 25 | 26 | import org.cocos2dx.lib.Cocos2dxActivity; 27 | import org.cocos2dx.lib.Cocos2dxGLSurfaceView; 28 | 29 | import android.os.Bundle; 30 | 31 | public class CocosWidgetTestCpp extends Cocos2dxActivity{ 32 | 33 | protected void onCreate(Bundle savedInstanceState){ 34 | super.onCreate(savedInstanceState); 35 | } 36 | 37 | public Cocos2dxGLSurfaceView onCreateView() { 38 | Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this); 39 | // CocosWidgetTestCpp should create stencil buffer 40 | glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8); 41 | 42 | return glSurfaceView; 43 | } 44 | 45 | static { 46 | System.loadLibrary("cocoswidget"); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Cpp/proj.blackberry/empty/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.blackberry/empty/empty -------------------------------------------------------------------------------- /Cpp/proj.blackberry/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.blackberry/icon.png -------------------------------------------------------------------------------- /Cpp/proj.blackberry/main.cpp: -------------------------------------------------------------------------------- 1 | #include "cocos2d.h" 2 | #include "AppDelegate.h" 3 | 4 | USING_NS_CC; 5 | 6 | int main(int argc, char **argv) 7 | { 8 | // create the application instance 9 | AppDelegate app; 10 | 11 | int width, height; 12 | const char *width_str, *height_str; 13 | width_str = getenv("WIDTH"); 14 | height_str = getenv("HEIGHT"); 15 | if (width_str && height_str) 16 | { 17 | width = atoi(width_str); 18 | height = atoi(height_str); 19 | } 20 | else 21 | { 22 | width = 1024; 23 | height = 600; 24 | } 25 | 26 | CCEGLView* eglView = CCEGLView::sharedOpenGLView(); 27 | eglView->setFrameSize(width, height); 28 | 29 | return CCApplication::sharedApplication()->run(); 30 | } 31 | -------------------------------------------------------------------------------- /Cpp/proj.ios/AppController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class RootViewController; 4 | 5 | @interface AppController : NSObject { 6 | UIWindow *window; 7 | RootViewController *viewController; 8 | } 9 | 10 | @end 11 | 12 | -------------------------------------------------------------------------------- /Cpp/proj.ios/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.ios/Default-568h@2x.png -------------------------------------------------------------------------------- /Cpp/proj.ios/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.ios/Default.png -------------------------------------------------------------------------------- /Cpp/proj.ios/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.ios/Default@2x.png -------------------------------------------------------------------------------- /Cpp/proj.ios/Icon-114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.ios/Icon-114.png -------------------------------------------------------------------------------- /Cpp/proj.ios/Icon-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.ios/Icon-120.png -------------------------------------------------------------------------------- /Cpp/proj.ios/Icon-144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.ios/Icon-144.png -------------------------------------------------------------------------------- /Cpp/proj.ios/Icon-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.ios/Icon-152.png -------------------------------------------------------------------------------- /Cpp/proj.ios/Icon-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.ios/Icon-57.png -------------------------------------------------------------------------------- /Cpp/proj.ios/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.ios/Icon-72.png -------------------------------------------------------------------------------- /Cpp/proj.ios/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.ios/Icon-76.png -------------------------------------------------------------------------------- /Cpp/proj.ios/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | Icon-57.png 13 | CFBundleIconFiles 14 | 15 | Icon.png 16 | Icon@2x.png 17 | Icon-57.png 18 | Icon-114.png 19 | Icon-72.png 20 | Icon-144.png 21 | Icon-76.png 22 | Icon-120.png 23 | Icon-152.png 24 | 25 | CFBundleIdentifier 26 | com.cocoswidget.testcpp 27 | CFBundleInfoDictionaryVersion 28 | 6.0 29 | CFBundleName 30 | ${PRODUCT_NAME} 31 | CFBundlePackageType 32 | APPL 33 | CFBundleShortVersionString 34 | 35 | CFBundleSignature 36 | ???? 37 | CFBundleVersion 38 | 1.0 39 | LSRequiresIPhoneOS 40 | 41 | UIAppFonts 42 | 43 | UISupportedInterfaceOrientations 44 | 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Cpp/proj.ios/Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'iphone' target in the 'iphone' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /Cpp/proj.ios/RootViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | @interface RootViewController : UIViewController { 5 | 6 | } 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /Cpp/proj.ios/RootViewController.mm: -------------------------------------------------------------------------------- 1 | #import "RootViewController.h" 2 | 3 | 4 | @implementation RootViewController 5 | 6 | /* 7 | // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. 8 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 9 | if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { 10 | // Custom initialization 11 | } 12 | return self; 13 | } 14 | */ 15 | 16 | /* 17 | // Implement loadView to create a view hierarchy programmatically, without using a nib. 18 | - (void)loadView { 19 | } 20 | */ 21 | 22 | /* 23 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 24 | - (void)viewDidLoad { 25 | [super viewDidLoad]; 26 | } 27 | 28 | */ 29 | // Override to allow orientations other than the default portrait orientation. 30 | // This method is deprecated on ios6 31 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 32 | return UIInterfaceOrientationIsLandscape( interfaceOrientation ); 33 | } 34 | 35 | // For ios6, use supportedInterfaceOrientations & shouldAutorotate instead 36 | - (NSUInteger) supportedInterfaceOrientations{ 37 | #ifdef __IPHONE_6_0 38 | return UIInterfaceOrientationMaskAllButUpsideDown; 39 | #endif 40 | } 41 | 42 | - (BOOL) shouldAutorotate { 43 | return YES; 44 | } 45 | 46 | //fix not hide status on ios7 47 | - (BOOL)prefersStatusBarHidden 48 | { 49 | return YES; 50 | } 51 | 52 | - (void)didReceiveMemoryWarning { 53 | // Releases the view if it doesn't have a superview. 54 | [super didReceiveMemoryWarning]; 55 | 56 | // Release any cached data, images, etc that aren't in use. 57 | } 58 | 59 | - (void)viewDidUnload { 60 | [super viewDidUnload]; 61 | // Release any retained subviews of the main view. 62 | // e.g. self.myOutlet = nil; 63 | } 64 | 65 | 66 | - (void)dealloc { 67 | [super dealloc]; 68 | } 69 | 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /Cpp/proj.ios/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | // Under iOS and the Simulator, we can use an alternate Accelerometer interface 4 | #import "AccelerometerSimulation.h" 5 | 6 | int main(int argc, char *argv[]) { 7 | 8 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 9 | int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); 10 | [pool release]; 11 | return retVal; 12 | } 13 | -------------------------------------------------------------------------------- /Cpp/proj.linux/Makefile: -------------------------------------------------------------------------------- 1 | EXECUTABLE = CocosWidgetTestCpp 2 | 3 | INCLUDES = -I.. -I../Classes 4 | 5 | SOURCES = main.cpp \ 6 | ../Classes/AppDelegate.cpp \ 7 | ../Classes/HelloWorldScene.cpp 8 | 9 | COCOS_ROOT = ../../.. 10 | include $(COCOS_ROOT)/cocos2dx/proj.linux/cocos2dx.mk 11 | 12 | SHAREDLIBS += -lcocos2d 13 | COCOS_LIBS = $(LIB_DIR)/libcocos2d.so 14 | 15 | $(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) 16 | @mkdir -p $(@D) 17 | $(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) 18 | 19 | $(OBJ_DIR)/%.o: %.cpp $(CORE_MAKEFILE_LIST) 20 | @mkdir -p $(@D) 21 | $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ 22 | 23 | $(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) 24 | @mkdir -p $(@D) 25 | $(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) $(VISIBILITY) -c $< -o $@ 26 | -------------------------------------------------------------------------------- /Cpp/proj.linux/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TXTCOLOR_DEFAULT="\033[0;m" 4 | TXTCOLOR_RED="\033[0;31m" 5 | TXTCOLOR_GREEN="\033[0;32m" 6 | 7 | COCOS2DX20_TRUNK=`pwd`/../../.. 8 | OUTPUT_DEBUG=$COCOS2DX20_TRUNK/lib/linux/debug/ 9 | OUTPUT_RELEASE=$COCOS2DX20_TRUNK/lib/linux/release/ 10 | 11 | check_make_result() 12 | { 13 | if [ 0 != $? ]; then 14 | exit 1 15 | fi 16 | } 17 | 18 | DEPENDS='libx11-dev' 19 | DEPENDS+=' libxmu-dev' 20 | DEPENDS+=' libglu1-mesa-dev' 21 | DEPENDS+=' libgl2ps-dev' 22 | DEPENDS+=' libxi-dev' 23 | DEPENDS+=' libglfw-dev' 24 | DEPENDS+=' g++' 25 | DEPENDS+=' libzip-dev' 26 | DEPENDS+=' libcurl4-gnutls-dev' 27 | DEPENDS+=' libfontconfig1-dev' 28 | DEPENDS+=' libsqlite3-dev' 29 | DEPENDS+=' libglew-dev' 30 | 31 | for i in $DEPENDS; do 32 | PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $i | grep "install ok installed") 33 | echo Checking for $i: $PKG_OK 34 | if [ "" == "$PKG_OK" ]; then 35 | echo -e $TXTCOLOR_GREEN"No $i. Setting up $i, please enter your password:"$TXTCOLOR_DEFAULT 36 | sudo apt-get --force-yes --yes install $i 37 | fi 38 | done 39 | 40 | mkdir -p $OUTPUT_DEBUG 41 | mkdir -p $OUTPUT_RELEASE 42 | 43 | make -C $COCOS2DX20_TRUNK/external/Box2D/proj.linux DEBUG=1 44 | check_make_result 45 | 46 | make -C $COCOS2DX20_TRUNK/external/chipmunk/proj.linux DEBUG=1 47 | check_make_result 48 | 49 | make -C $COCOS2DX20_TRUNK/cocos2dx/proj.linux DEBUG=1 50 | check_make_result 51 | 52 | make -C $COCOS2DX20_TRUNK/CocosDenshion/proj.linux DEBUG=1 53 | check_make_result 54 | 55 | make -C $COCOS2DX20_TRUNK/extensions/proj.linux DEBUG=1 56 | check_make_result 57 | 58 | make DEBUG=1 59 | check_make_result 60 | -------------------------------------------------------------------------------- /Cpp/proj.linux/main.cpp: -------------------------------------------------------------------------------- 1 | #include "../Classes/AppDelegate.h" 2 | #include "cocos2d.h" 3 | #include "CCEGLView.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | USING_NS_CC; 11 | 12 | int main(int argc, char **argv) 13 | { 14 | // create the application instance 15 | AppDelegate app; 16 | CCEGLView* eglView = CCEGLView::sharedOpenGLView(); 17 | eglView->setFrameSize(800, 480); 18 | return CCApplication::sharedApplication()->run(); 19 | } 20 | -------------------------------------------------------------------------------- /Cpp/proj.mac/AppController.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | #pragma once 26 | 27 | #import "cocos2d.h" 28 | #import "EAGLView.h" 29 | 30 | @interface AppController : NSObject 31 | { 32 | NSWindow *window; 33 | EAGLView *glView; 34 | } 35 | 36 | @property (nonatomic, assign) IBOutlet NSWindow* window; 37 | @property (nonatomic, assign) IBOutlet EAGLView* glView; 38 | 39 | -(IBAction) toggleFullScreen:(id)sender; 40 | -(IBAction) exitFullScreen:(id)sender; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Cpp/proj.mac/Icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.mac/Icon.icns -------------------------------------------------------------------------------- /Cpp/proj.mac/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | Icon 11 | CFBundleIdentifier 12 | com.cocoswidget.testcpp 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2012. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Cpp/proj.mac/Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Cpp/proj.mac/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Cpp/proj.mac/main.m: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | #import 26 | 27 | int main(int argc, char *argv[]) 28 | { 29 | return NSApplicationMain(argc, (const char **)argv); 30 | } 31 | -------------------------------------------------------------------------------- /Cpp/proj.marmalade/CocosWidgetTestCpp.mkb: -------------------------------------------------------------------------------- 1 | options 2 | { 3 | module_path="../../../cocos2dx/proj.marmalade/;../../../CocosDenshion/proj.marmalade/;../../../extensions/proj.marmalade/;../../../external/chipmunk/proj.marmalade/;../../../external/Box2D/proj.marmalade/" 4 | s3e-data-dir = "../Resources/" 5 | } 6 | 7 | includepaths 8 | { 9 | ../Classes 10 | } 11 | subprojects 12 | { 13 | IwGL 14 | cocos2dx 15 | cocos2dx-ext 16 | Box2D 17 | CocosDenshion 18 | # chipmunk 19 | } 20 | 21 | defines 22 | { 23 | CC_ENABLE_BOX2D_INTEGRATION=1 24 | } 25 | assets 26 | { 27 | (../Resources) 28 | } 29 | 30 | files 31 | { 32 | [Main] 33 | (src) 34 | Main.h 35 | Main.cpp 36 | 37 | (../Classes) 38 | AppDelegate.cpp 39 | AppDelegate.h 40 | HelloWorldScene.cpp 41 | HelloWorldScene.h 42 | 43 | } 44 | 45 | 46 | -------------------------------------------------------------------------------- /Cpp/proj.marmalade/src/Main.cpp: -------------------------------------------------------------------------------- 1 | // Application main file. 2 | 3 | #include "Main.h" 4 | #include "../Classes/AppDelegate.h" 5 | 6 | // Cocos2dx headers 7 | #include "cocos2d.h" 8 | 9 | // Marmaladeheaders 10 | #include "IwGL.h" 11 | 12 | USING_NS_CC; 13 | 14 | int main() 15 | { 16 | AppDelegate app; 17 | 18 | return cocos2d::CCApplication::sharedApplication()->Run(); 19 | } 20 | -------------------------------------------------------------------------------- /Cpp/proj.marmalade/src/Main.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_H 2 | #define MAIN_H 3 | 4 | #endif 5 | -------------------------------------------------------------------------------- /Cpp/proj.win32/CocosWidgetTestCpp.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(ProjectDir)..\Resources 5 | WindowsLocalDebugger 6 | 7 | 8 | $(ProjectDir)..\Resources 9 | WindowsLocalDebugger 10 | 11 | -------------------------------------------------------------------------------- /Cpp/proj.win32/main.cpp: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | #include "AppDelegate.h" 3 | #include "CCEGLView.h" 4 | 5 | USING_NS_CC; 6 | 7 | int APIENTRY _tWinMain(HINSTANCE hInstance, 8 | HINSTANCE hPrevInstance, 9 | LPTSTR lpCmdLine, 10 | int nCmdShow) 11 | { 12 | UNREFERENCED_PARAMETER(hPrevInstance); 13 | UNREFERENCED_PARAMETER(lpCmdLine); 14 | 15 | // create the application instance 16 | AppDelegate app; 17 | CCEGLView* eglView = CCEGLView::sharedOpenGLView(); 18 | eglView->setViewName("CocosWidgetTestCpp"); 19 | eglView->setFrameSize(960, 640); 20 | return CCApplication::sharedApplication()->run(); 21 | } 22 | -------------------------------------------------------------------------------- /Cpp/proj.win32/main.h: -------------------------------------------------------------------------------- 1 | #ifndef __MAIN_H__ 2 | #define __MAIN_H__ 3 | 4 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 5 | 6 | // Windows Header Files: 7 | #include 8 | #include 9 | 10 | // C RunTime Header Files 11 | #include "CCStdC.h" 12 | 13 | #endif // __MAIN_H__ 14 | -------------------------------------------------------------------------------- /Cpp/proj.winrt/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Cpp/proj.winrt/App.xaml.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2013 cocos2d-x.org 3 | Copyright (c) Microsoft Open Technologies, Inc. 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | // 26 | // App.xaml.h 27 | // Declaration of the App class. 28 | // 29 | 30 | #pragma once 31 | 32 | #include "App.g.h" 33 | #include "MainPage.xaml.h" 34 | 35 | namespace HelloCpp 36 | { 37 | /// 38 | /// Provides application-specific behavior to supplement the default Application class. 39 | /// 40 | ref class App sealed 41 | { 42 | public: 43 | App(); 44 | virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ args) override; 45 | 46 | private: 47 | void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args); 48 | MainPage^ m_mainPage; 49 | }; 50 | } 51 | -------------------------------------------------------------------------------- /Cpp/proj.winrt/Assets/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.winrt/Assets/Logo.png -------------------------------------------------------------------------------- /Cpp/proj.winrt/Assets/SmallLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.winrt/Assets/SmallLogo.png -------------------------------------------------------------------------------- /Cpp/proj.winrt/Assets/SplashScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.winrt/Assets/SplashScreen.png -------------------------------------------------------------------------------- /Cpp/proj.winrt/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.winrt/Assets/StoreLogo.png -------------------------------------------------------------------------------- /Cpp/proj.winrt/Assets/WideLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.winrt/Assets/WideLogo.png -------------------------------------------------------------------------------- /Cpp/proj.winrt/CocosWidgetTestCpp_TemporaryKey.pfx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leecjson/CocosWidget/084c8ed044a5d83cbd06a9325e5d97022f4c4586/Cpp/proj.winrt/CocosWidgetTestCpp_TemporaryKey.pfx -------------------------------------------------------------------------------- /Cpp/proj.winrt/MainPage.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | 14 |