: __pMsgboxPresenter(null)
, __msgboxStyle(MSGBOX_STYLE_NONE)
, __textColor(Color(0xFFFFFFFF))
+ , __pButtonEffectBitmap(null)
+ , __pTitleEffectBitmap(null)
+ , __pComposedButtonBitmap(null)
+ , __pComposedTitleBitmap(null)
, __text(L"")
, __timeout(0)
{
delete _pOutlineBitmap;
_pOutlineBitmap = null;
+ delete __pButtonEffectBitmap;
+ __pButtonEffectBitmap = null;
+
+ delete __pTitleEffectBitmap;
+ __pTitleEffectBitmap = null;
+
+ delete __pComposedButtonBitmap;
+ __pComposedButtonBitmap = null;
+
+ delete __pComposedTitleBitmap;
+ __pComposedTitleBitmap = null;
+
_SettingInfoImpl::RemoveSettingEventListenerForInternal(*this);
}
result r = E_SUCCESS;
float titleHeight = 0.0f;
+ Bitmap* buttonBgBitmap = null;
+ Bitmap* titleBgBitmap = null;
+ Color titleBgColor(0x00000000);
+ Color buttonBgColor(0x00000000);
+ _AccessibilityContainer* pContainer = null;
_titleText = title;
_titleState = !(title.Equals(L"", false));
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_SHAPE_CONFIG(MESSAGEBOX::TITLE_HEIGHT, GetOrientation(), titleHeight);
r = GetLastResult();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] failed to load MessageBox BG Image.");
+ // MsgBox-BottomBitmap
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BG_BUTTON_AREA, BITMAP_PIXEL_FORMAT_ARGB8888, buttonBgBitmap);
+ r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ // MsgBox-BottomEffectBitmap
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BG_BUTTON_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pButtonEffectBitmap);
+ r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ // MsgBox-TitleBitmap
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BG_TITLE_AREA, BITMAP_PIXEL_FORMAT_ARGB8888, titleBgBitmap);
+ r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ // MsgBox-TitleEffectBitmap
+ GET_BITMAP_CONFIG_N(MESSAGEBOX::BG_TITLE_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pTitleEffectBitmap);
+ r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
_pComposedBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*_pBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), _bgColor);
+ r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pComposedButtonBitmap = _BitmapImpl::GetColorReplacedBitmapN(*buttonBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), buttonBgColor);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, (__pComposedButtonBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pComposedTitleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*titleBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), titleBgColor);
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, (__pComposedTitleBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r));
// for clearing canvas
if (GetVisualElement() != null)
GetVisualElement()->SetSurfaceOpaque(false);
}
- _AccessibilityContainer* pContainer = null;
-
pContainer = GetAccessibilityContainer();
if(pContainer != null)
{
}
r = _SettingInfoImpl::AddSettingEventListenerForInternal(*this);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
SetTouchPressThreshold(0.08);
+ delete buttonBgBitmap;
+ buttonBgBitmap = null;
+
+ delete titleBgBitmap;
+ titleBgBitmap = null;
+
+ return r;
+
+CATCH:
+ delete buttonBgBitmap;
+ buttonBgBitmap = null;
+
+ delete titleBgBitmap;
+ titleBgBitmap = null;
+
+ delete _pComposedBgBitmap;
+ _pComposedBgBitmap = null;
+
+ delete __pComposedButtonBitmap;
+ __pComposedButtonBitmap = null;
+
+ delete __pComposedTitleBitmap;
+ __pComposedTitleBitmap = null;
+
return r;
}
{
return false;
}
+
+Bitmap*
+_MessageBox::GetButtonBackgroundBitmap(void)
+{
+ return __pComposedButtonBitmap;
+}
+
+Bitmap*
+_MessageBox::GetButtonBackgroundEffectBitmap(void)
+{
+ return __pButtonEffectBitmap;
+}
+
+Bitmap*
+_MessageBox::GetTitleBackgroundBitmap(void)
+{
+ return __pComposedTitleBitmap;
+}
+
+Bitmap*
+_MessageBox::GetTitleBackgroundEffectBitmap(void)
+{
+ return __pTitleEffectBitmap;
+}
}}} // Tizen::Ui::Controls
, __msgboxResult(MSGBOX_RESULT_CLOSE)
, __pBodyTextObject(null)
, __textBounds(0.0f, 0.0f, 0.0f, 0.0f)
+ , __titleBgBounds(0.0f, 0.0f, 0.0f, 0.0f)
+ , __buttonBgBounds(0.0f, 0.0f, 0.0f, 0.0f)
, __pLabel(null)
, __pScroll(null)
, __pScrollPanel(null)
float transTopMargin = 0.0f;
float transBottomMargin = 0.0f;
float labelHeight = 0.0f;
+ float transLeftMargin = 0.0f;
+ float transRightMargin = 0.0f;
GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_SIZE, orientation, titleTextSize);
GET_SHAPE_CONFIG(POPUP::MIN_TITLE_TEXT_SIZE, orientation, minTitleTextSize);
GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_TOP_MARGIN, orientation, transTopMargin);
GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, orientation, transBottomMargin);
+ GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin);
+ GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin);
__textBounds.width = defaultWidth - GetLeftRightLabelMargin();
+ __titleBgBounds.width = defaultWidth - (transLeftMargin + transRightMargin);
+ __buttonBgBounds.width = defaultWidth - (transLeftMargin + transRightMargin);
// TitleText
if (__pMessageBox->HasTitle() == true)
float transBottomMargin = 0.0f;
float transLeftMargin = 0.0f;
float transRightMargin = 0.0f;
-
float labelHeight = 0.0f;
_ControlOrientation orientation;
GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_LEFT_MARGIN, orientation, transLeftMargin);
GET_SHAPE_CONFIG(MESSAGEBOX::BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, orientation, transRightMargin);
+ __titleBgBounds= FloatRectangle(transLeftMargin, transTopMargin, _CoordinateSystemUtils::ConvertToFloat(defaultWidth) - (2 * transLeftMargin), titleHeight);
+
// TitleText
if (__pMessageBox->HasTitle() == true)
{
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
_titleBounds = FloatRectangle(titleLeftMargin + transLeftMargin,
- titleTopMargin + transTopMargin,
- defaultWidth - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin),
- titleHeight - titleTopMargin);
+ __titleBgBounds.y + (__titleBgBounds.height - labelHeight) / 2,
+ defaultWidth - (titleLeftMargin + titleRightMargin + transLeftMargin + transRightMargin),
+ titleHeight - titleTopMargin);
}
else
{
__pScrollPanel->AttachChild(*__pLabel);
__pMessageBox->AttachChild(*__pScrollPanel);
+ __buttonBgBounds = FloatRectangle(transLeftMargin, __pMessageBox->GetTotalHeight() - bottomHeight - transBottomMargin, _CoordinateSystemUtils::ConvertToFloat(defaultWidth)- (transLeftMargin + transRightMargin), bottomHeight);
+
r = CreateButtons();
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
result r = E_SUCCESS;
float defaultWidth = 0.0f;
-
float textSize = 0.0f;
bool isCustomBitmap = false;
_ControlOrientation orientation;
- isCustomBitmap = IS_CUSTOM_BITMAP(MESSAGEBOX::BG_NORMAL);
-
orientation = __pMessageBox->GetOrientation();
GET_SHAPE_CONFIG(MESSAGEBOX::DEFAULT_WIDTH, orientation, defaultWidth);
-
GET_SHAPE_CONFIG(MESSAGEBOX::TEXT_SIZE, orientation, textSize);
Canvas* pCanvas = __pMessageBox->GetCanvasN();
const Bitmap* pBackgroundBitmap = __pMessageBox->GetBackgroundBitmap();
const Bitmap* pOutlineBitmap = __pMessageBox->GetOutlineBitmap();
+ const Bitmap* pButtonBitmap = __pMessageBox->GetButtonBackgroundBitmap();
+ const Bitmap* pButtonEffectBitmap = __pMessageBox->GetButtonBackgroundEffectBitmap();
+ const Bitmap* pTitleBitmap = __pMessageBox->GetTitleBackgroundBitmap();
+ const Bitmap* pTitleEffectBitmap = __pMessageBox->GetTitleBackgroundEffectBitmap();
+ isCustomBitmap = IS_CUSTOM_BITMAP(MESSAGEBOX::BG_NORMAL);
// Draw BG
if (pBackgroundBitmap != null)
{
}
}
+ //DrawButtonBG
+ if(pButtonBitmap != null)
+ {
+ if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pButtonBitmap))
+ {
+ pCanvas->DrawNinePatchedBitmap(__buttonBgBounds, *pButtonBitmap);
+ }
+ else
+ {
+ pCanvas->DrawBitmap(__buttonBgBounds, *pButtonBitmap);
+ }
+ }
+ //DrawEffectButtonBitmap
+ if (pButtonEffectBitmap != null)
+ {
+ if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pButtonEffectBitmap))
+ {
+ pCanvas->DrawNinePatchedBitmap(__buttonBgBounds, *pButtonEffectBitmap);
+ }
+ else
+ {
+ pCanvas->DrawBitmap(__buttonBgBounds, *pButtonEffectBitmap);
+ }
+ }
+
// Draw Title
if (_pTitleTextObject != null)
{
+ //DrawTitleBG
+ if(pTitleBitmap != null)
+ {
+ if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pTitleBitmap))
+ {
+ pCanvas->DrawNinePatchedBitmap(__titleBgBounds, *pTitleBitmap);
+ }
+ else
+ {
+ pCanvas->DrawBitmap(__titleBgBounds, *pTitleBitmap);
+ }
+ }
+ //DrawEffectTitleBitmap
+ if (pTitleEffectBitmap != null)
+ {
+ if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pTitleEffectBitmap))
+ {
+ pCanvas->DrawNinePatchedBitmap(__titleBgBounds, *pTitleEffectBitmap);
+ }
+ else
+ {
+ pCanvas->DrawBitmap(__titleBgBounds, *pTitleEffectBitmap);
+ }
+ }
r = SetFontInfo(FONT_STYLE_PLAIN, _titleTextSize);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
_pTitleTextObject->SetFont(_pFont, 0, _pTitleTextObject->GetTextLength());
_pTitleTextObject->SetForegroundColor(__pMessageBox->GetTitleTextColor(), 0, _pTitleTextObject->GetTextLength());
_pTitleTextObject->SetBounds(_titleBounds);
-
_pTitleTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas));
}
w = defaultWidth - (btnSideMargin1 * 2.0f);
h = btnHeight;
x = btnSideMargin1;
- y = transTopMargin + titleHeight + (textTopMargin * 2.0f) + __textObjHeight + btnTopMargin;
break;
case 2:
w = (defaultWidth - (btnSideMargin2 * 2.0f) - btnGap) / 2.0f;
h = btnHeight;
x = btnSideMargin2 + (buttonIndex * (w + btnGap));
- y = transTopMargin + titleHeight + (textTopMargin * 2.0f) + __textObjHeight + btnTopMargin;
break;
case 3:
w = (defaultWidth - ((btnSideMargin3 + btnGap) * 2.0f)) / 3.0f;
h = btnHeight;
x = btnSideMargin3 + (buttonIndex * (w + btnGap));
- y = transTopMargin + titleHeight + (textTopMargin * 2.0f) + __textObjHeight + btnTopMargin;
break;
}
break;
default:
break;
}
-
+ y = __buttonBgBounds.y + (__buttonBgBounds.height - h) / 2;
return FloatRectangle(x, y, w, h);
}
virtual bool OnAccessibilityActionPerformed(const _AccessibilityContainer& control, const _AccessibilityElement& element);
virtual bool OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element);
virtual bool OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element);
+
+ Tizen::Graphics::Bitmap* GetButtonBackgroundBitmap(void);
+ Tizen::Graphics::Bitmap* GetButtonBackgroundEffectBitmap(void);
+ Tizen::Graphics::Bitmap* GetTitleBackgroundBitmap(void);
+ Tizen::Graphics::Bitmap* GetTitleBackgroundEffectBitmap(void);
// Accessors
public:
MessageBoxStyle GetMsgBoxStyle(void) const;
MessageBoxStyle __msgboxStyle;
Tizen::Graphics::Color __textColor;
+
+
+ Tizen::Graphics::Bitmap* __pButtonEffectBitmap;
+ Tizen::Graphics::Bitmap* __pTitleEffectBitmap;
+ Tizen::Graphics::Bitmap* __pComposedButtonBitmap;
+ Tizen::Graphics::Bitmap* __pComposedTitleBitmap;
Tizen::Base::String __text;
unsigned long __timeout;
Tizen::Graphics::_Text::TextObject* __pBodyTextObject;
Tizen::Graphics::FloatRectangle __textBounds;
+ Tizen::Graphics::FloatRectangle __titleBgBounds;
+ Tizen::Graphics::FloatRectangle __buttonBgBounds;
+
Tizen::Ui::Controls::_Label* __pLabel;
Tizen::Ui::Controls::_Scroll* __pScroll;
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_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_FIXED_VALUE_CONFIG(TEXT_MAX_LENGTH, 1);
DECLARE_SHAPE_CONFIG(MIN_WIDTH, 1);
DECLARE_SHAPE_CONFIG(MIN_HEIGHT, 2);
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_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_AREA, $00_popup_button_bg.#.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);
START_UI_CONFIG_MODE(480x800);
{
ADD_SHAPE_CONFIG(MIN_WIDTH, 510); // 20120504
ADD_SHAPE_CONFIG(MIN_HEIGHT, 122); // 20120803
- ADD_SHAPE_CONFIG(DEFAULT_WIDTH, 720); // 20121113
+ ADD_SHAPE_CONFIG(DEFAULT_WIDTH, 652); // 20121113
ADD_SHAPE_CONFIG(MAX_HEIGHT, 590); // 20120803
ADD_SHAPE_CONFIG(TITLE_HEIGHT, 78); // 20130403
ADD_SHAPE_CONFIG(TITLE_TEXT_SIZE, 50); // 20121113
ADD_SHAPE_CONFIG(MIN_TITLE_TEXT_SIZE, 42); // 20121113
ADD_SHAPE_CONFIG(TITLE_TEXT_TOP_MARGIN, 20); // 20130403
- ADD_SHAPE_CONFIG(TITLE_TEXT_LEFT_MARGIN, 29); // 20130403
- ADD_SHAPE_CONFIG(TITLE_TEXT_RIGHT_MARGIN, 29); // 20130403
+ ADD_SHAPE_CONFIG(TITLE_TEXT_LEFT_MARGIN, 26); // 20130403
+ ADD_SHAPE_CONFIG(TITLE_TEXT_RIGHT_MARGIN, 26); // 20130403
- ADD_SHAPE_CONFIG(BOTTOM_HEIGHT, 118); // 20130403
+ ADD_SHAPE_CONFIG(BOTTOM_HEIGHT, 96); // 20130403
ADD_SHAPE_CONFIG(TEXT_SIZE, 38); // 20130403
ADD_SHAPE_CONFIG(TEXT_HEIGHT, 132); // 20130403
ADD_SHAPE_CONFIG(TEXT_TOP_MRAGIN, 20); // 20121113
ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_TOP_MARGIN, 14); //20121113
- ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, 34); //20121113
+ ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_BOTTOM_MARGIN, 16); //20121113
ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_LEFT_MARGIN, 16);
ADD_SHAPE_CONFIG(BG_IMAGE_TRANSPARENT_RIGHT_MARGIN, 16);
ADD_SHAPE_CONFIG(BUTTON_HEIGHT, 74); // 20121113
- ADD_SHAPE_CONFIG(BUTTON_INTERNAL_GAP, 16); // 20130404
+ ADD_SHAPE_CONFIG(BUTTON_INTERNAL_GAP, 10); // 20130404
ADD_SHAPE_CONFIG(BUTTON_TOP_MARGIN, 20); // 20121113
ADD_SHAPE_CONFIG(BUTTON_BOTTOM_MARGIN, 24); // 20130403
- ADD_SHAPE_CONFIG(BUTTON_SIDE_MARGIN_01, 110); // 20120803 : 1 Button
- ADD_SHAPE_CONFIG(BUTTON_SIDE_MARGIN_02, 36); // 20121113 : 2 Buttons
- ADD_SHAPE_CONFIG(BUTTON_SIDE_MARGIN_03, 36); // 20121113 : 3 Buttons
+ ADD_SHAPE_CONFIG(BUTTON_SIDE_MARGIN_01, 101); // 20120803 : 1 Button
+ ADD_SHAPE_CONFIG(BUTTON_SIDE_MARGIN_02, 28); // 20121113 : 2 Buttons
+ ADD_SHAPE_CONFIG(BUTTON_SIDE_MARGIN_03, 28); // 20121113 : 3 Buttons
}
END_UI_CONFIG_MODE(720x1280);
START_UI_CONFIG_MODE(1280x720);
{
- ADD_SHAPE_CONFIG(DEFAULT_WIDTH, 900); // 20130403
- ADD_SHAPE_CONFIG(BUTTON_SIDE_MARGIN_01, 200); // 20130403 : 1 Button
+ ADD_SHAPE_CONFIG(DEFAULT_WIDTH, 832); // 20130403
+ ADD_SHAPE_CONFIG(BUTTON_SIDE_MARGIN_01, 191); // 20130403 : 1 Button
}
END_UI_CONFIG_MODE(1280x720);