当前位置: 首页>>代码示例>>C++>>正文


C++ HorizontalLayout::addChild方法代码示例

本文整理汇总了C++中HorizontalLayout::addChild方法的典型用法代码示例。如果您正苦于以下问题:C++ HorizontalLayout::addChild方法的具体用法?C++ HorizontalLayout::addChild怎么用?C++ HorizontalLayout::addChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HorizontalLayout的用法示例。


在下文中一共展示了HorizontalLayout::addChild方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createModePropertyLayout

/**
 * Create an layout containing a label and a check box widget.
 * The check box will be used to set the edit box #MAW_EDIT_BOX_MODE property.
 * Platform: iOS.
 */
HorizontalLayout* MainScreen::createModePropertyLayout()
{
	if (!isIOS())
	{
		return NULL;
	}

	HorizontalLayout* hLayout = new HorizontalLayout();
	hLayout->wrapContentVertically();

	Label* label = new Label();
	label->setText("Single line");
	hLayout->addChild(label);

	mSingleLineCheckBox = new CheckBox();
	mSingleLineCheckBox->setState(true);

	HorizontalLayout* spacer = new HorizontalLayout();
	int spacerWidth = this->getWidth() - label->getWidth() -
		mSingleLineCheckBox->getWidth();
	spacer->setWidth(spacerWidth);

	hLayout->addChild(spacer);
	hLayout->addChild(mSingleLineCheckBox);

	return hLayout;
}
开发者ID:GregorGullwi,项目名称:MoSync,代码行数:32,代码来源:MainScreen.cpp

示例2: createMainLayout

/**
 * Creates and adds main layout to the screen.
 */
void MainScreen::createMainLayout()
{
	// Create and add the main layout to the screen.
	mMainLayout = new VerticalLayout();
	mMainLayout->setBackgroundColor(0x220099);
	Screen::setMainWidget(mMainLayout);

	mGenderRadioGroup = new RadioGroup();
	mMainLayout->addChild(mGenderRadioGroup);
	mFemaleButton = new RadioButton();
	mFemaleButton->setTextColor(0xFF0000);
	mFemaleButton->setText("Female");
	mMaleButton = new RadioButton();
	mMaleButton->setText("Male");
	mMaleButton->setTextColor(0x0000FF);
	mUnknownButton = new RadioButton();
	mUnknownButton->setText("Alien");
	mUnknownButton->setTextColor(0x00FF00);
	mGenderRadioGroup->addView(mFemaleButton);
	mGenderRadioGroup->addView(mMaleButton);
	mGenderRadioGroup->addView(mUnknownButton);
	mClearGenderSelection = new Button();
	mClearGenderSelection->setText("Clear gender selection");
	mMainLayout->addChild(mClearGenderSelection);
	HorizontalLayout* getGenderLayout = new HorizontalLayout();
	getGenderLayout->setChildVerticalAlignment(MAW_ALIGNMENT_CENTER);
	mMainLayout->addChild(getGenderLayout);
	mGetGenderSelection = new Button();
	mGetGenderSelection->setText("Get the gender selection");
	getGenderLayout->addChild(mGetGenderSelection);
	mGenderSelectionLabel = new Label();
	mGenderSelectionLabel->fillSpaceHorizontally();
	getGenderLayout->addChild(mGenderSelectionLabel);

	HorizontalLayout* getCheckedLayout = new HorizontalLayout();
	getCheckedLayout->setChildVerticalAlignment(MAW_ALIGNMENT_CENTER);
	mMainLayout->addChild(getCheckedLayout);
	mGetGenderChecked = new Button();
	mGetGenderChecked->setText("Get male checked state");
	getCheckedLayout->addChild(mGetGenderChecked);
	mGenderCheckedLabel = new Label();
	mGenderCheckedLabel->fillSpaceHorizontally();
	getCheckedLayout->addChild(mGenderCheckedLabel);

	mToggleMaleButton = new Button();
	mToggleMaleButton->setText("Toggle(check) Male button");
	mMainLayout->addChild(mToggleMaleButton);

	mGenderSelectionEvent = new Label();
	mGenderSelectionEvent->setText("Radio Group event");
	mMainLayout->addChild(mGenderSelectionEvent);
	mRadioButtonSelectEvent = new Label();
	mRadioButtonSelectEvent->setText("Radio Button select event");
	mMainLayout->addChild(mRadioButtonSelectEvent);
	mradioButtonUnselectEvent = new Label();
	mradioButtonUnselectEvent->setText("Radio Button unselect event");
	mMainLayout->addChild(mradioButtonUnselectEvent);

}
开发者ID:Felard,项目名称:MoSync,代码行数:62,代码来源:MainScreen.cpp

