PuzzleSDK
UIRadioButtonTest.h
浏览该文件的文档.
1/****************************************************************************
2 Copyright (c) 2015 cocos2d-x.org
3 Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
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#ifndef __TestCpp__UIRadioButtonTest__
27#define __TestCpp__UIRadioButtonTest__
28
29#include "../UIScene.h"
30
31DEFINE_TEST_SUITE(UIRadioButtonTests);
32
34{
35public:
37
40
41 virtual bool init() override;
42
43 void addRadioButton(Ref* sender);
44 void deleteRadioButton(Ref* sender);
45
46private:
47 cocos2d::ui::RadioButtonGroup* _radioButtonGroup;
48 cocos2d::ui::Text* _allowNoSelectionText;
49
50};
51
52
54{
55public:
57
60
61 virtual bool init() override;
62 void onChangedRadioButtonGroup1(cocos2d::ui::RadioButton* radioButton, int index, cocos2d::ui::RadioButtonGroup::EventType type);
63 void onChangedRadioButtonGroup2(cocos2d::ui::RadioButton* radioButton, int index, cocos2d::ui::RadioButtonGroup::EventType type);
64 void onChangedRadioButtonSelect(cocos2d::ui::RadioButton* radioButton,cocos2d::ui::RadioButton::EventType type);
65 void clearRadioButtonGroup(Ref* sender);
66
67
68protected:
69 void addLog(const std::string& log);
70
71 cocos2d::ui::RadioButtonGroup* _radioButtonGroups[2];
72 cocos2d::ui::Text* _groupEventLabel;
73 cocos2d::ui::Text* _buttonEventLabel;
74 cocos2d::ui::Text* _logConsole;
76};
77
79{
80public:
82 virtual bool init() override;
83};
84
85#endif /* defined(__TestCpp__UIRadioButtonTest__) */
DEFINE_TEST_SUITE(UIRadioButtonTests)
virtual bool init() override
CREATE_FUNC(UIRadioButtonTabTest)
cocos2d::ui::RadioButtonGroup * _radioButtonGroup
virtual bool init() override
void deleteRadioButton(Ref *sender)
cocos2d::ui::Text * _allowNoSelectionText
CREATE_FUNC(UIRadioButtonTest)
void addRadioButton(Ref *sender)
cocos2d::ui::RadioButtonGroup * _radioButtonGroups[2]
void addLog(const std::string &log)
void onChangedRadioButtonGroup2(cocos2d::ui::RadioButton *radioButton, int index, cocos2d::ui::RadioButtonGroup::EventType type)
void onChangedRadioButtonSelect(cocos2d::ui::RadioButton *radioButton, cocos2d::ui::RadioButton::EventType type)
void clearRadioButtonGroup(Ref *sender)
cocos2d::ui::Text * _logConsole
virtual bool init() override
cocos2d::ui::Text * _groupEventLabel
cocos2d::ui::Text * _buttonEventLabel
void onChangedRadioButtonGroup1(cocos2d::ui::RadioButton *radioButton, int index, cocos2d::ui::RadioButtonGroup::EventType type)
CREATE_FUNC(UIRadioButtonTwoGroupsTest)