PuzzleSDK
UIButtonTest.h
浏览该文件的文档.
1/****************************************************************************
2 Copyright (c) 2013 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__UIButtonTest__
27#define __TestCpp__UIButtonTest__
28
29#include "../UIScene.h"
30
31DEFINE_TEST_SUITE(UIButtonTests);
32
33class UIButtonTest : public UIScene
34{
35public:
37
40
41 virtual bool init() override;
42 void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type);
43
44 void printWidgetResources(cocos2d::Ref* sender);
45protected:
46 cocos2d::ui::Text* _displayValueLabel;
47 cocos2d::ui::Button* _button;
48};
49
51{
52public:
54
57
58 virtual bool init() override;
59 void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type);
60
61protected:
62 cocos2d::ui::Text* _displayValueLabel;
63};
64
66{
67public:
69
72
73 virtual bool init() override;
74 void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type);
75
76protected:
77 cocos2d::ui::Text* _displayValueLabel;
78};
79
81{
82public:
84
87
88 virtual bool init() override;
89 void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type);
90
91protected:
92 cocos2d::ui::Text* _displayValueLabel;
93};
94
96{
97public:
99
102
103 virtual bool init() override;
104 void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type);
105
106protected:
107 cocos2d::ui::Text* _displayValueLabel;
108};
109
111{
112public:
114
117
118 virtual bool init() override;
119 void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type);
120
121protected:
122 cocos2d::ui::Text* _displayValueLabel;
123};
124
126{
127public:
129
132
133 virtual bool init() override;
134 void touchEvent(cocos2d::Ref* sender, cocos2d::ui::Widget::TouchEventType type);
135
136protected:
137 cocos2d::ui::Text* _displayValueLabel;
138};
139
141{
142public:
144
147
148 virtual bool init() override;
149 void sliderEvent(cocos2d::Ref* sender, cocos2d::ui::Slider::EventType type);
150
151protected:
152 cocos2d::ui::Text* _displayValueLabel;
153};
154
156{
157public:
159
162
163 virtual bool init() override;
164
165protected:
166 cocos2d::ui::Text* _displayValueLabel;
167};
168
170{
171public:
173
176
177 virtual bool init() override;
178
179protected:
180 cocos2d::ui::Text* _displayValueLabel;
181};
182
184{
185public:
187
190
191 virtual bool init() override;
192
193protected:
194 cocos2d::ui::Text* _displayValueLabel;
195};
196
198{
199public:
201
204
205 virtual bool init() override;
206
207protected:
208 cocos2d::ui::Text* _displayValueLabel;
209};
210
212{
213public:
215
218
219 virtual bool init() override;
220
221protected:
222 cocos2d::ui::Text* _displayValueLabel;
223};
224
226{
227public:
229
232
233 virtual bool init() override;
234
235protected:
236 cocos2d::ui::Text* _displayValueLabel;
237};
238
240{
241public:
243
246
247 virtual bool init() override;
248
249protected:
250 cocos2d::ui::Text* _displayValueLabel;
251};
252
253class Issue12249 : public UIScene
254{
255public:
257
258 Issue12249();
259
260 virtual bool init() override;
261
262protected:
263 cocos2d::ui::Text* _displayValueLabel;
264};
265
266class Issue17116: public UIScene
267{
268public:
270
271 Issue17116();
272
273 virtual bool init() override;
274};
275
277{
278public:
280
282
283 virtual bool init() override;
284};
285
287{
288public:
290
292
293 virtual bool init() override;
294};
295
296#endif /* defined(__TestCpp__UIButtonTest__) */
DEFINE_TEST_SUITE(UIButtonTests)
CREATE_FUNC(Issue12249)
virtual bool init() override
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:263
virtual bool init() override
CREATE_FUNC(Issue17116)
CREATE_FUNC(UIButtonCloneTest)
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:250
virtual bool init() override
virtual bool init() override
CREATE_FUNC(UIButtonDisableDefaultTest)
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:236
virtual bool init() override
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:208
CREATE_FUNC(UIButtonFlipTest)
CREATE_FUNC(UIButtonIgnoreContentSizeTest)
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:180
virtual bool init() override
CREATE_FUNC(UIButtonNormalDefaultTest)
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:222
virtual bool init() override
virtual bool init() override
CREATE_FUNC(UIButtonScale9ChangeSpriteFrame)
virtual bool init() override
void touchEvent(cocos2d::Ref *sender, cocos2d::ui::Widget::TouchEventType type)
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:92
CREATE_FUNC(UIButtonTest_PressedAction)
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:77
CREATE_FUNC(UIButtonTest_Scale9_State_Change)
virtual bool init() override
void touchEvent(cocos2d::Ref *sender, cocos2d::ui::Widget::TouchEventType type)
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:62
virtual bool init() override
CREATE_FUNC(UIButtonTest_Scale9)
void touchEvent(cocos2d::Ref *sender, cocos2d::ui::Widget::TouchEventType type)
void touchEvent(cocos2d::Ref *sender, cocos2d::ui::Widget::TouchEventType type)
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:107
CREATE_FUNC(UIButtonTest_Title)
virtual bool init() override
cocos2d::ui::Button * _button
Definition: UIButtonTest.h:47
virtual bool init() override
void printWidgetResources(cocos2d::Ref *sender)
CREATE_FUNC(UIButtonTest)
void touchEvent(cocos2d::Ref *sender, cocos2d::ui::Widget::TouchEventType type)
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:46
CREATE_FUNC(UIButtonTestRemoveSelf)
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:122
void touchEvent(cocos2d::Ref *sender, cocos2d::ui::Widget::TouchEventType type)
virtual bool init() override
CREATE_FUNC(UIButtonTestSwitchScale9)
virtual bool init() override
void touchEvent(cocos2d::Ref *sender, cocos2d::ui::Widget::TouchEventType type)
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:137
void sliderEvent(cocos2d::Ref *sender, cocos2d::ui::Slider::EventType type)
virtual bool init() override
CREATE_FUNC(UIButtonTestZoomScale)
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:152
virtual bool init() override
CREATE_FUNC(UIButtonTextOnly)
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:166
CREATE_FUNC(UIButtonTitleEffectTest)
cocos2d::ui::Text * _displayValueLabel
Definition: UIButtonTest.h:194
virtual bool init() override
virtual bool init() override
CREATE_FUNC(UIButtonWithPolygonInfo)