PuzzleSDK
UILayoutComponent_Berth_Test类 参考

#include <UILayoutTest.h>

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

Public 成员函数

virtual bool init () override
 
 CREATE_FUNC (UILayoutComponent_Berth_Test)
 
- Public 成员函数 继承自 UILayoutComponentTest
 CREATE_FUNC (UILayoutComponentTest)
 
void touchEvent (cocos2d::Ref *sender, cocos2d::ui::Widget::TouchEventType type)
 
- 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
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 
- Protected 属性 继承自 UILayoutComponentTest
cocos2d::LayerColor * _baseLayer
 
- 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
 

详细描述

在文件 UILayoutTest.h149 行定义.

成员函数说明

◆ CREATE_FUNC()

UILayoutComponent_Berth_Test::CREATE_FUNC ( UILayoutComponent_Berth_Test  )

◆ init()

bool UILayoutComponent_Berth_Test::init ( )
overridevirtual

重载 UILayoutComponentTest .

在文件 UILayoutTest.cpp866 行定义.

867{
869 {
870 Sprite* leftTopSprite = Sprite::create("cocosui/CloseSelected.png");
871 LayoutComponent* leftTop = LayoutComponent::bindLayoutComponent(leftTopSprite);
872 leftTop->setHorizontalEdge(LayoutComponent::HorizontalEdge::Left);
873 leftTop->setVerticalEdge(LayoutComponent::VerticalEdge::Top);
874 _baseLayer->addChild(leftTopSprite);
875
876 Sprite* leftBottomSprite = Sprite::create("cocosui/CloseSelected.png");
877 LayoutComponent* leftBottom = LayoutComponent::bindLayoutComponent(leftBottomSprite);
878 leftBottom->setHorizontalEdge(LayoutComponent::HorizontalEdge::Left);
879 leftBottom->setVerticalEdge(LayoutComponent::VerticalEdge::Bottom);
880 _baseLayer->addChild(leftBottomSprite);
881
882 Sprite* rightTopSprite = Sprite::create("cocosui/CloseSelected.png");
883 LayoutComponent* rightTop = LayoutComponent::bindLayoutComponent(rightTopSprite);
884 rightTop->setHorizontalEdge(LayoutComponent::HorizontalEdge::Right);
885 rightTop->setVerticalEdge(LayoutComponent::VerticalEdge::Top);
886 _baseLayer->addChild(rightTopSprite);
887
888 Sprite* rightBottomSprite = Sprite::create("cocosui/CloseSelected.png");
889 LayoutComponent* rightBottom = LayoutComponent::bindLayoutComponent(rightBottomSprite);
890 rightBottom->setHorizontalEdge(LayoutComponent::HorizontalEdge::Right);
891 rightBottom->setVerticalEdge(LayoutComponent::VerticalEdge::Bottom);
892 _baseLayer->addChild(rightBottomSprite);
893
894 ui::Helper::doLayout(_baseLayer);
895
896 return true;
897 }
898 return false;
899}
cocos2d::LayerColor * _baseLayer
Definition: UILayoutTest.h:145
virtual bool init() override

引用了 UILayoutComponentTest::_baseLayer , 以及 UILayoutComponentTest::init().

+ 函数调用图:

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