PuzzleSDK
UILayoutComponent_Berth_Stretch_Test类 参考

#include <UILayoutTest.h>

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

Public 成员函数

virtual bool init () override
 
 CREATE_FUNC (UILayoutComponent_Berth_Stretch_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.h157 行定义.

成员函数说明

◆ CREATE_FUNC()

UILayoutComponent_Berth_Stretch_Test::CREATE_FUNC ( UILayoutComponent_Berth_Stretch_Test  )

◆ init()

bool UILayoutComponent_Berth_Stretch_Test::init ( )
overridevirtual

重载 UILayoutComponentTest .

在文件 UILayoutTest.cpp901 行定义.

902{
904 {
905 ImageView* leftTopSprite = ImageView::create("cocosui/CloseSelected.png");
906 leftTopSprite->ignoreContentAdaptWithSize(false);
907 LayoutComponent* leftTop = LayoutComponent::bindLayoutComponent(leftTopSprite);
908 leftTop->setHorizontalEdge(LayoutComponent::HorizontalEdge::Left);
909 leftTop->setVerticalEdge(LayoutComponent::VerticalEdge::Top);
910 leftTop->setStretchWidthEnabled(true);
911 leftTop->setStretchHeightEnabled(true);
912 _baseLayer->addChild(leftTopSprite);
913 leftTop->setSize(leftTopSprite->getContentSize());
914 leftTop->setLeftMargin(0);
915 leftTop->setTopMargin(0);
916
917 ImageView* leftBottomSprite = ImageView::create("cocosui/CloseSelected.png");
918 leftBottomSprite->ignoreContentAdaptWithSize(false);
919 LayoutComponent* leftBottom = LayoutComponent::bindLayoutComponent(leftBottomSprite);
920 leftBottom->setHorizontalEdge(LayoutComponent::HorizontalEdge::Left);
921 leftBottom->setVerticalEdge(LayoutComponent::VerticalEdge::Bottom);
922 leftBottom->setStretchWidthEnabled(true);
923 leftBottom->setStretchHeightEnabled(true);
924 _baseLayer->addChild(leftBottomSprite);
925 leftBottom->setSize(leftBottomSprite->getContentSize());
926 leftBottom->setLeftMargin(0);
927 leftBottom->setBottomMargin(0);
928
929 ImageView* rightTopSprite = ImageView::create("cocosui/CloseSelected.png");
930 rightTopSprite->ignoreContentAdaptWithSize(false);
931 LayoutComponent* rightTop = LayoutComponent::bindLayoutComponent(rightTopSprite);
932 rightTop->setHorizontalEdge(LayoutComponent::HorizontalEdge::Right);
933 rightTop->setVerticalEdge(LayoutComponent::VerticalEdge::Top);
934 rightTop->setStretchWidthEnabled(true);
935 rightTop->setStretchHeightEnabled(true);
936 _baseLayer->addChild(rightTopSprite);
937 rightTop->setSize(rightTopSprite->getContentSize());
938 rightTop->setTopMargin(0);
939 rightTop->setRightMargin(0);
940
941 ImageView* rightBottomSprite = ImageView::create("cocosui/CloseSelected.png");
942 rightBottomSprite->ignoreContentAdaptWithSize(false);
943 LayoutComponent* rightBottom = LayoutComponent::bindLayoutComponent(rightBottomSprite);
944 rightBottom->setHorizontalEdge(LayoutComponent::HorizontalEdge::Right);
945 rightBottom->setVerticalEdge(LayoutComponent::VerticalEdge::Bottom);
946 rightBottom->setStretchWidthEnabled(true);
947 rightBottom->setStretchHeightEnabled(true);
948 _baseLayer->addChild(rightBottomSprite);
949 rightBottom->setSize(rightBottomSprite->getContentSize());
950 rightBottom->setBottomMargin(0);
951 rightBottom->setRightMargin(0);
952
953 ui::Helper::doLayout(_baseLayer);
954
955 return true;
956 }
957 return false;
958}
cocos2d::LayerColor * _baseLayer
Definition: UILayoutTest.h:145
virtual bool init() override

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

+ 函数调用图:

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