本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}