2014-08-19 10:28:24 +08:00
|
|
|
/****************************************************************************
|
2018-01-29 16:25:32 +08:00
|
|
|
Copyright (c) 2013-2016 Chukong Technologies Inc.
|
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2014-08-19 10:28:24 +08:00
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __cocos2d_tests__UIEditBoxTest__
|
|
|
|
#define __cocos2d_tests__UIEditBoxTest__
|
|
|
|
|
|
|
|
#include "UIScene.h"
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
DEFINE_TEST_SUITE(UIEditBoxTests);
|
|
|
|
|
2014-08-19 10:28:24 +08:00
|
|
|
class UIEditBoxTest : public UIScene, public cocos2d::ui::EditBoxDelegate
|
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(UIEditBoxTest);
|
|
|
|
|
|
|
|
virtual bool init() override;
|
2014-08-19 10:28:24 +08:00
|
|
|
|
2015-07-15 12:04:48 +08:00
|
|
|
virtual void editBoxEditingDidBegin(cocos2d::ui::EditBox* editBox)override;
|
2016-11-03 14:02:53 +08:00
|
|
|
virtual void editBoxEditingDidEndWithAction(cocos2d::ui::EditBox* editBox, cocos2d::ui::EditBoxDelegate::EditBoxEndAction action)override;
|
2015-07-15 12:04:48 +08:00
|
|
|
virtual void editBoxTextChanged(cocos2d::ui::EditBox* editBox, const std::string& text)override;
|
|
|
|
virtual void editBoxReturn(cocos2d::ui::EditBox* editBox)override;
|
2014-08-19 10:28:24 +08:00
|
|
|
|
|
|
|
|
2016-06-23 16:09:19 +08:00
|
|
|
protected:
|
|
|
|
cocos2d::Label* _TTFShowEditReturn;
|
|
|
|
cocos2d::ui::EditBox* _editName;
|
|
|
|
cocos2d::ui::EditBox* _editPassword;
|
|
|
|
cocos2d::ui::EditBox* _editEmail;
|
|
|
|
cocos2d::Node* _editEmailParent;
|
|
|
|
};
|
|
|
|
|
|
|
|
class UIEditBoxTestToggleVisibility : public UIScene, public cocos2d::ui::EditBoxDelegate
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(UIEditBoxTestToggleVisibility);
|
|
|
|
|
|
|
|
virtual bool init() override;
|
|
|
|
|
|
|
|
virtual void editBoxEditingDidBegin(cocos2d::ui::EditBox* editBox)override;
|
|
|
|
virtual void editBoxTextChanged(cocos2d::ui::EditBox* editBox, const std::string& text)override;
|
|
|
|
virtual void editBoxReturn(cocos2d::ui::EditBox* editBox)override;
|
|
|
|
|
|
|
|
|
2014-08-19 10:28:24 +08:00
|
|
|
protected:
|
|
|
|
cocos2d::Label* _TTFShowEditReturn;
|
|
|
|
cocos2d::ui::EditBox* _editName;
|
|
|
|
cocos2d::ui::EditBox* _editPassword;
|
|
|
|
cocos2d::ui::EditBox* _editEmail;
|
2015-11-23 11:48:28 +08:00
|
|
|
cocos2d::Node* _editEmailParent;
|
2014-08-19 10:28:24 +08:00
|
|
|
};
|
|
|
|
|
2017-12-22 09:14:27 +08:00
|
|
|
class UIEditBoxTestTextHorizontalAlignment : public UIScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(UIEditBoxTestTextHorizontalAlignment);
|
|
|
|
|
|
|
|
virtual bool init() override;
|
|
|
|
};
|
|
|
|
|
2018-08-07 09:29:51 +08:00
|
|
|
class UIEditBoxTestPressedAndDisabled : public UIScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(UIEditBoxTestPressedAndDisabled);
|
|
|
|
virtual bool init() override;
|
|
|
|
};
|
|
|
|
|
2014-08-19 10:28:24 +08:00
|
|
|
#endif /* defined(__cocos2d_tests__UIEditBoxTest__) */
|