#include <FBaseSysLog.h>
#include <FBaseErrorDefine.h>
#include <FGrp_BitmapImpl.h>
+#include <FSys_SettingInfoImpl.h>
#include "FUi_AccessibilityContainer.h"
#include "FUi_AccessibilityElement.h"
#include "FUi_CoordinateSystemUtils.h"
using namespace Tizen::Base;
using namespace Tizen::Graphics;
+using namespace Tizen::System;
namespace Tizen { namespace Ui { namespace Controls
delete _pOutlineBitmap;
_pOutlineBitmap = null;
+
+ _SettingInfoImpl::RemoveSettingEventListener(*this);
}
_MessageBox*
SetTouchPressThreshold(0.08);
+ r = _SettingInfoImpl::AddSettingEventListenerForInternal(*this);
+ SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
return r;
}
return __pMsgboxPresenter->OnTouchMoved(source, touchinfo);
}
+void
+_MessageBox::OnSettingChanged(String& key)
+{
+ const wchar_t* LOCALE_LANGUAGE = L"http://tizen.org/setting/locale.language";
+
+ if (key == LOCALE_LANGUAGE)
+ {
+ __pMsgboxPresenter->UpdateButtonString();
+ }
+}
}}} // Tizen::Ui::Controls
}
}
-result
-_MessageBoxPresenter::CreateButtons(void)
+void
+_MessageBoxPresenter::GetButtonString(void)
{
- String buttonText[3];
-
switch (__pMessageBox->GetMsgBoxStyle())
{
case MSGBOX_STYLE_NONE:
case MSGBOX_STYLE_OK:
__buttonNum = 1;
- GET_STRING_CONFIG(IDS_COM_SK_OK, buttonText[0]);
+ GET_STRING_CONFIG(IDS_COM_SK_OK, __buttonText[0]);
break;
case MSGBOX_STYLE_CANCEL:
__buttonNum = 1;
- GET_STRING_CONFIG(IDS_COM_SK_CANCEL, buttonText[0]);
+ GET_STRING_CONFIG(IDS_COM_SK_CANCEL, __buttonText[0]);
break;
case MSGBOX_STYLE_OKCANCEL:
__buttonNum = 2;
- GET_STRING_CONFIG(IDS_COM_SK_OK, buttonText[0]);
- GET_STRING_CONFIG(IDS_COM_SK_CANCEL, buttonText[1]);
+ GET_STRING_CONFIG(IDS_COM_SK_OK, __buttonText[0]);
+ GET_STRING_CONFIG(IDS_COM_SK_CANCEL, __buttonText[1]);
break;
case MSGBOX_STYLE_YESNO:
__buttonNum = 2;
- GET_STRING_CONFIG(IDS_COM_SK_YES, buttonText[0]);
- GET_STRING_CONFIG(IDS_COM_SK_NO, buttonText[1]);
+ GET_STRING_CONFIG(IDS_COM_SK_YES, __buttonText[0]);
+ GET_STRING_CONFIG(IDS_COM_SK_NO, __buttonText[1]);
break;
case MSGBOX_STYLE_YESNOCANCEL:
__buttonNum = 3;
- GET_STRING_CONFIG(IDS_COM_SK_YES, buttonText[0]);
- GET_STRING_CONFIG(IDS_COM_SK_NO, buttonText[1]);
- GET_STRING_CONFIG(IDS_COM_SK_CANCEL, buttonText[2]);
+ GET_STRING_CONFIG(IDS_COM_SK_YES, __buttonText[0]);
+ GET_STRING_CONFIG(IDS_COM_SK_NO, __buttonText[1]);
+ GET_STRING_CONFIG(IDS_COM_SK_CANCEL, __buttonText[2]);
break;
case MSGBOX_STYLE_ABORTRETRYIGNORE:
__buttonNum = 3;
- GET_STRING_CONFIG(IDS_COM_SK_ABORT, buttonText[0]);
- GET_STRING_CONFIG(IDS_COM_SK_RETRY, buttonText[1]);
- GET_STRING_CONFIG(IDS_COM_SK_IGNORE, buttonText[2]);
+ GET_STRING_CONFIG(IDS_COM_SK_ABORT, __buttonText[0]);
+ GET_STRING_CONFIG(IDS_COM_SK_RETRY, __buttonText[1]);
+ GET_STRING_CONFIG(IDS_COM_SK_IGNORE, __buttonText[2]);
break;
case MSGBOX_STYLE_CANCELTRYCONTINUE:
__buttonNum = 3;
- GET_STRING_CONFIG(IDS_COM_SK_CANCEL, buttonText[0]);
- GET_STRING_CONFIG(IDS_COM_SK_TRY, buttonText[1]);
- GET_STRING_CONFIG(IDS_COM_BODY_CONTINUE, buttonText[2]);
+ GET_STRING_CONFIG(IDS_COM_SK_CANCEL, __buttonText[0]);
+ GET_STRING_CONFIG(IDS_COM_SK_TRY, __buttonText[1]);
+ GET_STRING_CONFIG(IDS_COM_BODY_CONTINUE, __buttonText[2]);
break;
case MSGBOX_STYLE_RETRYCANCEL:
__buttonNum = 2;
- GET_STRING_CONFIG(IDS_COM_SK_RETRY, buttonText[0]);
- GET_STRING_CONFIG(IDS_COM_SK_CANCEL, buttonText[1]);
+ GET_STRING_CONFIG(IDS_COM_SK_RETRY, __buttonText[0]);
+ GET_STRING_CONFIG(IDS_COM_SK_CANCEL, __buttonText[1]);
break;
default:
break;
}
+}
+
+void
+_MessageBoxPresenter::UpdateButtonString(void)
+{
+ GetButtonString();
+
+ for (int i = 0; i < __buttonNum; i++)
+ {
+ __pButtons[i]->SetText(__buttonText[i]);
+ }
+}
+
+result
+_MessageBoxPresenter::CreateButtons(void)
+{
+ GetButtonString();
__pButtonListener = new (std::nothrow) _MessageBoxButtonListener();
SysTryReturn(NID_UI_CTRL, __pButtonListener != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = __pButtons[i]->Construct(CalculateButtonPositionAndSize(i));
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- __pButtons[i]->SetText(buttonText[i]);
+ __pButtons[i]->SetText(__buttonText[i]);
__pButtons[i]->AddTouchEventListener(*__pButtonListener);
pImpl = _ControlImpl::GetInstance(*__pButtons[i]);
#include <FBaseErrorDefine.h>
#include <FUiCtrlButton.h>
#include <FGrp_BitmapImpl.h>
+#include <FSys_SettingInfoImpl.h>
#include "FUi_AccessibilityContainer.h"
#include "FUi_AccessibilityElement.h"
#include "FUi_CoordinateSystemUtils.h"
using namespace Tizen::Ui;
using namespace Tizen::Ui::Animations;
using namespace Tizen::Base;
-
+using namespace Tizen::System;
namespace Tizen { namespace Ui { namespace Controls
{
__pTextAccessibilityElement->Activate(false);
__pTextAccessibilityElement = null;
}
+
+ _SettingInfoImpl::RemoveSettingEventListener(*this);
}
_ProgressPopup*
__pButton = new (std::nothrow) Button();
SysTryCatch(NID_UI_CTRL, __pButton != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
- r = __pButton->Construct(pPresenter->GetButtonBounds(), L"Cancel");
+ String buttonText;
+
+ GET_STRING_CONFIG(IDS_COM_SK_CANCEL, buttonText);
+
+ r = __pButton->Construct(pPresenter->GetButtonBounds(), buttonText);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
_ControlImpl* pImpl = _ControlImpl::GetInstance(*__pButton);
InitializeAccessibilityElement();
}
+ r = _SettingInfoImpl::AddSettingEventListenerForInternal(*this);
+ SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
return r;
CATCH:
return __pProgressPopupPresenter->OnTouchReleased(source, touchinfo);
}
+void
+_ProgressPopup::OnSettingChanged(String& key)
+{
+ const wchar_t* LOCALE_LANGUAGE = L"http://tizen.org/setting/locale.language";
+
+ if ((key == LOCALE_LANGUAGE) && (__pButton != null))
+ {
+ String buttonText;
+
+ GET_STRING_CONFIG(IDS_COM_SK_CANCEL, buttonText);
+ __pButton->SetText(buttonText);
+ }
+}
}}} // Tizen::Ui::Controls
#ifndef _FUI_CTRL_INTERNAL_MESSAGEBOX_H_
#define _FUI_CTRL_INTERNAL_MESSAGEBOX_H_
-
+#include <FSysISettingEventListener.h>
#include <FUiCtrlMessageBox.h>
#include "FUiCtrl_Popup.h"
namespace Tizen { namespace Ui { namespace Controls
{
-
class _MessageBoxPresenter;
/**
, virtual public Tizen::Base::Runtime::IEventListener
, virtual public _IUiEventListener
, virtual public _IUiEventPreviewer
+ , virtual public Tizen::System::ISettingEventListener
{
// Lifecycle
public:
virtual void OnChangeLayout(_ControlOrientation orientation);
virtual void OnBoundsChanged(void);
-
+ virtual void OnSettingChanged(Tizen::Base::String& key);
// Accessors
public:
Tizen::Base::String __text;
unsigned long __timeout;
-
}; // _MessageBox
virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
+ void UpdateButtonString(void);
+
//Accessor
public:
float GetBodyTextHeight(void) const;
float GetLabelHeight(Tizen::Graphics::_Text::TextObject* textObject, wchar_t* text, int length, float fontSize, FloatRectangle bounds);
float GetLeftRightLabelMargin(void);
+ void GetButtonString(void);
+
// Inner class
private:
class _MessageBoxButtonListener
_MessageBoxButtonListener* __pButtonListener;
MessageBoxModalResult __msgboxResult;
- Tizen::Ui::Controls::Button* __pButtons[3];
+ static const int MSGBOX_MAX_BUTTON_NUM = 3;
+
+ Tizen::Ui::Controls::Button* __pButtons[MSGBOX_MAX_BUTTON_NUM];
+ Tizen::Base::String __buttonText[MSGBOX_MAX_BUTTON_NUM];
Tizen::Ui::_AccessibilityElement* __pTextAccessibilityElement;
#ifndef _FUI_CTRL_INTERNAL_PROGRESS_POPUP_H_
#define _FUI_CTRL_INTERNAL_PROGRESS_POPUP_H_
-
+#include <FSysISettingEventListener.h>
#include <FUiCtrlProgressPopup.h>
#include "FUiCtrl_Popup.h"
#include "FUiCtrl_IActionEventListener.h"
, virtual public Tizen::Base::Runtime::IEventListener
, virtual public _IUiEventListener
, virtual public _IUiEventPreviewer
+ , virtual public Tizen::System::ISettingEventListener
{
//Lifecycle
virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
+ virtual void OnSettingChanged(Tizen::Base::String& key);
public:
result AddProgressPopupEventListener(const Tizen::Ui::Controls::_IProgressPopupEventListener& listener);