示例3: createListViewItemEditModeLayout

void SettingsScreen::createListViewItemEditModeLayout(VerticalLayout* listViewItemPropertiesVerticalLayout)
{
	HorizontalLayout* editModeLayout = new HorizontalLayout();
	editModeLayout->wrapContentVertically();
	mListViewItemEditModeCheckbox = new CheckBox();
	mListViewItemEditModeCheckbox->setState(false);
	Label* editModeLabel = new Label();
	editModeLabel->setText("Edit mode");
	editModeLayout->addChild(mListViewItemEditModeCheckbox);
	editModeLayout->addChild(editModeLabel);
	listViewItemPropertiesVerticalLayout->addChild(editModeLayout);
}
开发者ID:GregorGullwi,项目名称:MoSync,代码行数:12,代码来源:SettingsScreen.cpp

示例4: createMainLayout

/**
 * Creates and adds main layout to the screen.
 */
void MainScreen::createMainLayout()
{
	// Create and add the main layout to the screen.
	mMainLayout = new VerticalLayout();
	mMainLayout->setBackgroundColor(MAIN_LAYOUT_COLOR);
	Screen::setMainWidget(mMainLayout);

	// Create the "BUY" section.
	VerticalLayout* buyLayout = new VerticalLayout();
	buyLayout->wrapContentVertically();
	mMainLayout->addChild(buyLayout);
	Label* info = new Label();
	info->setText("Items for sale");
	info->setFontColor(INFO_LABELS_COLOR);
	buyLayout->addChild(info);

	// Add the list of available items for sale along with check boxes.
	for (int i=0; i < mProductNamesList.size(); i++)
	{
		HorizontalLayout* itemLayout = new HorizontalLayout();
		itemLayout->wrapContentVertically();
		CheckBox* itemCheckBox = new CheckBox();
		itemLayout->addChild(itemCheckBox);
		mItemsCheckBoxes.add(itemCheckBox);
		Label* itemId = new Label();
		itemId->setText(mProductNamesList[i]);
		itemId->setFontColor(ITEMS_COLOR);
		itemLayout->addChild(itemId);
		buyLayout->addChild(itemLayout);
	}

	// Use buy button to purchase the checked product it from the "BUY" section.
	mBuyButton = new Button();
	mBuyButton->setText("BUY");
	mMainLayout->addChild(mBuyButton);

	// Add a small break line between the two sections.
	HorizontalLayout* lineLayout = new HorizontalLayout();
	lineLayout->setHeight(BREAKLINE_HEIGHT);
	lineLayout->setBackgroundColor(BREAKLINE_COLOR);
	mMainLayout->addChild(lineLayout);

	// Create the "HISTORY" section.
	VerticalLayout* purchasedLayout = new VerticalLayout();
	Label* purchasedLabel = new Label();
	purchasedLabel->setText("Items you own");
	purchasedLabel->setFontColor(INFO_LABELS_COLOR);
	purchasedLayout->addChild(purchasedLabel);
	mPurchasedItemsList = new ListView();
	purchasedLayout->addChild(mPurchasedItemsList);
	mMainLayout->addChild(purchasedLayout);

}
开发者ID:,项目名称:,代码行数:56,代码来源:

示例5: createListViewItemUnhighlightedAnimationLayout

