/** * Create the UI for the color list screen. */ void SettingsScreen::createUI() { setTitle("Settings"); // Create the screen's main layout widget. VerticalLayout* mMainLayout = new VerticalLayout(); // Make the layout fill the entire screen. mMainLayout->fillSpaceHorizontally(); mMainLayout->fillSpaceVertically(); // Add the layout as the root of the screen's widget tree. Screen::setMainWidget(mMainLayout); Label* mTitle = new Label(); // Make the label fill the width of the parent layout and // adjust its height to "shrink wrap" the size of the text. mTitle->fillSpaceHorizontally(); mTitle->wrapContentVertically(); // Set the label text. mTitle->setText("application settings"); mTitle->setTextHorizontalAlignment("center"); // Add the label to the main layout. mMainLayout->addChild(mTitle); mAppCodeBox = new EditBox(); mAppCodeBox->fillSpaceHorizontally(); mAppCodeBox->wrapContentVertically(); mAppCodeBox->setPlaceholder("application code"); //mAppCodeBox->setInputFlag(EDIT_BOX_INPUT_FLAG_PASSWORD); mMainLayout->addChild(mAppCodeBox); mAppUniqBox = new EditBox(); mAppUniqBox->fillSpaceHorizontally(); mAppUniqBox->wrapContentVertically(); mAppUniqBox->setPlaceholder("application unique"); mMainLayout->addChild(mAppUniqBox); mAppPwdBox = new EditBox(); mAppPwdBox->fillSpaceHorizontally(); mAppPwdBox->wrapContentVertically(); mAppPwdBox->setInputFlag(EDIT_BOX_INPUT_FLAG_PASSWORD); mAppPwdBox->setPlaceholder("application password"); mMainLayout->addChild(mAppPwdBox); mSubmitButton = new Button(); mSubmitButton->fillSpaceHorizontally(); mSubmitButton->wrapContentVertically(); mSubmitButton->setTextHorizontalAlignment(MAW_ALIGNMENT_CENTER); mSubmitButton->setTextVerticalAlignment(MAW_ALIGNMENT_CENTER); mSubmitButton->setText("Save"); mMainLayout->addChild(mSubmitButton); mSubmitButton->addButtonListener(this); }
/** * Create the UI for the color list screen. */ void LogScreen::createUI() { setTitle("Log"); // Create the screen's main layout widget. VerticalLayout* mMainLayout = new VerticalLayout(); // Make the layout fill the entire screen. mMainLayout->fillSpaceHorizontally(); mMainLayout->fillSpaceVertically(); // Add the layout as the root of the screen's widget tree. Screen::setMainWidget(mMainLayout); Label* mTitle = new Label(); // Make the label fill the width of the parent layout and // adjust its height to "shrink wrap" the size of the text. mTitle->fillSpaceHorizontally(); mTitle->wrapContentVertically(); // Set the label text. mTitle->setText("log APIs"); mTitle->setTextHorizontalAlignment("center"); // Add the label to the main layout. mMainLayout->addChild(mTitle); mLogLineBox = new EditBox(); mLogLineBox->fillSpaceHorizontally(); mLogLineBox->wrapContentVertically(); mLogLineBox->setPlaceholder("Log line"); mMainLayout->addChild(mLogLineBox); mLogCategoryBox = new EditBox(); mLogCategoryBox->fillSpaceHorizontally(); mLogCategoryBox->wrapContentVertically(); mLogCategoryBox->setPlaceholder("Category"); mLogCategoryBox->setText("DEFAULT"); mMainLayout->addChild(mLogCategoryBox); mSubmitButton = new Button(); mSubmitButton->fillSpaceHorizontally(); mSubmitButton->wrapContentVertically(); mSubmitButton->setTextHorizontalAlignment(MAW_ALIGNMENT_CENTER); mSubmitButton->setTextVerticalAlignment(MAW_ALIGNMENT_CENTER); mSubmitButton->setText("Log"); mMainLayout->addChild(mSubmitButton); mSubmitButton->addButtonListener(this); }