本文整理汇总了C++中ListViewItem::fillSpaceHorizontally方法的典型用法代码示例。如果您正苦于以下问题:C++ ListViewItem::fillSpaceHorizontally方法的具体用法?C++ ListViewItem::fillSpaceHorizontally怎么用?C++ ListViewItem::fillSpaceHorizontally使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListViewItem
的用法示例。
在下文中一共展示了ListViewItem::fillSpaceHorizontally方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createMainLayout
/**
* Creates and adds main layout to the screen.
*/
void ListScreen::createMainLayout() {
// Create and add the main layout to the screen.
mMainLayout = new VerticalLayout();
Screen::setMainWidget(mMainLayout);
mListView = new ListView(LIST_VIEW_TYPE_SEGMENTED);
// the list view doesn't automatically sort its elements - the
// developer has to handle the sorting
for (int i = 0; i <= 5; i++)
{
ListViewSection* section = new ListViewSection(LIST_VIEW_SECTION_TYPE_SEGMENTED);
MAUtil::String sectionTitle = "Header ";
sectionTitle += MAUtil::integerToString(i);
section->setTitle("H" + MAUtil::integerToString(i));
section->setHeaderText(sectionTitle);
section->setFooterText("Footer " + MAUtil::integerToString(i));
mListView->addChild(section);
for (int j = 0; j <= 6; j++)
{
ListViewItem* item = new ListViewItem();
MAUtil::String itemText = "Item ";
itemText += MAUtil::integerToString(j);
item->setText(itemText);
item->setSubtitle("subtitle " + MAUtil::integerToString(j));
item->fillSpaceHorizontally();
section->addItem(item);
}
}
int result = mMainLayout->addChild(mListView);
printf("add mListView result = %d", result);
createListManipulationLayout();
if (isIOS() || isAndroid())
{
mReloadData = new Button();
mReloadData->setText("Reload data");
mReloadData->fillSpaceHorizontally();
mMainLayout->addChild(mReloadData);
}
}
示例2: createInputFlagListView
/**
* Creates the input flag list view
* @param mainLayout Widgets will be added to it.
*/
void EditBoxSettingsLayout::createInputFlagListView(ListView* aListView)
{
mInputFlagListView = new ListView();
mInputFlagListView->setHeight(PROPERTY_LINE_HEIGHT * 4);
mInputFlagListView->setBackgroundColor(0xFFFFFF);
for(int i = 0; i < INPUT_FLAGS_COUNT; i++)
{
ListViewItem* inputFlagItem = new ListViewItem();
inputFlagItem->setText(inputFlags[i]);
inputFlagItem->setBackgroundColor(0xFFFFFF);
inputFlagItem->setFontColor(0x000000);
inputFlagItem->fillSpaceHorizontally();
mInputFlagListView->addChild(inputFlagItem);
}
mInputFlagListView->fillSpaceHorizontally();
aListView->addChild(mInputFlagListView);
}
示例3: createInputFlagListView
/**
* Creates the input flag list view
* @param mainLayout Widgets will be added to it.
*/
void MainScreen::createInputFlagListView(VerticalLayout* aVerticalLayout)
{
mInputFlagListView = new ListView();
mInputFlagListView->setHeight(mScreenHeight/3);
mInputFlagListView->setBackgroundColor(0xFFFFFF);
for(int i = 0; i < INPUT_FLAGS_COUNT; i++)
{
ListViewItem* inputFlagItem = new ListViewItem();
inputFlagItem->setText(inputFlags[i]);
inputFlagItem->setBackgroundColor(0xFFFFFF);
inputFlagItem->setFontColor(0x000000);
inputFlagItem->fillSpaceHorizontally();
mInputFlagListView->addChild(inputFlagItem);
}
mInputFlagListView->fillSpaceHorizontally();
aVerticalLayout->addChild(mInputFlagListView);
}
示例4: addServerToList
/**
* Adds the server ip into the list view
*/
void ServersDialog::addServerToList(MAUtil::String serverIP)
{
// check if already exists
bool exists = false;
int totalItems = mListView->countChildWidgets();
for (int i = 0; i < totalItems; i++)
{
if (mListView->getChild(i)->getPropertyString("text") == serverIP)
{
exists = true;
}
}
if(!exists)
{
ListViewItem * item = new ListViewItem();
item->fillSpaceHorizontally();
item->setHeight(80);
item->setText(serverIP);
mListView->addChild(item);
}
}
示例5: updateProjectList
/**
* If there is no list populates the List View Widget with the project data
* from mProjects vector. Else destroys and deallocates previous list items
* and creates new ones.
*/
void WorkspaceLayout::updateProjectList(MAUtil::Vector <reloadProject> * projects)
{
// Remove The ListView and add An Activity Indicator
lprintfln("Updating Project List");
mListView->setVisible(false);
/**
* FIXME Removing listView and adding Activity indicator causes
* the list view not getting events until some point,
* when removing activity indicator to add the list again.
*/
//this->removeChild(mListView);
//this->addChild(mActivityIndicatorContainer);
// If there was a project Selected before update remove the
// control buttons
if(mSelectedProject != -1)
{
Widget *h = mListView->getChild(mSelectedProject)->getChild(0);
h->removeChild(h->getChild(1));
h->removeChild(h->getChild(1));
}
// ReInitialize selected project
mSelectedProject = -1;
mSelectedProjectName = "";
// Delete all the widgets from the ListView
int prProjects = mListView->countChildWidgets();
if(prProjects != 0)
{
for(int i = 0; i < prProjects; i++)
{
Widget *listItemWidget = mListView->getChild(0); // list Item Widget
Widget *hLayout = listItemWidget->getChild(0); // horizontal layout widget
for( int j = 0; j < hLayout->countChildWidgets(); j++)
{
Widget * w = hLayout->getChild(0);
hLayout->removeChild(w);
delete w;
}
listItemWidget->removeChild(hLayout);
delete hLayout;
mListView->removeChild(listItemWidget);
delete listItemWidget;
}
}
// Re-populate the ListView with projects
for (MAUtil::Vector <reloadProject>::iterator i = projects->begin(); i != projects->end(); i++)
{
// New List Itemprojects
ListViewItem* item = new ListViewItem();
item->setHeight(mWidgetHeight);
item->fillSpaceHorizontally();
// New Horizontal Layout
HorizontalLayout *itemHorizontalLayout = new HorizontalLayout();
itemHorizontalLayout->fillSpaceHorizontally();
itemHorizontalLayout->setHeight(mWidgetHeight);
// New Label
Label* projectNameLabel = new Label();
projectNameLabel->setTextHorizontalAlignment(MAW_ALIGNMENT_LEFT);
projectNameLabel->setTextVerticalAlignment(MAW_ALIGNMENT_CENTER);
projectNameLabel->setText(i->name);
projectNameLabel->fillSpaceHorizontally();
projectNameLabel->fillSpaceVertically();
if (mOS.find("iPhone") >= 0)
{
itemHorizontalLayout->setWidth(item->getWidth());
projectNameLabel->setFontColor(0xffffff);
}
itemHorizontalLayout->addChild(projectNameLabel);
item->addChild(itemHorizontalLayout);
mListView->addChild(item);
}
mListView->setVisible(true);
// Remove Indicator and Add Project ListView
//this->addChild(mListView);
//this->removeChild(mActivityIndicatorContainer);
}