axmol/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h

298 lines
6.6 KiB
C
Raw Normal View History

2013-09-16 20:54:13 +08:00
/****************************************************************************
Copyright (c) 2013 cocos2d-x.org
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
2015-04-16 14:38:00 +08:00
https://axis-project.github.io/
2015-04-16 14:38:00 +08:00
2013-09-16 20:54:13 +08:00
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:
2015-04-16 14:38:00 +08:00
2013-09-16 20:54:13 +08:00
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
2015-04-16 14:38:00 +08:00
2013-09-16 20:54:13 +08:00
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 __TestCpp__UIButtonTest__
#define __TestCpp__UIButtonTest__
#include "../UIScene.h"
DEFINE_TEST_SUITE(UIButtonTests);
2013-09-16 20:54:13 +08:00
class UIButtonTest : public UIScene
{
public:
CREATE_FUNC(UIButtonTest);
2013-09-16 20:54:13 +08:00
UIButtonTest();
~UIButtonTest();
virtual bool init() override;
void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type);
2013-09-16 20:54:13 +08:00
2015-12-01 11:07:02 +08:00
void printWidgetResources(cocos2d::Ref* sender);
2021-12-28 16:06:23 +08:00
2013-09-16 20:54:13 +08:00
protected:
cocos2d::ui::Text* _displayValueLabel;
2015-11-30 16:17:13 +08:00
cocos2d::ui::Button* _button;
2013-09-16 20:54:13 +08:00
};
class UIButtonTest_Scale9 : public UIScene
{
public:
CREATE_FUNC(UIButtonTest_Scale9);
2013-09-16 20:54:13 +08:00
UIButtonTest_Scale9();
~UIButtonTest_Scale9();
virtual bool init() override;
void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type);
2015-04-16 14:38:00 +08:00
2013-09-16 20:54:13 +08:00
protected:
cocos2d::ui::Text* _displayValueLabel;
2013-09-16 20:54:13 +08:00
};
2015-01-20 20:57:54 +08:00
class UIButtonTest_Scale9_State_Change : public UIScene
{
public:
CREATE_FUNC(UIButtonTest_Scale9_State_Change);
2015-01-20 20:57:54 +08:00
UIButtonTest_Scale9_State_Change();
~UIButtonTest_Scale9_State_Change();
virtual bool init() override;
void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type);
2015-01-20 20:57:54 +08:00
protected:
2021-12-28 16:06:23 +08:00
cocos2d::ui::Text* _displayValueLabel;
2015-01-20 20:57:54 +08:00
};
2013-09-16 20:54:13 +08:00
class UIButtonTest_PressedAction : public UIScene
{
public:
CREATE_FUNC(UIButtonTest_PressedAction);
2013-09-16 20:54:13 +08:00
UIButtonTest_PressedAction();
~UIButtonTest_PressedAction();
virtual bool init() override;
void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type);
2015-04-16 14:38:00 +08:00
2013-09-16 20:54:13 +08:00
protected:
cocos2d::ui::Text* _displayValueLabel;
2013-12-23 15:35:35 +08:00
};
class UIButtonTest_Title : public UIScene
{
public:
CREATE_FUNC(UIButtonTest_Title);
2013-12-23 15:35:35 +08:00
UIButtonTest_Title();
~UIButtonTest_Title();
virtual bool init() override;
void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type);
2015-04-16 14:38:00 +08:00
2013-12-23 15:35:35 +08:00
protected:
cocos2d::ui::Text* _displayValueLabel;
2013-09-16 20:54:13 +08:00
};
2014-07-25 14:40:58 +08:00
class UIButtonTestRemoveSelf : public UIScene
{
public:
CREATE_FUNC(UIButtonTestRemoveSelf);
2014-07-25 14:40:58 +08:00
UIButtonTestRemoveSelf();
~UIButtonTestRemoveSelf();
virtual bool init() override;
void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type);
2015-04-16 14:38:00 +08:00
protected:
cocos2d::ui::Text* _displayValueLabel;
};
2014-07-31 11:07:20 +08:00
class UIButtonTestSwitchScale9 : public UIScene
{
public:
CREATE_FUNC(UIButtonTestSwitchScale9);
2014-07-31 11:07:20 +08:00
UIButtonTestSwitchScale9();
~UIButtonTestSwitchScale9();
virtual bool init() override;
void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type);
2015-04-16 14:38:00 +08:00
2014-07-31 11:07:20 +08:00
protected:
cocos2d::ui::Text* _displayValueLabel;
2014-07-31 11:07:20 +08:00
};
class UIButtonTestZoomScale : public UIScene
{
public:
CREATE_FUNC(UIButtonTestZoomScale);
UIButtonTestZoomScale();
~UIButtonTestZoomScale();
virtual bool init() override;
void sliderEvent(cocos2d::Ref* sender, cocos2d::ui::Slider::EventType type);
protected:
cocos2d::ui::Text* _displayValueLabel;
};
2014-09-12 13:50:13 +08:00
class UIButtonTextOnly : public UIScene
{
public:
CREATE_FUNC(UIButtonTextOnly);
2014-09-12 13:50:13 +08:00
UIButtonTextOnly();
~UIButtonTextOnly();
virtual bool init() override;
2014-09-12 13:50:13 +08:00
protected:
cocos2d::ui::Text* _displayValueLabel;
2014-09-12 13:50:13 +08:00
};
class UIButtonIgnoreContentSizeTest : public UIScene
{
public:
CREATE_FUNC(UIButtonIgnoreContentSizeTest);
UIButtonIgnoreContentSizeTest();
~UIButtonIgnoreContentSizeTest();
virtual bool init() override;
2015-04-16 14:38:00 +08:00
protected:
cocos2d::ui::Text* _displayValueLabel;
};
class UIButtonTitleEffectTest : public UIScene
{
public:
CREATE_FUNC(UIButtonTitleEffectTest);
UIButtonTitleEffectTest();
~UIButtonTitleEffectTest();
virtual bool init() override;
2015-04-16 14:38:00 +08:00
protected:
cocos2d::ui::Text* _displayValueLabel;
};
2014-11-05 20:50:13 +08:00
class UIButtonFlipTest : public UIScene
{
public:
CREATE_FUNC(UIButtonFlipTest);
2014-11-05 20:50:13 +08:00
UIButtonFlipTest();
~UIButtonFlipTest();
virtual bool init() override;
2015-04-16 14:38:00 +08:00
2014-11-05 20:50:13 +08:00
protected:
cocos2d::ui::Text* _displayValueLabel;
2014-11-05 20:50:13 +08:00
};
2014-12-23 15:03:31 +08:00
class UIButtonNormalDefaultTest : public UIScene
{
public:
CREATE_FUNC(UIButtonNormalDefaultTest);
2014-12-23 15:03:31 +08:00
UIButtonNormalDefaultTest();
~UIButtonNormalDefaultTest();
virtual bool init() override;
2015-04-16 14:38:00 +08:00
2014-12-23 15:03:31 +08:00
protected:
cocos2d::ui::Text* _displayValueLabel;
2014-12-23 15:03:31 +08:00
};
class UIButtonDisableDefaultTest : public UIScene
{
public:
CREATE_FUNC(UIButtonDisableDefaultTest);
2014-12-23 15:03:31 +08:00
UIButtonDisableDefaultTest();
~UIButtonDisableDefaultTest();
virtual bool init() override;
2015-04-16 14:38:00 +08:00
protected:
cocos2d::ui::Text* _displayValueLabel;
};
class UIButtonCloneTest : public UIScene
{
public:
CREATE_FUNC(UIButtonCloneTest);
UIButtonCloneTest();
~UIButtonCloneTest();
virtual bool init() override;
2014-12-23 15:03:31 +08:00
protected:
cocos2d::ui::Text* _displayValueLabel;
2014-12-23 15:03:31 +08:00
};
class Issue12249 : public UIScene
{
public:
CREATE_FUNC(Issue12249);
2021-12-28 16:06:23 +08:00
Issue12249();
2021-12-28 16:06:23 +08:00
virtual bool init() override;
2021-12-28 16:06:23 +08:00
protected:
cocos2d::ui::Text* _displayValueLabel;
};
2021-12-28 16:06:23 +08:00
class Issue17116 : public UIScene
{
public:
CREATE_FUNC(Issue17116);
Issue17116();
virtual bool init() override;
};
2021-12-28 16:06:23 +08:00
class UIButtonWithPolygonInfo : public UIScene
{
public:
CREATE_FUNC(UIButtonWithPolygonInfo);
2021-12-28 16:06:23 +08:00
UIButtonWithPolygonInfo();
2021-12-28 16:06:23 +08:00
virtual bool init() override;
};
2021-12-28 16:06:23 +08:00
class UIButtonScale9ChangeSpriteFrame : public UIScene
{
public:
CREATE_FUNC(UIButtonScale9ChangeSpriteFrame);
2021-12-28 16:06:23 +08:00
UIButtonScale9ChangeSpriteFrame();
2021-12-28 16:06:23 +08:00
virtual bool init() override;
};
2013-09-16 20:54:13 +08:00
#endif /* defined(__TestCpp__UIButtonTest__) */