, __handleX(0)
, __prevSliderValue(0)
, __isSliderPressed(false)
+ , __isFocusModeStateChanged(false)
, __isNeedToBeUpdated(true)
, __isResourceLoaded(false)
, __isCustomHandle(false)
float offset = 0.0f;
float minimumHeight = 0.0f;
float minimumWidth = 0.0f;
- float topMargin = 0.0f;
float iconRightMargin = 0.0f;
float titleHeight = 0.0f;
FloatRectangle titleTextBounds;
}
__rect = FloatRectangle(0.0f, 0.0f, __pSlider->GetBoundsF().width, __pSlider->GetBoundsF().height);
- r = GET_SHAPE_CONFIG(SLIDER::BAR_TOP_MARGIN, orientation, topMargin);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
r = GET_SHAPE_CONFIG(SLIDER::ICON_RIGHT_MARGIN, orientation, iconRightMargin);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
minimumHeight = minimumHeight + titleHeight;
}
- if (__rect.height < minimumHeight )
+ if (__rect.height < minimumHeight)
{
__rect.height = minimumHeight;
}
}
}
}
- else if (__isSliderPressed == true) // pressed
+ else if (__isSliderPressed == true) // pressed
{
pHandleBitmap = __pHandlePressedBitmap;
pHandleEffectBitmap = __pHandlePressedEffectBitmap;
isCustomHandleBitmap = IS_CUSTOM_BITMAP(SLIDER::HANDLE_BG_PRESSED);
}
- else if (__pSlider->IsFocused() == true)
- {
- pHandleBitmap = __pHandleHighlightedBitmap;
- pHandleEffectBitmap = __pHandleHighlightedEffectBitmap;
- isCustomHandleBitmap = IS_CUSTOM_BITMAP(SLIDER::HANDLE_BG_HIGHLIGHTED);
- }
else //(__isSliderPressed == false) // normal state
{
pHandleBitmap = __pHandleNormalBitmap;
DrawBitmap(canvas, __barBgRect, __pBarBgColorReplacementBitmap);
if (isCustomBarBitmap == false)
{
- DrawBitmap(canvas, __barBgRect, __pBarBgResourceEffectBitmap);
+ DrawBitmap(canvas, __barBgRect, __pBarBgResourceEffectBitmap);
}
isCustomBarBitmap = IS_CUSTOM_BITMAP(SLIDER::BAR_NORMAL);
DrawBitmap(canvas, FloatRectangle(__barRect.x, __barRect.y, (__barRect.width + __handleRect.width / 2), __barRect.height), __pBarColorReplacementBitmap);
if (isCustomBarBitmap == false)
{
- DrawBitmap(canvas, FloatRectangle(__barRect.x, __barRect.y, (__barRect.width + __handleRect.width / 2), __barRect.height), __pBarResourceEffectBitmap);
+ DrawBitmap(canvas, FloatRectangle(__barRect.x, __barRect.y, (__barRect.width + __handleRect.width / 2), __barRect.height), __pBarResourceEffectBitmap);
}
__handleRect.x = __touchRect.x + __handleX;
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
if (isCustomHandleBitmap == false)
{
- r = DrawBitmap(*pHandleCanvas, FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), pHandleEffectBitmap);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = DrawBitmap(*pHandleCanvas, FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), pHandleEffectBitmap);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
}
}
else
bitmapWidth = pHandleBitmap->GetWidth();
bitmapHeight = pHandleBitmap->GetHeight();
- if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pHandleBitmap) == false)
+ if (!_BitmapImpl::CheckNinePatchedBitmapStrictly(*pHandleBitmap))
{
// to clip the center portion of the larger bitmap.
if( bitmapWidth > __handleRect.width )
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
}
+ if ((__pSlider->IsFocused()) && (__isFocusModeStateChanged == true))
+ {
+ if (__pHandleHighlightedBitmap)
+ {
+ if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*__pHandleHighlightedBitmap))
+ {
+ r = pHandleCanvas->DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), *__pHandleHighlightedBitmap);
+ }
+ else
+ {
+ r = pHandleCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), *__pHandleHighlightedBitmap);
+ }
+
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+ }
+
r = __pSlider->UpdateHandle(__handleRect);
if (r != E_SUCCESS)
{
if (__pTitleTextObject == null)
{
__pTitleTextObject = new (std::nothrow) TextObject();
- SysTryReturn(NID_UI_CTRL, __pTitleTextObject != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ SysTryReturn(NID_UI_CTRL, __pTitleTextObject != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
__pTitleTextObject->Construct();
}
r = GET_SHAPE_CONFIG(SLIDER::TITLE_TEXT_POSITION_X, orientation, titleTextBounds.x);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r));
- r = GET_SHAPE_CONFIG(SLIDER::BAR_TOP_MARGIN, orientation, topMargin);
+ r = GET_SHAPE_CONFIG(SLIDER::TITLE_TEXT_POSITION_Y, orientation, topMargin);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r));
titleTextBounds.y = topMargin;
return;
}
+void
+_SliderPresenter::SetFocusMode(bool focusmode)
+{
+ __isFocusModeStateChanged = focusmode;
+}
+
+bool
+_SliderPresenter::GetFocusMode(void)
+{
+ return __isFocusModeStateChanged;
+}
+
result
_SliderPresenter::SetThumbBitmap(SliderThumbStatus status, const Bitmap& bitmap)
{
delete __pHandleHighlightedEffectBitmap;
__pHandleHighlightedEffectBitmap = null;
- delete __pHandleHighlightedEffectBitmap;
- __pHandleHighlightedEffectBitmap = pThumbBitmap;
+ delete __pHandleHighlightedBitmap;
+ __pHandleHighlightedBitmap = pThumbBitmap;
break;
case SLIDER_THUMB_STATUS_NORMAL:
ADD_COLOR_CONFIG(HANDLE_BG_NORMAL, $W0641);
ADD_COLOR_CONFIG(HANDLE_BG_PRESSED, $W0641P);
ADD_COLOR_CONFIG(HANDLE_BG_DISABLED, $W0641D);
- ADD_COLOR_CONFIG(HANDLE_BG_HIGHLIGHTED, $W0641);
+ ADD_COLOR_CONFIG(HANDLE_BG_HIGHLIGHTED, $W161);
ADD_COLOR_CONFIG(HANDLE_NUMBER_TEXT_DISABLED, $W0611D);
ADD_COLOR_CONFIG(HANDLE_NUMBER_TEXT_NORMAL, $W0611);
ADD_IMAGE_CONFIG(HANDLE_BG_NORMAL, #00_slider_handle.png);
ADD_IMAGE_CONFIG(HANDLE_BG_PRESSED, #00_slider_handle.png);
ADD_IMAGE_CONFIG(HANDLE_BG_DISABLED, #00_slider_handle.png);
- ADD_IMAGE_CONFIG(HANDLE_BG_HIGHLIGHTED, #00_slider_handle.png);
+ ADD_IMAGE_CONFIG(HANDLE_BG_HIGHLIGHTED, #00_slider_handle_focus.png);
ADD_IMAGE_CONFIG(HANDLE_BG_EFFECT_NORMAL, #00_slider_handle_ef.png);
ADD_IMAGE_CONFIG(HANDLE_BG_EFFECT_PRESSED, #00_slider_handle_ef_press.png);
ADD_SHAPE_CONFIG(BAR_HEIGHT, 36);
ADD_SHAPE_CONFIG(BAR_LEFT_MARGIN_WITH_ICON, 26);
ADD_SHAPE_CONFIG(BAR_LEFT_MARGIN, 36);
- ADD_SHAPE_CONFIG(BAR_TOP_MARGIN, 16);
ADD_SHAPE_CONFIG(BAR_OFFSET, 9);
ADD_SHAPE_CONFIG(ICON_WIDTH, 72);
ADD_SHAPE_CONFIG(ICON_RIGHT_MARGIN, 16);
ADD_SHAPE_CONFIG(TITLE_TEXT_POSITION_X, 12);
+ ADD_SHAPE_CONFIG(TITLE_TEXT_POSITION_Y, 16);
ADD_SHAPE_CONFIG(TITLE_TEXT_SIZE, 32);
ADD_SHAPE_CONFIG(TITLE_TEXT_HEIGHT, 49);