void SettingsScreen::createListViewItemUnhighlightedAnimationLayout(VerticalLayout* listViewItemPropertiesVerticalLayout)
{
	HorizontalLayout* unhighlightedAnimationLayout = new HorizontalLayout();
	unhighlightedAnimationLayout->wrapContentVertically();
	mListViewItemUnhighlightedCheckbox = new CheckBox();
	mListViewItemUnhighlightedCheckbox->setState(false);
	Label* unhighlightedAnimationLabel = new Label();
	unhighlightedAnimationLabel->setText("Unhighlighted animation");
	unhighlightedAnimationLayout->addChild(mListViewItemUnhighlightedCheckbox);
	unhighlightedAnimationLayout->addChild(unhighlightedAnimationLabel);
	listViewItemPropertiesVerticalLayout->addChild(unhighlightedAnimationLayout);
}
开发者ID:GregorGullwi,项目名称:MoSync,代码行数:12,代码来源:SettingsScreen.cpp

示例6: createListViewItemDeleteButtonTextLayout

void SettingsScreen::createListViewItemDeleteButtonTextLayout(VerticalLayout* listViewItemPropertiesVerticalLayout)
{
	HorizontalLayout* currentListViewItemDeleteButtonLayout = new HorizontalLayout();
	currentListViewItemDeleteButtonLayout->wrapContentVertically();
	mSetListViewItemDeleteTitleButton = new Button();
	mSetListViewItemDeleteTitleButton->setText("Set delete");
	mSetListViewItemDeleteTitleButton->fillSpaceHorizontally();
	currentListViewItemDeleteButtonLayout->addChild(mSetListViewItemDeleteTitleButton);
	mSetListViewItemDeleteTitleEditBox = new EditBox();
	mSetListViewItemDeleteTitleEditBox->fillSpaceHorizontally();
	currentListViewItemDeleteButtonLayout->addChild(mSetListViewItemDeleteTitleEditBox);
	listViewItemPropertiesVerticalLayout->addChild(currentListViewItemDeleteButtonLayout);
}
开发者ID:GregorGullwi,项目名称:MoSync,代码行数:13,代码来源:SettingsScreen.cpp

示例7: createRow

/**
 * Create a new row for settings.
 * It contains a check box/button and a label.
 */
HorizontalLayout* MainScreen::createRow(Widget* check, Label* label)
{
	HorizontalLayout* hLayout = new HorizontalLayout();
	if ( check != NULL )
	{
		hLayout->addChild(check);
		HorizontalLayout* space = new HorizontalLayout();
		space->setWidth(10);
		hLayout->addChild(space);
	}
	hLayout->addChild(label);
	return hLayout;
}
开发者ID:Felard,项目名称:MoSync,代码行数:17,代码来源:MainScreen.cpp

示例8: createListViewItemFontColorLayout

void SettingsScreen::createListViewItemFontColorLayout(VerticalLayout* listViewItemPropertiesVerticalLayout)
{
	HorizontalLayout* currentListViewItemFontColorLayout = new HorizontalLayout();
	currentListViewItemFontColorLayout->wrapContentVertically();
	mSetListViewItemFontColorButton = new Button();
	mSetListViewItemFontColorButton->setText("Set font color");
	mSetListViewItemFontColorButton->fillSpaceHorizontally();
	currentListViewItemFontColorLayout->addChild(mSetListViewItemFontColorButton);
	mSetListViewItemFontColorEditBox = new EditBox();
	mSetListViewItemFontColorEditBox->fillSpaceHorizontally();
	mSetListViewItemFontColorEditBox->setPlaceholder("ex: 0xFF0000");
	currentListViewItemFontColorLayout->addChild(mSetListViewItemFontColorEditBox);
	listViewItemPropertiesVerticalLayout->addChild(currentListViewItemFontColorLayout);
}
开发者ID:GregorGullwi,项目名称:MoSync,代码行数:14,代码来源:SettingsScreen.cpp

示例9: createListViewItemFontSizeLayout

