using namespace Tizen::Ui::Controls;
const char* pTagApp = "QrCodeRecognizer";
-const String QrCodeRecognizer::MESSAGE_BOX_NAME = "MessageBox";
-const String QrCodeRecognizer::POPUP_NAME = "Popup";
QrCodeRecognizer::QrCodeRecognizer()
: __pTracker(0)
// Creates an instance of Popup
__pPopup = new Tizen::Ui::Controls::Popup();
__pPopup->Construct(true, Tizen::Graphics::Dimension(530, 250));
- __pPopup->SetName(POPUP_NAME);
__pPopup->SetPropagatedKeyEventListener(this);
__pForm = new TouchForm();
msgBox.Construct("Warning", "Low battery. Terminating App.", MSGBOX_STYLE_NONE, 3000);
msgBox.ShowAndWait(result);
-
- switch (result)
- {
- case MSGBOX_RESULT_CLOSE:
- Tizen::App::Application::GetInstance()->Terminate();
- return false;
- break;
-
- default:
- break;
- }
+ Tizen::App::Application::GetInstance()->Terminate();
+ return false;
}
}
msgBox.Construct("Warning", "Cannot init OpenGL. Terminating App.", MSGBOX_STYLE_NONE, 3000);
msgBox.ShowAndWait(result);
-
- switch (result)
- {
- case MSGBOX_RESULT_CLOSE:
- Tizen::App::Application::GetInstance()->Terminate();
- return false;
- break;
-
- default:
- break;
- }
+ Tizen::App::Application::GetInstance()->Terminate();
+ return false;
}
+
__pTracker = new Tracker();
__pForm->SendUserEvent(TouchForm::REQUEST_ACTIVATE, null);
msgBox.Construct("Warning","Cannot init camera. Terminating App.", MSGBOX_STYLE_NONE, 3000);
msgBox.ShowAndWait(result);
-
- switch (result)
- {
- case MSGBOX_RESULT_CLOSE:
- Tizen::App::Application::GetInstance()->Terminate();
- return false;
- break;
-
- default:
- break;
- }
+ Tizen::App::Application::GetInstance()->Terminate();
+ return false;
}
__pTracker->Init(__pForm);
int result = 0;
msgBox.Construct("Warning","Cannot restart camera. Terminating App.", MSGBOX_STYLE_OK, 0);
- msgBox.SetName(MESSAGE_BOX_NAME);
- msgBox.SetPropagatedKeyEventListener(this);
msgBox.ShowAndWait(result);
-
- switch (result)
- {
- case MSGBOX_RESULT_OK:
- Tizen::App::Application::GetInstance()->Terminate();
- break;
- default:
- break;
- }
+ Tizen::App::Application::GetInstance()->Terminate();
}
}
int result = 0;
msgBox.Construct("Warning","Low Battery.\nPlease charge to use.",MSGBOX_STYLE_OK);
- msgBox.SetName(MESSAGE_BOX_NAME);
- msgBox.SetPropagatedKeyEventListener(this);
msgBox.ShowAndWait(result);
-
- if(result == MSGBOX_RESULT_OK)
- {
- Application::GetInstance()->Terminate();
- return;
- }
+ Application::GetInstance()->Terminate();
}
}
}
bool
QrCodeRecognizer::OnKeyPressed (Control &source, const KeyEventInfo &keyEventInfo)
{
- return true;
+ return false;
}
bool
{
if(keyEventInfo.GetKeyCode() == KEY_BACK)
{
- if(source.GetName().CompareTo(MESSAGE_BOX_NAME) == 0)
- {
- Tizen::App::Application::GetInstance()->Terminate();
- }
- else if(source.GetName().CompareTo(POPUP_NAME) == 0)
- {
- OnActionPerformed(source, ID_BUTTON_NO);
- }
-
+ OnActionPerformed(source, ID_BUTTON_NO);
}
- return true;
+ return false;
}
bool
QrCodeRecognizer::OnPreviewKeyPressed (Control &source, const KeyEventInfo &keyEventInfo)
{
- return true;
+ return false;
}
bool
QrCodeRecognizer::OnPreviewKeyReleased (Control &source, const KeyEventInfo &keyEventInfo)
{
- return true;
+ return false;
}
bool
QrCodeRecognizer::TranslateKeyEventInfo (Control &source, KeyEventInfo &keyEventInfo)
{
- return true;
+ return false;
}
void