本文整理汇总了C++中VerticalLayout::setChildAlign方法的典型用法代码示例。如果您正苦于以下问题:C++ VerticalLayout::setChildAlign方法的具体用法?C++ VerticalLayout::setChildAlign怎么用?C++ VerticalLayout::setChildAlign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VerticalLayout
的用法示例。
在下文中一共展示了VerticalLayout::setChildAlign方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: finished
//.........这里部分代码省略.........
m_loginWidget->setMaxHeightRefSize("parent",0.2);
m_loginWidget->setBottomMargin(m_edgeSize);
m_loginWidget->setLeftMargin(m_edgeSize);
m_loginWidget->setRightMargin(m_edgeSize);
m_regWidget = new BasWidget;
hlay = new HorizontalLayout;
m_regButton = new BasButton;
m_regButton->setCanTouch(true);
m_regButton->setButtonInfo(lang->getStringById(StringEnum::Register).data(),"fonts/uifont35.fnt",m_theme,m_regImg,CCSizeMake(0,0),ccWHITE);
m_regButton->setButtonIndex(RegButton);
m_regButton->setClickCB(this,callfuncND_selector(LoginRegDialog::onButtonClicked));
m_regBackButton = new BasButton;
m_regBackButton->setCanTouch(true);
m_regBackButton->setButtonInfo(lang->getStringById(StringEnum::Back).data(),"fonts/uifont35.fnt",m_theme,m_regBackImg,CCSizeMake(0,0),ccWHITE);
m_regBackButton->setButtonIndex(RegBackButton);
m_regBackButton->setClickCB(this,callfuncND_selector(LoginRegDialog::onButtonClicked));
hlay->addWidget(m_regButton);
hlay->addWidget(m_regBackButton);
hlay->setAlignChildsSize(true);
hlay->setAveraged(true);
m_regWidget->setLayout(hlay);
m_regWidget->setLeft("parent",uilib::Left);
m_regWidget->setRight("parent",uilib::Right);
m_regWidget->setBottom("parent",uilib::Bottom);
m_regWidget->setMaxHeightRefSize("parent",0.2);
m_regWidget->setBottomMargin(m_edgeSize);
m_regWidget->setLeftMargin(m_edgeSize);
m_regWidget->setRightMargin(m_edgeSize);
//actions
BasNodeAction *moveIn = UiNodeActionFactory::getInstance()->getMoveActionByName("movein");
BasNodeAction *moveOut = UiNodeActionFactory::getInstance()->getMoveActionByName("moveout");
moveIn->setEaseType(uilib::EaseSineInOut);
moveIn->setMoveInType(uilib::ScaleYIn);
moveOut->setEaseType(uilib::EaseSineInOut);
moveOut->setMoveOutType(uilib::ScaleYOut);
moveOut->setActionTime(0.2);
moveIn->setStartTime(0.2);
m_loginWidget->setMoveinAction(moveIn);
m_loginWidget->setMoveoutAction(moveOut);
m_regWidget->setMoveinAction(moveIn);
m_regWidget->setMoveoutAction(moveOut);
}
this->addChild(m_loginTitleWidget);
this->addChild(m_regTitleWidget);
this->addChild(m_loginWidget);
this->addChild(m_regWidget);
m_regWidget->setEnabled(false);
m_regWidget->setVisible(false);
m_regTitleWidget->setVisible(false);
if(1){//content widget
m_contentWidget = new BasWidget;
m_contentWidget->setLeft("parent",uilib::Left);
m_contentWidget->setRight("parent",uilib::Right);
m_contentWidget->setLeftMargin(m_edgeSize);
m_contentWidget->setRightMargin(m_edgeSize);
m_contentWidget->setTopMargin(m_edgeSize / 4);
m_contentWidget->setBottomMargin(m_edgeSize / 4);
m_contentWidget->setTop(m_loginTitleWidget->getName(),uilib::Bottom);
m_contentWidget->setBottom(m_loginWidget->getName(),uilib::Top);
VerticalLayout *mainlay = new VerticalLayout;
BasLabel *label1,*label2;
label1 = new BasLabel;
label1->setLabelInfo(lang->getStringById(StringEnum::Account).data(),"fonts/uifont35.fnt","default","",CCSizeMake(0,0),ccBLACK);
label2 = new BasLabel;
label2->setLabelInfo(lang->getStringById(StringEnum::Passwd).data(),"fonts/uifont35.fnt","default","",CCSizeMake(0,0),ccBLACK);
m_accountBox = new InputBox;
m_accountBox->setMaxLength(m_accountLimitLen);
m_accountBox->setTheme("default","inputbg");
m_accountBox->setText(m_account);
m_accountBox->setMinHeightRefSize("parent",0.25);
m_passwdBox = new InputBox;
m_passwdBox->setMaxLength(m_passwdLimitLen);
m_passwdBox->setTheme("default","inputbg");
m_passwdBox->setText(m_passwd);
m_passwdBox->setMinHeightRefSize("parent",0.25);
m_passwdBox->setInputFlag(kEditBoxInputFlagPassword);
mainlay->addWidget(label1);
mainlay->addWidget(m_accountBox);
mainlay->addWidget(label2);
mainlay->addWidget(m_passwdBox);
mainlay->setAlignChildsSize(false);
mainlay->setAveraged(true);
mainlay->setChildAlign(0,uilib::Left);
mainlay->setChildAlign(2,uilib::Left);
mainlay->setChildAlign(1,uilib::Left);
mainlay->setChildAlign(1,uilib::Right);
mainlay->setChildAlign(3,uilib::Left);
mainlay->setChildAlign(3,uilib::Right);
m_contentWidget->setLayout(mainlay);
}
this->addChild(m_contentWidget);
}