2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiCtrl_SliderPresenter.cpp
20 * @brief This is the implementation file for the _SliderPresenter class.
23 #include <FBaseSysLog.h>
24 #include <FBaseErrorDefine.h>
25 #include <FGrp_BitmapImpl.h>
26 #include <FGrp_FontImpl.h>
27 #include <FGrp_TextTextObject.h>
28 #include <FGrp_TextTextSimple.h>
29 #include "FUi_UiTouchEvent.h"
30 #include "FUi_ResourceManager.h"
31 #include "FUiAnim_VisualElement.h"
32 #include "FUiCtrl_Slider.h"
33 #include "FUiCtrl_SliderModel.h"
34 #include "FUiCtrl_SliderOverlay.h"
35 #include "FUi_CoordinateSystemUtils.h"
36 #include "FUiCtrl_SliderPresenter.h"
38 using namespace Tizen::Graphics;
39 using namespace Tizen::Base;
40 using namespace Tizen::Ui::Animations;
41 using namespace Tizen::Graphics::_Text;
42 using namespace Tizen::Base::Runtime;
44 namespace Tizen { namespace Ui { namespace Controls
47 _SliderPresenter::_SliderPresenter(void)
49 , __pSliderModel(null)
50 , __pSliderOverlay(null)
52 , __pResourceBgTopBitmap(null)
53 , __pResourceBgMiddleBitmap(null)
54 , __pResourceBgBottomBitmap(null)
55 , __pResourceBgSingleBitmap(null)
56 , __pBgTopBitmap(null)
57 , __pBgMiddleBitmap(null)
58 , __pBgBottomBitmap(null)
59 , __pBgSingleBitmap(null)
60 , __pBgGrpStyleNoneBitmap(null)
61 , __pBgTopEffectBitmap(null)
62 , __pBgMiddleEffectBitmap(null)
63 , __pBgBottomEffectBitmap(null)
64 , __pBgSingleEffectBitmap(null)
65 , __pResourceBarBitmap(null)
66 , __pResourceBarBgBitmap(null)
67 , __pBarResourceEffectBitmap(null)
68 , __pBarBgResourceEffectBitmap(null)
69 , __pBarColorReplacementBitmap(null)
70 , __pBarBgColorReplacementBitmap(null)
71 , __pHandleNormalBitmap(null)
72 , __pHandlePressedBitmap(null)
73 , __pHandleDisabledBitmap(null)
74 , __pHandleHighlightedBitmap(null)
75 , __pHandleNormalEffectBitmap(null)
76 , __pHandlePressedEffectBitmap(null)
77 , __pHandleDisabledEffectBitmap(null)
78 , __pHandleHighlightedEffectBitmap(null)
79 , __currentBarColor(0)
80 , __currentBarBgColor(0)
83 , __pTitleTextObject(null)
86 , __prevSliderValue(0)
87 , __isSliderPressed(false)
88 , __isNeedToBeUpdated(true)
89 , __isResourceLoaded(false)
90 , __isCustomHandle(false)
91 , __isCustomPressedTextColor(false)
92 , __groupStyle(GROUP_STYLE_NONE)
95 , __isTimerRunning(false)
96 , __currentPosition(0.0f, 0.0f)
100 _SliderPresenter::~_SliderPresenter(void)
102 delete __pSliderModel;
103 __pSliderModel = null;
105 delete __pSliderOverlay;
106 __pSliderOverlay = null;
108 if (__pSlideTimer != null)
110 __pSlideTimer->Cancel();
111 delete __pSlideTimer;
112 __pSlideTimer = null;
115 delete __pResourceBgTopBitmap;
116 __pResourceBgTopBitmap = null;
118 delete __pResourceBgMiddleBitmap;
119 __pResourceBgMiddleBitmap = null;
121 delete __pResourceBgBottomBitmap;
122 __pResourceBgBottomBitmap = null;
124 delete __pResourceBgSingleBitmap;
125 __pResourceBgSingleBitmap = null;
127 delete __pBgTopBitmap;
128 __pBgTopBitmap = null;
130 delete __pBgMiddleBitmap;
131 __pBgMiddleBitmap = null;
133 delete __pBgBottomBitmap;
134 __pBgBottomBitmap = null;
136 delete __pBgSingleBitmap;
137 __pBgSingleBitmap = null;
139 delete __pBgGrpStyleNoneBitmap;
140 __pBgGrpStyleNoneBitmap = null;
142 delete __pBgTopEffectBitmap;
143 __pBgTopEffectBitmap = null;
145 delete __pBgMiddleEffectBitmap;
146 __pBgMiddleEffectBitmap = null;
148 delete __pBgBottomEffectBitmap;
149 __pBgBottomEffectBitmap = null;
151 delete __pBgSingleEffectBitmap;
152 __pBgSingleEffectBitmap = null;
154 delete __pResourceBarBitmap;
155 __pResourceBarBitmap = null;
157 delete __pResourceBarBgBitmap;
158 __pResourceBarBgBitmap = null;
160 delete __pBarResourceEffectBitmap;
161 __pBarResourceEffectBitmap = null;
163 delete __pBarBgResourceEffectBitmap;
164 __pBarBgResourceEffectBitmap = null;
166 delete __pBarColorReplacementBitmap;
167 __pBarColorReplacementBitmap = null;
169 delete __pBarBgColorReplacementBitmap;
170 __pBarBgColorReplacementBitmap = null;
172 delete __pHandleNormalBitmap;
173 __pHandleNormalBitmap = null;
175 delete __pHandlePressedBitmap;
176 __pHandlePressedBitmap = null;
178 delete __pHandleDisabledBitmap;
179 __pHandleDisabledBitmap = null;
181 delete __pHandleHighlightedBitmap;
182 __pHandleHighlightedBitmap = null;
184 delete __pHandleNormalEffectBitmap;
185 __pHandleNormalEffectBitmap = null;
187 delete __pHandlePressedEffectBitmap;
188 __pHandlePressedEffectBitmap = null;
190 delete __pHandleDisabledEffectBitmap;
191 __pHandleDisabledEffectBitmap = null;
193 delete __pHandleHighlightedEffectBitmap;
194 __pHandleHighlightedEffectBitmap = null;
196 delete __pTitleTextObject;
197 __pTitleTextObject = null;
202 _SliderPresenter::CreateInstanceN(const _Slider& slider)
204 result r = E_SUCCESS;
206 _SliderPresenter* pSliderPresenter = new (std::nothrow) _SliderPresenter;
207 SysTryReturn(NID_UI_CTRL, pSliderPresenter != null, null, E_OUT_OF_MEMORY,
208 "[E_OUT_OF_MEMORY] Memory allocation failed.");
210 pSliderPresenter->__pSlider = const_cast <_Slider*>(&slider);
211 SysTryCatch(NID_UI_CTRL, pSliderPresenter->__pSlider != null, , E_SYSTEM,
212 "[E_SYSTEM] A system error has occurred. The Slider control core is null.");
214 pSliderPresenter->__pSliderModel = new (std::nothrow) _SliderModel;
215 SysTryCatch(NID_UI_CTRL, pSliderPresenter->__pSliderModel != null, , E_OUT_OF_MEMORY,
216 "[E_OUT_OF_MEMORY] Memory allocation failed.");
218 if (pSliderPresenter->__pSlider->GetStyle() & _SLIDER_STYLE_OVERLAY)
220 pSliderPresenter->__pSliderOverlay = new (std::nothrow) _SliderOverlay;
221 SysTryCatch(NID_UI_CTRL, pSliderPresenter->__pSliderOverlay != null, , E_OUT_OF_MEMORY,
222 "[E_OUT_OF_MEMORY] Memory allocation failed.");
224 r = pSliderPresenter->__pSliderOverlay->Construct();
225 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
228 return pSliderPresenter;
231 delete pSliderPresenter;
232 pSliderPresenter = null;
238 _SliderPresenter::Resize(void)
240 result r = E_SUCCESS;
242 float barHeight = 0.0f;
243 float barLeftMargin = 0.0f;
244 float barRightMargin = 0.0f;
245 float sliderY = 0.0f;
246 float iconWidth = 0.0f;
247 float iconSideMargin = 0.0f;
249 float minimumHeight = 0.0f;
250 float minimumWidth = 0.0f;
251 float topMargin = 0.0f;
252 float iconRightMargin = 0.0f;
253 float titleHeight = 0.0f;
254 FloatRectangle titleTextBounds;
256 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
258 if (__isResourceLoaded == false)
261 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
262 __isResourceLoaded = true;
264 r = GET_SHAPE_CONFIG(SLIDER::HANDLE_ONE_DIGIT_TEXT_SIZE, orientation, __fontSize);
265 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
267 __pFont = __pSlider->GetFallbackFont();
269 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
271 r = GET_COLOR_CONFIG(SLIDER::HANDLE_NUMBER_TEXT_NORMAL, __handleTextColor);
272 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
274 r = GET_COLOR_CONFIG(SLIDER::HANDLE_NUMBER_TEXT_DISABLED, __handleTextDisabledColor);
275 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
277 __handleTextPressedColor = __handleTextColor;
278 __handleTextHighlightedColor = __handleTextColor;
282 r = GET_SHAPE_CONFIG(SLIDER::BAR_HEIGHT, orientation, barHeight);
283 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
285 r = GET_SHAPE_CONFIG(SLIDER::ICON_WIDTH, orientation, iconWidth);
286 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
288 r = GET_SHAPE_CONFIG(SLIDER::BAR_OFFSET, orientation, __barOffset);
289 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
291 if (!__isCustomHandle)
293 r = GET_SHAPE_CONFIG(SLIDER::HANDLE_OFFSET, orientation, offset);
294 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
296 r = GET_SHAPE_CONFIG(SLIDER::HANDLE_WIDTH, orientation, __handleRect.width);
297 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
299 r = GET_SHAPE_CONFIG(SLIDER::HANDLE_HEIGHT, orientation, __handleRect.height);
300 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
302 __rect = FloatRectangle(0.0f, 0.0f, __pSlider->GetBoundsF().width, __pSlider->GetBoundsF().height);
304 r = GET_SHAPE_CONFIG(SLIDER::BAR_TOP_MARGIN, orientation, topMargin);
305 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
307 r = GET_SHAPE_CONFIG(SLIDER::ICON_RIGHT_MARGIN, orientation, iconRightMargin);
308 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
310 if ((__pSlider->GetIcon(ICON_POSITION_LEFT) != null) || (__pSlider->GetIcon(ICON_POSITION_RIGHT) != null))
312 r = GET_SHAPE_CONFIG(SLIDER::MINIMUM_WIDTH_WITH_ICON, orientation, minimumWidth);
313 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
315 r = GET_SHAPE_CONFIG(SLIDER::BAR_LEFT_MARGIN_WITH_ICON, orientation, barLeftMargin);
316 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
320 r = GET_SHAPE_CONFIG(SLIDER::MINIMUM_WIDTH_WITHOUT_ICON, orientation, minimumWidth);
321 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
323 r = GET_SHAPE_CONFIG(SLIDER::BAR_LEFT_MARGIN, orientation, barLeftMargin);
324 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
327 barRightMargin = barLeftMargin;
329 if (__rect.width < minimumWidth)
331 __rect.width = minimumWidth;
334 r = GET_SHAPE_CONFIG(SLIDER::MINIMUM_HEIGHT, orientation, minimumHeight);
335 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
337 if (__pSlider->GetStyle() & _SLIDER_STYLE_TITLE_TEXT)
339 r = GET_SHAPE_CONFIG(SLIDER::TITLE_TEXT_HEIGHT, orientation, titleHeight);
340 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
342 minimumHeight = minimumHeight + titleHeight;
345 if (__rect.height < minimumHeight )
347 __rect.height = minimumHeight;
350 if (__pSlider->GetStyle() & _SLIDER_STYLE_TITLE_TEXT)
352 titleTextBounds = GetTitleTextBounds();
353 sliderY = titleTextBounds.y + titleTextBounds.height;
354 __touchRect = FloatRectangle(barLeftMargin - offset, sliderY + (__rect.height - (sliderY + __handleRect.height)) / 2.0f,
355 __rect.width - (barLeftMargin + barRightMargin) + (2.0f * offset), __handleRect.height);
359 __touchRect = FloatRectangle(barLeftMargin - offset, (__rect.height - __handleRect.height) / 2.0f,
360 (__rect.width - (barLeftMargin + barRightMargin)) + (2.0f * offset), __handleRect.height);
363 if (__pSlider->GetIcon(ICON_POSITION_LEFT) != null)
365 __touchRect.x = __touchRect.x + iconWidth + iconRightMargin;
366 __touchRect.width = __touchRect.width - (iconWidth + iconRightMargin);
369 if (__pSlider->GetIcon(ICON_POSITION_RIGHT) != null)
371 __touchRect.width = __touchRect.width - (iconWidth + iconSideMargin + iconRightMargin);
374 __barBgRect = FloatRectangle(__touchRect.x + offset, __touchRect.y +
375 ((__handleRect.height - barHeight) / 2.0f), __touchRect.width - (2.0f * offset), barHeight);
377 Rectangle absBounds = __pSlider->GetAbsoluteBounds();
378 FloatRectangle absBoundsFloat(absBounds.x, absBounds.y, absBounds.width, absBounds.height);
379 __pSliderOverlay->SetSliderRect(absBoundsFloat, __touchRect);
385 _SliderPresenter::LoadBitmap(void)
387 result r = E_SUCCESS;
390 Bitmap* pBitmap = null;
391 Bitmap* pNormalBitmap = null;
392 Bitmap* pPressedBitmap = null;
393 Bitmap* pDisabledBitmap = null;
394 Bitmap* pHighlightedBitmap = null;
395 Bitmap* pReplacementBitmap = null;
396 Color handleNormalColor;
397 Color handlePressedColor;
398 Color handleDisabledColor;
399 Color handleHighlightedColor;
401 r = GET_COLOR_CONFIG(SLIDER::BG_OTHERS_NORMAL, __currentBgColor);
402 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
404 r = GET_COLOR_CONFIG(SLIDER::BG_DEFAULT_NORMAL, __currentGrpStyleNoneColor);
405 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
407 r = GET_COLOR_CONFIG(SLIDER::BAR_NORMAL, __currentBarColor);
408 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
410 r = GET_COLOR_CONFIG(SLIDER::BAR_BG_NORMAL, __currentBarBgColor);
411 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
413 r = GET_COLOR_CONFIG(SLIDER::HANDLE_BG_NORMAL, handleNormalColor);
414 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
416 r = GET_COLOR_CONFIG(SLIDER::HANDLE_BG_PRESSED, handlePressedColor);
417 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
419 r = GET_COLOR_CONFIG(SLIDER::HANDLE_BG_DISABLED, handleDisabledColor);
420 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
422 r = GET_COLOR_CONFIG(SLIDER::HANDLE_BG_HIGHLIGHTED, handleHighlightedColor);
423 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
425 // for GROUP_STYLE_TOP
426 r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_TOP_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBgTopBitmap);
427 SysTryReturnResult(NID_UI_CTRL, (r == E_SUCCESS), r, "Propagating.");
429 __pBgTopBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgTopBitmap,Color::GetColor(COLOR_ID_MAGENTA), __currentBgColor);
431 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
433 r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_TOP_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgTopEffectBitmap);
434 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
437 // for GROUP_STYLE_MIDDLE
438 r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_MIDDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBgMiddleBitmap);
439 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
441 __pBgMiddleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgMiddleBitmap,Color::GetColor(COLOR_ID_MAGENTA), __currentBgColor);
443 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
445 r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_MIDDLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgMiddleEffectBitmap);
446 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
449 // for GROUP_STYLE_BOTTOM
450 r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_BOTTOM_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBgBottomBitmap);
451 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
453 __pBgBottomBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgBottomBitmap,Color::GetColor(COLOR_ID_MAGENTA), __currentBgColor);
455 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
457 r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_BOTTOM_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgBottomEffectBitmap);
458 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
460 // for GROUP_STYLE_SINGLE and GROUP_STYLE_NONE
461 r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_SINGLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBgSingleBitmap);
462 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
464 __pBgSingleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgSingleBitmap, Color::GetColor(COLOR_ID_MAGENTA), __currentBgColor);
466 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
468 __pBgGrpStyleNoneBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgSingleBitmap, Color::GetColor(COLOR_ID_MAGENTA), __currentGrpStyleNoneColor);
470 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
473 r = GET_BITMAP_CONFIG_N(PANEL::GROUPED_SINGLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pBgSingleEffectBitmap);
474 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
476 opacity = __currentBgColor.GetAlpha();
478 __pBgTopBitmap->SetAlphaConstant(opacity);
479 __pBgMiddleBitmap->SetAlphaConstant(opacity);
480 __pBgBottomBitmap->SetAlphaConstant(opacity);
481 __pBgSingleBitmap->SetAlphaConstant(opacity);
482 __pBgGrpStyleNoneBitmap->SetAlphaConstant(__currentGrpStyleNoneColor.GetAlpha());
485 __pBgTopEffectBitmap->SetAlphaConstant(opacity);
486 __pBgMiddleEffectBitmap->SetAlphaConstant(opacity);
487 __pBgBottomEffectBitmap->SetAlphaConstant(opacity);
488 __pBgSingleEffectBitmap->SetAlphaConstant(opacity);
492 r = GET_BITMAP_CONFIG_N(SLIDER::BAR_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBarBgBitmap);
493 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
495 __pBarBgColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBarBgBitmap,Color::GetColor(COLOR_ID_MAGENTA), __currentBarBgColor);
497 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
499 r = GET_BITMAP_CONFIG_N(SLIDER::BAR_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pResourceBarBitmap);
500 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
502 __pBarColorReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBarBitmap,Color::GetColor(COLOR_ID_MAGENTA), __currentBarColor);
504 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
506 r = GET_BITMAP_CONFIG_N(SLIDER::BAR_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pBarBgResourceEffectBitmap);
507 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
509 r = GET_BITMAP_CONFIG_N(SLIDER::BAR_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pBarResourceEffectBitmap);
510 SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
512 opacity = __currentBarColor.GetAlpha();
513 __pBarColorReplacementBitmap->SetAlphaConstant(opacity);
516 r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pNormalBitmap);
517 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
519 if (__pHandleNormalBitmap == null)
521 pReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), handleNormalColor);
523 SysTryCatch(NID_UI_CTRL, (pReplacementBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r));
525 __pHandleNormalBitmap = pReplacementBitmap;
528 r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pPressedBitmap);
529 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
531 if (__pHandlePressedBitmap == null)
533 pReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), handlePressedColor);
535 SysTryCatch(NID_UI_CTRL, (pReplacementBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r));
537 __pHandlePressedBitmap = pReplacementBitmap;
540 r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pDisabledBitmap);
541 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
543 if (__pHandleDisabledBitmap == null)
545 pReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDisabledBitmap, Color::GetColor(COLOR_ID_MAGENTA), handleDisabledColor);
547 SysTryCatch(NID_UI_CTRL, (pReplacementBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r));
549 __pHandleDisabledBitmap = pReplacementBitmap;
552 r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pHighlightedBitmap);
553 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
555 if (__pHandleHighlightedBitmap == null)
557 pReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA), handleHighlightedColor);
559 SysTryCatch(NID_UI_CTRL, (pReplacementBitmap != null), , r, "[%s] Propagating.", GetErrorMessage(r));
561 __pHandleHighlightedBitmap = pReplacementBitmap;
564 if (__pHandleNormalEffectBitmap == null)
566 r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_EFFECT_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
567 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
569 __pHandleNormalEffectBitmap = pBitmap;
572 if (__pHandlePressedEffectBitmap == null)
574 r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_EFFECT_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
575 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
577 __pHandlePressedEffectBitmap = pBitmap;
580 if (__pHandleDisabledEffectBitmap == null)
582 r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_EFFECT_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
583 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
585 __pHandleDisabledEffectBitmap = pBitmap;
588 if (__pHandleHighlightedEffectBitmap == null)
590 r = GET_BITMAP_CONFIG_N(SLIDER::HANDLE_BG_EFFECT_HIGHLIGHTED, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
591 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
593 __pHandleHighlightedEffectBitmap = pBitmap;
596 delete pNormalBitmap;
597 delete pPressedBitmap;
598 delete pDisabledBitmap;
599 delete pHighlightedBitmap;
605 delete pNormalBitmap;
606 delete pPressedBitmap;
607 delete pDisabledBitmap;
608 delete pHighlightedBitmap;
612 delete __pResourceBgTopBitmap;
613 __pResourceBgTopBitmap = null;
615 delete __pResourceBgMiddleBitmap;
616 __pResourceBgMiddleBitmap = null;
618 delete __pResourceBgBottomBitmap;
619 __pResourceBgBottomBitmap = null;
621 delete __pResourceBgSingleBitmap;
622 __pResourceBgSingleBitmap = null;
624 delete __pBgTopBitmap;
625 __pBgTopBitmap = null;
627 delete __pBgMiddleBitmap;
628 __pBgMiddleBitmap = null;
630 delete __pBgBottomBitmap;
631 __pBgBottomBitmap = null;
633 delete __pBgSingleBitmap;
634 __pBgSingleBitmap = null;
636 delete __pBgGrpStyleNoneBitmap;
637 __pBgGrpStyleNoneBitmap = null;
639 delete __pBgTopEffectBitmap;
640 __pBgTopEffectBitmap = null;
642 delete __pBgMiddleEffectBitmap;
643 __pBgMiddleEffectBitmap = null;
645 delete __pBgBottomEffectBitmap;
646 __pBgBottomEffectBitmap = null;
648 delete __pBgSingleEffectBitmap;
649 __pBgSingleEffectBitmap = null;
651 delete __pResourceBarBitmap;
652 __pResourceBarBitmap = null;
654 delete __pResourceBarBgBitmap;
655 __pResourceBarBgBitmap = null;
657 delete __pBarResourceEffectBitmap;
658 __pBarResourceEffectBitmap = null;
660 delete __pBarBgResourceEffectBitmap;
661 __pBarBgResourceEffectBitmap = null;
663 delete __pBarColorReplacementBitmap;
664 __pBarColorReplacementBitmap = null;
666 delete __pBarBgColorReplacementBitmap;
667 __pBarBgColorReplacementBitmap = null;
669 delete __pHandleNormalBitmap;
670 __pHandleNormalBitmap = null;
672 delete __pHandlePressedBitmap;
673 __pHandlePressedBitmap = null;
675 delete __pHandleDisabledBitmap;
676 __pHandleDisabledBitmap = null;
678 delete __pHandleHighlightedBitmap;
679 __pHandleHighlightedBitmap = null;
681 delete __pHandleNormalEffectBitmap;
682 __pHandleNormalEffectBitmap = null;
684 delete __pHandlePressedEffectBitmap;
685 __pHandlePressedEffectBitmap = null;
687 delete __pHandleDisabledEffectBitmap;
688 __pHandleDisabledEffectBitmap = null;
690 delete __pHandleHighlightedEffectBitmap;
691 __pHandleHighlightedEffectBitmap = null;
697 _SliderPresenter::CalculateSliderValue(float positionX, float offsetX)
699 int minValue = __pSliderModel->GetMinValue();
700 int maxValue = __pSliderModel->GetMaxValue();
702 if (positionX <= __touchRect.x + offsetX)
709 if (positionX >= (__touchRect.x + __touchRect.width) - offsetX)
711 __sliderX = __barBgRect.width - __handleRect.width - (2.0f * __barOffset);
712 __handleX = __touchRect.width - __handleRect.width;
716 if ((maxValue - minValue) == 0)
721 __sliderX = positionX - (__barBgRect.x + offsetX) - (2.0f * __barOffset);
722 __handleX = positionX - (__touchRect.x + offsetX);
724 __handleRect.x = __touchRect.x + __handleX;
725 __handleRect.y = __touchRect.y;
727 if (__handleRect.x < __touchRect.x )
729 __handleRect.x = __touchRect.x;
732 if (__handleRect.x + __handleRect.width > __touchRect.x + __touchRect.width )
734 __handleRect.x = __touchRect.x + __touchRect.width - __handleRect.width;
737 return minValue + (int) ((float) (__handleX * (maxValue - minValue)) / (float)(__touchRect.width - __handleRect.width) + 0.5); // current value = current width * range / bar bg width
741 _SliderPresenter::Draw(void)
743 if (__isNeedToBeUpdated == true)
746 __isNeedToBeUpdated = false;
753 _SliderPresenter::DrawSlider(void)
755 result r = E_SUCCESS;
756 float sliderY = 0.0f;
757 FloatRectangle titleTextBounds;
759 int style = __pSlider->GetStyle();
761 Canvas* pCanvas = __pSlider->GetCanvasN();
762 SysTryReturn(NID_UI_CTRL, pCanvas != null, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] System error occurred.");
764 r = DrawBackground(*pCanvas);
765 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
767 if (style & _SLIDER_STYLE_TITLE_TEXT)
769 titleTextBounds = GetTitleTextBounds();
770 sliderY = titleTextBounds.y + titleTextBounds.height;
773 if(sliderY < __rect.height)
775 r = DrawSliderBar(*pCanvas);
776 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
778 if (__isSliderPressed == true)
780 if (style & _SLIDER_STYLE_OVERLAY)
782 r = DrawSliderOverlay(__pSliderModel->GetValue());
783 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
787 r = DrawSliderBarNumber(__pSliderModel->GetValue());
788 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
793 r = DrawSliderBarNumber(__pSliderModel->GetValue());
794 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
798 if (style & _SLIDER_STYLE_TITLE_TEXT)
800 r = DrawTitleText(*pCanvas);
801 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
804 r = DrawIcon(*pCanvas);
805 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
820 _SliderPresenter::DrawBackground(Canvas& canvas)
822 Bitmap* pBgBitmap = null;
823 Bitmap* pBgEffectBitmap = null;
824 Bitmap* pBgGroupBitmap = null;
827 result r = E_SUCCESS;
828 canvas.SetBackgroundColor(Color(0x00000000));
831 if (!(__pSlider->GetStyle() & _SLIDER_STYLE_NO_BG))
833 switch (__groupStyle)
835 case GROUP_STYLE_TOP:
836 pBgEffectBitmap = __pBgTopEffectBitmap;
837 if (__pSlider->GetColor() == __currentBgColor)
839 pBgBitmap = __pBgTopBitmap;
843 pBgGroupBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgTopBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pSlider->GetColor());
847 SysLog(NID_UI_CTRL, "[%s] Propagating.", GetErrorMessage(r));
852 delete __pBgTopBitmap;
853 __pBgTopBitmap = null;
854 __pBgTopBitmap = pBgGroupBitmap;
856 pBgBitmap = pBgGroupBitmap;
857 opacity = __pSlider->GetColor().GetAlpha();
858 pBgBitmap->SetAlphaConstant(opacity);
859 __currentBgColor = __pSlider->GetColor();
864 case GROUP_STYLE_MIDDLE:
865 pBgEffectBitmap = __pBgMiddleEffectBitmap;
866 if (__pSlider->GetColor() == __currentBgColor)
868 pBgBitmap = __pBgMiddleBitmap;
872 pBgGroupBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgMiddleBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pSlider->GetColor());
876 SysLog(NID_UI_CTRL, "[%s] Propagating.", GetErrorMessage(r));
881 delete __pBgMiddleBitmap;
882 __pBgMiddleBitmap = null;
883 __pBgMiddleBitmap = pBgGroupBitmap;
885 pBgBitmap = __pBgMiddleBitmap;
886 opacity = __pSlider->GetColor().GetAlpha();
887 pBgBitmap->SetAlphaConstant(opacity);
888 __currentBgColor = __pSlider->GetColor();
893 case GROUP_STYLE_BOTTOM:
894 pBgEffectBitmap = __pBgBottomEffectBitmap;
895 if (__pSlider->GetColor() == __currentBgColor)
897 pBgBitmap = __pBgBottomBitmap;
901 pBgGroupBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgBottomBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pSlider->GetColor());
905 SysLog(NID_UI_CTRL, "[%s] Propagating.", GetErrorMessage(r));
910 delete __pBgBottomBitmap;
911 __pBgBottomBitmap = null;
912 __pBgBottomBitmap = pBgGroupBitmap;
914 pBgBitmap = __pBgBottomBitmap;
915 opacity = __pSlider->GetColor().GetAlpha();
916 pBgBitmap->SetAlphaConstant(opacity);
917 __currentBgColor = __pSlider->GetColor();
922 case GROUP_STYLE_SINGLE:
923 pBgEffectBitmap = __pBgSingleEffectBitmap;
924 if (__pSlider->GetColor() == __currentBgColor)
926 pBgBitmap = __pBgSingleBitmap;
930 pBgGroupBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgSingleBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pSlider->GetColor());
934 SysLog(NID_UI_CTRL, "[%s] Propagating.", GetErrorMessage(r));
940 delete __pBgSingleBitmap;
941 __pBgSingleBitmap = null;
942 __pBgSingleBitmap = pBgGroupBitmap;
944 pBgBitmap = __pBgSingleBitmap;
945 opacity = __pSlider->GetColor().GetAlpha();
946 pBgBitmap->SetAlphaConstant(opacity);
947 __currentBgColor = __pSlider->GetColor();
952 case GROUP_STYLE_NONE:
955 if (__pSlider->GetColor() == __currentBgColor)
957 pBgBitmap = __pBgGrpStyleNoneBitmap;
961 pBgGroupBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBgSingleBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pSlider->GetColor());
965 SysLog(NID_UI_CTRL, "[%s] Propagating.", GetErrorMessage(r));
970 delete __pBgGrpStyleNoneBitmap;
971 __pBgGrpStyleNoneBitmap = null;
972 __pBgGrpStyleNoneBitmap = pBgGroupBitmap;
974 pBgBitmap = __pBgGrpStyleNoneBitmap;
975 opacity = __pSlider->GetColor().GetAlpha();
976 pBgBitmap->SetAlphaConstant(opacity);
977 __currentBgColor = __pSlider->GetColor();
983 DrawBitmap(canvas, __rect, pBgBitmap);
984 if ( __groupStyle != GROUP_STYLE_NONE)
986 DrawBitmap(canvas, __rect, pBgEffectBitmap);
993 _SliderPresenter::OnChangeLayout(_ControlOrientation orientation)
995 int minValue = __pSliderModel->GetMinValue();
996 int maxValue = __pSliderModel->GetMaxValue();
998 if ( __isSliderPressed == true)
1000 __sliderX = ((__barBgRect.width - ( __handleRect.width + (2.0f * __barOffset))) * (__pSliderModel->GetValue() - minValue)) / (maxValue - minValue);
1001 __handleX = ((__touchRect.width - __handleRect.width) * (__pSliderModel->GetValue() - minValue)) / (maxValue - minValue);
1002 __pSlider->Invalidate();
1010 _SliderPresenter::DrawSliderBar(Canvas& canvas)
1012 result r = E_SUCCESS;
1013 float bitmapHeight = 0.0f;
1014 float bitmapWidth = 0.0f;
1015 float bitmapPositionX = 0.0f;
1016 float bitmapPositionY = 0.0f;
1018 float offset = 0.0f;
1019 Bitmap* pReplacementBitmap = null;
1020 Bitmap* pHandleBitmap = null;
1021 Bitmap* pHandleEffectBitmap = null;
1022 bool isCustomHandleBitmap = false;
1023 bool isCustomBarBitmap = false;
1025 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
1027 r = GET_SHAPE_CONFIG(SLIDER::HANDLE_OFFSET, orientation, offset);
1028 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1030 if (__pSlider->IsEnabled() == false) // disabled
1032 pHandleBitmap = __pHandleDisabledBitmap;
1033 pHandleEffectBitmap = __pHandleDisabledEffectBitmap;
1034 isCustomHandleBitmap = IS_CUSTOM_BITMAP(SLIDER::HANDLE_BG_DISABLED);
1035 if(__isSliderPressed == true)
1037 __isSliderPressed = false;
1038 if (__pSlider->GetStyle() & _SLIDER_STYLE_OVERLAY)
1040 __pSliderOverlay->Close();
1044 else if (__isSliderPressed == true) // pressed
1046 pHandleBitmap = __pHandlePressedBitmap;
1047 pHandleEffectBitmap = __pHandlePressedEffectBitmap;
1048 isCustomHandleBitmap = IS_CUSTOM_BITMAP(SLIDER::HANDLE_BG_PRESSED);
1050 else if (__pSlider->IsFocused() == true)
1052 pHandleBitmap = __pHandleHighlightedBitmap;
1053 pHandleEffectBitmap = __pHandleHighlightedEffectBitmap;
1054 isCustomHandleBitmap = IS_CUSTOM_BITMAP(SLIDER::HANDLE_BG_HIGHLIGHTED);
1056 else //(__isSliderPressed == false) // normal state
1058 pHandleBitmap = __pHandleNormalBitmap;
1059 pHandleEffectBitmap = __pHandleNormalEffectBitmap;
1060 isCustomHandleBitmap = IS_CUSTOM_BITMAP(SLIDER::HANDLE_BG_NORMAL);
1063 int minValue = __pSliderModel->GetMinValue();
1064 int maxValue = __pSliderModel->GetMaxValue();
1066 __barRect = FloatRectangle(__barBgRect.x + __barOffset, __barBgRect.y, __sliderX, __barBgRect.height);
1068 if (__isSliderPressed == false && (maxValue - minValue) != 0)
1070 __barRect.width = ((__barBgRect.width - ( __handleRect.width + (2.0f * __barOffset))) * (__pSliderModel->GetValue() - minValue)) / (maxValue - minValue);
1071 __handleX = ((__touchRect.width - __handleRect.width) * (__pSliderModel->GetValue() - minValue)) / (maxValue - minValue);
1074 if (__pSlider->GetBarBackgroundColor() != __currentBarBgColor)
1076 pReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBarBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pSlider->GetBarBackgroundColor());
1077 r = GetLastResult();
1078 SysTryReturn(NID_UI_CTRL, (pReplacementBitmap != null), r, r, "[%s] Propagating.", GetErrorMessage(r));
1080 delete __pBarBgColorReplacementBitmap;
1081 __pBarBgColorReplacementBitmap = null;
1083 __pBarBgColorReplacementBitmap = pReplacementBitmap;
1084 __currentBarBgColor = __pSlider->GetBarBackgroundColor();
1087 if (__pSlider->GetBarColor() != __currentBarColor)
1089 pReplacementBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pResourceBarBitmap, Color::GetColor(COLOR_ID_MAGENTA), __pSlider->GetBarColor());
1090 r = GetLastResult();
1091 SysTryReturn(NID_UI_CTRL, (pReplacementBitmap != null), r, r, "[%s] Propagating.", GetErrorMessage(r));
1093 delete __pBarColorReplacementBitmap;
1094 __pBarColorReplacementBitmap = null;
1096 __pBarColorReplacementBitmap = pReplacementBitmap;
1097 __currentBarColor = __pSlider->GetBarColor();
1100 // Redrawing twice is required because, when slider is disabled we are applying alpha channel to the bar
1101 // which will show the previously drawn portion.
1103 if (__pSlider->IsEnabled() == false) // disabled
1105 __pBarBgColorReplacementBitmap->SetAlphaConstant(0xFF);
1106 DrawBitmap(canvas, __barBgRect, __pBarBgColorReplacementBitmap);
1108 __pBarColorReplacementBitmap->SetAlphaConstant(0x4C);
1112 opacity = __pSlider->GetBarColor().GetAlpha();
1113 __pBarColorReplacementBitmap->SetAlphaConstant(opacity);
1116 isCustomBarBitmap = IS_CUSTOM_BITMAP(SLIDER::BAR_BG_NORMAL);
1117 DrawBitmap(canvas, __barBgRect, __pBarBgColorReplacementBitmap);
1118 if (isCustomBarBitmap == false)
1120 DrawBitmap(canvas, __barBgRect, __pBarBgResourceEffectBitmap);
1123 isCustomBarBitmap = IS_CUSTOM_BITMAP(SLIDER::BAR_NORMAL);
1124 DrawBitmap(canvas, FloatRectangle(__barRect.x, __barRect.y, (__barRect.width + __handleRect.width / 2), __barRect.height), __pBarColorReplacementBitmap);
1125 if (isCustomBarBitmap == false)
1127 DrawBitmap(canvas, FloatRectangle(__barRect.x, __barRect.y, (__barRect.width + __handleRect.width / 2), __barRect.height), __pBarResourceEffectBitmap);
1130 __handleRect.x = __touchRect.x + __handleX;
1131 __handleRect.y = __touchRect.y;
1133 if (__handleRect.x < __touchRect.x )
1135 __handleRect.x = __touchRect.x;
1138 if (__handleRect.x + __handleRect.width > __touchRect.x + __touchRect.width )
1140 __handleRect.x = __touchRect.x + __touchRect.width - __handleRect.width;
1143 Canvas* pHandleCanvas = __pSlider->GetHandleCanvasN();
1144 r = GetLastResult();
1145 SysTryReturn(NID_UI_CTRL, pHandleCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
1147 pHandleCanvas->SetBackgroundColor(0x00000000);
1148 pHandleCanvas->Clear();
1150 if (pHandleEffectBitmap != null) // drawing the default bitmap
1152 r = DrawBitmap(*pHandleCanvas, FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), pHandleBitmap);
1153 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1154 if (isCustomHandleBitmap == false)
1156 r = DrawBitmap(*pHandleCanvas, FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), pHandleEffectBitmap);
1157 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1162 bitmapWidth = pHandleBitmap->GetWidth();
1163 bitmapHeight = pHandleBitmap->GetHeight();
1165 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pHandleBitmap) == false)
1167 // to clip the center portion of the larger bitmap.
1168 if( bitmapWidth > __handleRect.width )
1170 bitmapPositionX = (bitmapWidth / 2.0f) - (__handleRect.width / 2.0f);
1171 bitmapWidth = __handleRect.width;
1174 if( bitmapHeight > __handleRect.height )
1176 bitmapPositionY = (bitmapHeight / 2.0f) - (__handleRect.height / 2.0f);
1177 bitmapHeight = __handleRect.height;
1180 r = pHandleCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), *pHandleBitmap, FloatRectangle(bitmapPositionX, bitmapPositionY, bitmapWidth, bitmapHeight));
1184 r = pHandleCanvas->DrawNinePatchedBitmap(FloatRectangle(0.0f, 0.0f, __handleRect.width, __handleRect.height), *pHandleBitmap);
1186 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
1189 r = __pSlider->UpdateHandle(__handleRect);
1192 SysLogException(NID_UI_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
1195 delete pHandleCanvas;
1196 pHandleCanvas = null;
1201 delete pHandleCanvas;
1202 pHandleCanvas = null;
1208 _SliderPresenter::DrawSliderBarNumber(int value)
1210 result r = E_SUCCESS;
1211 int handleNumberSize = 0;
1214 int valueLength = 0;
1215 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
1217 if (__pSlider->IsEnabled() == false) // disabled
1219 textColor = __handleTextDisabledColor;
1221 else if (__pSlider->IsFocused() == true)
1223 textColor = __handleTextHighlightedColor;
1225 else if ((__isSliderPressed == true) && !(__pSlider->GetStyle() & _SLIDER_STYLE_OVERLAY))
1227 if(!__isCustomPressedTextColor)
1229 r = GET_COLOR_CONFIG(SLIDER::OVERLAY_TEXT_NORMAL, __handleTextPressedColor);
1230 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1232 textColor = __handleTextPressedColor;
1236 textColor = __handleTextColor;
1239 FloatDimension textDim(0.0f, 0.0f);
1241 valueLength = text.GetLength();
1243 if (valueLength == SLIDER_HANDLE_THREE_DIGIT)
1245 r = GET_SHAPE_CONFIG(SLIDER::HANDLE_THREE_DIGIT_TEXT_SIZE, orientation, handleNumberSize);
1246 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1248 else if (valueLength == SLIDER_HANDLE_TWO_DIGIT)
1250 r = GET_SHAPE_CONFIG(SLIDER::HANDLE_TWO_DIGIT_TEXT_SIZE, orientation, handleNumberSize);
1251 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1255 r = GET_SHAPE_CONFIG(SLIDER::HANDLE_ONE_DIGIT_TEXT_SIZE, orientation, handleNumberSize);
1256 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1259 (_FontImpl::GetInstance(*__pFont))->SetSize(handleNumberSize);
1261 Canvas* pHandleCanvas = __pSlider->GetHandleCanvasN();
1262 r = GetLastResult();
1263 SysTryReturn(NID_UI_CTRL, pHandleCanvas != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
1265 pHandleCanvas->SetFont(*__pFont);
1266 __pFont->GetTextExtent(text, valueLength, textDim);
1268 FloatPoint textPoint;
1269 textPoint.x = (__handleRect.width - textDim.width) / 2.0f;
1270 textPoint.y = (__handleRect.height - textDim.height) / 2.0f;
1272 pHandleCanvas->SetForegroundColor(textColor);
1273 pHandleCanvas->DrawText(textPoint, text);
1275 delete pHandleCanvas;
1276 pHandleCanvas = null;
1282 _SliderPresenter::DrawTitleText(Canvas& canvas)
1284 result r = E_SUCCESS;
1286 TextSimple* pSimpleTitleText = null;
1287 int titleTextSize = 0;
1288 int titleLength = 0;
1289 FloatRectangle titleTextBounds;
1290 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
1292 titleLength = __pSlider->GetTitleText().GetLength();
1293 SysTryReturn(NID_UI_CTRL, titleLength != 0, E_SUCCESS, E_SUCCESS, "Title text is empty");
1295 r = GET_SHAPE_CONFIG(SLIDER::TITLE_TEXT_SIZE, orientation, titleTextSize);
1296 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1298 (_FontImpl::GetInstance(*__pFont))->SetSize(titleTextSize);
1300 titleTextBounds = GetTitleTextBounds();
1302 if (__pTitleTextObject == null)
1304 __pTitleTextObject = new (std::nothrow) TextObject();
1305 SysTryReturn(NID_UI_CTRL, __pTitleTextObject != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
1306 __pTitleTextObject->Construct();
1309 pSimpleTitleText = new (std::nothrow) TextSimple(const_cast<wchar_t*>(__pSlider->GetTitleText().GetPointer()), __pSlider->GetTitleText().GetLength());
1311 __pTitleTextObject->RemoveAll();
1312 __pTitleTextObject->AppendElement(*pSimpleTitleText);
1313 __pTitleTextObject->SetForegroundColor(__pSlider->GetTitleTextColor(), 0, __pTitleTextObject->GetTextLength());
1314 __pTitleTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
1315 __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
1316 __pTitleTextObject->SetBounds(GetTitleTextBounds());
1317 __pTitleTextObject->Compose();
1319 __pTitleTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_MIDDLE);
1320 __pTitleTextObject->SetFont(__pFont, 0, __pTitleTextObject->GetTextLength());
1321 __pTitleTextObject->Draw(*_CanvasImpl::GetInstance(canvas));
1327 _SliderPresenter::DrawIcon(Canvas& canvas)
1329 result r = E_SUCCESS;
1331 Bitmap* pLeftBitmap = __pSlider->GetIcon(ICON_POSITION_LEFT);
1332 Bitmap* pRightBitmap = __pSlider->GetIcon(ICON_POSITION_RIGHT);
1334 if (pLeftBitmap != null)
1336 r = DrawBitmap(canvas, GetIconBounds(ICON_POSITION_LEFT), pLeftBitmap);
1337 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1340 if (pRightBitmap != null)
1342 r = DrawBitmap(canvas, GetIconBounds(ICON_POSITION_RIGHT), pRightBitmap);
1343 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1350 _SliderPresenter::DrawSliderOverlay(int value)
1352 result r = E_SUCCESS;
1354 Rectangle absBounds = __pSlider->GetAbsoluteBounds();
1355 FloatRectangle absBoundsFloat(absBounds.x, absBounds.y, absBounds.width, absBounds.height);
1356 r = __pSliderOverlay->SetSliderRect(absBoundsFloat, __touchRect);
1357 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1359 r = __pSliderOverlay->DrawSliderOverlay(__touchRect.x + __handleX, __handleRect.width, value);
1360 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
1366 _SliderPresenter::DrawBitmap(Canvas& canvas, const FloatRectangle& bounds, Bitmap* pBitmap)
1368 result r = E_SUCCESS;
1370 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pBitmap))
1372 r = canvas.DrawNinePatchedBitmap(bounds, *pBitmap);
1373 SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
1377 r = canvas.DrawBitmap(bounds, *pBitmap);
1378 SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
1384 _SliderPresenter::GetTitleTextBounds(void) const
1386 FloatRectangle titleTextBounds;
1387 float topMargin = 0.0f;
1389 result r = E_SUCCESS;
1390 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
1392 r = GET_SHAPE_CONFIG(SLIDER::TITLE_TEXT_POSITION_X, orientation, titleTextBounds.x);
1393 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r));
1395 r = GET_SHAPE_CONFIG(SLIDER::BAR_TOP_MARGIN, orientation, topMargin);
1396 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r));
1398 titleTextBounds.y = topMargin;
1400 r = GET_SHAPE_CONFIG(SLIDER::TITLE_TEXT_HEIGHT, orientation, titleTextBounds.height);
1401 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r));
1403 titleTextBounds.width = __pSlider->GetBoundsF().width - titleTextBounds.x;
1405 return titleTextBounds;
1409 _SliderPresenter::GetTouchBounds(void) const
1415 _SliderPresenter::GetIconBounds(IconPosition iconPosition) const
1417 result r = E_SUCCESS;
1419 FloatRectangle iconBounds;
1420 float iconSideMargin = 0.0f;
1421 float barHeight = 0.0f;
1423 _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
1425 r = GET_SHAPE_CONFIG(SLIDER::ICON_WIDTH, orientation, iconBounds.width);
1426 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r));
1428 r = GET_SHAPE_CONFIG(SLIDER::ICON_HEIGHT, orientation, iconBounds.height);
1429 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r));
1431 r = GET_SHAPE_CONFIG(SLIDER::ICON_LEFT_MARGIN, orientation, iconSideMargin);
1432 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r));
1434 r = GET_SHAPE_CONFIG(SLIDER::BAR_HEIGHT, orientation, barHeight);;
1435 SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, FloatRectangle(), r, "[%s] Propagating.", GetErrorMessage(r));
1437 iconBounds.y = __barBgRect.y + ((barHeight - iconBounds.height) / 2);
1439 if (iconPosition == ICON_POSITION_LEFT)
1441 iconBounds.x = iconSideMargin;
1445 iconBounds.x = __rect.width - (iconSideMargin + iconBounds.width);
1452 _SliderPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
1454 if (__pSlider != &source)
1459 if (__pSlideTimer == null)
1461 __pSlideTimer = new (std::nothrow) Timer;
1462 SysTryReturn(NID_UI_CTRL, __pSlideTimer != null, true, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
1464 result r = __pSlideTimer->Construct(*this);
1467 delete __pSlideTimer;
1468 __pSlideTimer = null;
1474 FloatPoint point = touchinfo.GetCurrentPosition();
1476 if (__handleRect.Contains(point) == true)
1478 __isSliderPressed = true;
1480 int candidateValue = CalculateSliderValue(point.x, point.x - __handleRect.x);
1481 __prevSliderValue = candidateValue;
1483 __pSliderModel->SetValue(candidateValue);
1484 __pSlider->SetAccessibilityElementValue();
1486 if (__pSlider->GetStyle() & _SLIDER_STYLE_OVERLAY)
1488 __pSliderOverlay->Open(false);
1491 __pSlider->Invalidate();
1494 return __isSliderPressed;
1498 _SliderPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
1500 if (__pSlider != &source)
1505 if (__pSlideTimer != null)
1507 __isTimerRunning = false;
1508 __pSlideTimer->Cancel();
1511 FloatPoint point = touchinfo.GetCurrentPosition();
1513 Canvas* pCanvas = __pSlider->GetCanvasN();
1514 SysTryReturn(NID_UI_CTRL, pCanvas != null, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get the canvas.");
1516 if (point.x >= (pCanvas->GetBoundsF().x + pCanvas->GetBoundsF().width))
1518 point.x = pCanvas->GetBoundsF().x + pCanvas->GetBoundsF().width;
1521 if (__isSliderPressed == true)
1523 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
1524 __isSliderPressed = false;
1526 int candidateValue = CalculateSliderValue(point.x, point.x - __handleRect.x);
1528 __pSliderModel->SetValue(candidateValue);
1529 __pSlider->SetAccessibilityElementValue();
1530 __pSlider->Invalidate();
1532 if (__pSlider->GetStyle() & _SLIDER_STYLE_OVERLAY)
1534 __pSliderOverlay->Close();
1537 // Slider Event Fire is required if some handle value changes not fired sldier event because of timer call back.
1538 if (__prevSliderValue != candidateValue)
1540 _SliderEvent* pSliderEvent = dynamic_cast <_SliderEvent*>(__pSlider->GetSliderEvent());
1541 if (pSliderEvent != null)
1543 IEventArg* pEventArg = _SliderEvent::CreateSliderEventArgN(candidateValue);
1545 result r = GetLastResult();
1546 SysTryReturn(NID_UI_CTRL, pEventArg != null, true, r, "[%s] Propagating.", GetErrorMessage(r));
1548 pSliderEvent->Fire(*pEventArg);
1552 // Adjustment Event Fire
1553 _AdjustmentEvent* pAdjustmentEvent = dynamic_cast <_AdjustmentEvent*>(__pSlider->GetAdjustmentEvent());
1554 if (pAdjustmentEvent != null)
1556 IEventArg* pEventArg = _AdjustmentEvent::CreateAdjustmentEventArgN(candidateValue);
1557 result r = GetLastResult();
1558 SysTryReturn(NID_UI_CTRL, pEventArg != null, true, r, "[%s] Propagating.", GetErrorMessage(r));
1560 pAdjustmentEvent->Fire(*pEventArg);
1569 _SliderPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
1571 if (__pSlider != &source)
1576 if (__isSliderPressed == false)
1581 FloatPoint point = touchinfo.GetCurrentPosition();
1583 Canvas* pCanvas = __pSlider->GetCanvasN();
1584 SysTryReturn(NID_UI_CTRL, pCanvas != null, true, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get the canvas.");
1586 if (point.x >= (pCanvas->GetBoundsF().x + pCanvas->GetBoundsF().width))
1588 point.x = pCanvas->GetBoundsF().x + pCanvas->GetBoundsF().width;
1591 __currentPosition.x = point.x;
1592 __currentPosition.y = point.y;
1594 if ( __isTimerRunning == false )
1596 __isTimerRunning = true;
1597 __pSlideTimer->Start(__timerValue);
1604 _SliderPresenter::OnTimerExpired(Timer& timer)
1606 __isTimerRunning = false;
1608 float handleHalfWidth = __handleRect.width / 2;
1609 int candidateValue = CalculateSliderValue(__currentPosition.x, handleHalfWidth);
1611 __prevSliderValue = candidateValue;
1613 __pSliderModel->SetValue(candidateValue);
1614 __pSlider->SetAccessibilityElementValue();
1619 // Slider Event Fire
1620 _SliderEvent* pSliderEvent = dynamic_cast <_SliderEvent*>(__pSlider->GetSliderEvent());
1621 if (pSliderEvent != null)
1623 IEventArg* pEventArg = _SliderEvent::CreateSliderEventArgN(candidateValue);
1625 if( pEventArg == null)
1630 pSliderEvent->Fire(*pEventArg);
1637 _SliderPresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
1639 return OnTouchReleased(source, touchinfo);
1643 _SliderPresenter::OnBoundsChanged(void)
1645 __isNeedToBeUpdated = true;
1652 _SliderPresenter::OnFontChanged(Font* pFont)
1655 __isNeedToBeUpdated = true;
1657 if(__pSliderOverlay != null)
1658 __pSliderOverlay->SetFont(pFont);
1664 _SliderPresenter::OnFontInfoRequested(unsigned long& style, float& size)
1666 style = FONT_STYLE_BOLD;
1672 _SliderPresenter::SetMinValue(int minValue)
1674 __pSliderModel->SetMinValue(minValue);
1676 if (__pSliderModel->GetValue() < minValue)
1678 __pSliderModel->SetValue(minValue);
1685 _SliderPresenter::SetMaxValue(int maxValue)
1687 __pSliderModel->SetMaxValue(maxValue);
1689 if (__pSliderModel->GetValue() > maxValue)
1691 __pSliderModel->SetValue(maxValue);
1698 _SliderPresenter::GetMinValue(void) const
1700 return __pSliderModel->GetMinValue();
1704 _SliderPresenter::GetMaxValue(void) const
1706 return __pSliderModel->GetMaxValue();
1710 _SliderPresenter::SetValue(int value)
1712 SysTryReturnVoidResult(NID_UI_CTRL, __isSliderPressed == false, E_SYSTEM, "[E_SYSTEM] Failed to set value of slider.");
1714 int minValue = __pSliderModel->GetMinValue();
1715 int maxValue = __pSliderModel->GetMaxValue();
1717 if (value > maxValue)
1721 else if (value < minValue)
1726 __pSliderModel->SetValue(value);
1732 _SliderPresenter::GetValue(void) const
1734 return __pSliderModel->GetValue();
1738 _SliderPresenter::SetNeedUpdate(void)
1740 __isNeedToBeUpdated = true;
1745 _SliderPresenter::SetGroupStyle(GroupStyle groupStyle)
1747 __groupStyle = groupStyle;
1752 _SliderPresenter::SetThumbBitmap(SliderThumbStatus status, const Bitmap& bitmap)
1754 Bitmap* pThumbBitmap = null;
1755 result r = E_SUCCESS;
1757 pThumbBitmap = _BitmapImpl::CloneN(bitmap);
1759 r = GetLastResult();
1760 SysTryReturn(NID_UI_CTRL, pThumbBitmap != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
1764 case SLIDER_THUMB_STATUS_PRESSED:
1766 delete __pHandlePressedEffectBitmap;
1767 __pHandlePressedEffectBitmap = null;
1769 delete __pHandlePressedBitmap;
1770 __pHandlePressedBitmap = pThumbBitmap;
1773 case SLIDER_THUMB_STATUS_DISABLED:
1775 delete __pHandleDisabledEffectBitmap;
1776 __pHandleDisabledEffectBitmap = null;
1778 delete __pHandleDisabledBitmap;
1779 __pHandleDisabledBitmap = pThumbBitmap;
1782 case SLIDER_THUMB_STATUS_HIGHLIGHTED:
1784 delete __pHandleHighlightedEffectBitmap;
1785 __pHandleHighlightedEffectBitmap = null;
1787 delete __pHandleHighlightedEffectBitmap;
1788 __pHandleHighlightedEffectBitmap = pThumbBitmap;
1791 case SLIDER_THUMB_STATUS_NORMAL:
1795 delete __pHandleNormalEffectBitmap;
1796 __pHandleNormalEffectBitmap = null;
1798 delete __pHandleNormalBitmap;
1799 __pHandleNormalBitmap = pThumbBitmap;
1801 __handleRect.width = __pHandleNormalBitmap->GetWidth();
1802 __handleRect.height = __pHandleNormalBitmap->GetHeight();
1804 _VisualElement* pHandle = __pSlider->GetHandle();
1805 pHandle->SetBounds(FloatRectangle(__handleRect.x, __handleRect.y, __handleRect.width, __handleRect.height));
1807 __isCustomHandle = true;
1817 _SliderPresenter::SetThumbTextColor(SliderThumbStatus status, const Color& color)
1821 case SLIDER_THUMB_STATUS_PRESSED:
1822 __handleTextPressedColor = color;
1823 __isCustomPressedTextColor = true;
1826 case SLIDER_THUMB_STATUS_DISABLED:
1827 __handleTextDisabledColor = color;
1830 case SLIDER_THUMB_STATUS_HIGHLIGHTED:
1831 __handleTextHighlightedColor = color;
1834 case SLIDER_THUMB_STATUS_NORMAL:
1837 __handleTextColor = color;
1844 }}} // Tizen::Ui::Controls