本文整理汇总了C++中VerticalLayout::addWidget方法的典型用法代码示例。如果您正苦于以下问题:C++ VerticalLayout::addWidget方法的具体用法?C++ VerticalLayout::addWidget怎么用?C++ VerticalLayout::addWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VerticalLayout
的用法示例。
在下文中一共展示了VerticalLayout::addWidget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: finished
void LoginRegDialog::finished()
{
//init bg
CCSize dialogSize = CCSizeMake(m_anchorWidth,m_anchorHeight);
UiThemeDef *uiDef = UiThemeMgrProxy::getInstance()->getThemeByName(m_theme);
BasSkin *skin = BorderImageSkin::create(dialogSize,uiDef,m_bg);
if(skin) setSkin(skin);
LangDef *lang = UiThemeMgrProxy::getInstance()->getThemeMgr()->getLangDef();
if(1){ // title
m_loginTitleWidget = new BasButton;
m_loginTitleWidget->setCanTouch(false);
m_loginTitleWidget->setButtonInfo("","fonts/uifont35.fnt",m_theme,m_titleBg);
m_loginTitleWidget->setHorizontal("parent",0.5);
m_loginTitleWidget->setTop("parent",uilib::Top);
m_loginTitleWidget->setMaxHeightRefSize("parent",0.15);
m_loginTitleWidget->setTopMargin(m_edgeSize);
m_regTitleWidget = new BasButton;
m_regTitleWidget->setCanTouch(false);
m_regTitleWidget->setButtonInfo("","fonts/uifont35.fnt",m_theme,m_titleBg);
m_regTitleWidget->setHorizontal("parent",0.5);
m_regTitleWidget->setTop("parent",uilib::Top);
m_regTitleWidget->setMaxHeightRefSize("parent",0.15);
m_regTitleWidget->setTopMargin(m_edgeSize);
}
if(1){//buttons
m_loginWidget = new BasWidget;
HorizontalLayout *hlay;
hlay = new HorizontalLayout;
m_loginButton = new BasButton;
m_loginButton->setCanTouch(true);
m_loginButton->setButtonInfo(lang->getStringById(StringEnum::Login).data(),"fonts/uifont35.fnt",m_theme,m_loginImg,CCSizeMake(0,0),ccWHITE);
m_loginButton->setButtonIndex(LoginButton);
m_loginButton->setClickCB(this,callfuncND_selector(LoginRegDialog::onButtonClicked));
m_loginCancelButton = new BasButton;
m_loginCancelButton->setCanTouch(true);
m_loginCancelButton->setButtonInfo(lang->getStringById(StringEnum::Cancel).data(),"fonts/uifont35.fnt",m_theme,m_cancelImg,CCSizeMake(0,0),ccWHITE);
m_loginCancelButton->setButtonIndex(LoginCancelButton);
m_loginCancelButton->setClickCB(this,callfuncND_selector(LoginRegDialog::onButtonClicked));
m_loginRegButton = new BasButton;
m_loginRegButton->setCanTouch(true);
m_loginRegButton->setButtonInfo(lang->getStringById(StringEnum::Register).data(),"fonts/uifont35.fnt",m_theme,m_loginRegImg,CCSizeMake(0,0),ccWHITE);
m_loginRegButton->setButtonIndex(LoginRegButton);
m_loginRegButton->setClickCB(this,callfuncND_selector(LoginRegDialog::onButtonClicked));
hlay->addWidget(m_loginButton);
hlay->addWidget(m_loginCancelButton);
hlay->addWidget(m_loginRegButton);
hlay->setAlignChildsSize(true);
hlay->setAveraged(true);
m_loginWidget->setLayout(hlay);
m_loginWidget->setLeft("parent",uilib::Left);
m_loginWidget->setRight("parent",uilib::Right);
m_loginWidget->setBottom("parent",uilib::Bottom);
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);
//.........这里部分代码省略.........