* @since 2.1
*/
_OSP_EXPORT_ static const int TEXT_NORMAL;
+
+ /**
+ * The property key to get the normal background color of the bottom button area of messagebox.
+ *
+ * @since 2.2
+ */
+ _OSP_EXPORT_ static const int BOTTOM_BG_NORMAL;
+
+ /**
+ * The property key to get the normal background color of the title area of messagebox.
+ *
+ * @since 2.2
+ */
+ _OSP_EXPORT_ static const int TITLE_BG_NORMAL;
+
+ /**
+ * The property key to get the normal background color of the buttons of messagebox.
+ *
+ * @since 2.2
+ */
+ _OSP_EXPORT_ static const int BOTTOM_BUTTON_BG_NORMAL;
+
+ /**
+ * The property key to get the pressed background color of the buttons of messagebox.
+ *
+ * @since 2.2
+ */
+ _OSP_EXPORT_ static const int BOTTOM_BUTTON_BG_PRESSED;
+
+ /**
+ * The property key to get the disabled background color of the buttons of messagebox.
+ *
+ * @since 2.2
+ */
+ _OSP_EXPORT_ static const int BOTTOM_BUTTON_BG_DISABLED;
+
+ /**
+ * The property key to get the highlighted background color of the buttons of messagebox.
+ *
+ * @since 2.2
+ */
+ _OSP_EXPORT_ static const int BOTTOM_BUTTON_BG_HIGHLIGHTED;
+
+ /**
+ * The property key to get the normal text color of the buttons of messagebox.
+ *
+ * @since 2.2
+ */
+ _OSP_EXPORT_ static const int BOTTOM_BUTTON_TEXT_NORMAL;
+
+ /**
+ * The property key to get the pressed text color of the buttons of messagebox.
+ *
+ * @since 2.2
+ */
+ _OSP_EXPORT_ static const int BOTTOM_BUTTON_TEXT_PRESSED;
+
+ /**
+ * The property key to get the disabled text color of the buttons of messagebox.
+ *
+ * @since 2.2
+ */
+ _OSP_EXPORT_ static const int BOTTOM_BUTTON_TEXT_DISABLED;
+
+ /**
+ * The property key to get the highlighted text color of the buttons of messagebox.
+ *
+ * @since 2.2
+ */
+ _OSP_EXPORT_ static const int BOTTOM_BUTTON_TEXT_HIGHLIGHTED;
};
struct _OSP_EXPORT_ Panel
* @since 2.1
*/
_OSP_EXPORT_ static const int TITLE_TEXT_NORMAL;
+
+ /**
+ * The property key to get the background color of the title of popup.
+ *
+ * @since 2.2
+ */
+ _OSP_EXPORT_ static const int TITLE_BG_NORMAL;
};
struct _OSP_EXPORT_ Progress
const int ColorKey::MessageBox::BG_NORMAL = _MESSAGEBOX::BG_NORMAL_COLOR;
const int ColorKey::MessageBox::TITLE_TEXT_NORMAL = _MESSAGEBOX::TITLE_TEXT_NORMAL_COLOR;
const int ColorKey::MessageBox::TEXT_NORMAL = _MESSAGEBOX::TEXT_NORMAL_COLOR;
+const int ColorKey::MessageBox::BOTTOM_BG_NORMAL = _MESSAGEBOX::BOTTOM_BG_NORMAL_COLOR;
+const int ColorKey::MessageBox::TITLE_BG_NORMAL = _MESSAGEBOX::TITLE_BG_NORMAL_COLOR;
+const int ColorKey::MessageBox::BOTTOM_BUTTON_BG_NORMAL = _MESSAGEBOX::BOTTOM_BUTTON_BG_NORMAL_COLOR;
+const int ColorKey::MessageBox::BOTTOM_BUTTON_BG_PRESSED = _MESSAGEBOX::BOTTOM_BUTTON_BG_PRESSED_COLOR;
+const int ColorKey::MessageBox::BOTTOM_BUTTON_BG_DISABLED = _MESSAGEBOX::BOTTOM_BUTTON_BG_DISABLED_COLOR;
+const int ColorKey::MessageBox::BOTTOM_BUTTON_BG_HIGHLIGHTED = _MESSAGEBOX::BOTTOM_BUTTON_BG_HIGHLIGHTED_COLOR;
+const int ColorKey::MessageBox::BOTTOM_BUTTON_TEXT_NORMAL = _MESSAGEBOX::BOTTOM_BUTTON_TEXT_NORMAL_COLOR;
+const int ColorKey::MessageBox::BOTTOM_BUTTON_TEXT_PRESSED = _MESSAGEBOX::BOTTOM_BUTTON_TEXT_PRESSED_COLOR;
+const int ColorKey::MessageBox::BOTTOM_BUTTON_TEXT_DISABLED = _MESSAGEBOX::BOTTOM_BUTTON_TEXT_DISABLED_COLOR;
+const int ColorKey::MessageBox::BOTTOM_BUTTON_TEXT_HIGHLIGHTED = _MESSAGEBOX::BOTTOM_BUTTON_TEXT_HIGHLIGHTED_COLOR;
const int ColorKey::Panel::GROUPED_STYLE_BG_NORMAL = _PANEL::GROUPED_STYLE_BG_NORMAL_COLOR;
const int ColorKey::Popup::BG_NORMAL = _POPUP::BG_NORMAL_COLOR;
const int ColorKey::Popup::TITLE_TEXT_NORMAL = _POPUP::TITLE_TEXT_NORMAL_COLOR;
+const int ColorKey::Popup::TITLE_BG_NORMAL = _POPUP::TITLE_BG_NORMAL_COLOR;
const int ColorKey::Progress::BAR_BG_NORMAL = _PROGRESS::BAR_BG_NORMAL_COLOR;
const int ColorKey::Progress::BAR_NORMAL = _PROGRESS::BAR_NORMAL_COLOR;
const int ColorKey::Scroll::THUMB_BG_NORMAL = _SCROLL::THUMB_BG_NORMAL_COLOR;
GET_COLOR_CONFIG(MESSAGEBOX::BG_NORMAL, _bgColor);
GET_COLOR_CONFIG(MESSAGEBOX::TITLE_TEXT_NORMAL, _titleTextColor);
GET_COLOR_CONFIG(MESSAGEBOX::TEXT_NORMAL, __textColor);
- GET_COLOR_CONFIG(MESSAGEBOX::BG_TITLE, titleBgColor);
- GET_COLOR_CONFIG(MESSAGEBOX::BG_BUTTON, buttonBgColor);
+ GET_COLOR_CONFIG(MESSAGEBOX::TITLE_BG_NORMAL, titleBgColor);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BG_NORMAL, buttonBgColor);
GET_SHAPE_CONFIG(MESSAGEBOX::TITLE_HEIGHT, GetOrientation(), titleHeight);
result
_MessageBoxPresenter::CreateButtons(void)
{
+ result r = E_SUCCESS;
GetButtonString();
+ //Button Colors
+ Color buttonColorNormal(0x00000000);
+ Color buttonColorPressed(0x00000000);
+ Color buttonColorDisabled(0x00000000);
+ Color buttonColorHighlighted(0x00000000);
+ Color buttonTextNormal(0x00000000);
+ Color buttonTextPressed(0x00000000);
+ Color buttonTextDisabled(0x00000000);
+ Color buttonTextHighlighted(0x00000000);
+ bool isCustomBitmap = false;
- __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.");
- result r = E_SUCCESS;
+ Bitmap* pButtonBgNormal = null;
+ Bitmap* pButtonBgPressed = null;
+ Bitmap* pButtonBgDisabled = null;
+ Bitmap* pButtonBgHighlighted = null;
+
+ Bitmap* pComposedButtonBgNormal = null;
+ Bitmap* pComposedButtonBgPressed = null;
+ Bitmap* pComposedButtonBgDisabled = null;
+ Bitmap* pComposedButtonBgHighlighted = null;
+
+ Bitmap* pButtonNormalEffect = null;
+ Bitmap* pButtonPressedEffect = null;
+ Bitmap* pButtonDisabledEffect = null;
+
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_BG_NORMAL, buttonColorNormal);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_BG_PRESSED, buttonColorPressed);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_BG_DISABLED, buttonColorDisabled);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_BG_HIGHLIGHTED, buttonColorHighlighted);
+
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_TEXT_NORMAL, buttonTextNormal);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_TEXT_PRESSED, buttonTextPressed);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_TEXT_DISABLED, buttonTextDisabled);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_TEXT_HIGHLIGHTED, buttonTextHighlighted);
+
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonBgNormal);
+ r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating. Failed to load Bottom button normal Image.", GetErrorMessage(r));
+
+ isCustomBitmap = IS_CUSTOM_BITMAP(MESSAGEBOX::BOTTOM_BUTTON_BG_NORMAL);
+
+ if (!isCustomBitmap)
+ {
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_NORMAL_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonNormalEffect);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating. Failed to load Bottom button normal effect Image.", GetErrorMessage(r));
+ }
+
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonBgPressed);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating. Failed to load Bottom button pressed Image.", GetErrorMessage(r));
+
+ isCustomBitmap = IS_CUSTOM_BITMAP(MESSAGEBOX::BOTTOM_BUTTON_BG_PRESSED);
+
+ if (!isCustomBitmap)
+ {
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_PRESSED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonPressedEffect);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating. Failed to load Bottom button pressed effect Image.", GetErrorMessage(r));
+ }
+
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonBgDisabled);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating. Failed to load Bottom button disabled Image.", GetErrorMessage(r));
+
+ isCustomBitmap = IS_CUSTOM_BITMAP(MESSAGEBOX::BOTTOM_BUTTON_BG_DISABLED);
+
+ if (!isCustomBitmap)
+ {
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_DISABLED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonDisabledEffect);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating. Failed to load Bottom button disabled effect Image.", GetErrorMessage(r));
+ }
+
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonBgHighlighted);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating. Failed to load Bottom button highlighted Image.", GetErrorMessage(r));
+
+ pComposedButtonBgNormal = _BitmapImpl::GetColorReplacedBitmapN(*pButtonBgNormal, Color::GetColor(COLOR_ID_MAGENTA), buttonColorNormal);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, (pComposedButtonBgNormal != null), , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pComposedButtonBgPressed = _BitmapImpl::GetColorReplacedBitmapN(*pButtonBgPressed, Color::GetColor(COLOR_ID_MAGENTA), buttonColorPressed);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, (pComposedButtonBgPressed != null), , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pComposedButtonBgDisabled = _BitmapImpl::GetColorReplacedBitmapN(*pButtonBgDisabled, Color::GetColor(COLOR_ID_MAGENTA), buttonColorDisabled);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, (pComposedButtonBgDisabled != null), , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pComposedButtonBgHighlighted = _BitmapImpl::GetColorReplacedBitmapN(*pButtonBgHighlighted, Color::GetColor(COLOR_ID_MAGENTA), buttonColorHighlighted);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, (pComposedButtonBgHighlighted != null), , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pButtonListener = new (std::nothrow) _MessageBoxButtonListener();
+ SysTryCatch(NID_UI_CTRL, __pButtonListener != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
for (int i = 0; i < __buttonNum; i++)
{
__pButtons[i]->SetText(__buttonText[i]);
__pButtons[i]->AddTouchEventListener(*__pButtonListener);
__pButtons[i]->AddKeyEventListener(*__pButtonListener);
+ __pButtons[i]->SetNormalBackgroundBitmap(*pComposedButtonBgNormal);
+ __pButtons[i]->SetPressedBackgroundBitmap(*pComposedButtonBgPressed);
+ __pButtons[i]->SetDisabledBackgroundBitmap(*pComposedButtonBgDisabled);
+ __pButtons[i]->SetHighlightedBackgroundBitmap(*pComposedButtonBgHighlighted);
+ __pButtons[i]->SetTextColor(buttonTextNormal);
+ __pButtons[i]->SetPressedTextColor(buttonTextPressed);
+ __pButtons[i]->SetDisabledTextColor(buttonTextDisabled);
+ __pButtons[i]->SetHighlightedTextColor(buttonTextHighlighted);
pImpl = _ControlImpl::GetInstance(*__pButtons[i]);
pButtonCore = dynamic_cast<_Button*>(&pImpl->GetCore());
{
pButtonCore->SetTouchPressThreshold(0.16);
__pMessageBox->AttachChild(*pButtonCore);
+
+ if (pButtonNormalEffect != null)
+ {
+ pButtonCore->SetBackgroundEffectBitmap(_BUTTON_STATUS_NORMAL, *pButtonNormalEffect);
+ }
+
+ if (pButtonPressedEffect != null)
+ {
+ pButtonCore->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *pButtonPressedEffect);
+ }
+
+ if(pButtonDisabledEffect != null)
+ {
+ pButtonCore->SetBackgroundEffectBitmap(_BUTTON_STATUS_DISABLED, *pButtonDisabledEffect);
+ }
}
if (i != 0)
}
+ delete pButtonBgNormal;
+ pButtonBgNormal = null;
+
+ delete pButtonBgPressed;
+ pButtonBgPressed = null;
+
+ delete pButtonBgDisabled;
+ pButtonBgDisabled = null;
+
+ delete pButtonBgHighlighted;
+ pButtonBgHighlighted = null;
+
+ delete pComposedButtonBgNormal;
+ pComposedButtonBgNormal = null;
+
+ delete pComposedButtonBgPressed;
+ pComposedButtonBgPressed = null;
+
+ delete pComposedButtonBgDisabled;
+ pComposedButtonBgDisabled = null;
+
+ delete pComposedButtonBgHighlighted;
+ pComposedButtonBgHighlighted = null;
+
+ delete pButtonNormalEffect;
+ pButtonNormalEffect = null;
+
+ delete pButtonPressedEffect;
+ pButtonNormalEffect = null;
+
+ delete pButtonDisabledEffect;
+ pButtonNormalEffect = null;
+
return r;
CATCH:
+
+ delete pButtonBgNormal;
+ pButtonBgNormal = null;
+
+ delete pButtonBgPressed;
+ pButtonBgPressed = null;
+
+ delete pButtonBgDisabled;
+ pButtonBgDisabled = null;
+
+ delete pButtonBgHighlighted;
+ pButtonBgHighlighted = null;
+
+ delete pComposedButtonBgNormal;
+ pComposedButtonBgNormal = null;
+
+ delete pComposedButtonBgPressed;
+ pComposedButtonBgPressed = null;
+
+ delete pComposedButtonBgDisabled;
+ pComposedButtonBgDisabled = null;
+
+ delete pComposedButtonBgHighlighted;
+ pComposedButtonBgHighlighted = null;
+
+ delete pButtonNormalEffect;
+ pButtonNormalEffect = null;
+
+ delete pButtonPressedEffect;
+ pButtonNormalEffect = null;
+
+ delete pButtonDisabledEffect;
+ pButtonNormalEffect = null;
+
delete __pButtonListener;
__pButtonListener = null;
delete __pButtons[i];
__pButtons[i] = null;
}
-
return r;
}
if (pControl != null)
{
- _Button* pFocusControl = null;
if (keyCode == KEY_ENTER)
{
__buttonHandle = _ControlImpl::GetInstance(source)->GetCore().GetHandle();
if (_titleState)
{
- GET_COLOR_CONFIG(POPUP::BG_TITLE, titleBgColor);
+ GET_COLOR_CONFIG(POPUP::TITLE_BG_NORMAL, titleBgColor);
// Popup-TitleBitmap
GET_BITMAP_CONFIG_N(POPUP::BG_TITLE_AREA, BITMAP_PIXEL_FORMAT_ARGB8888, titleBgBitmap);
Color titleBgColor(0x00000000);
Color buttonBgColor(0x00000000);
+ Color buttonColorNormal(0x00000000);
+ Color buttonColorPressed(0x00000000);
+ Color buttonColorDisabled(0x00000000);
+ Color buttonColorHighlighted(0x00000000);
+ Color buttonTextNormal(0x00000000);
+ Color buttonTextPressed(0x00000000);
+ Color buttonTextDisabled(0x00000000);
+ Color buttonTextHighlighted(0x00000000);
+ bool isCustomBitmap = false;
+
+ Bitmap* pButtonBgNormal = null;
+ Bitmap* pButtonBgPressed = null;
+ Bitmap* pButtonBgDisabled = null;
+ Bitmap* pButtonBgHighlighted = null;
+
+ Bitmap* pComposedButtonBgNormal = null;
+ Bitmap* pComposedButtonBgPressed = null;
+ Bitmap* pComposedButtonBgDisabled = null;
+ Bitmap* pComposedButtonBgHighlighted = null;
+ Bitmap* pButtonNormalEffect = null;
+ Bitmap* pButtonPressedEffect = null;
+ Bitmap* pButtonDisabledEffect = null;
+
__animationRect = animationRect;
__buttonState = cancelButton;
__isTransparent = transparent;
GET_COLOR_CONFIG(POPUP::TITLE_TEXT_NORMAL, _titleTextColor);
GET_COLOR_CONFIG(MESSAGEBOX::TEXT_NORMAL, __textColor);
- GET_COLOR_CONFIG(MESSAGEBOX::BG_TITLE, titleBgColor);
- GET_COLOR_CONFIG(MESSAGEBOX::BG_BUTTON, buttonBgColor);
+ GET_COLOR_CONFIG(MESSAGEBOX::TITLE_BG_NORMAL, titleBgColor);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BG_NORMAL, buttonBgColor);
GET_BITMAP_CONFIG_N(POPUP::BG_OUTLINE_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, _pOutlineBitmap);
r = GetLastResult();
if (__buttonState && !__isTransparent)
{
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_BG_NORMAL, buttonColorNormal);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_BG_PRESSED, buttonColorPressed);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_BG_DISABLED, buttonColorDisabled);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_BG_HIGHLIGHTED, buttonColorHighlighted);
+
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_TEXT_NORMAL, buttonTextNormal);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_TEXT_PRESSED, buttonTextPressed);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_TEXT_DISABLED, buttonTextDisabled);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BUTTON_TEXT_HIGHLIGHTED, buttonTextHighlighted);
+
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonBgNormal);
+ r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating. Failed to load Bottom button normal Image.", GetErrorMessage(r));
+
+ isCustomBitmap = IS_CUSTOM_BITMAP(MESSAGEBOX::BOTTOM_BUTTON_BG_NORMAL);
+
+ if (!isCustomBitmap)
+ {
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_NORMAL_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonNormalEffect);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating. Failed to load Bottom button normal effect Image.", GetErrorMessage(r));
+ }
+
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonBgPressed);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating. Failed to load Bottom button pressed Image.", GetErrorMessage(r));
+
+ isCustomBitmap = IS_CUSTOM_BITMAP(MESSAGEBOX::BOTTOM_BUTTON_BG_PRESSED);
+
+ if (!isCustomBitmap)
+ {
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_PRESSED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonPressedEffect);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating. Failed to load Bottom button pressed effect Image.", GetErrorMessage(r));
+ }
+
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonBgDisabled);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating. Failed to load Bottom button disabled Image.", GetErrorMessage(r));
+
+ isCustomBitmap = IS_CUSTOM_BITMAP(MESSAGEBOX::BOTTOM_BUTTON_BG_DISABLED);
+
+ if (!isCustomBitmap)
+ {
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_DISABLED_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonDisabledEffect);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating. Failed to load Bottom button disabled effect Image.", GetErrorMessage(r));
+ }
+
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pButtonBgHighlighted);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating. Failed to load Bottom button highlighted Image.", GetErrorMessage(r));
+
+ pComposedButtonBgNormal = _BitmapImpl::GetColorReplacedBitmapN(*pButtonBgNormal, Color::GetColor(COLOR_ID_MAGENTA), buttonColorNormal);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, (pComposedButtonBgNormal != null), , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pComposedButtonBgPressed = _BitmapImpl::GetColorReplacedBitmapN(*pButtonBgPressed, Color::GetColor(COLOR_ID_MAGENTA), buttonColorPressed);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, (pComposedButtonBgPressed != null), , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pComposedButtonBgDisabled = _BitmapImpl::GetColorReplacedBitmapN(*pButtonBgDisabled, Color::GetColor(COLOR_ID_MAGENTA), buttonColorDisabled);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, (pComposedButtonBgDisabled != null), , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ pComposedButtonBgHighlighted = _BitmapImpl::GetColorReplacedBitmapN(*pButtonBgHighlighted, Color::GetColor(COLOR_ID_MAGENTA), buttonColorHighlighted);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, (pComposedButtonBgHighlighted != null), , r, "[%s] Propagating.", GetErrorMessage(r));
+
__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.");
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
SetButtonText();
+ __pButton->SetNormalBackgroundBitmap(*pComposedButtonBgNormal);
+ __pButton->SetPressedBackgroundBitmap(*pComposedButtonBgPressed);
+ __pButton->SetDisabledBackgroundBitmap(*pComposedButtonBgDisabled);
+ __pButton->SetHighlightedBackgroundBitmap(*pComposedButtonBgHighlighted);
+ __pButton->SetTextColor(buttonTextNormal);
+ __pButton->SetPressedTextColor(buttonTextPressed);
+ __pButton->SetDisabledTextColor(buttonTextDisabled);
+ __pButton->SetHighlightedTextColor(buttonTextHighlighted);
_ControlImpl* pImpl = _ControlImpl::GetInstance(*__pButton);
r = AttachChild(pImpl->GetCore());
pButtonCore->SetActionId(ID_PROGRESS_POPUP_CANCEL_BUTTON);
pButtonCore->AddActionEventListener(*this);
+ if (pButtonNormalEffect != null)
+ {
+ pButtonCore->SetBackgroundEffectBitmap(_BUTTON_STATUS_NORMAL, *pButtonNormalEffect);
+ }
+
+ if (pButtonPressedEffect != null)
+ {
+ pButtonCore->SetBackgroundEffectBitmap(_BUTTON_STATUS_PRESSED, *pButtonPressedEffect);
+ }
+
+ if(pButtonDisabledEffect != null)
+ {
+ pButtonCore->SetBackgroundEffectBitmap(_BUTTON_STATUS_DISABLED, *pButtonDisabledEffect);
+ }
}
pContainer = GetAccessibilityContainer();
buttonBgBitmap = null;
}
+ delete pButtonBgNormal;
+ pButtonBgNormal = null;
+
+ delete pButtonBgPressed;
+ pButtonBgPressed = null;
+
+ delete pButtonBgDisabled;
+ pButtonBgDisabled = null;
+
+ delete pButtonBgHighlighted;
+ pButtonBgHighlighted = null;
+
+ delete pComposedButtonBgNormal;
+ pComposedButtonBgNormal = null;
+
+ delete pComposedButtonBgPressed;
+ pComposedButtonBgPressed = null;
+
+ delete pComposedButtonBgDisabled;
+ pComposedButtonBgDisabled = null;
+
+ delete pComposedButtonBgHighlighted;
+ pComposedButtonBgHighlighted = null;
+
+ delete pButtonNormalEffect;
+ pButtonNormalEffect = null;
+
+ delete pButtonPressedEffect;
+ pButtonNormalEffect = null;
+
+ delete pButtonDisabledEffect;
+ pButtonNormalEffect = null;
+
delete titleBgBitmap;
titleBgBitmap = null;
return r;
-CATCH:
+ CATCH:
+
+ delete pButtonBgNormal;
+ pButtonBgNormal = null;
+
+ delete pButtonBgPressed;
+ pButtonBgPressed = null;
+
+ delete pButtonBgDisabled;
+ pButtonBgDisabled = null;
+
+ delete pButtonBgHighlighted;
+ pButtonBgHighlighted = null;
+
+ delete pComposedButtonBgNormal;
+ pComposedButtonBgNormal = null;
+
+ delete pComposedButtonBgPressed;
+ pComposedButtonBgPressed = null;
+
+ delete pComposedButtonBgDisabled;
+ pComposedButtonBgDisabled = null;
+
+ delete pComposedButtonBgHighlighted;
+ pComposedButtonBgHighlighted = null;
+
+ delete pButtonNormalEffect;
+ pButtonNormalEffect = null;
+
+ delete pButtonPressedEffect;
+ pButtonNormalEffect = null;
+
+ delete pButtonDisabledEffect;
+ pButtonNormalEffect = null;
delete titleBgBitmap;
titleBgBitmap = null;
{
result r = E_SUCCESS;
- // create button with new position
- if (HasButton())
- {
- _ControlImpl* pImpl = null;
- _Button* pButtonCore = null;
-
- if (__pButton != null)
- {
- pImpl = _ControlImpl::GetInstance(*__pButton);
- r = DetachChild(pImpl->GetCore());
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- delete __pButton;
- __pButton = null;
- }
-
- __pButton = new (std::nothrow) Button();
- SysTryReturn(NID_UI_CTRL, __pButton != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
-
- r = __pButton->Construct(__pProgressPopupPresenter->GetButtonBounds());
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- SetButtonText();
-
- pImpl = _ControlImpl::GetInstance(*__pButton);
- r = AttachChild(pImpl->GetCore());
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- pButtonCore = dynamic_cast <_Button*>(&pImpl->GetCore());
- r = GetLastResult();
- SysTryCatch(NID_UI_CTRL, pButtonCore != null, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- pButtonCore->SetActionId(ID_PROGRESS_POPUP_CANCEL_BUTTON);
- pButtonCore->AddActionEventListener(*this);
- }
-
+ // change the button bounds
+ __pButton->SetBounds(__pProgressPopupPresenter->GetButtonBounds());
// update total height -> GetTotalHeight (called by Impl)
// update process-animation rect position -> GetAnimationRect (called by UpdateProcessAnimationVE)
// update process-animation VE
-// r = __pProgressPopupPresenter->UpdateProcessAnimationVE();
+ r = __pProgressPopupPresenter->UpdateProcessAnimation();
// SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
return r;
return r;
}
+result
+_ProgressPopupPresenter::UpdateProcessAnimation(void)
+{
+ result r = E_SUCCESS;
+ FloatRectangle animationBounds = __pProgressPopup->GetAnimationRect();
+ if(__pAnimation)
+ {
+ r = __pAnimation->SetBounds(animationBounds);
+ }
+ return r;
+}
+
void
_ProgressPopupPresenter::OnAnimationStopped(const _Control & source)
{
DrawAnnexOnOffHandler(handlerPositionX);
-CATCH:
delete pOnOffButtonHandler;
return;
result PlayProcessAnimation(void);
result StopProcessAnimation(void);
result SetProcessAnimation(void);
+ result UpdateProcessAnimation(void);
// Touch Event Listener
virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
DECLARE_COLOR_CONFIG(BG_NORMAL, 1);
DECLARE_COLOR_CONFIG(TITLE_TEXT_NORMAL, 2);
DECLARE_COLOR_CONFIG(TEXT_NORMAL, 3);
- DECLARE_COLOR_CONFIG(BG_BUTTON, 4);
- DECLARE_COLOR_CONFIG(BG_TITLE, 5);
+ DECLARE_COLOR_CONFIG(BOTTOM_BG_NORMAL, 4);
+ DECLARE_COLOR_CONFIG(TITLE_BG_NORMAL, 5);
+ DECLARE_COLOR_CONFIG(BOTTOM_BUTTON_BG_NORMAL, 6);
+ DECLARE_COLOR_CONFIG(BOTTOM_BUTTON_BG_PRESSED, 7);
+ DECLARE_COLOR_CONFIG(BOTTOM_BUTTON_BG_DISABLED, 8);
+ DECLARE_COLOR_CONFIG(BOTTOM_BUTTON_BG_HIGHLIGHTED, 9);
+ DECLARE_COLOR_CONFIG(BOTTOM_BUTTON_TEXT_NORMAL, 10);
+ DECLARE_COLOR_CONFIG(BOTTOM_BUTTON_TEXT_PRESSED, 11);
+ DECLARE_COLOR_CONFIG(BOTTOM_BUTTON_TEXT_DISABLED, 12);
+ DECLARE_COLOR_CONFIG(BOTTOM_BUTTON_TEXT_HIGHLIGHTED, 13);
DECLARE_IMAGE_CONFIG(BG_NORMAL, 1);
DECLARE_IMAGE_CONFIG(BG_OUTLINE_EFFECT_NORMAL, 2);
DECLARE_IMAGE_CONFIG(BG_BUTTON_AREA, 3);
DECLARE_IMAGE_CONFIG(BG_BUTTON_EFFECT, 4);
DECLARE_IMAGE_CONFIG(BG_TITLE_AREA, 5);
DECLARE_IMAGE_CONFIG(BG_TITLE_EFFECT, 6);
+ DECLARE_IMAGE_CONFIG(BOTTOM_BUTTON_BG_NORMAL, 7);
+ DECLARE_IMAGE_CONFIG(BOTTOM_BUTTON_BG_PRESSED, 8);
+ DECLARE_IMAGE_CONFIG(BOTTOM_BUTTON_BG_DISABLED, 9);
+ DECLARE_IMAGE_CONFIG(BOTTOM_BUTTON_BG_HIGHLIGHTED, 10);
+ DECLARE_IMAGE_CONFIG(BOTTOM_BUTTON_NORMAL_EFFECT, 11);
+ DECLARE_IMAGE_CONFIG(BOTTOM_BUTTON_PRESSED_EFFECT, 12);
+ DECLARE_IMAGE_CONFIG(BOTTOM_BUTTON_DISABLED_EFFECT, 13);
+
DECLARE_FIXED_VALUE_CONFIG(TEXT_MAX_LENGTH, 1);
DECLARE_SHAPE_CONFIG(MIN_WIDTH, 1);
DECLARE_SHAPE_CONFIG(MIN_HEIGHT, 2);
DECLARE_UI_CONFIG(POPUP);
DECLARE_COLOR_CONFIG(BG_NORMAL, 1);
DECLARE_COLOR_CONFIG(TITLE_TEXT_NORMAL, 2);
- DECLARE_COLOR_CONFIG(BG_TITLE, 3);
+ DECLARE_COLOR_CONFIG(TITLE_BG_NORMAL, 3);
DECLARE_IMAGE_CONFIG(BG_NORMAL, 1);
DECLARE_IMAGE_CONFIG(BG_OUTLINE_EFFECT_NORMAL, 2);
DECLARE_IMAGE_CONFIG(BG_TITLE_AREA, 3);
__pImageKeyTable->Add(ResourceKey(key), _MESSAGEBOX::BG_NORMAL_IMAGE);
}
{
+ const char* key ="MESSAGEBOX::BOTTOM_BUTTON_BG_NORMAL";
+ __pImageKeyTable->Add(ResourceKey(key), _MESSAGEBOX::BOTTOM_BUTTON_BG_NORMAL_IMAGE);
+ }
+ {
+ const char* key ="MESSAGEBOX::BOTTOM_BUTTON_BG_PRESSED";
+ __pImageKeyTable->Add(ResourceKey(key), _MESSAGEBOX::BOTTOM_BUTTON_BG_PRESSED_IMAGE);
+ }
+ {
+ const char* key ="MESSAGEBOX::BOTTOM_BUTTON_BG_DISABLED";
+ __pImageKeyTable->Add(ResourceKey(key), _MESSAGEBOX::BOTTOM_BUTTON_BG_DISABLED_IMAGE);
+ }
+ {
+ const char* key ="MESSAGEBOX::BOTTOM_BUTTON_BG_HIGHLIGHTED";
+ __pImageKeyTable->Add(ResourceKey(key), _MESSAGEBOX::BOTTOM_BUTTON_BG_HIGHLIGHTED_IMAGE);
+ }
+ {
const char* key ="PANEL::GROUPED_SINGLE_BG_NORMAL";
__pImageKeyTable->Add(ResourceKey(key), _PANEL::GROUPED_SINGLE_BG_NORMAL_IMAGE);
}
__pColorKeyTable->Add(ResourceKey(key), _MESSAGEBOX::TEXT_NORMAL_COLOR);
}
{
+ const char* key ="MESSAGEBOX::BOTTOM_BG_NORMAL";
+ __pColorKeyTable->Add(ResourceKey(key), _MESSAGEBOX::BOTTOM_BG_NORMAL_COLOR);
+ }
+ {
+ const char* key ="MESSAGEBOX::TITLE_BG_NORMAL";
+ __pColorKeyTable->Add(ResourceKey(key), _MESSAGEBOX::TITLE_BG_NORMAL_COLOR);
+ }
+ {
+ const char* key ="MESSAGEBOX::BOTTOM_BUTTON_BG_NORMAL";
+ __pColorKeyTable->Add(ResourceKey(key), _MESSAGEBOX::BOTTOM_BUTTON_BG_NORMAL_COLOR);
+ }
+ {
+ const char* key ="MESSAGEBOX::BOTTOM_BUTTON_BG_PRESSED";
+ __pColorKeyTable->Add(ResourceKey(key), _MESSAGEBOX::BOTTOM_BUTTON_BG_PRESSED_COLOR);
+ }
+ {
+ const char* key ="MESSAGEBOX::BOTTOM_BUTTON_BG_DISABLED";
+ __pColorKeyTable->Add(ResourceKey(key), _MESSAGEBOX::BOTTOM_BUTTON_BG_DISABLED_COLOR);
+ }
+ {
+ const char* key ="MESSAGEBOX::BOTTOM_BUTTON_BG_HIGHLIGHTED";
+ __pColorKeyTable->Add(ResourceKey(key), _MESSAGEBOX::BOTTOM_BUTTON_BG_HIGHLIGHTED_COLOR);
+ }
+ {
+ const char* key ="MESSAGEBOX::BOTTOM_BUTTON_TEXT_NORMAL";
+ __pColorKeyTable->Add(ResourceKey(key), _MESSAGEBOX::BOTTOM_BUTTON_TEXT_NORMAL_COLOR);
+ }
+ {
+ const char* key ="MESSAGEBOX::BOTTOM_BUTTON_TEXT_PRESSED";
+ __pColorKeyTable->Add(ResourceKey(key), _MESSAGEBOX::BOTTOM_BUTTON_TEXT_PRESSED_COLOR);
+ }
+ {
+ const char* key ="MESSAGEBOX::BOTTOM_BUTTON_TEXT_DISABLED";
+ __pColorKeyTable->Add(ResourceKey(key), _MESSAGEBOX::BOTTOM_BUTTON_TEXT_DISABLED_COLOR);
+ }
+ {
+ const char* key ="MESSAGEBOX::BOTTOM_BUTTON_TEXT_HIGHLIGHTED";
+ __pColorKeyTable->Add(ResourceKey(key), _MESSAGEBOX::BOTTOM_BUTTON_TEXT_HIGHLIGHTED_COLOR);
+ }
+ {
const char* key ="OPTIONMENU::ITEM_TEXT_NORMAL";
__pColorKeyTable->Add(ResourceKey(key), _OPTIONMENU::ITEM_TEXT_NORMAL_COLOR);
}
__pColorKeyTable->Add(ResourceKey(key), _POPUP::TITLE_TEXT_NORMAL_COLOR);
}
{
+ const char* key ="POPUP::TITLE_BG_NORMAL";
+ __pColorKeyTable->Add(ResourceKey(key), _POPUP::TITLE_BG_NORMAL_COLOR);
+ }
+ {
const char* key ="PROGRESS::BAR_BG_NORMAL";
__pColorKeyTable->Add(ResourceKey(key), _PROGRESS::BAR_BG_NORMAL_COLOR);
}
ADD_SHAPE_CONFIG(GROUPITEM_ELEMENT_LEFT_MARGIN, 26);
ADD_SHAPE_CONFIG(GROUPITEM_ELEMENT_SPACING, 16);
ADD_SHAPE_CONFIG(GROUPITEM_DIVIDER_HEIGHT, 4);
- ADD_SHAPE_CONFIG(GROUPITEM_DIVIDER_LEFT_MARGIN, 24);
+ ADD_SHAPE_CONFIG(GROUPITEM_DIVIDER_LEFT_MARGIN, 0);
ADD_SHAPE_CONFIG(GROUPITEM_DIVIDER_BOTTOM_MARGIN, 14);
ADD_SHAPE_CONFIG(CONTEXTITEM_LEFT_MARGIN_ONE, 117);
ADD_SHAPE_CONFIG(CONTEXTITEM_LEFT_MARGIN, 16);
ADD_COLOR_CONFIG(BG_NORMAL, $B061L1);
ADD_COLOR_CONFIG(TITLE_TEXT_NORMAL, $B063L9);
ADD_COLOR_CONFIG(TEXT_NORMAL, $B063L1);
- ADD_COLOR_CONFIG(BG_BUTTON, $B061L3);
- ADD_COLOR_CONFIG(BG_TITLE, $B061L2);
+ ADD_COLOR_CONFIG(BOTTOM_BG_NORMAL, $B061L3);
+ ADD_COLOR_CONFIG(TITLE_BG_NORMAL, $B061L2);
+ ADD_COLOR_CONFIG(BOTTOM_BUTTON_BG_NORMAL, $B065L4);
+ ADD_COLOR_CONFIG(BOTTOM_BUTTON_BG_PRESSED, $B065L4P);
+ ADD_COLOR_CONFIG(BOTTOM_BUTTON_BG_DISABLED, $B065L4D);
+ ADD_COLOR_CONFIG(BOTTOM_BUTTON_BG_HIGHLIGHTED, $W161);
+ ADD_COLOR_CONFIG(BOTTOM_BUTTON_TEXT_NORMAL, $B064L3);
+ ADD_COLOR_CONFIG(BOTTOM_BUTTON_TEXT_PRESSED, $B064L3P);
+ ADD_COLOR_CONFIG(BOTTOM_BUTTON_TEXT_DISABLED, $B064L3D);
+ ADD_COLOR_CONFIG(BOTTOM_BUTTON_TEXT_HIGHLIGHTED, $B064L3);
ADD_IMAGE_CONFIG(BG_NORMAL, $00_popup_bg.#.png);
ADD_IMAGE_CONFIG(BG_OUTLINE_EFFECT_NORMAL, $00_popup_bg_ef.#.png);
ADD_IMAGE_CONFIG(BG_BUTTON_EFFECT, $00_popup_button_ef.#.png);
ADD_IMAGE_CONFIG(BG_TITLE_AREA, $00_popup_title_bg.#.png);
ADD_IMAGE_CONFIG(BG_TITLE_EFFECT, $00_popup_title_ef.#.png);
+ ADD_IMAGE_CONFIG(BOTTOM_BUTTON_BG_NORMAL, $00_popup_button_normal.#.png);
+ ADD_IMAGE_CONFIG(BOTTOM_BUTTON_BG_PRESSED, $00_popup_button_normal.#.png);
+ ADD_IMAGE_CONFIG(BOTTOM_BUTTON_BG_DISABLED, $00_popup_button_normal.#.png);
+ ADD_IMAGE_CONFIG(BOTTOM_BUTTON_BG_HIGHLIGHTED, $00_popup_button_focus.#.png);
+ ADD_IMAGE_CONFIG(BOTTOM_BUTTON_NORMAL_EFFECT, $00_popup_button_normal_ef.#.png);
+ ADD_IMAGE_CONFIG(BOTTOM_BUTTON_PRESSED_EFFECT, $00_popup_button_press_ef.#.png);
+ ADD_IMAGE_CONFIG(BOTTOM_BUTTON_DISABLED_EFFECT, $00_popup_button_dim_ef.#.png);
START_UI_CONFIG_MODE(480x800);
{
ADD_COLOR_CONFIG(BG_NORMAL, $B061L1);
ADD_COLOR_CONFIG(TITLE_TEXT_NORMAL, $B063L9);
- ADD_COLOR_CONFIG(BG_TITLE, $B061L2);
+ ADD_COLOR_CONFIG(TITLE_BG_NORMAL, $B061L2);
ADD_IMAGE_CONFIG(BG_NORMAL, $00_popup_bg.#.png);
ADD_IMAGE_CONFIG(BG_OUTLINE_EFFECT_NORMAL, $00_popup_bg_ef.#.png);