void SettingsScreen::createListViewItemFontSizeLayout(VerticalLayout* listViewItemPropertiesVerticalLayout)
{
	HorizontalLayout* currentListViewItemFontSizeLayout = new HorizontalLayout();
	currentListViewItemFontSizeLayout->wrapContentVertically();
	mSetListViewItemFontSizeButton = new Button();
	mSetListViewItemFontSizeButton->setText("Set font size");
	mSetListViewItemFontSizeButton->fillSpaceHorizontally();
	currentListViewItemFontSizeLayout->addChild(mSetListViewItemFontSizeButton);
	mSetListViewItemFontSizeEditBox = new EditBox();
	mSetListViewItemFontSizeEditBox->fillSpaceHorizontally();
	mSetListViewItemFontSizeEditBox->setInputMode(EDIT_BOX_INPUT_MODE_NUMERIC);
	currentListViewItemFontSizeLayout->addChild(mSetListViewItemFontSizeEditBox);
	listViewItemPropertiesVerticalLayout->addChild(currentListViewItemFontSizeLayout);
}
开发者ID:Felard,项目名称:MoSync,代码行数:14,代码来源:SettingsScreen.cpp

示例10: createRow

/**
 * Create a new row for settings.
 * It contains two widgets separated by a spacer.
 */
HorizontalLayout* SettingsScreen::createRow(
	Widget* firstWidget,
	Widget* secondWidget)
{
	HorizontalLayout* hLayout = new HorizontalLayout();
	if ( firstWidget != NULL )
	{
		hLayout->addChild(firstWidget);
		HorizontalLayout* space = new HorizontalLayout();
		space->setWidth(10);
		hLayout->addChild(space);
	}
	hLayout->addChild(secondWidget);
	return hLayout;
}
开发者ID:AliSayed,项目名称:MoSync,代码行数:19,代码来源:SettingsScreen.cpp

示例11: createSetButtonTextLayout

/**
 * Creates the set button text layout.
 */
void ButtonSettingsLayout::createSetButtonTextLayout()
{
	HorizontalLayout* setTextHorizontalLayout = new HorizontalLayout();
	setTextHorizontalLayout->setHeight(PROPERTY_LINE_HEIGHT);
	setTextButton = new Button();
	setTextButton->setText("Set button text:");
	setTextButton->fillSpaceHorizontally();
	setTextHorizontalLayout->addChild(setTextButton);

	setTextEditBox = new EditBox();
	setTextEditBox->setPlaceholder("Button text");
	setTextEditBox->fillSpaceHorizontally();
	setTextHorizontalLayout->addChild(setTextEditBox);

	this->addChild(setTextHorizontalLayout);
}
开发者ID:spiridon-alexandru,项目名称:NativeUIWidgetsDemo,代码行数:19,代码来源:ButtonSettingsLayout.cpp

示例12: createGetButtonTextLayout

/**
 * Creates the get button text layout.
 */
void ButtonSettingsLayout::createGetButtonTextLayout()
{
	HorizontalLayout* getTextHorizontalLayout = new HorizontalLayout();
	getTextHorizontalLayout->setHeight(PROPERTY_LINE_HEIGHT);
	getTextButton = new Button();
	getTextButton->setText("Get button text:");
	getTextButton->fillSpaceHorizontally();
	getTextHorizontalLayout->addChild(getTextButton);

	getTextLabel = new Label();
	getTextLabel->setText("No text yet");
	getTextLabel->fillSpaceHorizontally();
	getTextHorizontalLayout->addChild(getTextLabel);

	this->addChild(getTextHorizontalLayout);
}
开发者ID:spiridon-alexandru,项目名称:NativeUIWidgetsDemo,代码行数:19,代码来源:ButtonSettingsLayout.cpp

示例13: createGetEditBoxTextLayout

/**
 * Creates the get button text layout.
 */
