/** * Set a text for a label. * @param aLabel Handle to the label. * @param aText Label text. */ void setLabelText(MAWidgetHandle aLabel, MAUtil::String aText) { maWidgetSetProperty(aLabel,MAW_LABEL_TEXT, aText.c_str()); }
/** * Set a text for a button. * @param aButton Handle to the button. * @param aText Button text. */ void setButtonText(MAWidgetHandle aButton, MAUtil::String aText) { maWidgetSetProperty(aButton, MAW_BUTTON_TEXT, aText.c_str()); }
/** * Set the title of the screen. * The title is used by tab screen to display a text on the tab indicator. * @param title The screen title. */ void Screen::setTitle(const MAUtil::String& title) { setProperty(MAW_SCREEN_TITLE, title.c_str()); }
/** * Open a web page. * @param url The URL open. */ void WebView::openURL(const MAUtil::String& url) { this->setProperty(MAW_WEB_VIEW_URL, url.c_str()); }
/** * Check if a screen is shown. * @return true if the screen is visible, false otherwise. */ bool Screen::isShown() { MAUtil::String value = this->getPropertyString(MAW_SCREEN_IS_SHOWN); return (strcmp(value.c_str(), "true") == 0) ? true : false; }
/** * Add a new menu item to the Options Menu associated to this screen. * Platform: Android and WP7. * Option Menus are Android specific concept. The Options Menu is launched by * pressing the Menu key. The options menu is where you should include * actions and other options that are relevant to the current activity * context, such as "Search," "Compose email," or "Settings". * When opened, the first visible portion is the icon menu, which holds * up to six menu items. If your menu includes more than six items, Android * places the sixth item and the rest into the overflow menu, which the user * can open by selecting More. Those items do not display icons. On Windows * Phone 7 the control used is the application bar. * * @param title The title associated for the new item. * * Note: On Windows phone 7, by using this function you will obtain an * application bar menu item (text only) * * @return The index on which the menu item was added in the options menu, * an error code otherwise. */ int Screen::addOptionsMenuItem(const MAUtil::String title) { return maWidgetScreenAddOptionsMenuItem( getWidgetHandle(), title.c_str(), "", 0 ); }
/** * Handle the log message. */ void MessageHandler::handleLog(WebViewMessage& message) { MAUtil::String s = message.getParam("message"); maWriteLog(s.c_str(), s.length()); }
/** * \brief This function is used for writing the settings to the settings file */ void SettingsManager::_writeSettings() { _settingsFile = maFileOpen(_settingsFileCompletePath->c_str(), MA_ACCESS_READ_WRITE); maFileTruncate(_settingsFile, 0); char buffer[Model::BUFF_SIZE]; MAUtil::String binaryMask; if(_showAll) binaryMask = "100"; else if(_showMonthly) binaryMask = "010"; else if(_showFromDate) binaryMask = "001"; sprintf(buffer, "%s|%d|%s|%s|%.2f", _coin.c_str(), _date._day, Model::DateStructToString(_date).c_str(), binaryMask.c_str(), _debtValue); maFileWrite(_settingsFile, buffer, strlen(buffer)); maFileClose(_settingsFile); }
/** * Main screen is notified of a purchase error. * @param errorMessage. */ void MainScreen::productError(MAUtil::String errorMessage) { // Another purchase can now be requested. mBuyButton->setEnabled(true); maAlert("Purchase error", errorMessage.c_str(), "OK","",""); }