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


C++ ListView::fillSpaceHorizontally方法代码示例

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


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

示例1: createMainLayout

/**
 * Creates and adds main layout to the screen.
 */
void SettingsScreen::createMainLayout()
{

    VerticalLayout* mainLayout = new VerticalLayout();
    Screen::setMainWidget(mainLayout);

    ListView* listView = new ListView();
    listView->fillSpaceHorizontally();
    listView->fillSpaceVertically();
    mainLayout->addChild(listView);

    ListViewItem* listItem;

    // Add IP label and edit box
    mIPEditBox = new EditBox();
    mIPEditBox->setInputMode(EDIT_BOX_INPUT_MODE_NUMERIC);
    listView->addChild(this->createListViewItem(IP_LABEL_TEXT, mIPEditBox));

    // Add port label and edit box
    mPortEditBox = new EditBox();
    mPortEditBox->setInputMode(EDIT_BOX_INPUT_MODE_NUMERIC);
    listView->addChild(this->createListViewItem(PORT_LABEL_TEXT, mPortEditBox));

    if ( isAndroid() )
    {
        mShowOnlyIfInBackground = new CheckBox();
        mShowOnlyIfInBackground->setState(true);
        listView->addChild(createListViewItem(SHOW_ONLY_IF_NOT_RUNNING, mShowOnlyIfInBackground));

        mTickerText = new EditBox();
        mTickerText->setText(TICKER_DEFAULT);
        listView->addChild(createListViewItem(TICKER_LABEL, mTickerText));

        mContentTitle = new EditBox();
        mContentTitle->setText(TITLE_DEFAULT);
        listView->addChild(createListViewItem(TITLE_LABEL, mContentTitle));
    }

    // Android: If the registrationID was already saved from previous launches,
    // do not connect again.
    MAHandle myStore = maOpenStore("MyStore", 0);
    if ( isAndroid() && myStore == STERR_NONEXISTENT
            ||
            !isAndroid() )
    {
        // Add connection status label.
        listItem = new ListViewItem;
        listView->addChild(listItem);
        mConnectionStatusLabel = new Label();
        mConnectionStatusLabel->setText(CONNECTION_NOT_ESTABLISHED);
        listItem->addChild(mConnectionStatusLabel);

        listItem = new ListViewItem;
        listView->addChild(listItem);
        mConnectButton = new Button();
        mConnectButton->setText(CONNECT_BUTTON_TEXT);
        listItem->addChild(mConnectButton);
    }
}
开发者ID:JennYung,项目名称:MoSync,代码行数:62,代码来源:SettingsScreen.cpp

示例2: createMainLayout

/**
 * Creates and adds main layout to the screen.
 */
void CreateNotificationScreen::createMainLayout()
{

	VerticalLayout* mainLayout = new VerticalLayout();
	Screen::setMainWidget(mainLayout);

	ListView* listView = new ListView();
	listView->fillSpaceHorizontally();
	listView->fillSpaceVertically();
	mainLayout->addChild(listView);

	ListViewItem* listItem;
	HorizontalLayout* hLayout;
	Widget* space;

	// ================ Content body =====================
	mContentBody = new EditBox();
	listView->addChild(createListViewItem(CONTENT_BODY_LABEL_TEXT,(Widget*) mContentBody));

	if ( isAndroid() )
	{
		// ================ Content title =====================
		mContentTitle = new EditBox();
		listView->addChild(createListViewItem(CONTENT_TITLE_LABEL_TEXT, mContentTitle));

		// ================ Ticker text =====================
		mTickerText = new EditBox();
		listView->addChild(createListViewItem(TICKER_TEXT_LABEL_TEXT, mTickerText));
	}
	else
	{
		// ================ Badge number =====================
		mBadgeNumber = new EditBox();
		mBadgeNumber->setWidth(NUMERIC_EDIT_BOX_WIDTH);
		mBadgeNumber->setInputMode(EDIT_BOX_INPUT_MODE_NUMERIC);
		mBadgeNumber->addEditBoxListener(this);
		listView->addChild(createListViewItem(BADGE_NUMBER_LABEL_TEXT, mBadgeNumber));

		// ================ Alert action =====================
		mAlertAction = new EditBox();
		mAlertAction->addEditBoxListener(this);
		listView->addChild(createListViewItem(ALERT_ACTION_LABEL_TEXT, mAlertAction));
	}

	// ================ Play sound =====================
	mPlaySound = new CheckBox();
	listView->addChild(createListViewItem(PLAY_SOUND_LABEL_TEXT, mPlaySound));

	if ( isAndroid() )
	{
		// ================ Sound path=====================
		mSoundPath = new EditBox();
		listView->addChild(createListViewItem(SOUND_PATH_LABEL_TEXT, mSoundPath));

		// ================ Vibrate =====================
		mVibrate = new CheckBox();
		listView->addChild(createListViewItem(VIBRATE_LABEL_TEXT, mVibrate));

		mVibrateDuration = new EditBox();
		mVibrateDuration->setInputMode(EDIT_BOX_INPUT_MODE_NUMERIC);
		listView->addChild(createListViewItem(VIBRATE_DURATION_LABEL_TEXT, mVibrateDuration));

		// ================ Flashing LED =====================
		mFlash = new CheckBox();
		listView->addChild(createListViewItem(FLASH_LABEL_TEXT, mFlash));
		// The pattern
		mFlashColor = new EditBox();
		listView->addChild(createListViewItem(FLASH_COLOR_LABEL_TEXT, mFlashColor));
		mFlashOnLength = new EditBox();
		mFlashOnLength->setInputMode(EDIT_BOX_INPUT_MODE_NUMERIC);
		listView->addChild(createListViewItem(FLASH_ON_LABEL_TEXT, mFlashOnLength));
		mFlashOffLength = new EditBox();
		mFlashOffLength->setInputMode(EDIT_BOX_INPUT_MODE_NUMERIC);
		listView->addChild(createListViewItem(FLASH_OFF_LABEL_TEXT, mFlashOffLength));
	}

	// ================ Fire time =====================
	mTime = new EditBox();
	mTime->setWidth(NUMERIC_EDIT_BOX_WIDTH);
	mTime->setInputMode(EDIT_BOX_INPUT_MODE_NUMERIC);
	listView->addChild(createListViewItem(FIRE_TIME_LABEL_TEXT, mTime));

	// ================= Send image button ================
	hLayout = new HorizontalLayout();
	hLayout->fillSpaceHorizontally();
	listItem = new ListViewItem();
	listItem->addChild(hLayout);
	listView->addChild(listItem);
	mCreateNotificationButton = new ImageButton();
	mCreateNotificationButton->setImage(RES_IMAGE);

	space = this->createSpacer();
	hLayout->addChild(space);
	hLayout->addChild(mCreateNotificationButton);

	// Align the image button at the center of the layout.
	// Only after adding the image button widget to layout the widget's width
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


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