void EditBoxSettingsLayout::createGetEditBoxTextLayout()
{
	HorizontalLayout* getTextHorizontalLayout = new HorizontalLayout();
	getTextHorizontalLayout->setHeight(PROPERTY_LINE_HEIGHT);
	getTextButton = new Button();
	getTextButton->setText("Get edit box text:");
	getTextButton->fillSpaceHorizontally();
	getTextHorizontalLayout->addChild(getTextButton);

	getTextLabel = new Label();
	getTextLabel->setText("No text yet");
	getTextLabel->fillSpaceHorizontally();
	getTextHorizontalLayout->addChild(getTextLabel);

	mEditBoxListView->addChild(getTextHorizontalLayout);
}
开发者ID:spiridon-alexandru,项目名称:NativeUIWidgetsDemo,代码行数:19,代码来源:EditBoxSettingsLayout.cpp

示例14: createSetPlaceholderLayout

/**
 * Creates the set edit box placeholder text layout.
 */
void EditBoxSettingsLayout::createSetPlaceholderLayout()
{
	HorizontalLayout* getPlaceholderHorizontalLayout = new HorizontalLayout();
	getPlaceholderHorizontalLayout->setHeight(PROPERTY_LINE_HEIGHT);
	setPlaceholderButton = new Button();
	setPlaceholderButton->setText("Set placeholder text:");
	setPlaceholderButton->fillSpaceHorizontally();
	getPlaceholderHorizontalLayout->addChild(setPlaceholderButton);

	setPlaceholderEditBox = new EditBox();
	setPlaceholderEditBox->setPlaceholder("Edit box placeholder");
	setPlaceholderEditBox->fillSpaceHorizontally();
	getPlaceholderHorizontalLayout->addChild(setPlaceholderEditBox);

	mEditBoxListView->addChild(getPlaceholderHorizontalLayout);
}
开发者ID:spiridon-alexandru,项目名称:NativeUIWidgetsDemo,代码行数:19,代码来源:EditBoxSettingsLayout.cpp

示例15: createMainLayout

/**
 * Creates and adds main layout to the screen.
 */
void MainScreen::createMainLayout()
{
	// Create and add the main layout to the screen.
	mMainListView = new ListView();
	Screen::setMainWidget(mMainListView);

	Label* info1 = new Label();
	info1->setText("First edit box with Capitalize all characters");
	mMainListView->addChild(info1);

	mEditBox = new EditBox();
	mEditBox->setPlaceholder("Enter text...");
	mEditBox->setHeight(100);
	mEditBox->fillSpaceHorizontally();
	mMainListView->addChild(mEditBox);

	HorizontalLayout* layout = new HorizontalLayout();
	layout->setHeight(75);
	mMainListView->addChild(layout);

	mSetTextButton = new Button();
	mSetTextButton->setText("Reset text to DEFAULT ");
	layout->addChild(mSetTextButton);

	mGetTextButton = new Button();
	mGetTextButton->setText("Get text");
	layout->addChild(mGetTextButton);

	mGetTextLabel = new Label();
	mMainListView->addChild(mGetTextLabel);

	mKeyboardButton = new Button();
	mKeyboardButton->setText("Show/hide keyboard");
	mKeyboardButton->fillSpaceHorizontally();
	mMainListView->addChild(mKeyboardButton);

	// Create layout for widgets.
	this->createDecimalEditBoxView(mMaxTextLengthEditBox, mMainListView, MAX_TEXT_LENGTH_LABEL_TEXT);
	this->createDecimalEditBoxView(mMaxLinesEditBox, mMainListView, MAX_LINES_LABEL_TEXT);
	this->createDecimalEditBoxView(mMinLinesEditBox, mMainListView, MIN_LINES_LABEL_TEXT);
	this->createDecimalEditBoxView(mLinesNumberEditBox, mMainListView, LINES_NUMBER_LABEL_TEXT);
	this->createDecimalEditBoxView(mPlaceholderColorEditBox, mMainListView, PLACEHOLDER_COLOR_LABEL_TEXT);
	this->createInputModeListView(mMainListView);
	this->createInputFlagListView(mMainListView);

	maSetColor(0x8A2BE2);
}
开发者ID:miladir86,项目名称:MoSync,代码行数:50,代码来源:MainScreen.cpp


注:本文中的HorizontalLayout::addChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。