Rectangle rect(0, 0, 0, 0);
rect.width = pPopupData->popupDim.width;
- rect.height = (2*pPopupData->spacePad) + (pPopupData->editDim.height*2) + pPopupData->btnDim.height + (2*pPopupData->labelDim.height);
+ rect.height = (2*pPopupData->spacePad) + (pPopupData->editDim.height*2) + pPopupData->panelHeight + (2*pPopupData->labelDim.height);
r = _WebPopup::Construct(true, Dimension(rect.width, rect.height));
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
String hostRealm(host);
hostRealm.Append(L": \n ");
hostRealm.Append(realm);
- hostRealm.Append(L"\"");
r = pLabel->Construct(rect, hostRealm);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
pLayout->SetHorizontalAlignment(*pHostLabel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
pLayout->SetHorizontalAlignment(*__pIdEditField, LAYOUT_HORIZONTAL_ALIGN_CENTER);
pLayout->SetHorizontalAlignment(*__pPwdEditField, LAYOUT_HORIZONTAL_ALIGN_CENTER);
- pLayout->SetHorizontalAlignment(*pButtonPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
pLayout->SetSpacing(*__pPwdEditField, pPopupData->spacePad);
pLayout->SetSpacing(*pButtonPanel, pPopupData->spacePad);
*/
#include <FBaseColIList.h>
#include <FBaseSysLog.h>
+#include <FGrpColor.h>
#include <FUiCtrlButton.h>
#include <FUiCtrlPanel.h>
#include <FUiVerticalBoxLayout.h>
VerticalBoxLayout layout;
Dimension dim(popupDim);
- dim.height += __pWebPopupData->bottomMargin;
if (hasTitle)
{
result
_WebPopup::HidePopup(int modalResult)
{
- result r = E_SUCCESS;
-
- r = SetShowState(false);
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
if (__isModal)
{
__modal = modalResult;
return EndModal(__modal);
}
+ else
+ {
+ result r = E_SUCCESS;
- return E_SUCCESS;
+ r = SetShowState(false);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ return E_SUCCESS;
+ }
}
std::unique_ptr<Panel> pPanel(new (std::nothrow) Panel());
SysTryReturn(NID_WEB_CTRL, pPanel.get(), null, E_OUT_OF_MEMORY, "[%s] Memory Allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- Rectangle panelRect(0, 0, __pWebPopupData->popupDim.width, __pWebPopupData->btnDim.height);
+ Rectangle panelRect(0, 0, __pWebPopupData->popupDim.width, __pWebPopupData->panelHeight);
- result r = pPanel->Construct(panelRect);
+ result r = pPanel->Construct(panelRect, GROUP_STYLE_BOTTOM);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+ Color buttonBgColor(0x00000000);
+ GET_COLOR_CONFIG(MESSAGEBOX::BOTTOM_BG_NORMAL, buttonBgColor);
+ pPanel->SetBackgroundColor(buttonBgColor);
+
r = AddControl(*pPanel);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
int buttonMargin = __pWebPopupData->spacePad/2;
int buttonWidth = (__pWebPopupData->popupDim.width - buttonMargin*(idCount+1)) / idCount;
+ int buttonTopMargin = (__pWebPopupData->panelHeight - __pWebPopupData->btnDim.height)/2;
result r = E_SUCCESS;
+
+ //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);
+
+ Bitmap* pComposedButtonBgNormal = null;
+ Bitmap* pComposedButtonBgPressed = null;
+ Bitmap* pComposedButtonBgDisabled = null;
+ Bitmap* pComposedButtonBgHighlighted = 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);
+
+ r = GET_REPLACED_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, buttonColorNormal, pComposedButtonBgNormal);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ std::unique_ptr< Bitmap > pComposedBtnBgNormal(pComposedButtonBgNormal);
+
+ r = GET_REPLACED_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, buttonColorPressed, pComposedButtonBgPressed);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ std::unique_ptr< Bitmap > pComposedBtnBgPressed(pComposedButtonBgPressed);
+
+ r = GET_REPLACED_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, buttonColorDisabled, pComposedButtonBgDisabled);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ std::unique_ptr< Bitmap > pComposedBtnBgDisabled(pComposedButtonBgDisabled);
+
+ r = GET_REPLACED_BITMAP_CONFIG_N(MESSAGEBOX::BOTTOM_BUTTON_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, buttonColorHighlighted, pComposedButtonBgHighlighted);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ std::unique_ptr< Bitmap > pComposedBtnBgHighlighted(pComposedButtonBgHighlighted);
+
for (int i = 0; i < idCount; i++)
{
const Integer* pButtonId = static_cast<const Integer*>(buttonIds.GetAt(i));
std::unique_ptr<Button> pButton(new (std::nothrow) Button());
SysTryReturnResult(NID_WEB_CTRL, pButton.get(), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory Allocation failed.");
- r = pButton->Construct(Rectangle((buttonMargin*(i+1))+(buttonWidth*i), 0, buttonWidth, __pWebPopupData->btnDim.height), *pButtonTitle);
+ r = pButton->Construct(Rectangle((buttonMargin*(i+1))+(buttonWidth*i), buttonTopMargin, buttonWidth, __pWebPopupData->btnDim.height), *pButtonTitle);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
pButton->SetActionId(pButtonId->ToInt());
+ pButton->SetNormalBackgroundBitmap(*pComposedBtnBgNormal);
+ pButton->SetPressedBackgroundBitmap(*pComposedBtnBgPressed);
+ pButton->SetDisabledBackgroundBitmap(*pComposedBtnBgDisabled);
+ pButton->SetHighlightedBackgroundBitmap(*pComposedBtnBgHighlighted);
+ pButton->SetTextColor(buttonTextNormal);
+ pButton->SetPressedTextColor(buttonTextPressed);
+ pButton->SetDisabledTextColor(buttonTextDisabled);
+ pButton->SetHighlightedTextColor(buttonTextHighlighted);
+
//Add button to panel
r = pPanel->AddControl(*pButton);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_HEIGHT, orientation, __pWebPopupData->btnDim.height);
GET_SHAPE_CONFIG(MESSAGEBOX::BUTTON_SIDE_MARGIN_02, orientation, __pWebPopupData->spacePad);
+ GET_SHAPE_CONFIG(MESSAGEBOX::BOTTOM_HEIGHT, orientation, __pWebPopupData->panelHeight);
GET_SHAPE_CONFIG(LABEL::TEXT_FONT_SIZE, orientation, __pWebPopupData->labelFontSize);
GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION, orientation, __pWebPopupData->checkDim);