本文整理汇总了C++中HorizontalLayout::wrapContentVertically方法的典型用法代码示例。如果您正苦于以下问题:C++ HorizontalLayout::wrapContentVertically方法的具体用法?C++ HorizontalLayout::wrapContentVertically怎么用?C++ HorizontalLayout::wrapContentVertically使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HorizontalLayout
的用法示例。
在下文中一共展示了HorizontalLayout::wrapContentVertically方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createListViewSectionPropertiesLayout
/**
* Create ListView section properties layout
*/
void SettingsScreen::createListViewSectionPropertiesLayout()
{
VerticalLayout* listViewSectionPropertiesVerticalLayout = new VerticalLayout();
listViewSectionPropertiesVerticalLayout->wrapContentVertically();
mListViewSectionLabel = new Label();
mListViewSectionLabel->setText("No section in focus");
mListViewSectionLabel->setFontSize(TITLE_FONT_SIZE);
mListViewSectionLabel->setFontColor(0xFF0000);
listViewSectionPropertiesVerticalLayout->addChild(mListViewSectionLabel);
// create the current section title layout
HorizontalLayout* currentSectionTitleLayout = new HorizontalLayout();
currentSectionTitleLayout->wrapContentVertically();
mSetListViewSectionTitleButton = new Button();
mSetListViewSectionTitleButton->setText("Set title");
mSetListViewSectionTitleButton->fillSpaceHorizontally();
currentSectionTitleLayout->addChild(mSetListViewSectionTitleButton);
mCurrentListViewSectionTitleEditBox = new EditBox();
mCurrentListViewSectionTitleEditBox->fillSpaceHorizontally();
currentSectionTitleLayout->addChild(mCurrentListViewSectionTitleEditBox);
listViewSectionPropertiesVerticalLayout->addChild(currentSectionTitleLayout);
// create the current section header text layout
HorizontalLayout* currentSectionHeaderTextLayout = new HorizontalLayout();
currentSectionHeaderTextLayout->wrapContentVertically();
mSetListViewSectionHeaderButton = new Button();
mSetListViewSectionHeaderButton->setText("Set header");
mSetListViewSectionHeaderButton->fillSpaceHorizontally();
currentSectionHeaderTextLayout->addChild(mSetListViewSectionHeaderButton);
mCurrentListViewSectionHeaderEditBox = new EditBox();
mCurrentListViewSectionHeaderEditBox->fillSpaceHorizontally();
currentSectionHeaderTextLayout->addChild(mCurrentListViewSectionHeaderEditBox);
listViewSectionPropertiesVerticalLayout->addChild(currentSectionHeaderTextLayout);
// create the current section footer text layout
HorizontalLayout* currentSectionFooterTextLayout = new HorizontalLayout();
currentSectionFooterTextLayout->wrapContentVertically();
mSetListViewSectionFooterButton = new Button();
mSetListViewSectionFooterButton->setText("Set footer");
mSetListViewSectionFooterButton->fillSpaceHorizontally();
currentSectionFooterTextLayout->addChild(mSetListViewSectionFooterButton);
mCurrentListViewSectionFooterEditBox = new EditBox();
mCurrentListViewSectionFooterEditBox->fillSpaceHorizontally();
currentSectionFooterTextLayout->addChild(mCurrentListViewSectionFooterEditBox);
listViewSectionPropertiesVerticalLayout->addChild(currentSectionFooterTextLayout);
if (isWindowsPhone() || isAndroid())
{
listViewSectionPropertiesVerticalLayout->wrapContentVertically();
createListViewSectionHeaderPropertiesLayout(listViewSectionPropertiesVerticalLayout);
createListViewSectionFooterPropertiesLayout(listViewSectionPropertiesVerticalLayout);
}
ListViewItem* mListSectionPropertiesItem = new ListViewItem();
mListSectionPropertiesItem->setSelectionStyle(LIST_VIEW_ITEM_SELECTION_STYLE_NONE);
mListSectionPropertiesItem->addChild(listViewSectionPropertiesVerticalLayout);
mPropertiesListView->addChild(mListSectionPropertiesItem);
}
示例2: createListViewPropertiesLayout
/**
* Create ListView properties layout
*/
void SettingsScreen::createListViewPropertiesLayout()
{
VerticalLayout* listViewPropertiesVerticalLayout = new VerticalLayout();
listViewPropertiesVerticalLayout->wrapContentVertically();
Label* mListViewPropertiesLabel = new Label();
mListViewPropertiesLabel->setText("ListView properties");
mListViewPropertiesLabel->setFontSize(TITLE_FONT_SIZE);
mListViewPropertiesLabel->setFontColor(0xFF0000);
listViewPropertiesVerticalLayout->addChild(mListViewPropertiesLabel);
// create the allow selection layout
HorizontalLayout* allowSelectionLayout = new HorizontalLayout();
allowSelectionLayout->wrapContentVertically();
mListViewAllowSelectionCheckbox = new CheckBox();
mListViewAllowSelectionCheckbox->setState(true);
Label* allowSelectionLabel = new Label();
allowSelectionLabel->setText("Allow selection");
allowSelectionLayout->addChild(mListViewAllowSelectionCheckbox);
allowSelectionLayout->addChild(allowSelectionLabel);
listViewPropertiesVerticalLayout->addChild(allowSelectionLayout);
if (isIOS())
{
listViewPropertiesVerticalLayout->wrapContentVertically();
// create the mode selection layout
HorizontalLayout* modeSelectionLayout = new HorizontalLayout();
modeSelectionLayout->wrapContentVertically();
Label* setModeLabel = new Label();
setModeLabel->setText("Set mode: ");
modeSelectionLayout->addChild(setModeLabel);
mDisplayCheckBox = new CheckBox();
mDisplayCheckBox->setState(true);
listViewPropertiesVerticalLayout->addChild(modeSelectionLayout);
modeSelectionLayout = new HorizontalLayout();
Label* setDisplayLabel = new Label();
setDisplayLabel->setText("Display");
modeSelectionLayout->addChild(mDisplayCheckBox);
modeSelectionLayout->addChild(setDisplayLabel);
mEditCheckBox = new CheckBox();
mEditCheckBox->setState(false);
Label* setEditLabel = new Label();
setEditLabel->setText("Edit");
modeSelectionLayout->addChild(mEditCheckBox);
modeSelectionLayout->addChild(setEditLabel);
listViewPropertiesVerticalLayout->addChild(modeSelectionLayout);
createListViewItemSelectionStyleLayout(listViewPropertiesVerticalLayout);
}
ListViewItem* mListPropertiesItem = new ListViewItem();
mListPropertiesItem->setSelectionStyle(LIST_VIEW_ITEM_SELECTION_STYLE_NONE);
mListPropertiesItem->addChild(listViewPropertiesVerticalLayout);
mPropertiesListView->addChild(mListPropertiesItem);
}
示例3: 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;
}
示例4: createReceiptDialog
/**
* Create the dialog that will display receipt fields, on rows.
*/
void MainScreen::createReceiptDialog()
{
mReceiptDialog = new Dialog();
VerticalLayout* dialogLayout = new VerticalLayout();
mReceiptDialog->setMainWidget(dialogLayout);
HorizontalLayout* titleLayout = new HorizontalLayout();
titleLayout->wrapContentVertically();
titleLayout->setChildHorizontalAlignment(MAW_ALIGNMENT_CENTER);
Label* title = new Label("Product Receipt");
title->setFontColor(RECEIPT_FIELD_COLOR);
titleLayout->addChild(title);
dialogLayout->addChild(titleLayout);
Label* receiptProductIdInfo = new Label("Product ID");
receiptProductIdInfo->setFontColor(RECEIPT_FIELD_COLOR);
mReceiptProductId = new Label();
Label* receiptAppId = new Label("App ID");
receiptAppId->setFontColor(RECEIPT_FIELD_COLOR);
mReceiptAppId = new Label();
Label* receiptTransactionDate = new Label("Transaction date");
receiptTransactionDate->setFontColor(RECEIPT_FIELD_COLOR);
mReceiptTransactionDate = new Label();
dialogLayout->addChild(receiptProductIdInfo);
dialogLayout->addChild(mReceiptProductId);
dialogLayout->addChild(receiptAppId);
dialogLayout->addChild(mReceiptAppId);
dialogLayout->addChild(receiptTransactionDate);
dialogLayout->addChild(mReceiptTransactionDate);
if ( getPlatform() == IOS )
{
Label* receiptTransactionId = new Label("Transaction ID");
receiptTransactionId->setFontColor(RECEIPT_FIELD_COLOR);
mReceiptTransactionId = new Label();
Label* receiptVersionExternalId = new Label("Version external ID");
receiptVersionExternalId->setFontColor(RECEIPT_FIELD_COLOR);
mReceiptVersionExternalId = new Label();
Label* receiptBid = new Label("BID");
receiptBid->setFontColor(RECEIPT_FIELD_COLOR);
mReceiptBid = new Label();
dialogLayout->addChild(receiptTransactionId);
dialogLayout->addChild(mReceiptTransactionId);
dialogLayout->addChild(receiptVersionExternalId);
dialogLayout->addChild(mReceiptVersionExternalId);
dialogLayout->addChild(receiptBid);
dialogLayout->addChild(mReceiptBid);
}
mReceiptOkButton = new Button();
mReceiptOkButton->setText("Ok");
dialogLayout->addChild(mReceiptOkButton);
}
示例5: createListViewSectionFooterPropertiesLayout
void SettingsScreen::createListViewSectionFooterPropertiesLayout(VerticalLayout* listViewSectionPropertiesVerticalLayout)
{
// create the current section footer background color layout
HorizontalLayout* currentSectionFooterBackgroundColorLayout = new HorizontalLayout();
currentSectionFooterBackgroundColorLayout->wrapContentVertically();
mSetSectionFooterBackgroundColor = new Button();
mSetSectionFooterBackgroundColor->setText("Footer bg");
mSetSectionFooterBackgroundColor->fillSpaceHorizontally();
currentSectionFooterBackgroundColorLayout->addChild(mSetSectionFooterBackgroundColor);
mFooterBackgroundColorEditBox = new EditBox();
mFooterBackgroundColorEditBox->setPlaceholder("ex: 0xFF0000");
mFooterBackgroundColorEditBox->fillSpaceHorizontally();
currentSectionFooterBackgroundColorLayout->addChild(mFooterBackgroundColorEditBox);
listViewSectionPropertiesVerticalLayout->addChild(currentSectionFooterBackgroundColorLayout);
// create the current section footer font size layout
HorizontalLayout* currentSectionFooterFontSizeLayout = new HorizontalLayout();
currentSectionFooterFontSizeLayout->wrapContentVertically();
mSetSectionFooterFontSize = new Button();
mSetSectionFooterFontSize->setText("Footer font sz");
mSetSectionFooterFontSize->fillSpaceHorizontally();
currentSectionFooterFontSizeLayout->addChild(mSetSectionFooterFontSize);
mFooterFontSizeEditBox = new EditBox();
mFooterFontSizeEditBox->setInputMode(EDIT_BOX_INPUT_MODE_NUMERIC);
mFooterFontSizeEditBox->fillSpaceHorizontally();
currentSectionFooterFontSizeLayout->addChild(mFooterFontSizeEditBox);
listViewSectionPropertiesVerticalLayout->addChild(currentSectionFooterFontSizeLayout);
// create the current section footer font color layout
HorizontalLayout* currentSectionFooterFontColorLayout = new HorizontalLayout();
currentSectionFooterFontColorLayout->wrapContentVertically();
mSetSectionFooterFontColor = new Button();
mSetSectionFooterFontColor->setText("Footer font color");
mSetSectionFooterFontColor->fillSpaceHorizontally();
currentSectionFooterFontColorLayout->addChild(mSetSectionFooterFontColor);
mFooterFontColorEditBox = new EditBox();
mFooterFontColorEditBox->setPlaceholder("ex: 0xFF0000");
mFooterFontColorEditBox->fillSpaceHorizontally();
currentSectionFooterFontColorLayout->addChild(mFooterFontColorEditBox);
listViewSectionPropertiesVerticalLayout->addChild(currentSectionFooterFontColorLayout);
}
示例6: 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);
}
示例7: 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);
}
示例8: 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);
}
示例9: 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);
}
示例10: 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);
}
示例11: 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);
}
示例12: createListManipulationLayout
/**
* Creates the list manipulation UI (remove section, add/remove item).
*/
void ListScreen::createListManipulationLayout()
{
mRemoveFirstSection = new Button();
mRemoveFirstSection->setText("Remove first secction");
mRemoveFirstSection->fillSpaceHorizontally();
mMainLayout->addChild(mRemoveFirstSection);
HorizontalLayout* itemManipulationLayout = new HorizontalLayout();
itemManipulationLayout->wrapContentVertically();
mAddItem = new Button();
mAddItem->setText("Add item");
mAddItem->fillSpaceHorizontally();
itemManipulationLayout->addChild(mAddItem);
mRemoveItem = new Button();
mRemoveItem->setText("Remove item");
mRemoveItem->fillSpaceHorizontally();
itemManipulationLayout->addChild(mRemoveItem);
mMainLayout->addChild(itemManipulationLayout);
}
示例13: addCheckboxWidget
void addCheckboxWidget(Layout* aTargetLayout)
{
VerticalLayout* betaWrapper = new VerticalLayout();
betaWrapper->fillSpaceHorizontally();
betaWrapper->wrapContentVertically();
betaWrapper->setPaddingTop(int(mFontSize * 0.5));
VerticalLayout* betaContainer = new VerticalLayout();
betaContainer->fillSpaceHorizontally();
betaContainer->wrapContentVertically();
betaContainer->setBackgroundColor(AUX_COLOR);
setRoundPadding(aTargetLayout);
HorizontalLayout* subSettingsContainer = new HorizontalLayout();
subSettingsContainer->fillSpaceHorizontally();
subSettingsContainer->wrapContentVertically();
subSettingsContainer->setChildVerticalAlignment(MAW_ALIGNMENT_CENTER);
subSettingsContainer->setChildHorizontalAlignment(MAW_ALIGNMENT_RIGHT);
Label* betaText = new Label();
betaText->setText("This is a checkBox");
betaText->setFontColor(LABEL_FONT_COLOR);
betaText->setFontSize(mFontSize);
betaText->fillSpaceHorizontally();
betaText->wrapContentVertically();
betaText->setTextHorizontalAlignment(MAW_ALIGNMENT_LEFT);
CheckBox* betaCB = new CheckBox();
betaCB->wrapContentHorizontally();
betaCB->wrapContentVertically();
betaCB->setState(true);
subSettingsContainer->addChild(betaText);
subSettingsContainer->addChild(betaCB);
betaContainer->addChild(subSettingsContainer);
betaWrapper->addChild(betaContainer);
aTargetLayout->addChild(betaWrapper);
}