PuzzleSDK
UIRichTextXMLInvalid类 参考

#include <UIRichTextTest.h>

+ 类 UIRichTextXMLInvalid 继承关系图:
+ UIRichTextXMLInvalid 的协作图:

Public 成员函数

 CREATE_FUNC (UIRichTextXMLInvalid)
 
bool init () override
 
- Public 成员函数 继承自 UIScene
 UIScene ()
 
 ~UIScene ()
 
virtual void onEnter () override
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual std::string title () const
 
virtual std::string subtitle () const
 
virtual Type getTestType () const
 
virtual float getDuration () const
 
virtual std::string getExpectedOutput () const
 
virtual std::string getActualOutput () const
 
virtual void restartTestCallback (cocos2d::Ref *sender)
 
virtual void nextTestCallback (cocos2d::Ref *sender)
 
virtual void priorTestCallback (cocos2d::Ref *sender)
 
virtual void onBackCallback (cocos2d::Ref *sender)
 
void setTestSuite (TestSuite *testSuite)
 
TestSuitegetTestSuite () const
 
float getRunTime () const
 
void setTestCaseName (const std::string &name)
 
std::string getTestCaseName () const
 
const cocos2d::Label * getSubtitleLable () const
 
const cocos2d::MenuItemImage * getRestartTestItem () const
 

Protected 属性

cocos2d::ui::RichText * _richText
 
- Protected 属性 继承自 UIScene
cocos2d::Layer * _uiLayer
 
cocos2d::ui::Layout * _widget
 
cocos2d::ui::Text * _sceneTitle
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 

详细描述

在文件 UIRichTextTest.h202 行定义.

成员函数说明

◆ CREATE_FUNC()

UIRichTextXMLInvalid::CREATE_FUNC ( UIRichTextXMLInvalid  )

◆ init()

bool UIRichTextXMLInvalid::init ( )
overridevirtual

重载 UIScene .

在文件 UIRichTextTest.cpp1310 行定义.

1311{
1312 if (UIScene::init())
1313 {
1314 Size widgetSize = _widget->getContentSize();
1315
1316 // Add the alert
1317 Text *alert = Text::create("Invalid XML test", "fonts/Marker Felt.ttf", 30);
1318 alert->setColor(Color3B(159, 168, 176));
1319 alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getContentSize().height * 3.125));
1320 _widget->addChild(alert);
1321
1322
1323 // RichText
1324 _richText = RichText::createWithXML("this is an invalid xml. <i>no closing tag");
1325 if (_richText)
1326 {
1327 _richText->ignoreContentAdaptWithSize(false);
1328 _richText->setContentSize(Size(100, 100));
1329
1330 _richText->setPosition(Vec2(widgetSize.width / 2, widgetSize.height / 2));
1331 _richText->setLocalZOrder(10);
1332
1333
1334 _widget->addChild(_richText);
1335
1336 // test remove all children, this call won't effect the test
1337 _richText->removeAllChildren();
1338 }
1339 return true;
1340 }
1341 return false;
1342}
cocos2d::ui::RichText * _richText
virtual bool init() override
Definition: UIScene.cpp:46
cocos2d::ui::Layout * _widget
Definition: UIScene.h:45

引用了 _richText, UIScene::_widget , 以及 UIScene::init().

+ 函数调用图:

类成员变量说明

◆ _richText

cocos2d::ui::RichText* UIRichTextXMLInvalid::_richText
protected

在文件 UIRichTextTest.h210 行定义.

被这些函数引用 init().


该类的文档由以下文件生成: