2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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.
18 * @file FUiCtrl_CheckButtonPresenter.cpp
19 * @brief This is the implementation file for the _CheckButtonPresenter class.
22 #include <FBaseErrorDefine.h>
23 #include <FBaseSysLog.h>
24 #include <FGrp_BitmapImpl.h>
25 #include <FGrp_CanvasImpl.h>
26 #include <FGrp_FontImpl.h>
27 #include <FGrp_TextTextObject.h>
28 #include <FGrp_TextTextSimple.h>
29 #include "FUi_CoordinateSystemUtils.h"
30 #include "FUi_ResourceManager.h"
31 #include "FUi_UiTouchEvent.h"
32 #include "FUiAnim_VisualElement.h"
33 #include "FUiCtrl_CheckButtonPresenter.h"
34 #include "FUiCtrl_CheckButtonModel.h"
36 using namespace Tizen::Base;
37 using namespace Tizen::Graphics;
38 using namespace Tizen::Graphics::_Text;
39 using namespace Tizen::Base::Runtime;
41 namespace Tizen { namespace Ui { namespace Controls
44 _CheckButtonPresenter::_CheckButtonPresenter(void)
45 : __pCheckButton(null)
46 , __pCheckButtonModel(null)
47 , __previousEnabledState(false)
48 , __touchMoveHandled(false)
50 , __pTitleTextFont(null)
52 , __pTitleTextObject(null)
53 , __titleTextBounds(FloatRectangle())
54 , __textBounds(FloatRectangle())
55 , __defaultButtonBounds(FloatRectangle())
56 , __onOffSlidingButtonBounds(FloatRectangle())
57 , __detailedButtonBounds(FloatRectangle())
60 , __pCheckAnimationTimer(null)
62 , __onOffHandlerPosition(0.0f)
63 , __onOffHandlerPressed(false)
64 , __onOffHandlerMoved(false)
65 , __highlightedIndex(0)
66 , __detailedPressed(false)
71 _CheckButtonPresenter::~_CheckButtonPresenter(void)
73 if (__pCheckButtonModel)
75 delete __pCheckButtonModel;
76 __pCheckButtonModel = null;
85 if (__pTitleTextObject)
87 delete __pTitleTextObject;
88 __pTitleTextObject = null;
91 if (__pCheckAnimationTimer)
93 delete __pCheckAnimationTimer;
94 __pCheckAnimationTimer = null;
99 _CheckButtonPresenter::Construct(const _CheckButton& checkButton)
101 result r = E_SUCCESS;
103 __pCheckButton = const_cast <_CheckButton*>(&checkButton);
105 __fontStyle = FONT_STYLE_PLAIN;
107 __pTextObject = new (std::nothrow) TextObject();
108 SysTryCatch(NID_UI_CTRL, __pTextObject != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
110 __pTitleTextObject = new (std::nothrow) TextObject();
111 SysTryCatch(NID_UI_CTRL, __pTitleTextObject != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
113 __pTextObject->Construct();
114 __pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
115 __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
117 __pTitleTextObject->Construct();
118 __pTitleTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
119 __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
121 CalculateTextBounds();
122 CalculateTitleTextBounds();
123 CalculateButtonBounds();
129 delete __pTextObject;
130 __pTextObject = null;
132 delete __pTitleTextObject;
133 __pTitleTextObject = null;
139 _CheckButtonPresenter::Install(void)
141 result r = E_SUCCESS;
143 _CheckButtonModel* pModel = new (std::nothrow) _CheckButtonModel();
144 SysTryReturn(NID_UI_CTRL, pModel, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
146 r = SetModel(*pModel);
147 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
149 r = pModel->Construct();
150 SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
160 _CheckButtonPresenter::SetModel(const _CheckButtonModel& checkButtonModel)
162 __pCheckButtonModel = const_cast <_CheckButtonModel*>(&checkButtonModel);
168 _CheckButtonPresenter::OnFontChanged(Font* pFont)
171 __pTitleTextFont = pFont;
177 _CheckButtonPresenter::OnFontInfoRequested(unsigned long& style, int& size)
180 size = _CoordinateSystemUtils::ConvertToInteger(__fontSize);
186 _CheckButtonPresenter::OnFontInfoRequested(unsigned long& style, float& size)
195 _CheckButtonPresenter::SetFontInfo(unsigned long style, float size)
204 _CheckButtonPresenter::Draw(void)
214 _CheckButtonPresenter::DrawBackground(void)
216 Canvas* pCanvas = __pCheckButton->GetCanvasN();
219 SysLog(NID_UI_CTRL, "Cannot get a canvas.");
224 Bitmap* pBgBitmap = null;
225 Bitmap* pReColorBgBitmap = null;
227 Bitmap* pHighlightedBgBitmap = null;
228 Bitmap* pHighlightedReColorBgBitmap = null;
230 FloatDimension minDimension(0.0f, 0.0f);
231 FloatDimension minDimensionWithAnnex(0.0f, 0.0f);
233 GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION, __pCheckButton->GetOrientation(), minDimension);
234 GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION_WITH_ANNEX, __pCheckButton->GetOrientation(), minDimensionWithAnnex);
236 FloatRectangle bounds(0.0f, 0.0f, __pCheckButton->GetBoundsF().width, __pCheckButton->GetBoundsF().height);
238 _CheckButtonStatus checkStatus = __pCheckButton->GetCheckButtonStatus();
239 BackgroundStyle backgroundStyle = __pCheckButton->GetBackgroundStyle();
240 CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
242 if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_ONOFF
243 || checkStyle == CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER)
245 if (bounds.width < minDimension.width )
247 bounds.width = minDimension.width;
250 if (bounds.height < minDimension.height )
252 bounds.height = minDimension.height;
257 if (bounds.width < minDimensionWithAnnex.width )
259 bounds.width = minDimensionWithAnnex.width;
262 if (bounds.height < minDimensionWithAnnex.height )
264 bounds.height = minDimensionWithAnnex.height;
268 pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
271 if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
273 if (backgroundStyle == BACKGROUND_STYLE_NONE)
275 pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
280 pBgBitmap = __pCheckButton->GetBackgroundBitmap(__pCheckButton->GetGroupStyle(), _CHECK_BUTTON_STATUS_NORMAL);
282 if (pBgBitmap && _BitmapImpl::CheckNinePatchedBitmapStrictly(*pBgBitmap))
284 pReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgBitmap, Color::GetColor(COLOR_ID_MAGENTA),
285 __pCheckButton->GetColor(_CHECK_BUTTON_STATUS_NORMAL));
286 if (pReColorBgBitmap)
288 pCanvas->DrawNinePatchedBitmap(bounds, *pReColorBgBitmap);
291 bool themeBgBitmap = false;
293 if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_SINGLE)
295 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_SINGLE_BG_NORMAL);
297 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_TOP)
299 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_TOP_BG_NORMAL);
301 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_MIDDLE)
303 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_MIDDLE_BG_NORMAL);
305 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_BOTTOM)
307 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_BOTTOM_BG_NORMAL);
310 if (themeBgBitmap == false)
312 Bitmap* pBgNormalEffectBitmap = __pCheckButton->GetBackgroundNormalEffectBitmap(__pCheckButton->GetGroupStyle());
314 if (pBgNormalEffectBitmap)
316 pCanvas->DrawNinePatchedBitmap(bounds, *pBgNormalEffectBitmap);
324 pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBgBitmap);
329 else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
331 if (backgroundStyle == BACKGROUND_STYLE_NONE)
333 pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
338 pBgBitmap = __pCheckButton->GetBackgroundBitmap(__pCheckButton->GetGroupStyle(), _CHECK_BUTTON_STATUS_DISABLED);
340 if (pBgBitmap && _BitmapImpl::CheckNinePatchedBitmapStrictly(*pBgBitmap))
342 pReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgBitmap, Color::GetColor(COLOR_ID_MAGENTA),
343 __pCheckButton->GetColor(_CHECK_BUTTON_STATUS_DISABLED));
344 if (pReColorBgBitmap)
346 pCanvas->DrawNinePatchedBitmap(bounds, *pReColorBgBitmap);
349 bool themeBgBitmap = false;
351 if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_SINGLE)
353 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_SINGLE_BG_DISABLED);
355 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_TOP)
357 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_TOP_BG_DISABLED);
359 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_MIDDLE)
361 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_MIDDLE_BG_DISABLED);
363 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_BOTTOM)
365 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_BOTTOM_BG_DISABLED);
368 if (themeBgBitmap == false)
370 Bitmap* pBgNormalEffectBitmap = __pCheckButton->GetBackgroundNormalEffectBitmap(__pCheckButton->GetGroupStyle());
372 if (pBgNormalEffectBitmap)
374 pCanvas->DrawNinePatchedBitmap(bounds, *pBgNormalEffectBitmap);
382 pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBgBitmap);
387 else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
389 if (backgroundStyle == BACKGROUND_STYLE_NONE)
391 pCanvas->SetBackgroundColor(__pCheckButton->GetColor(_CHECK_BUTTON_STATUS_PRESSED));
396 pBgBitmap = __pCheckButton->GetBackgroundBitmap(__pCheckButton->GetGroupStyle(), _CHECK_BUTTON_STATUS_PRESSED);
398 if (pBgBitmap && _BitmapImpl::CheckNinePatchedBitmapStrictly(*pBgBitmap))
400 pReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgBitmap, Color::GetColor(COLOR_ID_MAGENTA),
401 __pCheckButton->GetColor(_CHECK_BUTTON_STATUS_PRESSED));
402 if (pReColorBgBitmap)
404 pCanvas->DrawNinePatchedBitmap(bounds, *pReColorBgBitmap);
407 bool themeBgBitmap = false;
409 if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_SINGLE)
411 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_SINGLE_BG_PRESSED);
413 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_TOP)
415 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_TOP_BG_PRESSED);
417 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_MIDDLE)
419 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_MIDDLE_BG_PRESSED);
421 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_BOTTOM)
423 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_BOTTOM_BG_PRESSED);
426 if (themeBgBitmap == false)
428 Bitmap* pBgPressedEffectBitmap = __pCheckButton->GetBackgroundPressedEffectBitmap(__pCheckButton->GetGroupStyle());
430 if (pBgPressedEffectBitmap)
432 pCanvas->DrawNinePatchedBitmap(bounds, *pBgPressedEffectBitmap);
440 pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBgBitmap);
445 else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
447 if (backgroundStyle == BACKGROUND_STYLE_NONE)
449 pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
452 pHighlightedBgBitmap = __pCheckButton->GetBackgroundBitmap(__pCheckButton->GetGroupStyle(), _CHECK_BUTTON_STATUS_HIGHLIGHTED);
454 pHighlightedReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pHighlightedBgBitmap,
455 Color::GetColor(COLOR_ID_MAGENTA), __pCheckButton->GetColor(_CHECK_BUTTON_STATUS_HIGHLIGHTED));
457 if (pHighlightedReColorBgBitmap && __highlightedIndex == 0)
459 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pHighlightedReColorBgBitmap))
461 pCanvas->DrawNinePatchedBitmap(bounds, *pHighlightedReColorBgBitmap);
465 pCanvas->DrawBitmap(bounds, *pHighlightedReColorBgBitmap,
466 FloatRectangle(0.0f, 0.0f, pHighlightedReColorBgBitmap->GetWidthF(), pHighlightedReColorBgBitmap->GetHeightF()));
472 pBgBitmap = __pCheckButton->GetBackgroundBitmap(__pCheckButton->GetGroupStyle(), _CHECK_BUTTON_STATUS_NORMAL);
474 if (pBgBitmap && _BitmapImpl::CheckNinePatchedBitmapStrictly(*pBgBitmap))
476 pReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgBitmap, Color::GetColor(COLOR_ID_MAGENTA),
477 __pCheckButton->GetColor(_CHECK_BUTTON_STATUS_NORMAL));
478 if (pReColorBgBitmap)
480 pCanvas->DrawNinePatchedBitmap(bounds, *pReColorBgBitmap);
483 bool themeBgBitmap = false;
485 if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_SINGLE)
487 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_SINGLE_BG_HIGHLIGHTED);
489 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_TOP)
491 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_TOP_BG_HIGHLIGHTED);
493 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_MIDDLE)
495 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_MIDDLE_BG_HIGHLIGHTED);
497 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_BOTTOM)
499 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_BOTTOM_BG_HIGHLIGHTED);
502 if (themeBgBitmap == false)
504 Bitmap* pBgPressedEffectBitmap = __pCheckButton->GetBackgroundPressedEffectBitmap(__pCheckButton->GetGroupStyle());
506 if (pBgPressedEffectBitmap)
508 pCanvas->DrawNinePatchedBitmap(bounds, *pBgPressedEffectBitmap);
516 pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBgBitmap);
520 pHighlightedBgBitmap = __pCheckButton->GetBackgroundBitmap(__pCheckButton->GetGroupStyle(), _CHECK_BUTTON_STATUS_HIGHLIGHTED);
522 pHighlightedReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pHighlightedBgBitmap,
523 Color::GetColor(COLOR_ID_MAGENTA), __pCheckButton->GetColor(_CHECK_BUTTON_STATUS_HIGHLIGHTED));
525 if (pHighlightedReColorBgBitmap && __highlightedIndex == 0)
527 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pHighlightedReColorBgBitmap))
529 pCanvas->DrawNinePatchedBitmap(bounds, *pHighlightedReColorBgBitmap);
533 pCanvas->DrawBitmap(bounds, *pHighlightedReColorBgBitmap,
534 FloatRectangle(0.0f, 0.0f, pHighlightedReColorBgBitmap->GetWidthF(), pHighlightedReColorBgBitmap->GetHeightF()));
541 if (backgroundStyle == BACKGROUND_STYLE_NONE)
543 pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
548 pBgBitmap = __pCheckButton->GetBackgroundBitmap(__pCheckButton->GetGroupStyle(), __pCheckButton->GetCheckButtonStatus());
550 if (pBgBitmap && _BitmapImpl::CheckNinePatchedBitmapStrictly(*pBgBitmap))
552 pReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgBitmap, Color::GetColor(COLOR_ID_MAGENTA),
553 __pCheckButton->GetColor(_CHECK_BUTTON_STATUS_SELECTED));
554 if (pReColorBgBitmap)
556 pCanvas->DrawNinePatchedBitmap(bounds, *pReColorBgBitmap);
559 bool themeBgBitmap = false;
561 if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_SINGLE)
563 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_SINGLE_BG_SELECTED);
565 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_TOP)
567 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_TOP_BG_SELECTED);
569 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_MIDDLE)
571 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_MIDDLE_BG_SELECTED);
573 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_BOTTOM)
575 themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_BOTTOM_BG_SELECTED);
578 if (themeBgBitmap == false)
580 Bitmap* pBgNormalEffectBitmap = __pCheckButton->GetBackgroundNormalEffectBitmap(__pCheckButton->GetGroupStyle());
582 if (pBgNormalEffectBitmap)
584 pCanvas->DrawNinePatchedBitmap(bounds, *pBgNormalEffectBitmap);
592 pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBgBitmap);
599 delete pReColorBgBitmap;
600 delete pHighlightedReColorBgBitmap;
606 _CheckButtonPresenter::DrawCheckBitmap(void)
608 Canvas* pCanvas = __pCheckButton->GetCanvasN();
611 SysLog(NID_UI_CTRL, "Cannot get a canvas.");
616 Color detailedNormalBgColor;
617 Color detailedDisabledBgColor;
618 Color detailedPressedBgColor;
619 Color detailedHighlightedBgColor;
620 Color detailedSelectedBgColor;
622 Color detailedRightNormalColor;
623 Color detailedRightDisabledColor;
624 Color detailedRightPressedColor;
625 Color detailedRightHighlightedColor;
626 Color detailedRightSelectedColor;
628 GET_COLOR_CONFIG(CHECKBUTTON::DETAILED_ICON_BG_NORMAL, detailedNormalBgColor);
629 GET_COLOR_CONFIG(CHECKBUTTON::DETAILED_ICON_BG_DISABLED, detailedDisabledBgColor);
630 GET_COLOR_CONFIG(CHECKBUTTON::DETAILED_ICON_BG_PRESSED, detailedPressedBgColor);
631 GET_COLOR_CONFIG(CHECKBUTTON::DETAILED_ICON_BG_HIGHLIGHTED, detailedHighlightedBgColor);
632 GET_COLOR_CONFIG(CHECKBUTTON::DETAILED_ICON_BG_SELECTED, detailedSelectedBgColor);
634 GET_COLOR_CONFIG(CHECKBUTTON::DETAILED_ICON_TEXT_NORMAL, detailedRightNormalColor);
635 GET_COLOR_CONFIG(CHECKBUTTON::DETAILED_ICON_TEXT_DISABLED, detailedRightDisabledColor);
636 GET_COLOR_CONFIG(CHECKBUTTON::DETAILED_ICON_TEXT_PRESSED, detailedRightPressedColor);
637 GET_COLOR_CONFIG(CHECKBUTTON::DETAILED_ICON_TEXT_HIGHLIGHTED, detailedRightHighlightedColor);
638 GET_COLOR_CONFIG(CHECKBUTTON::DETAILED_ICON_TEXT_SELECTED, detailedRightSelectedColor);
640 Bitmap* pReColorCircleBitmap = null;
641 Bitmap* pReColorRightBitmap = null;
643 _CheckButtonStatus checkStatus = __pCheckButton->GetCheckButtonStatus();
644 CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
646 CalculateButtonBounds();
648 if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
650 if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
652 Bitmap* pMarkBgNormalBitmap = __pCheckButton->GetMarkBgBitmap(_CHECK_BUTTON_STATUS_NORMAL);
654 if (pMarkBgNormalBitmap)
656 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgNormalBitmap);
659 if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
661 Bitmap* pCircleNormalBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_NORMAL);
662 Bitmap* pDetailedRightNormalBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_NORMAL);
664 if (__detailedPressed == true)
666 if (pCircleNormalBitmap)
668 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedPressedBgColor);
671 if (pDetailedRightNormalBitmap)
673 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
678 if (pCircleNormalBitmap)
680 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedNormalBgColor);
683 if (pDetailedRightNormalBitmap)
685 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightNormalColor);
689 if (pReColorCircleBitmap)
691 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
694 if (pReColorRightBitmap)
696 float arrowWidth = pReColorRightBitmap->GetWidthF();
697 float arrowHeight = pReColorRightBitmap->GetHeightF();
699 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
700 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
703 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_NORMAL);
705 if (themeBgBitmap == false)
707 Bitmap* pCircleNormalEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
709 if (pCircleNormalEffectBitmap)
711 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap);
716 else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
718 Bitmap* pMarkBgDisabledBitmap = __pCheckButton->GetMarkBgBitmap(_CHECK_BUTTON_STATUS_DISABLED);
720 if (pMarkBgDisabledBitmap)
722 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgDisabledBitmap);
725 if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
727 Bitmap* pCircleDisabledBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_DISABLED);
728 Bitmap* pDetailedRightDisabledBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_DISABLED);
730 if (pCircleDisabledBitmap)
732 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleDisabledBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedDisabledBgColor);
735 if (pDetailedRightDisabledBitmap)
737 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightDisabledBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightDisabledColor);
740 if (pReColorCircleBitmap)
742 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
745 if (pReColorRightBitmap)
747 float arrowWidth = pReColorRightBitmap->GetWidthF();
748 float arrowHeight = pReColorRightBitmap->GetHeightF();
750 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
751 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
754 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_DISABLED);
756 if (themeBgBitmap == false)
758 Bitmap* pCircleNormalEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
760 if (pCircleNormalEffectBitmap)
762 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap);
767 else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
769 Bitmap* pMarkBgPressedBitmap = __pCheckButton->GetMarkBgBitmap(_CHECK_BUTTON_STATUS_PRESSED);
771 if (pMarkBgPressedBitmap)
773 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgPressedBitmap);
776 if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
778 Bitmap* pCirclePressedBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_PRESSED);
779 Bitmap* pDetailedRightPressedBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_PRESSED);
781 if (__detailedPressed == true)
783 if (pCirclePressedBitmap)
785 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCirclePressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedPressedBgColor);
788 if (pDetailedRightPressedBitmap)
790 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
795 if (pCirclePressedBitmap)
797 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCirclePressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedNormalBgColor);
800 if (pDetailedRightPressedBitmap)
802 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightNormalColor);
806 if (pReColorCircleBitmap)
808 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
811 if (pReColorRightBitmap)
813 float arrowWidth = pReColorRightBitmap->GetWidthF();
814 float arrowHeight = pReColorRightBitmap->GetHeightF();
816 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
817 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
820 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_PRESSED);
822 if (themeBgBitmap == false)
824 Bitmap* pCirclePressedEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
826 if (pCirclePressedEffectBitmap)
828 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCirclePressedEffectBitmap);
833 else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
835 Bitmap* pMarkBgNormalBitmap = __pCheckButton->GetMarkBgBitmap(_CHECK_BUTTON_STATUS_NORMAL);
836 Bitmap* pMarkBgHighlightedBitmap = __pCheckButton->GetMarkBgBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
838 if (pMarkBgNormalBitmap)
840 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgNormalBitmap);
843 Bitmap* pReColorMarkBgHighlightedBitmap = null;
845 if (pMarkBgHighlightedBitmap)
847 pReColorMarkBgHighlightedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pMarkBgHighlightedBitmap,
848 Color::GetColor(COLOR_ID_MAGENTA), detailedHighlightedBgColor);
851 if (pReColorMarkBgHighlightedBitmap && __highlightedIndex == 1)
853 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pReColorMarkBgHighlightedBitmap);
856 delete pReColorMarkBgHighlightedBitmap;
858 if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
860 Bitmap* pCircleNormalBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_NORMAL);
861 Bitmap* pCircleHighlightedBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
862 Bitmap* pDetailedRightHighlightedBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
864 if (__detailedPressed == true)
866 if (pCircleNormalBitmap)
868 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedPressedBgColor);
871 if (pDetailedRightHighlightedBitmap)
873 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
878 if (pCircleNormalBitmap)
880 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedNormalBgColor);
883 if (pDetailedRightHighlightedBitmap)
885 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightHighlightedColor);
889 if (pReColorCircleBitmap)
891 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
894 if (pReColorRightBitmap)
896 float arrowWidth = pReColorRightBitmap->GetWidthF();
897 float arrowHeight = pReColorRightBitmap->GetHeightF();
899 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
900 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
903 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_HIGHLIGHTED);
905 if (themeBgBitmap == false)
907 Bitmap* pCirclePressedEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
909 if (pCirclePressedEffectBitmap)
911 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCirclePressedEffectBitmap);
915 Bitmap* pReColorCircleHighlightedBitmap = null;
917 if (pCircleHighlightedBitmap)
919 pReColorCircleHighlightedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedHighlightedBgColor);
922 if (pReColorCircleHighlightedBitmap && __highlightedIndex == 2)
924 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleHighlightedBitmap);
927 delete pReColorCircleHighlightedBitmap;
930 else if (checkStatus == _CHECK_BUTTON_STATUS_SELECTED)
932 Bitmap* pMarkBgSelectedBitmap = __pCheckButton->GetMarkBgBitmap(_CHECK_BUTTON_STATUS_SELECTED);
934 if (pMarkBgSelectedBitmap)
936 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgSelectedBitmap);
939 if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
941 Bitmap* pCircleSelectedBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_SELECTED);
942 Bitmap* pDetailedRightSelectedBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_SELECTED);
944 if (__detailedPressed == true)
946 if (pCircleSelectedBitmap)
948 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedPressedBgColor);
951 if (pDetailedRightSelectedBitmap)
953 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
958 if (pCircleSelectedBitmap)
960 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedSelectedBgColor);
963 if (pDetailedRightSelectedBitmap)
965 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightSelectedColor);
969 if (pReColorCircleBitmap)
971 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
974 if (pReColorRightBitmap)
976 float arrowWidth = pReColorRightBitmap->GetWidthF();
977 float arrowHeight = pReColorRightBitmap->GetHeightF();
979 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
980 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
983 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_SELECTED);
985 if (themeBgBitmap == false)
987 Bitmap* pCircleNormalEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
989 if (pCircleNormalEffectBitmap)
991 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap);
999 else if (checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1001 if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
1003 if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1005 Bitmap* pCircleNormalBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1006 Bitmap* pDetailedRightNormalBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1008 if (__detailedPressed == true)
1010 if (pCircleNormalBitmap)
1012 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedPressedBgColor);
1015 if (pDetailedRightNormalBitmap)
1017 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
1022 if (pCircleNormalBitmap)
1024 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedNormalBgColor);
1027 if (pDetailedRightNormalBitmap)
1029 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightNormalColor);
1033 if (pReColorCircleBitmap)
1035 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
1038 if (pReColorRightBitmap)
1040 float arrowWidth = pReColorRightBitmap->GetWidthF();
1041 float arrowHeight = pReColorRightBitmap->GetHeightF();
1043 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1044 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
1047 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_NORMAL);
1049 if (themeBgBitmap == false)
1051 Bitmap* pCircleNormalEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
1053 if (pCircleNormalEffectBitmap)
1055 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap);
1060 else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
1062 if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1064 Bitmap* pCircleDisabledBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_DISABLED);
1065 Bitmap* pDetailedRightDisabledBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_DISABLED);
1067 if (pCircleDisabledBitmap)
1069 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleDisabledBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedDisabledBgColor);
1072 if (pDetailedRightDisabledBitmap)
1074 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightDisabledBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightDisabledColor);
1077 if (pReColorCircleBitmap)
1079 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
1082 if (pReColorRightBitmap)
1084 float arrowWidth = pReColorRightBitmap->GetWidthF();
1085 float arrowHeight = pReColorRightBitmap->GetHeightF();
1087 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1088 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
1091 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_DISABLED);
1093 if (themeBgBitmap == false)
1095 Bitmap* pCircleNormalEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
1097 if (pCircleNormalEffectBitmap)
1099 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap);
1104 else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
1106 if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1108 Bitmap* pCirclePressedBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_PRESSED);
1109 Bitmap* pDetailedRightPressedBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_PRESSED);
1111 if (__detailedPressed == true)
1113 if (pCirclePressedBitmap)
1115 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCirclePressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedPressedBgColor);
1118 if (pDetailedRightPressedBitmap)
1120 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
1125 if (pCirclePressedBitmap)
1127 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCirclePressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedNormalBgColor);
1130 if (pDetailedRightPressedBitmap)
1132 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightPressedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightNormalColor);
1136 if (pReColorCircleBitmap)
1138 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
1141 if (pReColorRightBitmap)
1143 float arrowWidth = pReColorRightBitmap->GetWidthF();
1144 float arrowHeight = pReColorRightBitmap->GetHeightF();
1146 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1147 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
1150 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_PRESSED);
1152 if (themeBgBitmap == false)
1154 Bitmap* pCirclePressedEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
1156 if (pCirclePressedEffectBitmap)
1158 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCirclePressedEffectBitmap);
1163 else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
1165 if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1167 Bitmap* pCircleNormalBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1168 Bitmap* pCircleHighlightedBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
1169 Bitmap* pDetailedRightHighlightedBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
1171 if (__detailedPressed == true)
1173 if (pCircleNormalBitmap)
1175 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedPressedBgColor);
1178 if (pDetailedRightHighlightedBitmap)
1180 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
1185 if (pCircleNormalBitmap)
1187 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedNormalBgColor);
1190 if (pDetailedRightHighlightedBitmap)
1192 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightHighlightedColor);
1196 if (pReColorCircleBitmap)
1198 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
1201 if (pReColorRightBitmap)
1203 float arrowWidth = pReColorRightBitmap->GetWidthF();
1204 float arrowHeight = pReColorRightBitmap->GetHeightF();
1206 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1207 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
1210 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_HIGHLIGHTED);
1212 if (themeBgBitmap == false)
1214 Bitmap* pCirclePressedEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
1216 if (pCirclePressedEffectBitmap)
1218 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCirclePressedEffectBitmap);
1222 Bitmap* pReColorCircleHighlightedBitmap = null;
1224 if (pCircleHighlightedBitmap)
1226 pReColorCircleHighlightedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedHighlightedBgColor);
1229 if (pReColorCircleHighlightedBitmap && __highlightedIndex == 1)
1231 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleHighlightedBitmap);
1234 delete pReColorCircleHighlightedBitmap;
1237 else if (checkStatus == _CHECK_BUTTON_STATUS_SELECTED)
1239 if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1241 Bitmap* pCircleSelectedBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_SELECTED);
1242 Bitmap* pDetailedRightSelectedBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_SELECTED);
1244 if (__detailedPressed == true)
1246 if (pCircleSelectedBitmap)
1248 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedPressedBgColor);
1251 if (pDetailedRightSelectedBitmap)
1253 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightPressedColor);
1258 if (pCircleSelectedBitmap)
1260 pReColorCircleBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pCircleSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedSelectedBgColor);
1263 if (pDetailedRightSelectedBitmap)
1265 pReColorRightBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDetailedRightSelectedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedRightSelectedColor);
1269 if (pReColorCircleBitmap)
1271 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pReColorCircleBitmap);
1274 if (pReColorRightBitmap)
1276 float arrowWidth = pReColorRightBitmap->GetWidthF();
1277 float arrowHeight = pReColorRightBitmap->GetHeightF();
1279 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1280 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pReColorRightBitmap);
1283 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_SELECTED);
1285 if (themeBgBitmap == false)
1287 Bitmap* pCircleNormalEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
1289 if (pCircleNormalEffectBitmap)
1291 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleNormalEffectBitmap);
1297 DrawMarkAnimation();
1299 else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF || checkStyle == CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER)
1301 if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
1303 Bitmap* pOnOffBgNormalBitmap = __pCheckButton->GetOnOffBgBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1305 if (pOnOffBgNormalBitmap)
1307 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgNormalBitmap);
1310 Bitmap* pOnOffNormalBitmap = __pCheckButton->GetOnOffBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1312 if (__pCheckButton->IsSelected() && pOnOffNormalBitmap)
1314 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffNormalBitmap);
1317 else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
1319 Bitmap* pOnOffBgDisabledBitmap = __pCheckButton->GetOnOffBgBitmap(_CHECK_BUTTON_STATUS_DISABLED);
1321 if (pOnOffBgDisabledBitmap)
1323 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgDisabledBitmap);
1326 Bitmap* pOnOffDisabledBitmap = __pCheckButton->GetOnOffBitmap(_CHECK_BUTTON_STATUS_DISABLED);
1328 if (__pCheckButton->IsSelected() && pOnOffDisabledBitmap)
1330 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffDisabledBitmap);
1333 else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
1335 Bitmap* pOnOffBgPressedBitmap = __pCheckButton->GetOnOffBgBitmap(_CHECK_BUTTON_STATUS_PRESSED);
1337 if (pOnOffBgPressedBitmap)
1339 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgPressedBitmap);
1342 Bitmap* pOnOffPressedBitmap = __pCheckButton->GetOnOffBitmap(_CHECK_BUTTON_STATUS_PRESSED);
1344 if (__pCheckButton->IsSelected() && pOnOffPressedBitmap)
1346 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffPressedBitmap);
1349 else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
1351 Bitmap* pOnOffBgNormalBitmap = __pCheckButton->GetOnOffBgBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1352 Bitmap* pOnOffBgHighlightedBitmap = __pCheckButton->GetOnOffBgBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
1354 if (pOnOffBgNormalBitmap)
1356 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgNormalBitmap);
1359 Bitmap* pOnOffHighlightedBitmap = __pCheckButton->GetOnOffBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
1361 if (__pCheckButton->IsSelected() && pOnOffHighlightedBitmap)
1363 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffHighlightedBitmap);
1366 Bitmap* pReColorOnOffBgHighlightedBitmap = null;
1368 if (pOnOffBgHighlightedBitmap)
1370 pReColorOnOffBgHighlightedBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pOnOffBgHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA), detailedHighlightedBgColor);
1373 if (pReColorOnOffBgHighlightedBitmap && __highlightedIndex == 1)
1375 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pReColorOnOffBgHighlightedBitmap);
1378 delete pReColorOnOffBgHighlightedBitmap;
1380 else if (checkStatus == _CHECK_BUTTON_STATUS_SELECTED)
1382 Bitmap* pOnOffBgSelectedBitmap = __pCheckButton->GetOnOffBgBitmap(_CHECK_BUTTON_STATUS_SELECTED);
1384 if (pOnOffBgSelectedBitmap)
1386 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgSelectedBitmap);
1389 Bitmap* pOnOffSelectedBitmap = __pCheckButton->GetOnOffBitmap(_CHECK_BUTTON_STATUS_SELECTED);
1391 if (__pCheckButton->IsSelected() && pOnOffSelectedBitmap)
1393 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffSelectedBitmap);
1397 else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1399 float handlerWidth = 0.0f;
1400 GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_HANDLER_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, handlerWidth);
1401 DrawOnOffSlidingHandler(__onOffHandlerPosition - (handlerWidth / 2.0f));
1403 float dividerWidth = 0.0f;
1404 float dividerTopMargin = 0.0f;
1405 float dividerRightMargin = 0.0f;
1407 Color dividerLeftColor;
1408 //Color dividerRightColor;
1409 FloatDimension minDimension(0.0f, 0.0f);
1411 GET_SHAPE_CONFIG(CHECKBUTTON::DIVIDER_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, dividerWidth);
1412 GET_SHAPE_CONFIG(CHECKBUTTON::DIVIDER_TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, dividerTopMargin);
1413 GET_SHAPE_CONFIG(CHECKBUTTON::DIVIDER_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, dividerRightMargin);
1414 GET_COLOR_CONFIG(HEADER::DIVIDER_LINE_LEFT_NORMAL, dividerLeftColor);
1415 //GET_COLOR_CONFIG(HEADER::DIVIDER_LINE_RIGHT_NORMAL, dividerRightColor);
1417 GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION, __pCheckButton->GetOrientation(), minDimension);
1419 FloatRectangle bounds(0.0f, 0.0f, __pCheckButton->GetBoundsF().width, __pCheckButton->GetBoundsF().height);
1421 if (bounds.height < minDimension.height )
1423 bounds.height = minDimension.height;
1426 if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1428 pCanvas->SetForegroundColor(dividerLeftColor);
1429 pCanvas->SetLineWidth(dividerWidth);
1430 pCanvas->DrawLine(FloatPoint(__onOffSlidingButtonBounds.x - dividerRightMargin + dividerWidth, dividerTopMargin),
1431 FloatPoint(__onOffSlidingButtonBounds.x - dividerRightMargin + dividerWidth, dividerTopMargin + bounds.height - dividerTopMargin * 2));
1433 //pCanvas->SetForegroundColor(dividerRightColor);
1434 //pCanvas->SetLineWidth(dividerWidth/2);
1435 //pCanvas->DrawLine(FloatPoint(__onOffSlidingButtonBounds.x - dividerRightMargin + dividerWidth, dividerTopMargin),
1436 // FloatPoint(__onOffSlidingButtonBounds.x - dividerRightMargin + dividerWidth, dividerTopMargin + bounds.height - dividerTopMargin * 2));
1441 delete pReColorCircleBitmap;
1442 delete pReColorRightBitmap;
1448 _CheckButtonPresenter::DrawText(void)
1450 result r = E_SUCCESS;
1452 TextSimple* pSimpleText = null;
1453 TextSimple* pSimpleTitleText = null;
1454 TextObjectAlignment horizontalAlign = TEXT_OBJECT_ALIGNMENT_CENTER;
1455 TextObjectAlignment verticalAlign = TEXT_OBJECT_ALIGNMENT_MIDDLE;
1457 _CheckButtonStatus checkStatus = __pCheckButton->GetCheckButtonStatus();
1458 bool showTitle = __pCheckButton->GetShowTitle();
1460 Canvas* pCanvas = __pCheckButton->GetCanvasN();
1461 if (pCanvas == null)
1463 SysLog(NID_UI_CTRL, "Cannot get a canvas.");
1468 __pTextObject->RemoveAll(true);
1469 pSimpleText = new (std::nothrow) TextSimple(const_cast<wchar_t*>(__pCheckButton->GetText().GetPointer()), __pCheckButton->GetText().GetLength());
1470 __pTextObject->AppendElement(*pSimpleText);
1472 __pTitleTextObject->RemoveAll(true);
1473 pSimpleTitleText = new (std::nothrow) TextSimple(const_cast<wchar_t*>(__pCheckButton->GetTitleText().GetPointer()), __pCheckButton->GetTitleText().GetLength());
1474 __pTitleTextObject->AppendElement(*pSimpleTitleText);
1476 if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
1478 __pTextObject->SetForegroundColor(__pCheckButton->GetTextColor(), 0, __pTextObject->GetTextLength());
1479 __pTitleTextObject->SetForegroundColor(__pCheckButton->GetTitleTextColor(), 0, __pTitleTextObject->GetTextLength());
1481 else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
1483 __pTextObject->SetForegroundColor(__pCheckButton->GetDisabledTextColor(), 0, __pTextObject->GetTextLength());
1484 __pTitleTextObject->SetForegroundColor(__pCheckButton->GetDisabledTitleTextColor(), 0, __pTitleTextObject->GetTextLength());
1486 else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
1488 __pTextObject->SetForegroundColor(__pCheckButton->GetPressedTextColor(), 0, __pTextObject->GetTextLength());
1489 __pTitleTextObject->SetForegroundColor(__pCheckButton->GetPressedTitleTextColor(), 0, __pTitleTextObject->GetTextLength());
1491 else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
1493 __pTextObject->SetForegroundColor(__pCheckButton->GetHighlightedTextColor(), 0, __pTextObject->GetTextLength());
1494 __pTitleTextObject->SetForegroundColor(__pCheckButton->GetHighlightedTitleTextColor(), 0, __pTitleTextObject->GetTextLength());
1498 __pTextObject->SetForegroundColor(__pCheckButton->GetSelectedTextColor(), 0, __pTextObject->GetTextLength());
1499 __pTitleTextObject->SetForegroundColor(__pCheckButton->GetSelectedTitleTextColor(), 0, __pTitleTextObject->GetTextLength());
1502 CalculateTextBounds();
1503 CalculateTitleTextBounds();
1505 __pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
1506 __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
1507 __pTextObject->SetBounds(GetTextBoundsF());
1508 __pTextObject->Compose();
1510 __pTitleTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
1511 __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
1512 __pTitleTextObject->SetBounds(GetTitleTextBoundsF());
1513 __pTitleTextObject->Compose();
1515 switch (__pCheckButton->GetTextHorizontalAlignment())
1517 case ALIGNMENT_LEFT:
1518 horizontalAlign = TEXT_OBJECT_ALIGNMENT_LEFT;
1520 case ALIGNMENT_CENTER:
1521 horizontalAlign = TEXT_OBJECT_ALIGNMENT_CENTER;
1524 horizontalAlign = TEXT_OBJECT_ALIGNMENT_RIGHT;
1527 switch (__pCheckButton->GetTextVerticalAlignment())
1530 verticalAlign = TEXT_OBJECT_ALIGNMENT_TOP;
1532 case ALIGNMENT_MIDDLE:
1533 verticalAlign = TEXT_OBJECT_ALIGNMENT_MIDDLE;
1536 verticalAlign = TEXT_OBJECT_ALIGNMENT_BOTTOM;
1539 __fontSize = __pCheckButton->GetTextSizeF();
1540 __pTextFont = __pCheckButton->GetFallbackFont();
1541 r = GetLastResult();
1542 SysTryReturnVoidResult(NID_UI_CTRL, __pTextFont, r, "[%s] Propagating.", GetErrorMessage(r));
1544 __pTextObject->SetAlignment(horizontalAlign | verticalAlign);
1545 __pTextObject->SetFont(__pTextFont, 0, __pTextObject->GetTextLength());
1546 __pTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas));
1548 __fontSize = __pCheckButton->GetTitleTextSizeF();
1549 __pTitleTextFont = __pCheckButton->GetFallbackFont();
1550 r = GetLastResult();
1551 SysTryReturnVoidResult(NID_UI_CTRL, __pTitleTextFont, r, "[%s] Propagating.", GetErrorMessage(r));
1553 __pTitleTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_MIDDLE);
1554 __pTitleTextObject->SetFont(__pTitleTextFont, 0, __pTitleTextObject->GetTextLength());
1558 __pTitleTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas));
1567 _CheckButtonPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
1569 if (&source != __pCheckButton)
1574 if (!__pCheckButton->IsEnabled())
1579 __touchMoveHandled = false;
1581 FloatPoint touchPoint = touchinfo.GetCurrentPosition();
1583 touchPoint.x += source.GetClientBoundsF().x;
1584 touchPoint.y += source.GetClientBoundsF().y;
1586 CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
1588 if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1590 if (__onOffSlidingButtonBounds.Contains(touchPoint))
1592 __onOffHandlerPressed = true;
1596 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
1599 else if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1601 if (__detailedButtonBounds.Contains(touchPoint))
1603 __detailedPressed = true;
1607 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
1612 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
1615 __pCheckButton->Invalidate();
1621 _CheckButtonPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
1623 float checkButtonLeftMargin = 0.0f;
1624 float checkButtonDetailedBitmapWidth = 0.0f;
1625 float checkButtonOnOffSlidingBitmapWidth = 0.0f;
1626 float dividerRightMargin = 0.0f;
1628 GET_SHAPE_CONFIG(CHECKBUTTON::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonLeftMargin);
1629 GET_SHAPE_CONFIG(CHECKBUTTON::DETAILED_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonDetailedBitmapWidth);
1630 GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonOnOffSlidingBitmapWidth);
1631 GET_SHAPE_CONFIG(CHECKBUTTON::DIVIDER_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, dividerRightMargin);
1633 if (&source != __pCheckButton)
1638 if (!__pCheckButton->IsEnabled())
1643 _CheckButtonStatus status = __pCheckButton->GetCheckButtonStatus();
1644 CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
1646 if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1648 if (status == _CHECK_BUTTON_STATUS_NORMAL && __onOffHandlerPressed == false)
1650 __onOffHandlerMoved = false;
1655 else if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1657 if (status == _CHECK_BUTTON_STATUS_NORMAL && __detailedPressed == true)
1659 __detailedPressed = false;
1661 __pCheckButton->Invalidate();
1668 if (status == _CHECK_BUTTON_STATUS_NORMAL)
1674 if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON
1675 || checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1677 StartCheckAnimationTimer();
1681 FloatPoint touchPoint = touchinfo.GetCurrentPosition();
1683 touchPoint.x += source.GetClientBoundsF().x;
1684 touchPoint.y += source.GetClientBoundsF().y;
1686 FloatRectangle bounds = __pCheckButton->GetClientBoundsF();
1687 FloatRectangle detailedBounds = __pCheckButton->GetClientBoundsF();
1689 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
1690 __pCheckButton->Invalidate();
1692 if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1694 if (!__detailedButtonBounds.Contains(touchPoint))
1696 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
1698 __pCheckButton->FireActionEvent();
1700 if (__pCheckButton->GetRadioGroup() != null)
1702 __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
1706 else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1708 detailedBounds.width = detailedBounds.width - checkButtonLeftMargin - checkButtonOnOffSlidingBitmapWidth - dividerRightMargin;
1710 if (!detailedBounds.Contains(touchPoint))
1712 if (__onOffHandlerMoved == false)
1714 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
1716 __pCheckButton->FireActionEvent();
1718 if (__pCheckButton->GetRadioGroup() != null)
1720 __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
1725 AdjustHandlerPosition();
1727 __onOffHandlerPressed = false;
1728 __onOffHandlerMoved = false;
1730 else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING)
1732 if (bounds.Contains(touchPoint))
1734 if (__onOffHandlerMoved == false)
1736 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
1738 __pCheckButton->FireActionEvent();
1740 if (__pCheckButton->GetRadioGroup() != null)
1742 __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
1747 AdjustHandlerPosition();
1749 __onOffHandlerPressed = false;
1750 __onOffHandlerMoved = false;
1754 if (bounds.Contains(touchPoint))
1756 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
1758 __pCheckButton->FireActionEvent();
1760 if (__pCheckButton->GetRadioGroup() != null)
1762 __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
1771 _CheckButtonPresenter::InitOnOffHandlerMoved(void)
1773 __onOffHandlerMoved = false;
1779 _CheckButtonPresenter::AdjustHandlerPosition(void)
1781 float handlerWidth = 0.0f;
1782 GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_HANDLER_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, handlerWidth);
1784 if (__onOffHandlerMoved == false)
1786 if (!__pCheckButton->IsSelected())
1788 __onOffHandlerPosition = __onOffSlidingButtonBounds.x;
1792 __onOffHandlerPosition = __onOffSlidingButtonBounds.x + __onOffSlidingButtonBounds.width - (handlerWidth / 2.0f);
1797 if (!__pCheckButton->IsSelected())
1799 if (__onOffHandlerPosition < __onOffSlidingButtonBounds.x + (__onOffSlidingButtonBounds.width / 2.0f))
1801 __onOffHandlerPosition = __onOffSlidingButtonBounds.x;
1805 __onOffHandlerPosition = __onOffSlidingButtonBounds.x + __onOffSlidingButtonBounds.width - (handlerWidth / 2.0f);
1807 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
1809 __pCheckButton->FireActionEvent();
1811 if (__pCheckButton->GetRadioGroup() != null)
1813 __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
1819 if (__onOffHandlerPosition < __onOffSlidingButtonBounds.x + (__onOffSlidingButtonBounds.width / 2.0f))
1821 __onOffHandlerPosition = __onOffSlidingButtonBounds.x;
1823 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
1825 __pCheckButton->FireActionEvent();
1827 if (__pCheckButton->GetRadioGroup() != null)
1829 __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
1834 __onOffHandlerPosition = __onOffSlidingButtonBounds.x + __onOffSlidingButtonBounds.width - (handlerWidth / 2.0f);
1839 __pCheckButton->Invalidate();
1845 _CheckButtonPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
1847 if (&source != __pCheckButton)
1852 if (!__pCheckButton->IsEnabled())
1857 FloatPoint touchPoint = touchinfo.GetCurrentPosition();
1859 touchPoint.x += source.GetClientBoundsF().x;
1860 touchPoint.y += source.GetClientBoundsF().y;
1862 FloatRectangle bounds = __pCheckButton->GetClientBoundsF();
1863 bool isInCheckButtonArea = bounds.Contains(touchPoint);
1864 bool isInOnOffHandlerArea = __onOffSlidingButtonBounds.Contains(touchPoint);
1865 bool isDetailedArea = __detailedButtonBounds.Contains(touchPoint);
1867 CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
1869 if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1871 if (__onOffHandlerPressed == true)
1873 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
1877 if (isInCheckButtonArea == true && __touchMoveHandled == false && isInOnOffHandlerArea == false )
1879 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
1883 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
1887 else if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1889 if (isDetailedArea == true && __touchMoveHandled == false)
1891 __detailedPressed = true;
1893 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
1897 __detailedPressed = false;
1899 if (isInCheckButtonArea == true && __touchMoveHandled == false && isDetailedArea == false )
1901 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
1905 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
1911 if (isInCheckButtonArea == true && __touchMoveHandled == false)
1913 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
1917 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
1921 if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1923 if (isInOnOffHandlerArea == true && __onOffHandlerPressed == true)
1925 __onOffHandlerPosition = touchPoint.x;
1927 __onOffHandlerMoved = true;
1931 __pCheckButton->Invalidate();
1933 if (__onOffHandlerMoved == true)
1944 _CheckButtonPresenter::DrawOnOffSlidingHandler(float handlerPosition)
1946 Canvas* pCanvas = __pCheckButton->GetCanvasN();
1947 if (pCanvas == null)
1949 SysLog(NID_UI_CTRL, "Cannot get a canvas.");
1954 Bitmap* pReColorBgBitmap = null;
1956 Color detailedHighlightedBgColor;
1957 GET_COLOR_CONFIG(CHECKBUTTON::DETAILED_ICON_BG_HIGHLIGHTED, detailedHighlightedBgColor);
1959 float handlerMargin = 0.0f;
1960 float handlerWidth = 0.0f;
1962 _CheckButtonStatus checkStatus = __pCheckButton->GetCheckButtonStatus();
1964 GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_HANDLER_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, handlerMargin);
1965 GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_HANDLER_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, handlerWidth);
1967 if (handlerPosition < __onOffSlidingButtonBounds.x)
1969 handlerPosition = __onOffSlidingButtonBounds.x;
1972 if (handlerPosition > __onOffSlidingButtonBounds.x + __onOffSlidingButtonBounds.width - handlerWidth)
1974 handlerPosition = __onOffSlidingButtonBounds.x + __onOffSlidingButtonBounds.width - handlerWidth;
1977 if (!__pCheckButton->IsSelected())
1979 if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
1981 Bitmap* pOnOffSlidingNormalBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1983 if (pOnOffSlidingNormalBgBitmap)
1985 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingNormalBgBitmap);
1988 Bitmap* pOnOffSlidingOffHandlerNormalBitmap = __pCheckButton->GetOnOffSlidingOffHandlerBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1990 if (pOnOffSlidingOffHandlerNormalBitmap)
1992 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOffHandlerNormalBitmap);
1995 else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
1997 Bitmap* pOnOffSlidingDisabledBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_DISABLED);
1999 if (pOnOffSlidingDisabledBgBitmap)
2001 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingDisabledBgBitmap);
2004 Bitmap* pOnOffSlidingOffHandlerDisabledBitmap = __pCheckButton->GetOnOffSlidingOffHandlerBitmap(_CHECK_BUTTON_STATUS_DISABLED);
2006 if (pOnOffSlidingOffHandlerDisabledBitmap)
2008 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOffHandlerDisabledBitmap);
2011 else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
2013 Bitmap* pOnOffSlidingPressedBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_PRESSED);
2015 if (pOnOffSlidingPressedBgBitmap)
2017 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingPressedBgBitmap);
2020 Bitmap* pOnOffSlidingOffHandlerPressedBitmap = __pCheckButton->GetOnOffSlidingOffHandlerBitmap(_CHECK_BUTTON_STATUS_PRESSED);
2022 if (pOnOffSlidingOffHandlerPressedBitmap)
2024 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOffHandlerPressedBitmap);
2027 else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
2029 Bitmap* pOnOffSlidingHighlightedBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2031 if (pOnOffSlidingHighlightedBgBitmap)
2033 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingHighlightedBgBitmap);
2036 Bitmap* pOnOffSlidingOffHandlerNormalBitmap = __pCheckButton->GetOnOffSlidingOffHandlerBitmap(_CHECK_BUTTON_STATUS_NORMAL);
2038 if (pOnOffSlidingOffHandlerNormalBitmap)
2040 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOffHandlerNormalBitmap);
2043 Bitmap* pOnOffSlidingOffHandlerHighlightedBitmap = __pCheckButton->GetOnOffSlidingOffHandlerBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2045 if (pOnOffSlidingOffHandlerHighlightedBitmap)
2047 pReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pOnOffSlidingOffHandlerHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA),
2048 detailedHighlightedBgColor);
2051 if (pReColorBgBitmap && __highlightedIndex == 1)
2053 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pReColorBgBitmap);
2056 else if (checkStatus == _CHECK_BUTTON_STATUS_SELECTED)
2058 Bitmap* pOnOffSlidingSelectedBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_SELECTED);
2060 if (pOnOffSlidingSelectedBgBitmap)
2062 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingSelectedBgBitmap);
2065 Bitmap* pOnOffSlidingOffHandlerSelectedBitmap = __pCheckButton->GetOnOffSlidingOffHandlerBitmap(_CHECK_BUTTON_STATUS_SELECTED);
2067 if (pOnOffSlidingOffHandlerSelectedBitmap)
2069 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOffHandlerSelectedBitmap);
2075 if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
2077 Bitmap* pOnOffSlidingNormalBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_NORMAL);
2079 if (pOnOffSlidingNormalBgBitmap)
2081 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingNormalBgBitmap);
2084 Bitmap* pOnOffSlidingOnHandlerNormalBitmap = __pCheckButton->GetOnOffSlidingOnHandlerBitmap(_CHECK_BUTTON_STATUS_NORMAL);
2086 if (pOnOffSlidingOnHandlerNormalBitmap)
2088 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOnHandlerNormalBitmap);
2091 else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
2093 Bitmap* pOnOffSlidingDisabledBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_DISABLED);
2095 if (pOnOffSlidingDisabledBgBitmap)
2097 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingDisabledBgBitmap);
2100 Bitmap* pOnOffSlidingOnHandlerDisabledBitmap = __pCheckButton->GetOnOffSlidingOnHandlerBitmap(_CHECK_BUTTON_STATUS_DISABLED);
2102 if (pOnOffSlidingOnHandlerDisabledBitmap)
2104 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOnHandlerDisabledBitmap);
2107 else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
2109 Bitmap* pOnOffSlidingPressedBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_PRESSED);
2111 if (pOnOffSlidingPressedBgBitmap)
2113 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingPressedBgBitmap);
2116 Bitmap* pOnOffSlidingOnHandlerPressedBitmap = __pCheckButton->GetOnOffSlidingOnHandlerBitmap(_CHECK_BUTTON_STATUS_PRESSED);
2118 if (pOnOffSlidingOnHandlerPressedBitmap)
2120 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOnHandlerPressedBitmap);
2123 else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
2125 Bitmap* pOnOffSlidingHighlightedBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2127 if (pOnOffSlidingHighlightedBgBitmap)
2129 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingHighlightedBgBitmap);
2132 Bitmap* pOnOffSlidingOnHandlerNormalBitmap = __pCheckButton->GetOnOffSlidingOnHandlerBitmap(_CHECK_BUTTON_STATUS_NORMAL);
2134 if (pOnOffSlidingOnHandlerNormalBitmap)
2136 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOnHandlerNormalBitmap);
2139 Bitmap* pOnOffSlidingOnHandlerHighlightedBitmap = __pCheckButton->GetOnOffSlidingOnHandlerBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2141 if (pOnOffSlidingOnHandlerHighlightedBitmap)
2143 pReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pOnOffSlidingOnHandlerHighlightedBitmap, Color::GetColor(COLOR_ID_MAGENTA),
2144 detailedHighlightedBgColor);
2147 if (pReColorBgBitmap && __highlightedIndex == 1)
2149 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pReColorBgBitmap);
2152 else if (checkStatus == _CHECK_BUTTON_STATUS_SELECTED)
2154 Bitmap* pOnOffSlidingSelectedBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_SELECTED);
2156 if (pOnOffSlidingSelectedBgBitmap)
2158 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingSelectedBgBitmap);
2161 Bitmap* pOnOffSlidingOnHandlerSelectedBitmap = __pCheckButton->GetOnOffSlidingOnHandlerBitmap(_CHECK_BUTTON_STATUS_SELECTED);
2163 if (pOnOffSlidingOnHandlerSelectedBitmap)
2165 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOnHandlerSelectedBitmap);
2171 delete pReColorBgBitmap;
2177 _CheckButtonPresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
2179 if (&source != __pCheckButton)
2184 if (!__pCheckButton->IsEnabled())
2189 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
2190 __pCheckButton->Invalidate();
2196 _CheckButtonPresenter::OnTouchMoveHandled(const _Control& control)
2198 __touchMoveHandled = true;
2199 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
2200 __pCheckButton->Invalidate();
2206 _CheckButtonPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
2208 _KeyCode keyCode = keyInfo.GetKeyCode();
2210 CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
2212 if (__pCheckButton->IsFocusModeStateEnabled() == true && keyCode == _KEY_ENTER)
2214 if (__pCheckButton->GetCheckButtonStatus() != _CHECK_BUTTON_STATUS_DISABLED)
2216 if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
2218 if (__highlightedIndex == 1)
2220 __onOffHandlerPressed = true;
2224 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
2227 else if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
2229 if (__highlightedIndex == 2)
2231 __detailedPressed = true;
2235 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
2238 else if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
2240 if (__highlightedIndex == 1)
2242 __detailedPressed = true;
2246 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
2251 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
2256 __pCheckButton->Invalidate();
2262 _CheckButtonPresenter::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
2264 _KeyCode keyCode = keyInfo.GetKeyCode();
2266 CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
2268 if (__pCheckButton->IsFocusModeStateEnabled() == true && keyCode == _KEY_LEFT)
2270 if (checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER)
2272 __highlightedIndex = 0;
2274 else if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
2276 if (__highlightedIndex == 0)
2278 __highlightedIndex = 1;
2280 else if (__highlightedIndex == 1)
2282 __highlightedIndex = 2;
2284 else if (__highlightedIndex == 2)
2286 __highlightedIndex = 0;
2291 if (__highlightedIndex == 0)
2293 __highlightedIndex = 1;
2295 else if (__highlightedIndex == 1)
2297 __highlightedIndex = 0;
2301 __pCheckButton->Invalidate();
2303 else if (__pCheckButton->IsFocusModeStateEnabled() == true && keyCode == _KEY_RIGHT)
2305 if (checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER)
2307 __highlightedIndex = 0;
2309 else if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
2311 if (__highlightedIndex == 0)
2313 __highlightedIndex = 2;
2315 else if (__highlightedIndex == 1)
2317 __highlightedIndex = 0;
2319 else if (__highlightedIndex == 2)
2321 __highlightedIndex = 1;
2326 if (__highlightedIndex == 0)
2328 __highlightedIndex = 1;
2330 else if (__highlightedIndex == 1)
2332 __highlightedIndex = 0;
2336 __pCheckButton->Invalidate();
2338 else if (__pCheckButton->IsFocusModeStateEnabled() == true && keyCode == _KEY_ENTER)
2340 if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON
2341 || checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
2343 StartCheckAnimationTimer();
2347 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
2348 __pCheckButton->Invalidate();
2350 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2352 if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
2354 if (__highlightedIndex != 2)
2356 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
2358 __pCheckButton->FireActionEvent();
2360 if (__pCheckButton->GetRadioGroup() != null)
2362 __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
2367 __detailedPressed = false;
2370 else if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
2372 if (__highlightedIndex != 1)
2374 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
2376 __pCheckButton->FireActionEvent();
2378 if (__pCheckButton->GetRadioGroup() != null)
2380 __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
2385 __detailedPressed = false;
2388 else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING)
2390 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
2392 __pCheckButton->FireActionEvent();
2394 if (__pCheckButton->GetRadioGroup() != null)
2396 __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
2399 AdjustHandlerPosition();
2401 __onOffHandlerPressed = false;
2402 __onOffHandlerMoved = false;
2406 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
2408 __pCheckButton->FireActionEvent();
2410 if (__pCheckButton->GetRadioGroup() != null)
2412 __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
2421 _CheckButtonPresenter::IsEnabledStateChanged(void)
2423 bool __currentEnabledState = __pCheckButton->GetEnableState();
2425 if (__currentEnabledState != __previousEnabledState)
2427 __previousEnabledState = __currentEnabledState;
2437 _CheckButtonPresenter::CalculateTitleTextBounds(void)
2439 float checkButtonLeftMargin = 0.0f;
2440 float checkButtonTopMargin = 0.0f;
2441 float checkButtonBitmapWidth = 0.0f;
2442 float checkButtonOnOffSlidingBitmapWidth = 0.0f;
2443 float checkButtonDetailedBitmapWidth = 0.0f;
2444 float checkButtonTitleTextHeight = 0.0f;
2445 float checkButtonTextHeight = 0.0f;
2447 FloatDimension minDimension(0.0f, 0.0f);
2448 FloatDimension minDimensionWithAnnex(0.0f, 0.0f);
2450 GET_SHAPE_CONFIG(CHECKBUTTON::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonLeftMargin);
2451 GET_SHAPE_CONFIG(CHECKBUTTON::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTopMargin);
2452 GET_SHAPE_CONFIG(CHECKBUTTON::MARK_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonBitmapWidth);
2453 GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonOnOffSlidingBitmapWidth);
2454 GET_SHAPE_CONFIG(CHECKBUTTON::DETAILED_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonDetailedBitmapWidth);
2455 GET_SHAPE_CONFIG(CHECKBUTTON::TITLE_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTitleTextHeight);
2456 GET_SHAPE_CONFIG(CHECKBUTTON::TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTextHeight);
2458 GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION, __pCheckButton->GetOrientation(), minDimension);
2459 GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION_WITH_ANNEX, __pCheckButton->GetOrientation(), minDimensionWithAnnex);
2461 FloatRectangle bounds(0.0f, 0.0f, __pCheckButton->GetBoundsF().width, __pCheckButton->GetBoundsF().height);
2463 CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
2465 if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_ONOFF
2466 || checkStyle == CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER)
2468 if (bounds.width < minDimension.width )
2470 bounds.width = minDimension.width;
2473 if (bounds.height < minDimension.height )
2475 bounds.height = minDimension.height;
2480 if (bounds.width < minDimensionWithAnnex.width )
2482 bounds.width = minDimensionWithAnnex.width;
2485 if (bounds.height < minDimensionWithAnnex.height )
2487 bounds.height = minDimensionWithAnnex.height;
2491 if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
2493 __titleTextBounds.x = checkButtonLeftMargin;
2494 __titleTextBounds.y = checkButtonTopMargin;
2495 __titleTextBounds.width = bounds.width - checkButtonLeftMargin * 3 - checkButtonOnOffSlidingBitmapWidth;
2496 __titleTextBounds.height = bounds.height - checkButtonTopMargin * 2 - __textBounds.height;
2500 if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
2502 __titleTextBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth;
2503 __titleTextBounds.y = checkButtonTopMargin;
2504 __titleTextBounds.width = bounds.width - checkButtonLeftMargin * 4 - checkButtonBitmapWidth - checkButtonDetailedBitmapWidth;
2505 __titleTextBounds.height = bounds.height - checkButtonTopMargin * 2 - __textBounds.height;
2509 __titleTextBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth;
2510 __titleTextBounds.y = checkButtonTopMargin;
2511 __titleTextBounds.width = bounds.width - checkButtonLeftMargin * 3 - checkButtonBitmapWidth;
2512 __titleTextBounds.height = bounds.height - checkButtonTopMargin * 2 - __textBounds.height;
2520 _CheckButtonPresenter::CalculateTextBounds(void)
2522 float checkButtonLeftMargin = 0.0f;
2523 float checkButtonTopMargin = 0.0f;
2524 float checkButtonBitmapWidth = 0.0f;
2525 float checkButtonOnOffSlidingBitmapWidth = 0.0f;
2526 float checkButtonDetailedBitmapWidth = 0.0f;
2527 float checkButtonTitleTextHeight = 0.0f;
2528 float checkButtonTextHeight = 0.0f;
2530 FloatDimension minDimension(0.0f, 0.0f);
2531 FloatDimension minDimensionWithAnnex(0.0f, 0.0f);
2533 GET_SHAPE_CONFIG(CHECKBUTTON::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonLeftMargin);
2534 GET_SHAPE_CONFIG(CHECKBUTTON::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTopMargin);
2535 GET_SHAPE_CONFIG(CHECKBUTTON::MARK_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonBitmapWidth);
2536 GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonOnOffSlidingBitmapWidth);
2537 GET_SHAPE_CONFIG(CHECKBUTTON::DETAILED_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonDetailedBitmapWidth);
2538 GET_SHAPE_CONFIG(CHECKBUTTON::TITLE_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTitleTextHeight);
2539 GET_SHAPE_CONFIG(CHECKBUTTON::TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTextHeight);
2541 GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION, __pCheckButton->GetOrientation(), minDimension);
2542 GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION_WITH_ANNEX, __pCheckButton->GetOrientation(), minDimensionWithAnnex);
2544 FloatRectangle bounds(0.0f, 0.0f, __pCheckButton->GetBoundsF().width, __pCheckButton->GetBoundsF().height);
2546 CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
2547 bool showTitle = __pCheckButton->GetShowTitle();
2549 if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_ONOFF
2550 || checkStyle == CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER)
2552 if (bounds.width < minDimension.width )
2554 bounds.width = minDimension.width;
2557 if (bounds.height < minDimension.height )
2559 bounds.height = minDimension.height;
2564 if (bounds.width < minDimensionWithAnnex.width )
2566 bounds.width = minDimensionWithAnnex.width;
2569 if (bounds.height < minDimensionWithAnnex.height )
2571 bounds.height = minDimensionWithAnnex.height;
2575 if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
2579 __textBounds.x = checkButtonLeftMargin;
2580 __textBounds.y = checkButtonTopMargin + checkButtonTitleTextHeight;
2581 __textBounds.width = bounds.width - checkButtonLeftMargin * 3 - checkButtonOnOffSlidingBitmapWidth;
2582 __textBounds.height = bounds.height - checkButtonTopMargin * 2 - checkButtonTitleTextHeight;
2586 __textBounds.x = checkButtonLeftMargin;
2587 __textBounds.y = checkButtonTopMargin;
2588 __textBounds.width = bounds.width - checkButtonLeftMargin * 3 - checkButtonOnOffSlidingBitmapWidth;
2589 __textBounds.height = bounds.height - checkButtonTopMargin * 2;
2594 if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
2598 __textBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth;
2599 __textBounds.y = checkButtonTopMargin + checkButtonTitleTextHeight;
2600 __textBounds.width = bounds.width - checkButtonLeftMargin * 4 - checkButtonBitmapWidth - checkButtonDetailedBitmapWidth;
2601 __textBounds.height = bounds.height - checkButtonTopMargin * 2 - checkButtonTitleTextHeight;
2605 __textBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth;
2606 __textBounds.y = checkButtonTopMargin;
2607 __textBounds.width = bounds.width - checkButtonLeftMargin * 4 - checkButtonBitmapWidth - checkButtonDetailedBitmapWidth;
2608 __textBounds.height = bounds.height - checkButtonTopMargin * 2;
2615 __textBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth;
2616 __textBounds.y = checkButtonTopMargin + checkButtonTitleTextHeight;
2617 __textBounds.width = bounds.width - checkButtonLeftMargin * 3 - checkButtonBitmapWidth;
2618 __textBounds.height = bounds.height - checkButtonTopMargin * 2 - checkButtonTitleTextHeight;
2622 __textBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth;
2623 __textBounds.y = checkButtonTopMargin;
2624 __textBounds.width = bounds.width - checkButtonLeftMargin * 3 - checkButtonBitmapWidth;
2625 __textBounds.height = bounds.height - checkButtonTopMargin * 2;
2634 _CheckButtonPresenter::CalculateButtonBounds(void)
2636 float checkButtonLeftMargin = 0.0f;
2637 float checkButtonBitmapWidth = 0.0f;
2638 float checkButtonBitmapHeight = 0.0f;
2639 float checkButtonOnOffSlidingBitmapWidth = 0.0f;
2640 float checkButtonOnOffSlidingBitmapHeight = 0.0f;
2641 float checkButtonDetaieldBitmapWidth = 0.0f;
2642 float checkButtonDetaieldBitmapHeight = 0.0f;
2644 FloatDimension minDimension(0.0f, 0.0f);
2645 FloatDimension minDimensionWithAnnex(0.0f, 0.0f);
2647 GET_SHAPE_CONFIG(CHECKBUTTON::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonLeftMargin);
2648 GET_SHAPE_CONFIG(CHECKBUTTON::MARK_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonBitmapWidth);
2649 GET_SHAPE_CONFIG(CHECKBUTTON::MARK_BITMAP_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonBitmapHeight);
2650 GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonOnOffSlidingBitmapWidth);
2651 GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_BITMAP_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonOnOffSlidingBitmapHeight);
2652 GET_SHAPE_CONFIG(CHECKBUTTON::DETAILED_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonDetaieldBitmapWidth);
2653 GET_SHAPE_CONFIG(CHECKBUTTON::DETAILED_BITMAP_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonDetaieldBitmapHeight);
2655 GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION, __pCheckButton->GetOrientation(), minDimension);
2656 GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION_WITH_ANNEX, __pCheckButton->GetOrientation(), minDimensionWithAnnex);
2658 FloatRectangle bounds(0.0f, 0.0f, __pCheckButton->GetBoundsF().width, __pCheckButton->GetBoundsF().height);
2660 CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
2662 if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_ONOFF
2663 || checkStyle == CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER)
2665 if (bounds.width < minDimension.width )
2667 bounds.width = minDimension.width;
2670 if (bounds.height < minDimension.height )
2672 bounds.height = minDimension.height;
2677 if (bounds.width < minDimensionWithAnnex.width )
2679 bounds.width = minDimensionWithAnnex.width;
2682 if (bounds.height < minDimensionWithAnnex.height )
2684 bounds.height = minDimensionWithAnnex.height;
2688 __defaultButtonBounds.x = checkButtonLeftMargin;
2689 __defaultButtonBounds.y = (bounds.height - checkButtonBitmapHeight) / 2;
2690 __defaultButtonBounds.width = checkButtonBitmapWidth;
2691 __defaultButtonBounds.height = checkButtonBitmapHeight;
2693 __onOffSlidingButtonBounds.x = bounds.width - checkButtonLeftMargin - checkButtonOnOffSlidingBitmapWidth;
2694 __onOffSlidingButtonBounds.y = (bounds.height - checkButtonOnOffSlidingBitmapHeight) / 2;
2695 __onOffSlidingButtonBounds.width = checkButtonOnOffSlidingBitmapWidth;
2696 __onOffSlidingButtonBounds.height = checkButtonOnOffSlidingBitmapHeight;
2698 __detailedButtonBounds.x = bounds.width - checkButtonLeftMargin - checkButtonDetaieldBitmapWidth;
2699 __detailedButtonBounds.y = (bounds.height - checkButtonDetaieldBitmapHeight) / 2;
2700 __detailedButtonBounds.width = checkButtonDetaieldBitmapWidth;
2701 __detailedButtonBounds.height = checkButtonDetaieldBitmapHeight;
2707 _CheckButtonPresenter::GetTitleTextBoundsF(void) const
2709 return __titleTextBounds;
2713 _CheckButtonPresenter::GetTextBoundsF(void) const
2715 return __textBounds;
2719 _CheckButtonPresenter::GetDefaultButtonBoundsF(void) const
2721 return __defaultButtonBounds;
2725 _CheckButtonPresenter::GetOnOffSlidingButtonBoundsF(void) const
2727 return __onOffSlidingButtonBounds;
2731 _CheckButtonPresenter::GetDetailedButtonBoundsF(void) const
2733 return __detailedButtonBounds;
2737 _CheckButtonPresenter::StartCheckAnimationTimer(void)
2739 result r = E_SUCCESS;
2740 if (__pCheckAnimationTimer == null)
2742 __pCheckAnimationTimer = new (std::nothrow) Timer;
2743 SysTryReturn(NID_UI_CTRL, (__pCheckAnimationTimer != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memroy allocation failed.");
2745 r = __pCheckAnimationTimer->Construct(*this);
2746 SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
2750 __pCheckAnimationTimer->Cancel();
2753 __pCheckAnimationTimer->Start(CHECK_ACTION_TIMER_PERIOD);
2754 SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
2758 ResetCheckAnimationTimer();
2763 _CheckButtonPresenter::ResetCheckAnimationTimer(void)
2765 delete __pCheckAnimationTimer;
2766 __pCheckAnimationTimer = null;
2772 _CheckButtonPresenter::OnTimerExpired(Timer& timer)
2776 if (__ratio <= RATIO_MAX)
2778 StartCheckAnimationTimer();
2779 DrawMarkAnimation();
2783 ResetCheckAnimationTimer();
2791 _CheckButtonPresenter::OnDrawFocus(void)
2793 if (__pCheckButton->GetCheckButtonStatus() != _CHECK_BUTTON_STATUS_DISABLED)
2795 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2796 __pCheckButton->Invalidate();
2803 _CheckButtonPresenter::OnChildControlFocusMoved(const _Control& control)
2809 _CheckButtonPresenter::IsChildControlFocusManage(void) const
2815 _CheckButtonPresenter::OnFocusableStateChanged(bool focusalbeState)
2821 _CheckButtonPresenter::OnFocusModeStateChanged(void)
2823 if (__pCheckButton->GetCheckButtonStatus() != _CHECK_BUTTON_STATUS_DISABLED)
2825 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
2826 __pCheckButton->Invalidate();
2833 _CheckButtonPresenter::OnFocusGained(const _Control& source)
2835 __highlightedIndex = 0;
2837 if (__pCheckButton->IsFocusModeStateEnabled() == true)
2839 if (__pCheckButton->GetCheckButtonStatus() != _CHECK_BUTTON_STATUS_DISABLED)
2841 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2842 __pCheckButton->Invalidate();
2850 _CheckButtonPresenter::OnFocusLost(const _Control& source)
2852 if (__pCheckButton->GetCheckButtonStatus() != _CHECK_BUTTON_STATUS_DISABLED)
2854 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
2855 __pCheckButton->Invalidate();
2861 _CheckButtonPresenter::DrawMarkAnimation(void)
2863 Canvas* pCanvas = __pCheckButton->GetCanvasN();
2864 if (pCanvas == null)
2866 SysLog(NID_UI_CTRL, "Cannot get a canvas.");
2871 _CheckButtonStatus checkStatus = __pCheckButton->GetCheckButtonStatus();
2873 if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
2875 Bitmap* pMarkNormalBitmap = __pCheckButton->GetMarkBitmap(_CHECK_BUTTON_STATUS_NORMAL);
2877 if (__pCheckButton->IsSelected() && pMarkNormalBitmap)
2879 FloatRectangle sourceRect(0.0f, 0.0f, pMarkNormalBitmap->GetWidthF() * __ratio * 0.1, pMarkNormalBitmap->GetHeightF());
2880 FloatRectangle destRect(__defaultButtonBounds.x, __defaultButtonBounds.y, pMarkNormalBitmap->GetWidthF() * __ratio * 0.1, pMarkNormalBitmap->GetHeightF());
2882 pCanvas->DrawBitmap(destRect, *pMarkNormalBitmap, sourceRect);
2885 else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
2887 Bitmap* pMarkDisabledBitmap = __pCheckButton->GetMarkBitmap(_CHECK_BUTTON_STATUS_DISABLED);
2889 if (__pCheckButton->IsSelected() && pMarkDisabledBitmap)
2891 FloatRectangle sourceRect(0.0f, 0.0f, pMarkDisabledBitmap->GetWidthF() * __ratio * 0.1, pMarkDisabledBitmap->GetHeightF());
2892 FloatRectangle destRect(__defaultButtonBounds.x, __defaultButtonBounds.y, pMarkDisabledBitmap->GetWidthF() * __ratio * 0.1, pMarkDisabledBitmap->GetHeightF());
2894 pCanvas->DrawBitmap(destRect, *pMarkDisabledBitmap, sourceRect);
2897 else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
2899 Bitmap* pMarkPressedBitmap = __pCheckButton->GetMarkBitmap(_CHECK_BUTTON_STATUS_PRESSED);
2901 if (__pCheckButton->IsSelected() && pMarkPressedBitmap)
2903 FloatRectangle sourceRect(0.0f, 0.0f, pMarkPressedBitmap->GetWidthF() * __ratio * 0.1, pMarkPressedBitmap->GetHeightF());
2904 FloatRectangle destRect(__defaultButtonBounds.x, __defaultButtonBounds.y, pMarkPressedBitmap->GetWidthF() * __ratio * 0.1, pMarkPressedBitmap->GetHeightF());
2906 pCanvas->DrawBitmap(destRect, *pMarkPressedBitmap, sourceRect);
2909 else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
2911 Bitmap* pMarkHighlightedBitmap = __pCheckButton->GetMarkBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2913 if (__pCheckButton->IsSelected() && pMarkHighlightedBitmap)
2915 FloatRectangle sourceRect(0.0f, 0.0f, pMarkHighlightedBitmap->GetWidthF() * __ratio * 0.1, pMarkHighlightedBitmap->GetHeightF());
2916 FloatRectangle destRect(__defaultButtonBounds.x, __defaultButtonBounds.y, pMarkHighlightedBitmap->GetWidthF() * __ratio * 0.1, pMarkHighlightedBitmap->GetHeightF());
2918 pCanvas->DrawBitmap(destRect, *pMarkHighlightedBitmap, sourceRect);
2921 else if (checkStatus == _CHECK_BUTTON_STATUS_SELECTED)
2923 Bitmap* pMarkSelectedBitmap = __pCheckButton->GetMarkBitmap(_CHECK_BUTTON_STATUS_SELECTED);
2925 if (__pCheckButton->IsSelected() && pMarkSelectedBitmap)
2927 FloatRectangle sourceRect(0.0f, 0.0f, pMarkSelectedBitmap->GetWidthF() * __ratio * 0.1, pMarkSelectedBitmap->GetHeightF());
2928 FloatRectangle destRect(__defaultButtonBounds.x, __defaultButtonBounds.y, pMarkSelectedBitmap->GetWidthF() * __ratio * 0.1, pMarkSelectedBitmap->GetHeightF());
2930 pCanvas->DrawBitmap(destRect, *pMarkSelectedBitmap, sourceRect);
2939 }}} // Tizen::Ui::Controls