From 1d1ddf143e4d2244257460b814567e0149c85da4 Mon Sep 17 00:00:00 2001 From: Rakesh Gajjar Date: Wed, 24 Apr 2013 15:59:58 +0530 Subject: [PATCH] Nabi Issue (N_SE-36034, N_SE-36081, N_SE-36083) fix Change-Id: I758791fe376e14e5c0cfce0ecdb8379df98d74b8 --- inc/MfSearchForm.h | 3 ++- src/MfCreateFolderForm.cpp | 34 ++++++++++++++++++++-------------- src/MfSearchForm.cpp | 7 +++++++ 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/inc/MfSearchForm.h b/inc/MfSearchForm.h index 1848192..a2db420 100644 --- a/inc/MfSearchForm.h +++ b/inc/MfSearchForm.h @@ -93,7 +93,8 @@ public: void OnKeypadClosed(Tizen::Ui::Control& source); void OnKeypadOpened(Tizen::Ui::Control& source); void OnKeypadWillOpen(Tizen::Ui::Control& source); - + void OnKeypadBoundsChanged(Tizen::Ui::Control& source); + //ITextEventListener void OnTextValueChangeCanceled(const Tizen::Ui::Control& source); void OnTextValueChanged(const Tizen::Ui::Control& source); diff --git a/src/MfCreateFolderForm.cpp b/src/MfCreateFolderForm.cpp index b3dbb68..63ab358 100644 --- a/src/MfCreateFolderForm.cpp +++ b/src/MfCreateFolderForm.cpp @@ -271,7 +271,7 @@ CreateFolderForm::OnActionPerformed(const Tizen::Ui::Control& source, int action if (__pEditFieldFolderName != null) { folderName.Append(__pEditFieldFolderName->GetText()); - folderName.Trim(); + //folderName.Trim(); AppLogDebug("folder value is %ls",folderName.GetPointer()); __rootPath = FolderNavigationPresentationModel::GetCurrentPath(); @@ -364,7 +364,7 @@ CreateFolderForm::OnActionPerformed(const Tizen::Ui::Control& source, int action if (__pEditFieldFolderName != null) { __fileName = __pEditFieldFolderName->GetText(); - __fileName.Trim(); + //__fileName.Trim(); } String OriginalName = __pDirectory->GetFileName(); @@ -788,18 +788,21 @@ CreateFolderForm::OnTextValueChanged(const Tizen::Ui::Control& source) tempLength = ID_FILE_NAME_LENGTH_MAX; } - currentInput = __pEditFieldFolderName->GetText(); - - if(currentInput.Contains(specialCharacters[0])) + textToCheck = __pEditFieldFolderName->GetText().GetLength() - __textLength; + r = currentText.SubString(__pEditFieldFolderName->GetCursorPosition() - textToCheck,currentInput); + for(int i = 0 ; i < currentInput.GetLength() ; i++) { - String invalidCharacterString; - AppResource::GetInstance()->GetString(L"IDS_COM_POP_INVALID_CHARACTERS", invalidCharacterString); - messageBox.Construct(L"", invalidCharacterString, MSGBOX_STYLE_NONE, ID_MESSAGE_BOX_TIMEOUT_ONE_SECOND); - messageBox.ShowAndWait(modalResult); - r = currentInput.Replace("/",""); - __pEditFieldFolderName->SetText(currentInput); - __pEditFieldFolderName->SetFocus(); - AppLogDebug("result is %s",GetErrorMessage(r)); + if(specialCharacters.Contains(currentInput[i])) + { + String invalidCharacterString; + AppResource::GetInstance()->GetString(L"IDS_COM_POP_INVALID_CHARACTERS", invalidCharacterString); + messageBox.Construct(L"", invalidCharacterString, MSGBOX_STYLE_NONE, ID_MESSAGE_BOX_TIMEOUT_ONE_SECOND); + messageBox.ShowAndWait(modalResult); + currentText.Remove(__pEditFieldFolderName->GetCursorPosition()-textToCheck,textToCheck); + __pEditFieldFolderName->SetText(currentText); + __pEditFieldFolderName->SetFocus(); + break; + } } inputLength = byteCount; @@ -836,6 +839,9 @@ CreateFolderForm::OnTextValueChanged(const Tizen::Ui::Control& source) __pEditFieldFolderName->ShowKeypad(); return; } + + r = utf8.GetByteCount(__pEditFieldFolderName->GetText(), byteCount); + __textLength = byteCount; } return; } @@ -1269,7 +1275,7 @@ CreateFolderForm::OnNotificationReceived(Tizen::Base::Collection::ArrayList* pAr if (pSceneManager != null) { String fileName = __pEditFieldFolderName->GetText(); - fileName.Trim(); + //fileName.Trim(); if(__pDirectory != null) { __pDirectory->SetFileName(fileName); diff --git a/src/MfSearchForm.cpp b/src/MfSearchForm.cpp index caca5a9..bbd44f8 100644 --- a/src/MfSearchForm.cpp +++ b/src/MfSearchForm.cpp @@ -1837,3 +1837,10 @@ SearchForm::OnAppControlCompleted(void) } AppLogDebug("OnAppControlCompleted--"); } + +void +SearchForm::OnKeypadBoundsChanged(Tizen::Ui::Control& source) +{ + __pSearchBar->SetContentAreaSize(Dimension(GetClientAreaBounds().width, GetClientAreaBounds().height - H_SEARCH_BAR)); + __pListView->SetSize(Dimension(GetClientAreaBounds().width, GetClientAreaBounds().height - H_SEARCH_BAR)); +} -- 2.7.4