本文整理汇总了C++中AppResource::GetString方法的典型用法代码示例。如果您正苦于以下问题:C++ AppResource::GetString方法的具体用法?C++ AppResource::GetString怎么用?C++ AppResource::GetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppResource
的用法示例。
在下文中一共展示了AppResource::GetString方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetErrorMessage
bool
ShareMenu::Initialize(Point loadPoint, String& content, bool isLink)
{
result r = E_SUCCESS;
__shareContent.SetCapacity(content.GetCapacity());
__shareContent = content;
__isLink = isLink;
__pBTOppClient = null;
if((r = Construct(Point(loadPoint), CONTEXT_MENU_STYLE_LIST)) != E_SUCCESS)
{
AppLog("ShareMenu create Failed %s", GetErrorMessage(r));
return false;
}
String message, email, bluetooth;
AppResource *pAppResource = Application::GetInstance()->GetAppResource();
pAppResource->GetString(L"IDS_MESSAGE", message);
pAppResource->GetString(L"IDS_EMAIL", email);
pAppResource->GetString(L"IDS_BLUETOOTH", bluetooth);
AddItem(message, ID_MESSAGE);
AddItem(email, ID_EMAIL);
AddItem(bluetooth, ID_BLUETOOTH);
AddActionEventListener(*this);
return true;
}
示例2:
void
CreateProfileForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
{
SceneManager* pSceneManager = SceneManager::GetInstance();
AppAssert(pSceneManager);
switch (actionId)
{
case ID_BUTTON_SAVE:
if (__pProfileNameEditField->GetText().IsEmpty())
{
int doModal;
MessageBox messageBox;
String getError, getProfileNameError;
AppResource * pAppResource = Application::GetInstance()->GetAppResource();
pAppResource->GetString(IDS_PROFILE_NAME_ERROR, getProfileNameError);
pAppResource->GetString(IDS_ERROR, getError);
messageBox.Construct(getError, getProfileNameError, MSGBOX_STYLE_OK, 0);
messageBox.ShowAndWait(doModal);
}
else
{
pSceneManager->GoBackward(BackwardSceneTransition());
ProfileListForm *pProfileListForm = static_cast< ProfileListForm* >(Application::GetInstance()->GetAppFrame()->GetFrame()->GetControl(FORM_LIST));
if (pProfileListForm != NULL) {
long long id;
DateTime startDateTime, dueDateTime;
Tizen::System::SystemTime::GetTicks(id);
startDateTime.SetValue(__pStartEditDate->GetYear(),
__pStartEditDate->GetMonth(),
__pStartEditDate->GetDay(),
__pStartEditTime->GetHour(),
__pStartEditTime->GetMinute(),
0);
dueDateTime.SetValue(__pDueEditDate->GetYear(),
__pDueEditDate->GetMonth(),
__pDueEditDate->GetDay(),
__pDueEditTime->GetHour(),
__pDueEditTime->GetMinute(),
0);
_profile_t_ profileSave = { id, __pProfileNameEditField->GetText(), startDateTime, dueDateTime, __latitude, __longitude, __pVolumeSlider->GetValue(),
__pWifiCheckButton->IsSelected()?1:0,
__pDescriptionEditField->GetText() };
pProfileListForm->SaveUsingmodeProfile(profileSave); //Create
}
}
break;
case ID_LOCATION_BUTTON:
pSceneManager->GoForward(ForwardSceneTransition(SCENE_LOCATION));
break;
default:
break;
}
}
示例3: ContextMenu
void
MainForm::CreateContextMenuDay(void) {
String captionToday;
String captionTomorrow;
AppResource *pAppResource = Application::GetInstance()->GetAppResource();
pAppResource->GetString("IDS_TODAY", captionToday);
pAppResource->GetString("IDS_TOMORROW", captionTomorrow);
__pContextMenuDay = new ContextMenu();
__pContextMenuDay->Construct(Point(405, 105), CONTEXT_MENU_STYLE_LIST);
__pContextMenuDay->AddItem(captionToday, ID_CONTEXT_TODAY);
__pContextMenuDay->AddItem(captionTomorrow, ID_CONTEXT_TOMORROW);
__pContextMenuDay->AddActionEventListener(*this);
}
示例4: strReq
result
MainForm::RetrieveMenu(Day day) {
result r = E_SUCCESS;
String emptyText;
AppResource *pAppResource = Application::GetInstance()->GetAppResource();
pAppResource->GetString("IDS_LOADING", emptyText);
__pListFood->SetTextOfEmptyList(emptyText);
__pListFood->RequestRedraw();
currentDay = day;
String strReq(L"http://www.studentenwerk-dresden.de/feeds/speiseplan.rss");
switch (day) {
case Tomorrow:
strReq.Append("?tag=morgen");
break;
default:
break;
}
__pMenuParser->RetrieveFeed(strReq, *this);
return r;
}
示例5: OnInitializing
result HeaderForm::OnInitializing(int index) {
result r = E_SUCCESS;
headerIndex = index;
/*
* I18N
*/
String routePlanner = "Routeplanner";
String liveboard = "Liveboard";
AppResource* appRes = Application::GetInstance()->GetAppResource();
appRes->GetString(L"HEADER_ROUTEPLANNER", routePlanner);
appRes->GetString(L"HEADER_LIVEBOARD", liveboard);
/*
* set OrientationListener
*/
this->SetOrientation(ORIENTATION_AUTOMATIC);
this->AddOrientationEventListener(*this);
// set header
Header* headerObj = this->GetHeader();
headerObj->SetStyle(HEADER_STYLE_SEGMENTED);
// Liveboard header
HeaderItem liveBoardHeaderItem;
liveBoardHeaderItem.Construct(HEADER_ID_LIVEBOARD);
liveBoardHeaderItem.SetText(liveboard);
liveBoardHeaderItem.SetActionId(this->ACTION_HEADER_ID_LIVEBOARD);
// routePlanner header
HeaderItem routePlannerHeaderItem;
routePlannerHeaderItem.Construct(HEADER_ID_ROUTE_PLANNER);
routePlannerHeaderItem.SetText(routePlanner);
routePlannerHeaderItem.SetActionId(this->ACTION_HEADER_ID_ROUTE_PLANNER);
/*
* create HeaderItems
*/
headerObj->AddItem(routePlannerHeaderItem);
headerObj->AddItem(liveBoardHeaderItem);
headerObj->SetItemSelected(index);
/*
* add header action listener
*/
headerObj->AddActionEventListener(*this);
return r;
}
示例6: MessageBox
void
MainForm::OnParsingFailure(String &error) {
String title;
String text;
String emptyText;
AppResource *pAppResource = Application::GetInstance()->GetAppResource();
pAppResource->GetString("IDS_APPNAME", title);
pAppResource->GetString("IDS_FAILURE", text);
pAppResource->GetString("IDS_ERROR", emptyText);
__pListFood->SetTextOfEmptyList(emptyText);
__pListFood->RequestRedraw();
MessageBox *pMessageBox = new MessageBox();
pMessageBox->Construct(title, text, MSGBOX_STYLE_OK );
pMessageBox->Show();
delete pMessageBox;
StopLoadingAnimation();
}
示例7: validate
bool LiveBoardRequest::validate(){
AppResource* appRes = Application::GetInstance()->GetAppResource();
_errors.RemoveAll();
bool validate = true;
if(_station == null){
validate = false;
String error;
appRes->GetString(L"ERROR_STATION", error);
_errors.Add(error);
}
return validate;
}
示例8: AddItem
void
ConstellationForm::Update(void) {
__pConstelList ->RemoveAllItems();
Osp::Base::Collection::IEnumerator* constNames = SkyCanvas::getConstellations()->GetEnumeratorN();
String emptyString;
__pConstelList -> AddItem(&emptyString, &emptyString, null, null, null);
while (constNames -> MoveNext() == E_SUCCESS) {
String* constNameAbbr = (String*) constNames -> GetCurrent();
String constName;
AppResource* appResource = Application::GetInstance()->GetAppResource();
appResource->GetString(*constNameAbbr, constName);
__pConstelList -> AddItem(&constName, &constName, null, null, null);
}
}
示例9: OptionMenu
void
MainForm::CreateOptionMenu(void) {
String captionAbout;
AppResource *pAppResource = Application::GetInstance()->GetAppResource();
pAppResource->GetString("IDS_ABOUT", captionAbout);
__pOptionMenu = new OptionMenu();
__pOptionMenu->Construct();
__pOptionMenu->AddItem(captionAbout, ID_OPTIONMENU_ABOUT);
__pOptionMenu->AddActionEventListener(*this);
SetOptionkeyActionId(ID_OPTIONMENU);
AddOptionkeyActionListener(*this);
}
示例10: AddItem
void
StarForm::Update(Osp::Base::Collection::IList* starsList) {
__pStarsList ->RemoveAllItems();
Osp::Base::Collection::IEnumerator* starNames = starsList ->GetEnumeratorN();
String emptyString;
__pStarsList -> AddItem(&emptyString, &emptyString, null, null, null);
while (starNames -> MoveNext() == E_SUCCESS) {
String starName;
String* starNameAbbr = (String*) starNames -> GetCurrent();
String constAcronym;
String constName;
String starConstAcronym;
String greekLetter;
starNameAbbr -> SubString(0, 3, greekLetter);
starNameAbbr -> SubString(4, 3, constAcronym);
starNameAbbr -> SubString(0, 7, starConstAcronym);
AppResource* appResource = Application::GetInstance()->GetAppResource();
appResource->GetString(starConstAcronym, starName);
appResource->GetString(constAcronym, constName);
starName.Append(" (");
starName.Append(GetGreek(greekLetter));
starName.Append(" ");
starName.Append(constName);
starName.Append(")");
Osp::Graphics::Bitmap* bitmapButtonPressed;
Osp::App::AppResource* pAppResource = Osp::App::Application::GetInstance()->GetAppResource();
bitmapButtonPressed = pAppResource -> GetBitmapN(L"ButtonPressed.png");
__pStarsList -> AddItem(&starName, null, bitmapButtonPressed, bitmapButtonPressed, null);
}
}
示例11: String
void
MainForm::OnParsingCompleted(ArrayList &feedData) {
AppResource *pAppResource = Application::GetInstance()->GetAppResource();
if (feedData.GetCount() == 0) {
// no service this day
String emptyText;
pAppResource->GetString("IDS_NOSERVICE", emptyText);
__pListFood->SetTextOfEmptyList(emptyText);
} else {
IEnumerator *pEnum = feedData.GetEnumeratorN();
HashMap *pItem = null;
int mensaIndex = -1;
String *currentMensa = null;
String currencySymbol;
pAppResource->GetString("IDS_CURRENCY", currencySymbol);
String soldOut;
pAppResource->GetString("IDS_SOLDOUT", soldOut);
// iterate over items (meals) in feed
while (pEnum->MoveNext() == E_SUCCESS) {
pItem = (HashMap *)pEnum->GetCurrent();
// check if mensa is already in the list (we assume the feed to be ordered)
if (!currentMensa || !(static_cast<String *>(pItem->GetValue(*(new String("author")))))->Equals(*currentMensa, false)) {
currentMensa = static_cast<String *>(pItem->GetValue(*(new String("author"))));
mensaIndex++;
// Create a main item of the ExpandableList
CustomListItem* pMainItem = new CustomListItem();
pMainItem->Construct(100);
pMainItem->SetItemFormat(*__pMainItemFormat);
pMainItem->SetElement(TEXT_ID, *(new String(*currentMensa)));
// Add the item to the ExpandableList
__pListFood->AddItem(*pMainItem, mensaIndex);
}
String *title = static_cast<String *>(pItem->GetValue(*(new String("title"))));
title->Trim();
String priceStudents;
String priceStaff;
int stringLength = title->GetLength();
// Create a sub item of the ExpandableList
CustomListItem *pSubItem = new CustomListItem();
pSubItem->Construct(100);
pSubItem->SetItemFormat(*__pSubItemFormat);
// get prices
if (title->EndsWith(L" EUR)")) {
// parse price
title->SubString(stringLength - 20, 5, priceStudents);
priceStudents.Append(currencySymbol);
title->SubString(stringLength - 9, 5, priceStaff);
priceStaff.Append(currencySymbol);
title->Remove(stringLength - 22, 22);
pSubItem->SetElement(PRICESTUDENT_ID, priceStudents);
pSubItem->SetElement(PRICESTAFF_ID, priceStaff);
} else if (title->EndsWith(L"(ausverkauft)")) {
// sold out
title->Remove(stringLength - 14, 14);
pSubItem->SetElement(REMARK_ID, soldOut);
}
pSubItem->SetElement(TEXT_ID, *title);
// Add sub item to the ExpandableList
__pListFood->AddSubItem(mensaIndex, *pSubItem);
}
// clean up
delete pEnum;
}
__pListFood->RequestRedraw();
__pListFood->ScrollToTop();
StopLoadingAnimation();
}
示例12:
void
MainForm::OnActionPerformed(const Osp::Ui::Control& source, int actionId) {
String caption;
AppResource *pAppResource = Application::GetInstance()->GetAppResource();
switch(actionId) {
case ID_BUTTON_DAY:
AppLog("Day Button is clicked! \n");
// show Context Menu
__pContextMenuDay->SetShowState(true);
__pContextMenuDay->Show();
break;
case ID_CONTEXT_TODAY:
AppLog("Today chosen.");
__pListFood->RemoveAllItems();
__pListFood->RequestRedraw();
StartLoadingAnimation();
pAppResource->GetString("IDS_TODAY", caption);
__pButtonDay->SetText(caption);
__pButtonDay->RequestRedraw();
// request menu
RetrieveMenu(Today);
break;
case ID_CONTEXT_TOMORROW:
AppLog("Tomorrow chosen.");
__pListFood->RemoveAllItems();
__pListFood->RequestRedraw();
StartLoadingAnimation();
pAppResource->GetString("IDS_TOMORROW", caption);
__pButtonDay->SetText(caption);
__pButtonDay->RequestRedraw();
// request menu
RetrieveMenu(Tomorrow);
break;
case ID_OPTIONMENU:
__pOptionMenu->SetShowState(true);
__pOptionMenu->Show();
break;
case ID_OPTIONMENU_ABOUT:
AppLog("Showing about.");
ShowAboutPopup();
break;
case ID_SOFTKEY_0:
AppLog("Refreshing.");
__pListFood->RemoveAllItems();
__pListFood->RequestRedraw();
StartLoadingAnimation();
RetrieveMenu(currentDay);
break;
case ID_SOFTKEY_1:
AppLog("Closing app.");
Application::GetInstance()->Terminate();
break;
case ID_BUTTON_ABOUTCLOSE:
AppLog("Closing popup.");
HideAboutPopup();
break;
default:
break;
}
}
示例13: GetHeader
result
CreateProfileForm::OnInitializing(void)
{
result r = E_SUCCESS;
AppResource * pAppResource = Application::GetInstance()->GetAppResource();
// Header
Header* pHeader = GetHeader();
AppAssert(pHeader);
pHeader->SetStyle(HEADER_STYLE_TITLE);
String getHeaderTitle;
pAppResource->GetString(IDS_CREATE_TITLE, getHeaderTitle);
pHeader->SetTitleText(getHeaderTitle);
// Footer
Footer* pFooter = GetFooter();
AppAssert(pFooter);
pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
// Save Button
FooterItem footerSave;
footerSave.Construct(ID_BUTTON_SAVE);
String getSaveButton;
pAppResource->GetString(IDS_SAVE, getSaveButton);
footerSave.SetText(getSaveButton);
pFooter->AddItem(footerSave);
pFooter->AddActionEventListener(*this);
SetFormBackEventListener(this);
static const unsigned int COLOR_BACKGROUND_LABEL = 0xFFEFEDE5;
static const unsigned int COLOR_TITLE_LABEL = 0xFF808080;
static const int UI_X_POSITION_GAP = 20;
static const int UI_WIDTH = GetClientAreaBounds().width - 40;
static const int UI_X_POSITION_MIDDLE = UI_WIDTH / 4;
static const int UI_HEIGHT = 112;
static const int UI_SPACE = 26;
int yPosition = 0;
__pScrollPanel = new (std::nothrow) ScrollPanel();
__pScrollPanel->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height));
// ProfileName
__pProfileNameEditField = new (std::nothrow) EditField();
__pProfileNameEditField->Construct(Rectangle(UI_X_POSITION_GAP, yPosition, UI_WIDTH, UI_HEIGHT), EDIT_FIELD_STYLE_NORMAL, INPUT_STYLE_FULLSCREEN, EDIT_FIELD_TITLE_STYLE_TOP);
String getProfileName, getProfileNameGuid;
pAppResource->GetString(IDS_PROFILE_NAME, getProfileName);
pAppResource->GetString(IDS_PROFILE_GUIDE, getProfileNameGuid);
__pProfileNameEditField->SetGuideText(getProfileNameGuid);
__pProfileNameEditField->SetName(L"ProfileName");
__pProfileNameEditField->SetTitleText(getProfileName);
__pProfileNameEditField->SetOverlayKeypadCommandButtonVisible(false);
__pScrollPanel->AddControl(__pProfileNameEditField);
// Start Date
int minYear = Calendarbook::GetMinDateTime().GetYear() + 1;
int maxYear = Calendarbook::GetMaxDateTime().GetYear() - 1;
Label* pStartDateLabel = new (std::nothrow) Label();
String getStartDateTime, getDudueDateTime;
pAppResource->GetString(IDS_START_DATETIME, getStartDateTime);
pAppResource->GetString(IDS_END_DATETIME, getDudueDateTime);
pStartDateLabel->Construct(Rectangle(UI_X_POSITION_GAP, yPosition += UI_HEIGHT + UI_SPACE, UI_WIDTH, UI_HEIGHT), getStartDateTime);
pStartDateLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
pStartDateLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
pStartDateLabel->SetTextColor(COLOR_TITLE_LABEL);
pStartDateLabel->SetBackgroundColor(COLOR_BACKGROUND_LABEL);
__pScrollPanel->AddControl(pStartDateLabel);
__pStartEditDate = new (std::nothrow) EditDate();
__pStartEditDate->Construct(Point(UI_X_POSITION_GAP, yPosition + 10));
__pStartEditDate->SetCurrentDate();
__pStartEditDate->SetYearRange(minYear, maxYear);
__pStartEditDate->AddDateChangeEventListener(*this);
__pScrollPanel->AddControl(__pStartEditDate);
__pStartEditTime = new (std::nothrow) EditTime();
__pStartEditTime->Construct(Point(UI_X_POSITION_MIDDLE * 2 + UI_SPACE, yPosition + 10));
__pStartEditTime->SetCurrentTime();
__pStartEditTime->AddTimeChangeEventListener(*this);
__pScrollPanel->AddControl(__pStartEditTime);
// Due Date
Label* pDueDateLabel = new (std::nothrow) Label();
pDueDateLabel->Construct(Rectangle(UI_X_POSITION_GAP, yPosition += UI_HEIGHT, UI_WIDTH, UI_HEIGHT), getDudueDateTime);
pDueDateLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
pDueDateLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
pDueDateLabel->SetTextColor(COLOR_TITLE_LABEL);
pDueDateLabel->SetBackgroundColor(COLOR_BACKGROUND_LABEL);
__pScrollPanel->AddControl(pDueDateLabel);
__pDueEditDate = new (std::nothrow) EditDate();
__pDueEditDate->Construct(Point(UI_X_POSITION_GAP, yPosition + 10));
__pDueEditDate->SetCurrentDate();
__pDueEditDate->SetYearRange(minYear, maxYear);
__pDueEditDate->AddDateChangeEventListener(*this);
__pScrollPanel->AddControl(__pDueEditDate);
DateTime endTime;
//.........这里部分代码省略.........