Fix a log error
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrl_CheckButtonPresenter.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
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.
16 //
17 /**
18  * @file                FUiCtrl_CheckButtonPresenter.cpp
19  * @brief               This is the implementation file for the _CheckButtonPresenter class.
20  */
21
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"
35
36 using namespace Tizen::Base;
37 using namespace Tizen::Graphics;
38 using namespace Tizen::Graphics::_Text;
39 using namespace Tizen::Base::Runtime;
40
41 namespace Tizen { namespace Ui { namespace Controls
42 {
43
44 _CheckButtonPresenter::_CheckButtonPresenter(void)
45         : __pCheckButton(null)
46         , __pCheckButtonModel(null)
47         , __previousEnabledState(false)
48         , __touchMoveHandled(false)
49         , __pTextFont(null)
50         , __pTitleTextFont(null)
51         , __pTextObject(null)
52         , __pTitleTextObject(null)
53         , __titleTextBounds(FloatRectangle())
54         , __textBounds(FloatRectangle())
55         , __defaultButtonBounds(FloatRectangle())
56         , __onOffSlidingButtonBounds(FloatRectangle())
57         , __detailedButtonBounds(FloatRectangle())
58         , __fontStyle(0)
59         , __fontSize(0.0f)
60         , __pCheckAnimationTimer(null)
61         , __ratio(10)
62         , __onOffHandlerPosition(0.0f)
63         , __onOffHandlerPressed(false)
64         , __onOffHandlerMoved(false)
65         , __highlightedIndex(0)
66         , __detailedPressed(false)
67 {
68
69 }
70
71 _CheckButtonPresenter::~_CheckButtonPresenter(void)
72 {
73         if (__pCheckButtonModel)
74         {
75                 delete __pCheckButtonModel;
76                 __pCheckButtonModel = null;
77         }
78
79         if (__pTextObject)
80         {
81                 delete __pTextObject;
82                 __pTextObject = null;
83         }
84
85         if (__pTitleTextObject)
86         {
87                 delete __pTitleTextObject;
88                 __pTitleTextObject = null;
89         }
90
91         if (__pCheckAnimationTimer)
92         {
93                 delete __pCheckAnimationTimer;
94                 __pCheckAnimationTimer = null;
95         }
96 }
97
98 result
99 _CheckButtonPresenter::Construct(const _CheckButton& checkButton)
100 {
101         result r = E_SUCCESS;
102
103         __pCheckButton = const_cast <_CheckButton*>(&checkButton);
104
105         __fontStyle = FONT_STYLE_PLAIN;
106
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.");
109
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.");
112
113         __pTextObject->Construct();
114         __pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
115         __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
116
117         __pTitleTextObject->Construct();
118         __pTitleTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
119         __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
120
121         CalculateTextBounds();
122         CalculateTitleTextBounds();
123         CalculateButtonBounds();
124
125         return E_SUCCESS;
126
127 CATCH:
128
129         delete __pTextObject;
130         __pTextObject = null;
131
132         delete __pTitleTextObject;
133         __pTitleTextObject = null;
134
135         return r;
136 }
137
138 result
139 _CheckButtonPresenter::Install(void)
140 {
141         result r = E_SUCCESS;
142
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.");
145
146         r = SetModel(*pModel);
147         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
148
149         r = pModel->Construct();
150         SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
151
152         return E_SUCCESS;
153
154 CATCH:
155         delete pModel;
156         return r;
157 }
158
159 result
160 _CheckButtonPresenter::SetModel(const _CheckButtonModel& checkButtonModel)
161 {
162         __pCheckButtonModel = const_cast <_CheckButtonModel*>(&checkButtonModel);
163
164         return E_SUCCESS;
165 }
166
167 void
168 _CheckButtonPresenter::OnFontChanged(Font* pFont)
169 {
170         __pTextFont = pFont;
171         __pTitleTextFont = pFont;
172
173         return;
174 }
175
176 void
177 _CheckButtonPresenter::OnFontInfoRequested(unsigned long& style, int& size)
178 {
179         style = __fontStyle;
180         size = _CoordinateSystemUtils::ConvertToInteger(__fontSize);
181
182         return;
183 }
184
185 void
186 _CheckButtonPresenter::OnFontInfoRequested(unsigned long& style, float& size)
187 {
188         style = __fontStyle;
189         size =  __fontSize;
190
191         return;
192 }
193
194 void
195 _CheckButtonPresenter::SetFontInfo(unsigned long style, float size)
196 {
197         __fontStyle = style;
198         __fontSize = size;
199
200         return;
201 }
202
203 void
204 _CheckButtonPresenter::Draw(void)
205 {
206         DrawBackground();
207         DrawCheckBitmap();
208         DrawText();
209
210         return;
211 }
212
213 void
214 _CheckButtonPresenter::DrawBackground(void)
215 {
216         Canvas* pCanvas = __pCheckButton->GetCanvasN();
217         if (pCanvas == null)
218         {
219                 SysLog(NID_UI_CTRL, "Cannot get a canvas.");
220
221                 return;
222         }
223
224         Bitmap* pBgBitmap = null;
225         Bitmap* pReColorBgBitmap = null;
226
227         Bitmap* pHighlightedBgBitmap = null;
228         Bitmap* pHighlightedReColorBgBitmap = null;
229
230         FloatDimension minDimension(0.0f, 0.0f);
231         FloatDimension minDimensionWithAnnex(0.0f, 0.0f);
232
233         GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION, __pCheckButton->GetOrientation(), minDimension);
234         GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION_WITH_ANNEX, __pCheckButton->GetOrientation(), minDimensionWithAnnex);
235
236         FloatRectangle bounds(0.0f, 0.0f, __pCheckButton->GetBoundsF().width, __pCheckButton->GetBoundsF().height);
237
238         _CheckButtonStatus checkStatus = __pCheckButton->GetCheckButtonStatus();
239         BackgroundStyle backgroundStyle = __pCheckButton->GetBackgroundStyle();
240         CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
241
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)
244         {
245                 if (bounds.width < minDimension.width)
246                 {
247                         bounds.width = minDimension.width;
248                 }
249
250                 if (bounds.height < minDimension.height)
251                 {
252                         bounds.height = minDimension.height;
253                 }
254         }
255         else
256         {
257                 if (bounds.width < minDimensionWithAnnex.width)
258                 {
259                         bounds.width = minDimensionWithAnnex.width;
260                 }
261
262                 if (bounds.height < minDimensionWithAnnex.height)
263                 {
264                         bounds.height = minDimensionWithAnnex.height;
265                 }
266         }
267
268         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
269         pCanvas->Clear();
270
271         if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
272         {
273                 if (backgroundStyle == BACKGROUND_STYLE_NONE)
274                 {
275                         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
276                         pCanvas->Clear();
277                 }
278                 else
279                 {
280                         pBgBitmap = __pCheckButton->GetBackgroundBitmap(__pCheckButton->GetGroupStyle(), _CHECK_BUTTON_STATUS_NORMAL);
281
282                         if (pBgBitmap && _BitmapImpl::CheckNinePatchedBitmapStrictly(*pBgBitmap))
283                         {
284                                 pReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgBitmap, Color::GetColor(COLOR_ID_MAGENTA),
285                                                 __pCheckButton->GetColor(_CHECK_BUTTON_STATUS_NORMAL));
286                                 if (pReColorBgBitmap)
287                                 {
288                                         pCanvas->DrawNinePatchedBitmap(bounds, *pReColorBgBitmap);
289                                 }
290
291                                 bool themeBgBitmap = false;
292
293                                 if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_SINGLE)
294                                 {
295                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_SINGLE_BG_NORMAL);
296                                 }
297                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_TOP)
298                                 {
299                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_TOP_BG_NORMAL);
300                                 }
301                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_MIDDLE)
302                                 {
303                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_MIDDLE_BG_NORMAL);
304                                 }
305                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_BOTTOM)
306                                 {
307                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_BOTTOM_BG_NORMAL);
308                                 }
309
310                                 if (themeBgBitmap == false)
311                                 {
312                                         Bitmap* pBgNormalEffectBitmap = __pCheckButton->GetBackgroundNormalEffectBitmap(__pCheckButton->GetGroupStyle());
313
314                                         if (pBgNormalEffectBitmap)
315                                         {
316                                                 pCanvas->DrawNinePatchedBitmap(bounds, *pBgNormalEffectBitmap);
317                                         }
318                                 }
319                         }
320                         else
321                         {
322                                 if (pBgBitmap)
323                                 {
324                                         pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBgBitmap);
325                                 }
326                         }
327                 }
328         }
329         else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
330         {
331                 if (backgroundStyle == BACKGROUND_STYLE_NONE)
332                 {
333                         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
334                         pCanvas->Clear();
335                 }
336                 else
337                 {
338                         pBgBitmap = __pCheckButton->GetBackgroundBitmap(__pCheckButton->GetGroupStyle(), _CHECK_BUTTON_STATUS_DISABLED);
339
340                         if (pBgBitmap && _BitmapImpl::CheckNinePatchedBitmapStrictly(*pBgBitmap))
341                         {
342                                 pReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgBitmap, Color::GetColor(COLOR_ID_MAGENTA),
343                                                 __pCheckButton->GetColor(_CHECK_BUTTON_STATUS_DISABLED));
344                                 if (pReColorBgBitmap)
345                                 {
346                                         pCanvas->DrawNinePatchedBitmap(bounds, *pReColorBgBitmap);
347                                 }
348
349                                 bool themeBgBitmap = false;
350
351                                 if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_SINGLE)
352                                 {
353                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_SINGLE_BG_DISABLED);
354                                 }
355                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_TOP)
356                                 {
357                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_TOP_BG_DISABLED);
358                                 }
359                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_MIDDLE)
360                                 {
361                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_MIDDLE_BG_DISABLED);
362                                 }
363                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_BOTTOM)
364                                 {
365                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_BOTTOM_BG_DISABLED);
366                                 }
367
368                                 if (themeBgBitmap == false)
369                                 {
370                                         Bitmap* pBgNormalEffectBitmap = __pCheckButton->GetBackgroundNormalEffectBitmap(__pCheckButton->GetGroupStyle());
371
372                                         if (pBgNormalEffectBitmap)
373                                         {
374                                                 pCanvas->DrawNinePatchedBitmap(bounds, *pBgNormalEffectBitmap);
375                                         }
376                                 }
377                         }
378                         else
379                         {
380                                 if (pBgBitmap)
381                                 {
382                                         pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBgBitmap);
383                                 }
384                         }
385                 }
386         }
387         else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
388         {
389                 if (backgroundStyle == BACKGROUND_STYLE_NONE)
390                 {
391                         pCanvas->SetBackgroundColor(__pCheckButton->GetColor(_CHECK_BUTTON_STATUS_PRESSED));
392                         pCanvas->Clear();
393                 }
394                 else
395                 {
396                         pBgBitmap = __pCheckButton->GetBackgroundBitmap(__pCheckButton->GetGroupStyle(), _CHECK_BUTTON_STATUS_PRESSED);
397
398                         if (pBgBitmap && _BitmapImpl::CheckNinePatchedBitmapStrictly(*pBgBitmap))
399                         {
400                                 pReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgBitmap, Color::GetColor(COLOR_ID_MAGENTA),
401                                                 __pCheckButton->GetColor(_CHECK_BUTTON_STATUS_PRESSED));
402                                 if (pReColorBgBitmap)
403                                 {
404                                         pCanvas->DrawNinePatchedBitmap(bounds, *pReColorBgBitmap);
405                                 }
406
407                                 bool themeBgBitmap = false;
408
409                                 if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_SINGLE)
410                                 {
411                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_SINGLE_BG_PRESSED);
412                                 }
413                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_TOP)
414                                 {
415                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_TOP_BG_PRESSED);
416                                 }
417                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_MIDDLE)
418                                 {
419                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_MIDDLE_BG_PRESSED);
420                                 }
421                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_BOTTOM)
422                                 {
423                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_BOTTOM_BG_PRESSED);
424                                 }
425
426                                 if (themeBgBitmap == false)
427                                 {
428                                         Bitmap* pBgPressedEffectBitmap = __pCheckButton->GetBackgroundPressedEffectBitmap(__pCheckButton->GetGroupStyle());
429
430                                         if (pBgPressedEffectBitmap)
431                                         {
432                                                 pCanvas->DrawNinePatchedBitmap(bounds, *pBgPressedEffectBitmap);
433                                         }
434                                 }
435                         }
436                         else
437                         {
438                                 if (pBgBitmap)
439                                 {
440                                         pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBgBitmap);
441                                 }
442                         }
443                 }
444         }
445         else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
446         {
447                 if (backgroundStyle == BACKGROUND_STYLE_NONE)
448                 {
449                         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
450                         pCanvas->Clear();
451
452                         pHighlightedBgBitmap = __pCheckButton->GetBackgroundBitmap(__pCheckButton->GetGroupStyle(), _CHECK_BUTTON_STATUS_HIGHLIGHTED);
453
454                         pHighlightedReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pHighlightedBgBitmap,
455                                         Color::GetColor(COLOR_ID_MAGENTA), __pCheckButton->GetColor(_CHECK_BUTTON_STATUS_HIGHLIGHTED));
456
457                         if (pHighlightedReColorBgBitmap && __highlightedIndex == 0)
458                         {
459                                 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pHighlightedReColorBgBitmap))
460                                 {
461                                         pCanvas->DrawNinePatchedBitmap(bounds, *pHighlightedReColorBgBitmap);
462                                 }
463                                 else
464                                 {
465                                         pCanvas->DrawBitmap(bounds, *pHighlightedReColorBgBitmap,
466                                                         FloatRectangle(0.0f, 0.0f, pHighlightedReColorBgBitmap->GetWidthF(), pHighlightedReColorBgBitmap->GetHeightF()));
467                                 }
468                         }
469                 }
470                 else
471                 {
472                         pBgBitmap = __pCheckButton->GetBackgroundBitmap(__pCheckButton->GetGroupStyle(), _CHECK_BUTTON_STATUS_NORMAL);
473
474                         if (pBgBitmap && _BitmapImpl::CheckNinePatchedBitmapStrictly(*pBgBitmap))
475                         {
476                                 pReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgBitmap, Color::GetColor(COLOR_ID_MAGENTA),
477                                                 __pCheckButton->GetColor(_CHECK_BUTTON_STATUS_NORMAL));
478                                 if (pReColorBgBitmap)
479                                 {
480                                         pCanvas->DrawNinePatchedBitmap(bounds, *pReColorBgBitmap);
481                                 }
482
483                                 bool themeBgBitmap = false;
484
485                                 if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_SINGLE)
486                                 {
487                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_SINGLE_BG_HIGHLIGHTED);
488                                 }
489                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_TOP)
490                                 {
491                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_TOP_BG_HIGHLIGHTED);
492                                 }
493                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_MIDDLE)
494                                 {
495                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_MIDDLE_BG_HIGHLIGHTED);
496                                 }
497                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_BOTTOM)
498                                 {
499                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_BOTTOM_BG_HIGHLIGHTED);
500                                 }
501
502                                 if (themeBgBitmap == false)
503                                 {
504                                         Bitmap* pBgPressedEffectBitmap = __pCheckButton->GetBackgroundPressedEffectBitmap(__pCheckButton->GetGroupStyle());
505
506                                         if (pBgPressedEffectBitmap)
507                                         {
508                                                 pCanvas->DrawNinePatchedBitmap(bounds, *pBgPressedEffectBitmap);
509                                         }
510                                 }
511                         }
512                         else
513                         {
514                                 if (pBgBitmap)
515                                 {
516                                         pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBgBitmap);
517                                 }
518                         }
519
520                         pHighlightedBgBitmap = __pCheckButton->GetBackgroundBitmap(__pCheckButton->GetGroupStyle(), _CHECK_BUTTON_STATUS_HIGHLIGHTED);
521
522                         pHighlightedReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pHighlightedBgBitmap,
523                                         Color::GetColor(COLOR_ID_MAGENTA), __pCheckButton->GetColor(_CHECK_BUTTON_STATUS_HIGHLIGHTED));
524
525                         if (pHighlightedReColorBgBitmap && __highlightedIndex == 0)
526                         {
527                                 if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pHighlightedReColorBgBitmap))
528                                 {
529                                         pCanvas->DrawNinePatchedBitmap(bounds, *pHighlightedReColorBgBitmap);
530                                 }
531                                 else
532                                 {
533                                         pCanvas->DrawBitmap(bounds, *pHighlightedReColorBgBitmap,
534                                                         FloatRectangle(0.0f, 0.0f, pHighlightedReColorBgBitmap->GetWidthF(), pHighlightedReColorBgBitmap->GetHeightF()));
535                                 }
536                         }
537                 }
538         }
539         else
540         {
541                 if (backgroundStyle == BACKGROUND_STYLE_NONE)
542                 {
543                         pCanvas->SetBackgroundColor(Color(0, 0, 0, 0));
544                         pCanvas->Clear();
545                 }
546                 else
547                 {
548                         pBgBitmap = __pCheckButton->GetBackgroundBitmap(__pCheckButton->GetGroupStyle(), __pCheckButton->GetCheckButtonStatus());
549
550                         if (pBgBitmap && _BitmapImpl::CheckNinePatchedBitmapStrictly(*pBgBitmap))
551                         {
552                                 pReColorBgBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pBgBitmap, Color::GetColor(COLOR_ID_MAGENTA),
553                                                 __pCheckButton->GetColor(_CHECK_BUTTON_STATUS_SELECTED));
554                                 if (pReColorBgBitmap)
555                                 {
556                                         pCanvas->DrawNinePatchedBitmap(bounds, *pReColorBgBitmap);
557                                 }
558
559                                 bool themeBgBitmap = false;
560
561                                 if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_SINGLE)
562                                 {
563                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_SINGLE_BG_SELECTED);
564                                 }
565                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_TOP)
566                                 {
567                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_TOP_BG_SELECTED);
568                                 }
569                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_MIDDLE)
570                                 {
571                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_MIDDLE_BG_SELECTED);
572                                 }
573                                 else if (__pCheckButton->GetGroupStyle() == GROUP_STYLE_BOTTOM)
574                                 {
575                                         themeBgBitmap = IS_CUSTOM_BITMAP(PANEL::GROUPED_BOTTOM_BG_SELECTED);
576                                 }
577
578                                 if (themeBgBitmap == false)
579                                 {
580                                         Bitmap* pBgNormalEffectBitmap = __pCheckButton->GetBackgroundNormalEffectBitmap(__pCheckButton->GetGroupStyle());
581
582                                         if (pBgNormalEffectBitmap)
583                                         {
584                                                 pCanvas->DrawNinePatchedBitmap(bounds, *pBgNormalEffectBitmap);
585                                         }
586                                 }
587                         }
588                         else
589                         {
590                                 if (pBgBitmap)
591                                 {
592                                         pCanvas->DrawBitmap(FloatRectangle(0.0f, 0.0f, bounds.width, bounds.height), *pBgBitmap);
593                                 }
594                         }
595                 }
596         }
597
598         delete pCanvas;
599         delete pReColorBgBitmap;
600         delete pHighlightedReColorBgBitmap;
601
602         return;
603 }
604
605 void
606 _CheckButtonPresenter::DrawCheckBitmap(void)
607 {
608         Canvas* pCanvas = __pCheckButton->GetCanvasN();
609         if (pCanvas == null)
610         {
611                 SysLog(NID_UI_CTRL, "Cannot get a canvas.");
612
613                 return;
614         }
615
616         Color detailedNormalBgColor;
617         Color detailedDisabledBgColor;
618         Color detailedPressedBgColor;
619         Color detailedHighlightedBgColor;
620         Color detailedSelectedBgColor;
621
622         Color detailedRightNormalColor;
623         Color detailedRightDisabledColor;
624         Color detailedRightPressedColor;
625         Color detailedRightHighlightedColor;
626         Color detailedRightSelectedColor;
627
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);
633
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);
639
640         Bitmap* pReColorCircleBitmap = null;
641         Bitmap* pReColorRightBitmap = null;
642
643         _CheckButtonStatus checkStatus = __pCheckButton->GetCheckButtonStatus();
644         CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
645
646         CalculateButtonBounds();
647
648         if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
649         {
650                 if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
651                 {
652                         Bitmap* pMarkBgNormalBitmap = __pCheckButton->GetMarkBgBitmap(_CHECK_BUTTON_STATUS_NORMAL);
653
654                         if (pMarkBgNormalBitmap)
655                         {
656                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgNormalBitmap);
657                         }
658
659                         if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
660                         {
661                                 Bitmap* pCircleBitmap = null;
662                                 Bitmap* pDetailedRightBitmap = null;
663                                 Bitmap* pCircleEffectBitmap = null;
664                                 Bitmap* pDetailedRightEffectBitmap = null;
665
666                                 if (__detailedPressed == true)
667                                 {
668                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_PRESSED);
669                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_PRESSED);
670
671                                         pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
672                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
673                                 }
674                                 else
675                                 {
676                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(checkStatus);
677                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(checkStatus);
678
679                                         pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
680                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
681                                 }
682
683                                 if (pCircleBitmap)
684                                 {
685                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleBitmap);
686                                 }
687
688                                 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_NORMAL);
689
690                                 if (themeBgBitmap == false)
691                                 {
692                                         if (pCircleEffectBitmap)
693                                         {
694                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
695                                         }
696                                 }
697
698                                 if (pDetailedRightBitmap)
699                                 {
700                                         float arrowWidth = pDetailedRightBitmap->GetWidthF();
701                                         float arrowHeight = pDetailedRightBitmap->GetHeightF();
702
703                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
704                                                         , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightBitmap);
705                                 }
706
707                                 themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_NORMAL);
708
709                                 if (themeBgBitmap == false)
710                                 {
711                                         if (pDetailedRightEffectBitmap)
712                                         {
713                                                 float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
714                                                 float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
715
716                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
717                                                                 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
718                                         }
719                                 }
720                         }
721                 }
722                 else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
723                 {
724                         Bitmap* pMarkBgDisabledBitmap = __pCheckButton->GetMarkBgBitmap(_CHECK_BUTTON_STATUS_DISABLED);
725
726                         if (pMarkBgDisabledBitmap)
727                         {
728                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgDisabledBitmap);
729                         }
730
731                         if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
732                         {
733                                 Bitmap* pCircleBitmap = __pCheckButton->GetCircleBitmap(checkStatus);
734                                 Bitmap* pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(checkStatus);
735                                 Bitmap* pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
736                                 Bitmap* pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
737
738                                 if (pCircleBitmap)
739                                 {
740                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleBitmap);
741                                 }
742
743                                 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_DISABLED);
744
745                                 if (themeBgBitmap == false)
746                                 {
747                                         if (pCircleEffectBitmap)
748                                         {
749                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
750                                         }
751                                 }
752
753                                 if (pDetailedRightBitmap)
754                                 {
755                                         float arrowWidth = pDetailedRightBitmap->GetWidthF();
756                                         float arrowHeight = pDetailedRightBitmap->GetHeightF();
757
758                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
759                                                         , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightBitmap);
760                                 }
761
762                                 themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_DISABLED);
763
764                                 if (themeBgBitmap == false)
765                                 {
766                                         if (pDetailedRightEffectBitmap)
767                                         {
768                                                 float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
769                                                 float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
770
771                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
772                                                                 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
773                                         }
774                                 }
775                         }
776                 }
777                 else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
778                 {
779                         Bitmap* pMarkBgPressedBitmap = __pCheckButton->GetMarkBgBitmap(_CHECK_BUTTON_STATUS_PRESSED);
780
781                         if (pMarkBgPressedBitmap)
782                         {
783                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgPressedBitmap);
784                         }
785
786                         if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
787                         {
788                                 Bitmap* pCircleBitmap = null;
789                                 Bitmap* pDetailedRightBitmap = null;
790                                 Bitmap* pCircleEffectBitmap = null;
791                                 Bitmap* pDetailedRightEffectBitmap = null;
792
793                                 if (__detailedPressed == true)
794                                 {
795                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(checkStatus);
796                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(checkStatus);
797
798                                         pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
799                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
800                                 }
801                                 else
802                                 {
803                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_NORMAL);
804                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_NORMAL);
805
806                                         pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
807                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
808                                 }
809
810                                 if (pCircleBitmap)
811                                 {
812                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleBitmap);
813                                 }
814
815                                 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_PRESSED);
816
817                                 if (themeBgBitmap == false)
818                                 {
819                                         if (pCircleEffectBitmap)
820                                         {
821                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
822                                         }
823                                 }
824
825                                 if (pDetailedRightBitmap)
826                                 {
827                                         float arrowWidth = pDetailedRightBitmap->GetWidthF();
828                                         float arrowHeight = pDetailedRightBitmap->GetHeightF();
829
830                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
831                                                         , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightBitmap);
832                                 }
833
834                                 themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_PRESSED);
835
836                                 if (themeBgBitmap == false)
837                                 {
838                                         if (pDetailedRightEffectBitmap)
839                                         {
840                                                 float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
841                                                 float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
842
843                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
844                                                                 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
845                                         }
846                                 }
847                         }
848                 }
849                 else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
850                 {
851                         Bitmap* pMarkBgNormalBitmap = __pCheckButton->GetMarkBgBitmap(_CHECK_BUTTON_STATUS_NORMAL);
852                         Bitmap* pMarkBgHighlightedBitmap = __pCheckButton->GetMarkBgBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
853
854                         if (pMarkBgNormalBitmap)
855                         {
856                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgNormalBitmap);
857                         }
858
859                         if (pMarkBgHighlightedBitmap && __highlightedIndex == 1)
860                         {
861                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgHighlightedBitmap);
862                         }
863
864                         if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
865                         {
866                                 Bitmap* pCircleHighlightedBitmap = __pCheckButton->GetCircleBitmap(checkStatus);
867
868                                 Bitmap* pCircleBitmap = null;
869                                 Bitmap* pDetailedRightBitmap = null;
870                                 Bitmap* pCircleEffectBitmap = null;
871                                 Bitmap* pDetailedRightEffectBitmap = null;
872
873                                 if (__detailedPressed == true)
874                                 {
875                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_PRESSED);
876                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_PRESSED);
877
878                                         pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
879                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
880                                 }
881                                 else
882                                 {
883                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_NORMAL);
884                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_NORMAL);
885
886                                         pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
887                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
888                                 }
889
890                                 if (pCircleBitmap)
891                                 {
892                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleBitmap);
893                                 }
894
895                                 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_HIGHLIGHTED);
896
897                                 if (themeBgBitmap == false)
898                                 {
899                                         if (pCircleEffectBitmap)
900                                         {
901                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
902                                         }
903                                 }
904
905                                 if (pDetailedRightBitmap)
906                                 {
907                                         float arrowWidth = pDetailedRightBitmap->GetWidthF();
908                                         float arrowHeight = pDetailedRightBitmap->GetHeightF();
909
910                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
911                                                         , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightBitmap);
912                                 }
913
914                                 themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_HIGHLIGHTED);
915
916                                 if (themeBgBitmap == false)
917                                 {
918                                         if (pDetailedRightEffectBitmap)
919                                         {
920                                                 float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
921                                                 float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
922
923                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
924                                                                 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
925                                         }
926                                 }
927
928                                 if (pCircleHighlightedBitmap && __highlightedIndex == 2)
929                                 {
930                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleHighlightedBitmap);
931                                 }
932                         }
933                 }
934                 else if (checkStatus == _CHECK_BUTTON_STATUS_SELECTED)
935                 {
936                         Bitmap* pMarkBgSelectedBitmap = __pCheckButton->GetMarkBgBitmap(_CHECK_BUTTON_STATUS_SELECTED);
937
938                         if (pMarkBgSelectedBitmap)
939                         {
940                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pMarkBgSelectedBitmap);
941                         }
942
943                         if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
944                         {
945                                 Bitmap* pCircleBitmap = null;
946                                 Bitmap* pDetailedRightBitmap = null;
947                                 Bitmap* pCircleEffectBitmap = null;
948                                 Bitmap* pDetailedRightEffectBitmap = null;
949
950                                 if (__detailedPressed == true)
951                                 {
952                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_PRESSED);
953                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_PRESSED);
954
955                                         pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
956                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
957                                 }
958                                 else
959                                 {
960                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(checkStatus);
961                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(checkStatus);
962
963                                         pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
964                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
965                                 }
966
967                                 if (pCircleBitmap)
968                                 {
969                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleBitmap);
970                                 }
971
972                                 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_SELECTED);
973
974                                 if (themeBgBitmap == false)
975                                 {
976                                         if (pCircleEffectBitmap)
977                                         {
978                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
979                                         }
980                                 }
981
982                                 if (pDetailedRightBitmap)
983                                 {
984                                         float arrowWidth = pDetailedRightBitmap->GetWidthF();
985                                         float arrowHeight = pDetailedRightBitmap->GetHeightF();
986
987                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
988                                                         , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightBitmap);
989                                 }
990
991                                 themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_SELECTED);
992
993                                 if (themeBgBitmap == false)
994                                 {
995                                         if (pDetailedRightEffectBitmap)
996                                         {
997                                                 float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
998                                                 float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
999
1000                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1001                                                                 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
1002                                         }
1003                                 }
1004                         }
1005                 }
1006
1007                 DrawMarkAnimation();
1008         }
1009         else if (checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1010         {
1011                 if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
1012                 {
1013                         if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1014                         {
1015                                 Bitmap* pCircleBitmap = null;
1016                                 Bitmap* pDetailedRightBitmap = null;
1017                                 Bitmap* pCircleEffectBitmap = null;
1018                                 Bitmap* pDetailedRightEffectBitmap = null;
1019
1020                                 if (__detailedPressed == true)
1021                                 {
1022                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_PRESSED);
1023                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_PRESSED);
1024
1025                                         pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
1026                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
1027                                 }
1028                                 else
1029                                 {
1030                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(checkStatus);
1031                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(checkStatus);
1032
1033                                         pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
1034                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
1035                                 }
1036
1037                                 if (pCircleBitmap)
1038                                 {
1039                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleBitmap);
1040                                 }
1041
1042                                 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_NORMAL);
1043
1044                                 if (themeBgBitmap == false)
1045                                 {
1046                                         if (pCircleEffectBitmap)
1047                                         {
1048                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
1049                                         }
1050                                 }
1051
1052                                 if (pDetailedRightBitmap)
1053                                 {
1054                                         float arrowWidth = pDetailedRightBitmap->GetWidthF();
1055                                         float arrowHeight = pDetailedRightBitmap->GetHeightF();
1056
1057                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1058                                                         , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightBitmap);
1059                                 }
1060
1061                                 themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_NORMAL);
1062
1063                                 if (themeBgBitmap == false)
1064                                 {
1065                                         if (pDetailedRightEffectBitmap)
1066                                         {
1067                                                 float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
1068                                                 float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
1069
1070                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1071                                                                 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
1072                                         }
1073                                 }
1074                         }
1075                 }
1076                 else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
1077                 {
1078                         if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1079                         {
1080                                 Bitmap* pCircleBitmap = __pCheckButton->GetCircleBitmap(checkStatus);
1081                                 Bitmap* pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(checkStatus);
1082                                 Bitmap* pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
1083                                 Bitmap* pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
1084
1085                                 if (pCircleBitmap)
1086                                 {
1087                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleBitmap);
1088                                 }
1089
1090                                 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_DISABLED);
1091
1092                                 if (themeBgBitmap == false)
1093                                 {
1094                                         if (pCircleEffectBitmap)
1095                                         {
1096                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
1097                                         }
1098                                 }
1099
1100                                 if (pDetailedRightBitmap)
1101                                 {
1102                                         float arrowWidth = pDetailedRightBitmap->GetWidthF();
1103                                         float arrowHeight = pDetailedRightBitmap->GetHeightF();
1104
1105                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1106                                                         , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightBitmap);
1107                                 }
1108
1109                                 themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_DISABLED);
1110
1111                                 if (themeBgBitmap == false)
1112                                 {
1113                                         if (pDetailedRightEffectBitmap)
1114                                         {
1115                                                 float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
1116                                                 float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
1117
1118                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1119                                                                 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
1120                                         }
1121                                 }
1122                         }
1123                 }
1124                 else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
1125                 {
1126                         if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1127                         {
1128                                 Bitmap* pCircleBitmap = null;
1129                                 Bitmap* pDetailedRightBitmap = null;
1130                                 Bitmap* pCircleEffectBitmap = null;
1131                                 Bitmap* pDetailedRightEffectBitmap = null;
1132
1133                                 if (__detailedPressed == true)
1134                                 {
1135                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(checkStatus);
1136                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(checkStatus);
1137
1138                                         pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
1139                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
1140                                 }
1141                                 else
1142                                 {
1143                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1144                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1145
1146                                         pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
1147                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
1148                                 }
1149
1150                                 if (pCircleBitmap)
1151                                 {
1152                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleBitmap);
1153                                 }
1154
1155                                 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_PRESSED);
1156
1157                                 if (themeBgBitmap == false)
1158                                 {
1159                                         if (pCircleEffectBitmap)
1160                                         {
1161                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
1162                                         }
1163                                 }
1164
1165                                 if (pDetailedRightBitmap)
1166                                 {
1167                                         float arrowWidth = pDetailedRightBitmap->GetWidthF();
1168                                         float arrowHeight = pDetailedRightBitmap->GetHeightF();
1169
1170                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1171                                                         , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightBitmap);
1172                                 }
1173
1174                                 themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_PRESSED);
1175
1176                                 if (themeBgBitmap == false)
1177                                 {
1178                                         if (pDetailedRightEffectBitmap)
1179                                         {
1180                                                 float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
1181                                                 float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
1182
1183                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1184                                                                 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
1185                                         }
1186                                 }
1187                         }
1188                 }
1189                 else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
1190                 {
1191                         if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1192                         {
1193                                 Bitmap* pCircleHighlightedBitmap = __pCheckButton->GetCircleBitmap(checkStatus);
1194
1195                                 Bitmap* pCircleBitmap = null;
1196                                 Bitmap* pDetailedRightBitmap = null;
1197                                 Bitmap* pCircleEffectBitmap = null;
1198                                 Bitmap* pDetailedRightEffectBitmap = null;
1199
1200                                 if (__detailedPressed == true)
1201                                 {
1202                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_PRESSED);
1203                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_PRESSED);
1204
1205                                         pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
1206                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
1207                                 }
1208                                 else
1209                                 {
1210                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1211                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1212
1213                                         pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
1214                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
1215                                 }
1216
1217                                 if (pCircleBitmap)
1218                                 {
1219                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleBitmap);
1220                                 }
1221
1222                                 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_HIGHLIGHTED);
1223
1224                                 if (themeBgBitmap == false)
1225                                 {
1226                                         if (pCircleEffectBitmap)
1227                                         {
1228                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
1229                                         }
1230                                 }
1231
1232                                 if (pDetailedRightBitmap)
1233                                 {
1234                                         float arrowWidth = pDetailedRightBitmap->GetWidthF();
1235                                         float arrowHeight = pDetailedRightBitmap->GetHeightF();
1236
1237                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1238                                                         , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightBitmap);
1239                                 }
1240
1241                                 themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_HIGHLIGHTED);
1242
1243                                 if (themeBgBitmap == false)
1244                                 {
1245                                         if (pDetailedRightEffectBitmap)
1246                                         {
1247                                                 float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
1248                                                 float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
1249
1250                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1251                                                                 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
1252                                         }
1253                                 }
1254
1255                                 if (pCircleHighlightedBitmap && __highlightedIndex == 1)
1256                                 {
1257                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleHighlightedBitmap);
1258                                 }
1259                         }
1260                 }
1261                 else if (checkStatus == _CHECK_BUTTON_STATUS_SELECTED)
1262                 {
1263                         if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1264                         {
1265                                 Bitmap* pCircleBitmap = null;
1266                                 Bitmap* pDetailedRightBitmap = null;
1267                                 Bitmap* pCircleEffectBitmap = null;
1268                                 Bitmap* pDetailedRightEffectBitmap = null;
1269
1270                                 if (__detailedPressed == true)
1271                                 {
1272                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(_CHECK_BUTTON_STATUS_PRESSED);
1273                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(_CHECK_BUTTON_STATUS_PRESSED);
1274
1275                                         pCircleEffectBitmap = __pCheckButton->GetCirclePressedEffectBitmap();
1276                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightPressedEffectBitmap();
1277                                 }
1278                                 else
1279                                 {
1280                                         pCircleBitmap = __pCheckButton->GetCircleBitmap(checkStatus);
1281                                         pDetailedRightBitmap = __pCheckButton->GetDetailedRightBitmap(checkStatus);
1282
1283                                         pCircleEffectBitmap = __pCheckButton->GetCircleNormalEffectBitmap();
1284                                         pDetailedRightEffectBitmap = __pCheckButton->GetDetailedRightNormalEffectBitmap();
1285                                 }
1286
1287                                 if (pCircleBitmap)
1288                                 {
1289                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleBitmap);
1290                                 }
1291
1292                                 bool themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_BG_SELECTED);
1293
1294                                 if (themeBgBitmap == false)
1295                                 {
1296                                         if (pCircleEffectBitmap)
1297                                         {
1298                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x, __detailedButtonBounds.y), *pCircleEffectBitmap);
1299                                         }
1300                                 }
1301
1302                                 if (pDetailedRightBitmap)
1303                                 {
1304                                         float arrowWidth = pDetailedRightBitmap->GetWidthF();
1305                                         float arrowHeight = pDetailedRightBitmap->GetHeightF();
1306
1307                                         pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1308                                                         , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightBitmap);
1309                                 }
1310
1311                                 themeBgBitmap = IS_CUSTOM_BITMAP(CHECKBUTTON::DETAILED_ICON_SELECTED);
1312
1313                                 if (themeBgBitmap == false)
1314                                 {
1315                                         if (pDetailedRightEffectBitmap)
1316                                         {
1317                                                 float arrowWidth = pDetailedRightEffectBitmap->GetWidthF();
1318                                                 float arrowHeight = pDetailedRightEffectBitmap->GetHeightF();
1319
1320                                                 pCanvas->DrawBitmap(FloatPoint(__detailedButtonBounds.x + (__detailedButtonBounds.width - arrowWidth) / 2.0f
1321                                                                 , __detailedButtonBounds.y + (__detailedButtonBounds.height - arrowHeight) / 2.0f), *pDetailedRightEffectBitmap);
1322                                         }
1323                                 }
1324                         }
1325                 }
1326
1327                 DrawMarkAnimation();
1328         }
1329         else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF || checkStyle == CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER)
1330         {
1331                 if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
1332                 {
1333                         Bitmap* pOnOffBgNormalBitmap = __pCheckButton->GetOnOffBgBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1334
1335                         if (pOnOffBgNormalBitmap)
1336                         {
1337                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgNormalBitmap);
1338                         }
1339
1340                         Bitmap* pOnOffNormalBitmap = __pCheckButton->GetOnOffBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1341
1342                         if (__pCheckButton->IsSelected() && pOnOffNormalBitmap)
1343                         {
1344                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffNormalBitmap);
1345                         }
1346                 }
1347                 else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
1348                 {
1349                         Bitmap* pOnOffBgDisabledBitmap = __pCheckButton->GetOnOffBgBitmap(_CHECK_BUTTON_STATUS_DISABLED);
1350
1351                         if (pOnOffBgDisabledBitmap)
1352                         {
1353                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgDisabledBitmap);
1354                         }
1355
1356                         Bitmap* pOnOffDisabledBitmap = __pCheckButton->GetOnOffBitmap(_CHECK_BUTTON_STATUS_DISABLED);
1357
1358                         if (__pCheckButton->IsSelected() && pOnOffDisabledBitmap)
1359                         {
1360                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffDisabledBitmap);
1361                         }
1362                 }
1363                 else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
1364                 {
1365                         Bitmap* pOnOffBgPressedBitmap = __pCheckButton->GetOnOffBgBitmap(_CHECK_BUTTON_STATUS_PRESSED);
1366
1367                         if (pOnOffBgPressedBitmap)
1368                         {
1369                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgPressedBitmap);
1370                         }
1371
1372                         Bitmap* pOnOffPressedBitmap = __pCheckButton->GetOnOffBitmap(_CHECK_BUTTON_STATUS_PRESSED);
1373
1374                         if (__pCheckButton->IsSelected() && pOnOffPressedBitmap)
1375                         {
1376                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffPressedBitmap);
1377                         }
1378                 }
1379                 else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
1380                 {
1381                         Bitmap* pOnOffBgNormalBitmap = __pCheckButton->GetOnOffBgBitmap(_CHECK_BUTTON_STATUS_NORMAL);
1382                         Bitmap* pOnOffBgHighlightedBitmap = __pCheckButton->GetOnOffBgBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
1383
1384                         if (pOnOffBgNormalBitmap)
1385                         {
1386                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgNormalBitmap);
1387                         }
1388
1389                         Bitmap* pOnOffHighlightedBitmap = __pCheckButton->GetOnOffBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
1390
1391                         if (__pCheckButton->IsSelected() && pOnOffHighlightedBitmap)
1392                         {
1393                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffHighlightedBitmap);
1394                         }
1395
1396                         if (pOnOffBgHighlightedBitmap && __highlightedIndex == 1)
1397                         {
1398                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgHighlightedBitmap);
1399                         }
1400                 }
1401                 else if (checkStatus == _CHECK_BUTTON_STATUS_SELECTED)
1402                 {
1403                         Bitmap* pOnOffBgSelectedBitmap = __pCheckButton->GetOnOffBgBitmap(_CHECK_BUTTON_STATUS_SELECTED);
1404
1405                         if (pOnOffBgSelectedBitmap)
1406                         {
1407                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffBgSelectedBitmap);
1408                         }
1409
1410                         Bitmap* pOnOffSelectedBitmap = __pCheckButton->GetOnOffBitmap(_CHECK_BUTTON_STATUS_SELECTED);
1411
1412                         if (__pCheckButton->IsSelected() && pOnOffSelectedBitmap)
1413                         {
1414                                 pCanvas->DrawBitmap(FloatPoint(__defaultButtonBounds.x, __defaultButtonBounds.y), *pOnOffSelectedBitmap);
1415                         }
1416                 }
1417         }
1418         else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1419         {
1420                 float handlerWidth = 0.0f;
1421                 GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_HANDLER_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, handlerWidth);
1422                 DrawOnOffSlidingHandler(__onOffHandlerPosition - (handlerWidth / 2.0f));
1423
1424                 float dividerWidth = 0.0f;
1425                 float dividerTopMargin = 0.0f;
1426                 float dividerRightMargin = 0.0f;
1427
1428                 Color dividerLeftColor;
1429                 //Color dividerRightColor;
1430                 FloatDimension minDimension(0.0f, 0.0f);
1431
1432                 GET_SHAPE_CONFIG(CHECKBUTTON::DIVIDER_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, dividerWidth);
1433                 GET_SHAPE_CONFIG(CHECKBUTTON::DIVIDER_TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, dividerTopMargin);
1434                 GET_SHAPE_CONFIG(CHECKBUTTON::DIVIDER_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, dividerRightMargin);
1435                 GET_COLOR_CONFIG(HEADER::DIVIDER_LINE_LEFT_NORMAL, dividerLeftColor);
1436                 //GET_COLOR_CONFIG(HEADER::DIVIDER_LINE_RIGHT_NORMAL, dividerRightColor);
1437
1438                 GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION, __pCheckButton->GetOrientation(), minDimension);
1439
1440                 FloatRectangle bounds(0.0f, 0.0f, __pCheckButton->GetBoundsF().width, __pCheckButton->GetBoundsF().height);
1441
1442                 if (bounds.height < minDimension.height)
1443                 {
1444                         bounds.height = minDimension.height;
1445                 }
1446
1447                 if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1448                 {
1449                         pCanvas->SetForegroundColor(dividerLeftColor);
1450                         pCanvas->SetLineWidth(dividerWidth);
1451                         pCanvas->DrawLine(FloatPoint(__onOffSlidingButtonBounds.x - dividerRightMargin + dividerWidth, dividerTopMargin),
1452                                         FloatPoint(__onOffSlidingButtonBounds.x - dividerRightMargin + dividerWidth, dividerTopMargin + bounds.height - dividerTopMargin * 2));
1453
1454                         //pCanvas->SetForegroundColor(dividerRightColor);
1455                         //pCanvas->SetLineWidth(dividerWidth/2);
1456                         //pCanvas->DrawLine(FloatPoint(__onOffSlidingButtonBounds.x - dividerRightMargin + dividerWidth, dividerTopMargin),
1457                         //              FloatPoint(__onOffSlidingButtonBounds.x - dividerRightMargin + dividerWidth, dividerTopMargin + bounds.height - dividerTopMargin * 2));
1458                 }
1459         }
1460
1461         delete pCanvas;
1462         delete pReColorCircleBitmap;
1463         delete pReColorRightBitmap;
1464
1465         return;
1466 }
1467
1468 void
1469 _CheckButtonPresenter::DrawText(void)
1470 {
1471         result r = E_SUCCESS;
1472
1473         TextSimple* pSimpleText = null;
1474         TextSimple* pSimpleTitleText = null;
1475         TextObjectAlignment horizontalAlign = TEXT_OBJECT_ALIGNMENT_CENTER;
1476         TextObjectAlignment verticalAlign = TEXT_OBJECT_ALIGNMENT_MIDDLE;
1477
1478         _CheckButtonStatus checkStatus = __pCheckButton->GetCheckButtonStatus();
1479         bool showTitle = __pCheckButton->GetShowTitle();
1480
1481         Canvas* pCanvas = __pCheckButton->GetCanvasN();
1482         if (pCanvas == null)
1483         {
1484                 SysLog(NID_UI_CTRL, "Cannot get a canvas.");
1485
1486                 return;
1487         }
1488
1489         __pTextObject->RemoveAll(true);
1490         pSimpleText = new (std::nothrow) TextSimple(const_cast<wchar_t*>(__pCheckButton->GetText().GetPointer()), __pCheckButton->GetText().GetLength());
1491         __pTextObject->AppendElement(*pSimpleText);
1492
1493         __pTitleTextObject->RemoveAll(true);
1494         pSimpleTitleText = new (std::nothrow) TextSimple(const_cast<wchar_t*>(__pCheckButton->GetTitleText().GetPointer()), __pCheckButton->GetTitleText().GetLength());
1495         __pTitleTextObject->AppendElement(*pSimpleTitleText);
1496
1497         if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
1498         {
1499                 __pTextObject->SetForegroundColor(__pCheckButton->GetTextColor(), 0, __pTextObject->GetTextLength());
1500                 __pTitleTextObject->SetForegroundColor(__pCheckButton->GetTitleTextColor(), 0, __pTitleTextObject->GetTextLength());
1501         }
1502         else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
1503         {
1504                 __pTextObject->SetForegroundColor(__pCheckButton->GetDisabledTextColor(), 0, __pTextObject->GetTextLength());
1505                 __pTitleTextObject->SetForegroundColor(__pCheckButton->GetDisabledTitleTextColor(), 0, __pTitleTextObject->GetTextLength());
1506         }
1507         else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
1508         {
1509                 __pTextObject->SetForegroundColor(__pCheckButton->GetPressedTextColor(), 0, __pTextObject->GetTextLength());
1510                 __pTitleTextObject->SetForegroundColor(__pCheckButton->GetPressedTitleTextColor(), 0, __pTitleTextObject->GetTextLength());
1511         }
1512         else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
1513         {
1514                 __pTextObject->SetForegroundColor(__pCheckButton->GetHighlightedTextColor(), 0, __pTextObject->GetTextLength());
1515                 __pTitleTextObject->SetForegroundColor(__pCheckButton->GetHighlightedTitleTextColor(), 0, __pTitleTextObject->GetTextLength());
1516         }
1517         else
1518         {
1519                 __pTextObject->SetForegroundColor(__pCheckButton->GetSelectedTextColor(), 0, __pTextObject->GetTextLength());
1520                 __pTitleTextObject->SetForegroundColor(__pCheckButton->GetSelectedTitleTextColor(), 0, __pTitleTextObject->GetTextLength());
1521         }
1522
1523         CalculateTextBounds();
1524         CalculateTitleTextBounds();
1525
1526         __pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
1527         __pTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
1528         __pTextObject->SetBounds(GetTextBoundsF());
1529         __pTextObject->Compose();
1530
1531         __pTitleTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
1532         __pTitleTextObject->SetAction(TEXT_OBJECT_ACTION_TYPE_ABBREV);
1533         __pTitleTextObject->SetBounds(GetTitleTextBoundsF());
1534         __pTitleTextObject->Compose();
1535
1536         switch (__pCheckButton->GetTextHorizontalAlignment())
1537         {
1538         case ALIGNMENT_LEFT:
1539                 horizontalAlign = TEXT_OBJECT_ALIGNMENT_LEFT;
1540                 break;
1541         case ALIGNMENT_CENTER:
1542                 horizontalAlign = TEXT_OBJECT_ALIGNMENT_CENTER;
1543                 break;
1544         default:
1545                 horizontalAlign = TEXT_OBJECT_ALIGNMENT_RIGHT;
1546         }
1547
1548         switch (__pCheckButton->GetTextVerticalAlignment())
1549         {
1550         case ALIGNMENT_TOP:
1551                 verticalAlign = TEXT_OBJECT_ALIGNMENT_TOP;
1552                 break;
1553         case ALIGNMENT_MIDDLE:
1554                 verticalAlign = TEXT_OBJECT_ALIGNMENT_MIDDLE;
1555                 break;
1556         default:
1557                 verticalAlign = TEXT_OBJECT_ALIGNMENT_BOTTOM;
1558         }
1559
1560         __fontSize =  __pCheckButton->GetTextSizeF();
1561         __pTextFont = __pCheckButton->GetFallbackFont();
1562         r = GetLastResult();
1563         SysTryReturnVoidResult(NID_UI_CTRL, __pTextFont, r, "[%s] Propagating.", GetErrorMessage(r));
1564
1565         __pTextObject->SetAlignment(horizontalAlign | verticalAlign);
1566         __pTextObject->SetFont(__pTextFont, 0, __pTextObject->GetTextLength());
1567         __pTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas));
1568
1569         __fontSize = __pCheckButton->GetTitleTextSizeF();
1570         __pTitleTextFont = __pCheckButton->GetFallbackFont();
1571         r = GetLastResult();
1572         SysTryReturnVoidResult(NID_UI_CTRL, __pTitleTextFont, r, "[%s] Propagating.", GetErrorMessage(r));
1573
1574         __pTitleTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT | TEXT_OBJECT_ALIGNMENT_MIDDLE);
1575         __pTitleTextObject->SetFont(__pTitleTextFont, 0, __pTitleTextObject->GetTextLength());
1576
1577         if (showTitle)
1578         {
1579                 __pTitleTextObject->Draw(*_CanvasImpl::GetInstance(*pCanvas));
1580         }
1581
1582         delete pCanvas;
1583
1584         return;
1585 }
1586
1587 bool
1588 _CheckButtonPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
1589 {
1590         if (&source != __pCheckButton)
1591         {
1592                 return false;
1593         }
1594
1595         if (!__pCheckButton->IsEnabled())
1596         {
1597                 return true;
1598         }
1599
1600         __touchMoveHandled = false;
1601
1602         FloatPoint touchPoint = touchinfo.GetCurrentPosition();
1603
1604         touchPoint.x += source.GetClientBoundsF().x;
1605         touchPoint.y += source.GetClientBoundsF().y;
1606
1607         CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
1608
1609         if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1610         {
1611                 if (__onOffSlidingButtonBounds.Contains(touchPoint))
1612                 {
1613                         __onOffHandlerPressed = true;
1614                 }
1615                 else
1616                 {
1617                         __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
1618                 }
1619         }
1620         else if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1621         {
1622                 if (__detailedButtonBounds.Contains(touchPoint))
1623                 {
1624                         __detailedPressed = true;
1625                 }
1626                 else
1627                 {
1628                         __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
1629                 }
1630         }
1631         else
1632         {
1633                 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
1634         }
1635
1636         __pCheckButton->Invalidate();
1637
1638         return true;
1639 }
1640
1641 bool
1642 _CheckButtonPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo)
1643 {
1644         float checkButtonLeftMargin = 0.0f;
1645         float checkButtonDetailedBitmapWidth = 0.0f;
1646         float checkButtonOnOffSlidingBitmapWidth = 0.0f;
1647         float dividerRightMargin = 0.0f;
1648
1649         GET_SHAPE_CONFIG(CHECKBUTTON::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonLeftMargin);
1650         GET_SHAPE_CONFIG(CHECKBUTTON::DETAILED_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonDetailedBitmapWidth);
1651         GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonOnOffSlidingBitmapWidth);
1652         GET_SHAPE_CONFIG(CHECKBUTTON::DIVIDER_RIGHT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, dividerRightMargin);
1653
1654         if (&source != __pCheckButton)
1655         {
1656                 return false;
1657         }
1658
1659         if (!__pCheckButton->IsEnabled())
1660         {
1661                 return true;
1662         }
1663
1664         _CheckButtonStatus status = __pCheckButton->GetCheckButtonStatus();
1665         CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
1666
1667         if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1668         {
1669                 if (status == _CHECK_BUTTON_STATUS_NORMAL && __onOffHandlerPressed == false)
1670                 {
1671                         __onOffHandlerMoved = false;
1672
1673                         return true;
1674                 }
1675         }
1676         else if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1677         {
1678                 if (status == _CHECK_BUTTON_STATUS_NORMAL && __detailedPressed == true)
1679                 {
1680                         __detailedPressed = false;
1681
1682                         __pCheckButton->Invalidate();
1683
1684                         return true;
1685                 }
1686         }
1687         else
1688         {
1689                 if (status == _CHECK_BUTTON_STATUS_NORMAL)
1690                 {
1691                         return true;
1692                 }
1693         }
1694
1695         if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON
1696                         || checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1697         {
1698                 StartCheckAnimationTimer();
1699                 __ratio = 0;
1700         }
1701
1702         FloatPoint touchPoint = touchinfo.GetCurrentPosition();
1703
1704         touchPoint.x += source.GetClientBoundsF().x;
1705         touchPoint.y += source.GetClientBoundsF().y;
1706
1707         FloatRectangle bounds = __pCheckButton->GetClientBoundsF();
1708         FloatRectangle detailedBounds = __pCheckButton->GetClientBoundsF();
1709
1710         __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
1711         __pCheckButton->Invalidate();
1712
1713         if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1714         {
1715                 if (bounds.Contains(touchPoint) && !__detailedButtonBounds.Contains(touchPoint))
1716                 {
1717                         PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
1718
1719                         __pCheckButton->FireActionEvent();
1720
1721                         if (__pCheckButton->GetRadioGroup() != null)
1722                         {
1723                                 __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
1724                         }
1725                 }
1726         }
1727         else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1728         {
1729                 detailedBounds.width = detailedBounds.width - checkButtonLeftMargin - checkButtonOnOffSlidingBitmapWidth - dividerRightMargin;
1730
1731                 if (!detailedBounds.Contains(touchPoint))
1732                 {
1733                         if (__onOffHandlerMoved == false)
1734                         {
1735                                 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
1736
1737                                 __pCheckButton->FireActionEvent();
1738
1739                                 if (__pCheckButton->GetRadioGroup() != null)
1740                                 {
1741                                         __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
1742                                 }
1743                         }
1744                 }
1745
1746                 AdjustHandlerPosition();
1747
1748                 __onOffHandlerPressed = false;
1749                 __onOffHandlerMoved = false;
1750         }
1751         else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING)
1752         {
1753                 if (bounds.Contains(touchPoint))
1754                 {
1755                         if (__onOffHandlerMoved == false)
1756                         {
1757                                 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
1758
1759                                 __pCheckButton->FireActionEvent();
1760
1761                                 if (__pCheckButton->GetRadioGroup() != null)
1762                                 {
1763                                         __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
1764                                 }
1765                         }
1766                 }
1767
1768                 AdjustHandlerPosition();
1769
1770                 __onOffHandlerPressed = false;
1771                 __onOffHandlerMoved = false;
1772         }
1773         else
1774         {
1775                 if (bounds.Contains(touchPoint))
1776                 {
1777                         PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
1778
1779                         __pCheckButton->FireActionEvent();
1780
1781                         if (__pCheckButton->GetRadioGroup() != null)
1782                         {
1783                                 __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
1784                         }
1785                 }
1786         }
1787
1788         return true;
1789 }
1790
1791 result
1792 _CheckButtonPresenter::InitOnOffHandlerMoved(void)
1793 {
1794         __onOffHandlerMoved = false;
1795
1796         return E_SUCCESS;
1797 }
1798
1799 result
1800 _CheckButtonPresenter::AdjustHandlerPosition(void)
1801 {
1802         float handlerWidth = 0.0f;
1803         GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_HANDLER_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, handlerWidth);
1804
1805         if (__onOffHandlerMoved == false)
1806         {
1807                 if (!__pCheckButton->IsSelected())
1808                 {
1809                         __onOffHandlerPosition = __onOffSlidingButtonBounds.x;
1810                 }
1811                 else
1812                 {
1813                         __onOffHandlerPosition = __onOffSlidingButtonBounds.x + __onOffSlidingButtonBounds.width - (handlerWidth / 2.0f);
1814                 }
1815         }
1816         else
1817         {
1818                 if (!__pCheckButton->IsSelected())
1819                 {
1820                         if (__onOffHandlerPosition < __onOffSlidingButtonBounds.x + (__onOffSlidingButtonBounds.width / 2.0f))
1821                         {
1822                                 __onOffHandlerPosition = __onOffSlidingButtonBounds.x;
1823                         }
1824                         else
1825                         {
1826                                 __onOffHandlerPosition = __onOffSlidingButtonBounds.x + __onOffSlidingButtonBounds.width - (handlerWidth / 2.0f);
1827
1828                                 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
1829
1830                                 __pCheckButton->FireActionEvent();
1831
1832                                 if (__pCheckButton->GetRadioGroup() != null)
1833                                 {
1834                                         __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
1835                                 }
1836                         }
1837                 }
1838                 else
1839                 {
1840                         if (__onOffHandlerPosition < __onOffSlidingButtonBounds.x + (__onOffSlidingButtonBounds.width / 2.0f))
1841                         {
1842                                 __onOffHandlerPosition = __onOffSlidingButtonBounds.x;
1843
1844                                 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
1845
1846                                 __pCheckButton->FireActionEvent();
1847
1848                                 if (__pCheckButton->GetRadioGroup() != null)
1849                                 {
1850                                         __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
1851                                 }
1852                         }
1853                         else
1854                         {
1855                                 __onOffHandlerPosition = __onOffSlidingButtonBounds.x + __onOffSlidingButtonBounds.width - (handlerWidth / 2.0f);
1856                         }
1857                 }
1858         }
1859
1860         __pCheckButton->Invalidate();
1861
1862         return E_SUCCESS;
1863 }
1864
1865 bool
1866 _CheckButtonPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
1867 {
1868         if (&source != __pCheckButton)
1869         {
1870                 return false;
1871         }
1872
1873         if (!__pCheckButton->IsEnabled())
1874         {
1875                 return true;
1876         }
1877
1878         FloatPoint touchPoint = touchinfo.GetCurrentPosition();
1879
1880         touchPoint.x += source.GetClientBoundsF().x;
1881         touchPoint.y += source.GetClientBoundsF().y;
1882
1883         FloatRectangle bounds = __pCheckButton->GetClientBoundsF();
1884         bool isInCheckButtonArea = bounds.Contains(touchPoint);
1885         bool isInOnOffHandlerArea = __onOffSlidingButtonBounds.Contains(touchPoint);
1886         bool isDetailedArea = __detailedButtonBounds.Contains(touchPoint);
1887
1888         CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
1889
1890         if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1891         {
1892                 if (__onOffHandlerPressed == true)
1893                 {
1894                         __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
1895                 }
1896                 else
1897                 {
1898                         if (isInCheckButtonArea == true && __touchMoveHandled == false && isInOnOffHandlerArea == false)
1899                         {
1900                                 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
1901                         }
1902                         else
1903                         {
1904                                 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
1905                         }
1906                 }
1907         }
1908         else if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
1909         {
1910                 if (isDetailedArea == true && __touchMoveHandled == false)
1911                 {
1912                         __detailedPressed = true;
1913
1914                         __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
1915                 }
1916                 else
1917                 {
1918                         __detailedPressed = false;
1919
1920                         if (isInCheckButtonArea == true && __touchMoveHandled == false && isDetailedArea == false)
1921                         {
1922                                 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
1923                         }
1924                         else
1925                         {
1926                                 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
1927                         }
1928                 }
1929         }
1930         else
1931         {
1932                 if (isInCheckButtonArea == true && __touchMoveHandled == false)
1933                 {
1934                         __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
1935                 }
1936                 else
1937                 {
1938                         __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
1939                 }
1940         }
1941
1942         if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
1943         {
1944                 if (isInOnOffHandlerArea == true && __onOffHandlerPressed == true)
1945                 {
1946                         __onOffHandlerPosition = touchPoint.x;
1947
1948                         __onOffHandlerMoved = true;
1949                 }
1950         }
1951
1952         __pCheckButton->Invalidate();
1953
1954         if (__onOffHandlerMoved == true)
1955         {
1956                 return true;
1957         }
1958         else
1959         {
1960                 return false;
1961         }
1962 }
1963
1964 void
1965 _CheckButtonPresenter::DrawOnOffSlidingHandler(float handlerPosition)
1966 {
1967         Canvas* pCanvas = __pCheckButton->GetCanvasN();
1968         if (pCanvas == null)
1969         {
1970                 SysLog(NID_UI_CTRL, "Cannot get a canvas.");
1971
1972                 return;
1973         }
1974
1975         Bitmap* pReColorBgBitmap = null;
1976
1977         Color detailedHighlightedBgColor;
1978         GET_COLOR_CONFIG(CHECKBUTTON::DETAILED_ICON_BG_HIGHLIGHTED, detailedHighlightedBgColor);
1979
1980         float handlerMargin = 0.0f;
1981         float handlerWidth = 0.0f;
1982
1983         _CheckButtonStatus checkStatus = __pCheckButton->GetCheckButtonStatus();
1984
1985         GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_HANDLER_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, handlerMargin);
1986         GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_HANDLER_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, handlerWidth);
1987
1988         if (handlerPosition < __onOffSlidingButtonBounds.x)
1989         {
1990                 handlerPosition = __onOffSlidingButtonBounds.x;
1991         }
1992
1993         if (handlerPosition > __onOffSlidingButtonBounds.x + __onOffSlidingButtonBounds.width - handlerWidth)
1994         {
1995                 handlerPosition = __onOffSlidingButtonBounds.x + __onOffSlidingButtonBounds.width - handlerWidth;
1996         }
1997
1998         if (!__pCheckButton->IsSelected())
1999         {
2000                 if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
2001                 {
2002                         Bitmap* pOnOffSlidingNormalBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_NORMAL);
2003
2004                         if (pOnOffSlidingNormalBgBitmap)
2005                         {
2006                                 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingNormalBgBitmap);
2007                         }
2008
2009                         Bitmap* pOnOffSlidingOffHandlerNormalBitmap = __pCheckButton->GetOnOffSlidingOffHandlerBitmap(_CHECK_BUTTON_STATUS_NORMAL);
2010
2011                         if (pOnOffSlidingOffHandlerNormalBitmap)
2012                         {
2013                                 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOffHandlerNormalBitmap);
2014                         }
2015                 }
2016                 else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
2017                 {
2018                         Bitmap* pOnOffSlidingDisabledBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_DISABLED);
2019
2020                         if (pOnOffSlidingDisabledBgBitmap)
2021                         {
2022                                 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingDisabledBgBitmap);
2023                         }
2024
2025                         Bitmap* pOnOffSlidingOffHandlerDisabledBitmap = __pCheckButton->GetOnOffSlidingOffHandlerBitmap(_CHECK_BUTTON_STATUS_DISABLED);
2026
2027                         if (pOnOffSlidingOffHandlerDisabledBitmap)
2028                         {
2029                                 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOffHandlerDisabledBitmap);
2030                         }
2031                 }
2032                 else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
2033                 {
2034                         Bitmap* pOnOffSlidingPressedBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_PRESSED);
2035
2036                         if (pOnOffSlidingPressedBgBitmap)
2037                         {
2038                                 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingPressedBgBitmap);
2039                         }
2040
2041                         Bitmap* pOnOffSlidingOffHandlerPressedBitmap = __pCheckButton->GetOnOffSlidingOffHandlerBitmap(_CHECK_BUTTON_STATUS_PRESSED);
2042
2043                         if (pOnOffSlidingOffHandlerPressedBitmap)
2044                         {
2045                                 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOffHandlerPressedBitmap);
2046                         }
2047                 }
2048                 else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
2049                 {
2050                         Bitmap* pOnOffSlidingHighlightedBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2051
2052                         if (pOnOffSlidingHighlightedBgBitmap)
2053                         {
2054                                 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingHighlightedBgBitmap);
2055                         }
2056
2057                         Bitmap* pOnOffSlidingOffHandlerNormalBitmap = __pCheckButton->GetOnOffSlidingOffHandlerBitmap(_CHECK_BUTTON_STATUS_NORMAL);
2058
2059                         if (pOnOffSlidingOffHandlerNormalBitmap)
2060                         {
2061                                 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOffHandlerNormalBitmap);
2062                         }
2063
2064                         Bitmap* pOnOffSlidingOffHandlerHighlightedBitmap = __pCheckButton->GetOnOffSlidingOffHandlerBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2065
2066                         if (pOnOffSlidingOffHandlerHighlightedBitmap && __highlightedIndex == 1)
2067                         {
2068                                 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOffHandlerHighlightedBitmap);
2069                         }
2070                 }
2071                 else if (checkStatus == _CHECK_BUTTON_STATUS_SELECTED)
2072                 {
2073                         Bitmap* pOnOffSlidingSelectedBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_SELECTED);
2074
2075                         if (pOnOffSlidingSelectedBgBitmap)
2076                         {
2077                                 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingSelectedBgBitmap);
2078                         }
2079
2080                         Bitmap* pOnOffSlidingOffHandlerSelectedBitmap = __pCheckButton->GetOnOffSlidingOffHandlerBitmap(_CHECK_BUTTON_STATUS_SELECTED);
2081
2082                         if (pOnOffSlidingOffHandlerSelectedBitmap)
2083                         {
2084                                 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOffHandlerSelectedBitmap);
2085                         }
2086                 }
2087         }
2088         else
2089         {
2090                 if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
2091                 {
2092                         Bitmap* pOnOffSlidingNormalBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_NORMAL);
2093
2094                         if (pOnOffSlidingNormalBgBitmap)
2095                         {
2096                                 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingNormalBgBitmap);
2097                         }
2098
2099                         Bitmap* pOnOffSlidingOnHandlerNormalBitmap = __pCheckButton->GetOnOffSlidingOnHandlerBitmap(_CHECK_BUTTON_STATUS_NORMAL);
2100
2101                         if (pOnOffSlidingOnHandlerNormalBitmap)
2102                         {
2103                                 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOnHandlerNormalBitmap);
2104                         }
2105                 }
2106                 else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
2107                 {
2108                         Bitmap* pOnOffSlidingDisabledBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_DISABLED);
2109
2110                         if (pOnOffSlidingDisabledBgBitmap)
2111                         {
2112                                 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingDisabledBgBitmap);
2113                         }
2114
2115                         Bitmap* pOnOffSlidingOnHandlerDisabledBitmap = __pCheckButton->GetOnOffSlidingOnHandlerBitmap(_CHECK_BUTTON_STATUS_DISABLED);
2116
2117                         if (pOnOffSlidingOnHandlerDisabledBitmap)
2118                         {
2119                                 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOnHandlerDisabledBitmap);
2120                         }
2121                 }
2122                 else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
2123                 {
2124                         Bitmap* pOnOffSlidingPressedBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_PRESSED);
2125
2126                         if (pOnOffSlidingPressedBgBitmap)
2127                         {
2128                                 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingPressedBgBitmap);
2129                         }
2130
2131                         Bitmap* pOnOffSlidingOnHandlerPressedBitmap = __pCheckButton->GetOnOffSlidingOnHandlerBitmap(_CHECK_BUTTON_STATUS_PRESSED);
2132
2133                         if (pOnOffSlidingOnHandlerPressedBitmap)
2134                         {
2135                                 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOnHandlerPressedBitmap);
2136                         }
2137                 }
2138                 else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
2139                 {
2140                         Bitmap* pOnOffSlidingHighlightedBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2141
2142                         if (pOnOffSlidingHighlightedBgBitmap)
2143                         {
2144                                 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingHighlightedBgBitmap);
2145                         }
2146
2147                         Bitmap* pOnOffSlidingOnHandlerNormalBitmap = __pCheckButton->GetOnOffSlidingOnHandlerBitmap(_CHECK_BUTTON_STATUS_NORMAL);
2148
2149                         if (pOnOffSlidingOnHandlerNormalBitmap)
2150                         {
2151                                 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOnHandlerNormalBitmap);
2152                         }
2153
2154                         Bitmap* pOnOffSlidingOnHandlerHighlightedBitmap = __pCheckButton->GetOnOffSlidingOnHandlerBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2155
2156                         if (pOnOffSlidingOnHandlerHighlightedBitmap && __highlightedIndex == 1)
2157                         {
2158                                 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOnHandlerHighlightedBitmap);
2159                         }
2160                 }
2161                 else if (checkStatus == _CHECK_BUTTON_STATUS_SELECTED)
2162                 {
2163                         Bitmap* pOnOffSlidingSelectedBgBitmap = __pCheckButton->GetOnOffSlidingBgBitmap(_CHECK_BUTTON_STATUS_SELECTED);
2164
2165                         if (pOnOffSlidingSelectedBgBitmap)
2166                         {
2167                                 pCanvas->DrawBitmap(FloatPoint(__onOffSlidingButtonBounds.x, __onOffSlidingButtonBounds.y), *pOnOffSlidingSelectedBgBitmap);
2168                         }
2169
2170                         Bitmap* pOnOffSlidingOnHandlerSelectedBitmap = __pCheckButton->GetOnOffSlidingOnHandlerBitmap(_CHECK_BUTTON_STATUS_SELECTED);
2171
2172                         if (pOnOffSlidingOnHandlerSelectedBitmap)
2173                         {
2174                                 pCanvas->DrawBitmap(FloatPoint(handlerPosition, __onOffSlidingButtonBounds.y - handlerMargin), *pOnOffSlidingOnHandlerSelectedBitmap);
2175                         }
2176                 }
2177         }
2178
2179         delete pCanvas;
2180         delete pReColorBgBitmap;
2181
2182         return;
2183 }
2184
2185 bool
2186 _CheckButtonPresenter::OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo)
2187 {
2188         if (&source != __pCheckButton)
2189         {
2190                 return false;
2191         }
2192
2193         if (!__pCheckButton->IsEnabled())
2194         {
2195                 return true;
2196         }
2197
2198         __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
2199         __pCheckButton->Invalidate();
2200
2201         return true;
2202 }
2203
2204 void
2205 _CheckButtonPresenter::OnTouchMoveHandled(const _Control& control)
2206 {
2207         __touchMoveHandled = true;
2208         __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
2209         __pCheckButton->Invalidate();
2210
2211         return;
2212 }
2213
2214 bool
2215 _CheckButtonPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
2216 {
2217         _KeyCode keyCode = keyInfo.GetKeyCode();
2218
2219         CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
2220
2221         if (__pCheckButton->IsFocusModeStateEnabled() == true && keyCode == _KEY_ENTER)
2222         {
2223                 if (__pCheckButton->GetCheckButtonStatus() != _CHECK_BUTTON_STATUS_DISABLED)
2224                 {
2225                         if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
2226                         {
2227                                 if (__highlightedIndex == 1)
2228                                 {
2229                                         __onOffHandlerPressed = true;
2230                                 }
2231                                 else
2232                                 {
2233                                         __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
2234                                 }
2235                         }
2236                         else if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
2237                         {
2238                                 if (__highlightedIndex == 2)
2239                                 {
2240                                         __detailedPressed = true;
2241                                 }
2242                                 else
2243                                 {
2244                                         __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
2245                                 }
2246                         }
2247                         else if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
2248                         {
2249                                 if (__highlightedIndex == 1)
2250                                 {
2251                                         __detailedPressed = true;
2252                                 }
2253                                 else
2254                                 {
2255                                         __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
2256                                 }
2257                         }
2258                         else
2259                         {
2260                                 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_PRESSED);
2261                         }
2262                 }
2263         }
2264
2265         __pCheckButton->Invalidate();
2266
2267         return false;
2268 }
2269
2270 bool
2271 _CheckButtonPresenter::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
2272 {
2273         _KeyCode keyCode = keyInfo.GetKeyCode();
2274
2275         CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
2276
2277         if (__pCheckButton->IsFocusModeStateEnabled() == true && keyCode == _KEY_LEFT)
2278         {
2279                 if (checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER)
2280                 {
2281                         __highlightedIndex = 0;
2282                 }
2283                 else if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
2284                 {
2285                         if (__highlightedIndex == 0)
2286                         {
2287                                 __highlightedIndex = 1;
2288                         }
2289                         else if (__highlightedIndex == 1)
2290                         {
2291                                 __highlightedIndex = 2;
2292                         }
2293                         else if (__highlightedIndex == 2)
2294                         {
2295                                 __highlightedIndex = 0;
2296                         }
2297                 }
2298                 else
2299                 {
2300                         if (__highlightedIndex == 0)
2301                         {
2302                                 __highlightedIndex = 1;
2303                         }
2304                         else if (__highlightedIndex == 1)
2305                         {
2306                                 __highlightedIndex = 0;
2307                         }
2308                 }
2309
2310                 __pCheckButton->Invalidate();
2311         }
2312         else if (__pCheckButton->IsFocusModeStateEnabled() == true && keyCode == _KEY_RIGHT)
2313         {
2314                 if (checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER)
2315                 {
2316                         __highlightedIndex = 0;
2317                 }
2318                 else if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
2319                 {
2320                         if (__highlightedIndex == 0)
2321                         {
2322                                 __highlightedIndex = 2;
2323                         }
2324                         else if (__highlightedIndex == 1)
2325                         {
2326                                 __highlightedIndex = 0;
2327                         }
2328                         else if (__highlightedIndex == 2)
2329                         {
2330                                 __highlightedIndex = 1;
2331                         }
2332                 }
2333                 else
2334                 {
2335                         if (__highlightedIndex == 0)
2336                         {
2337                                 __highlightedIndex = 1;
2338                         }
2339                         else if (__highlightedIndex == 1)
2340                         {
2341                                 __highlightedIndex = 0;
2342                         }
2343                 }
2344
2345                 __pCheckButton->Invalidate();
2346         }
2347         else if (__pCheckButton->IsFocusModeStateEnabled() == true && keyCode == _KEY_ENTER)
2348         {
2349                 if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON
2350                                 || checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
2351                 {
2352                         if (__detailedPressed == false)
2353                         {
2354                                 StartCheckAnimationTimer();
2355                                 __ratio = 0;
2356                         }
2357                 }
2358
2359                 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
2360                 __pCheckButton->Invalidate();
2361
2362                 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2363
2364                 if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON)
2365                 {
2366                         if (__highlightedIndex != 2)
2367                         {
2368                                 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
2369
2370                                 __pCheckButton->FireActionEvent();
2371
2372                                 if (__pCheckButton->GetRadioGroup() != null)
2373                                 {
2374                                         __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
2375                                 }
2376                         }
2377                         else
2378                         {
2379                                 __detailedPressed = false;
2380                         }
2381                 }
2382                 else if (checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
2383                 {
2384                         if (__highlightedIndex != 1)
2385                         {
2386                                 PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
2387
2388                                 __pCheckButton->FireActionEvent();
2389
2390                                 if (__pCheckButton->GetRadioGroup() != null)
2391                                 {
2392                                         __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
2393                                 }
2394                         }
2395                         else
2396                         {
2397                                 __detailedPressed = false;
2398                         }
2399                 }
2400                 else if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING)
2401                 {
2402                         PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
2403
2404                         __pCheckButton->FireActionEvent();
2405
2406                         if (__pCheckButton->GetRadioGroup() != null)
2407                         {
2408                                 __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
2409                         }
2410
2411                         AdjustHandlerPosition();
2412
2413                         __onOffHandlerPressed = false;
2414                         __onOffHandlerMoved = false;
2415                 }
2416                 else
2417                 {
2418                         PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP, __pCheckButton);
2419
2420                         __pCheckButton->FireActionEvent();
2421
2422                         if (__pCheckButton->GetRadioGroup() != null)
2423                         {
2424                                 __pCheckButton->SendTouchReleasedEvent(*__pCheckButton);
2425                         }
2426                 }
2427         }
2428
2429         return false;
2430 }
2431
2432 bool
2433 _CheckButtonPresenter::IsEnabledStateChanged(void)
2434 {
2435         bool __currentEnabledState = __pCheckButton->GetEnableState();
2436
2437         if (__currentEnabledState != __previousEnabledState)
2438         {
2439                 __previousEnabledState = __currentEnabledState;
2440                 return true;
2441         }
2442         else
2443         {
2444                 return false;
2445         }
2446 }
2447
2448 result
2449 _CheckButtonPresenter::CalculateTitleTextBounds(void)
2450 {
2451         float checkButtonLeftMargin = 0.0f;
2452         float checkButtonTopMargin = 0.0f;
2453         float checkButtonBitmapWidth = 0.0f;
2454         float checkButtonOnOffSlidingBitmapWidth = 0.0f;
2455         float checkButtonDetailedBitmapWidth = 0.0f;
2456         float checkButtonTitleTextHeight = 0.0f;
2457         float checkButtonTextHeight = 0.0f;
2458
2459         FloatDimension minDimension(0.0f, 0.0f);
2460         FloatDimension minDimensionWithAnnex(0.0f, 0.0f);
2461
2462         GET_SHAPE_CONFIG(CHECKBUTTON::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonLeftMargin);
2463         GET_SHAPE_CONFIG(CHECKBUTTON::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTopMargin);
2464         GET_SHAPE_CONFIG(CHECKBUTTON::MARK_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonBitmapWidth);
2465         GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonOnOffSlidingBitmapWidth);
2466         GET_SHAPE_CONFIG(CHECKBUTTON::DETAILED_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonDetailedBitmapWidth);
2467         GET_SHAPE_CONFIG(CHECKBUTTON::TITLE_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTitleTextHeight);
2468         GET_SHAPE_CONFIG(CHECKBUTTON::TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTextHeight);
2469
2470         GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION, __pCheckButton->GetOrientation(), minDimension);
2471         GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION_WITH_ANNEX, __pCheckButton->GetOrientation(), minDimensionWithAnnex);
2472
2473         FloatRectangle bounds(0.0f, 0.0f, __pCheckButton->GetBoundsF().width, __pCheckButton->GetBoundsF().height);
2474
2475         CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
2476
2477         if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_ONOFF
2478                         || checkStyle == CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER)
2479         {
2480                 if (bounds.width < minDimension.width)
2481                 {
2482                         bounds.width = minDimension.width;
2483                 }
2484
2485                 if (bounds.height < minDimension.height)
2486                 {
2487                         bounds.height = minDimension.height;
2488                 }
2489         }
2490         else
2491         {
2492                 if (bounds.width < minDimensionWithAnnex.width)
2493                 {
2494                         bounds.width = minDimensionWithAnnex.width;
2495                 }
2496
2497                 if (bounds.height < minDimensionWithAnnex.height)
2498                 {
2499                         bounds.height = minDimensionWithAnnex.height;
2500                 }
2501         }
2502
2503         if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
2504         {
2505                 __titleTextBounds.x = checkButtonLeftMargin;
2506                 __titleTextBounds.y = checkButtonTopMargin;
2507                 __titleTextBounds.width = bounds.width - checkButtonLeftMargin * 3 - checkButtonOnOffSlidingBitmapWidth;
2508                 __titleTextBounds.height = bounds.height - checkButtonTopMargin * 2 - __textBounds.height;
2509         }
2510         else
2511         {
2512                 if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
2513                 {
2514                         __titleTextBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth;
2515                         __titleTextBounds.y = checkButtonTopMargin;
2516                         __titleTextBounds.width = bounds.width - checkButtonLeftMargin * 4 - checkButtonBitmapWidth - checkButtonDetailedBitmapWidth;
2517                         __titleTextBounds.height = bounds.height - checkButtonTopMargin * 2 - __textBounds.height;
2518                 }
2519                 else
2520                 {
2521                         __titleTextBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth;
2522                         __titleTextBounds.y = checkButtonTopMargin;
2523                         __titleTextBounds.width = bounds.width - checkButtonLeftMargin * 3 - checkButtonBitmapWidth;
2524                         __titleTextBounds.height = bounds.height - checkButtonTopMargin * 2 - __textBounds.height;
2525                 }
2526         }
2527
2528         return E_SUCCESS;
2529 }
2530
2531 result
2532 _CheckButtonPresenter::CalculateTextBounds(void)
2533 {
2534         float checkButtonLeftMargin = 0.0f;
2535         float checkButtonTopMargin = 0.0f;
2536         float checkButtonBitmapWidth = 0.0f;
2537         float checkButtonOnOffSlidingBitmapWidth = 0.0f;
2538         float checkButtonDetailedBitmapWidth = 0.0f;
2539         float checkButtonTitleTextHeight = 0.0f;
2540         float checkButtonTextHeight = 0.0f;
2541
2542         FloatDimension minDimension(0.0f, 0.0f);
2543         FloatDimension minDimensionWithAnnex(0.0f, 0.0f);
2544
2545         GET_SHAPE_CONFIG(CHECKBUTTON::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonLeftMargin);
2546         GET_SHAPE_CONFIG(CHECKBUTTON::TOP_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTopMargin);
2547         GET_SHAPE_CONFIG(CHECKBUTTON::MARK_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonBitmapWidth);
2548         GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonOnOffSlidingBitmapWidth);
2549         GET_SHAPE_CONFIG(CHECKBUTTON::DETAILED_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonDetailedBitmapWidth);
2550         GET_SHAPE_CONFIG(CHECKBUTTON::TITLE_TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTitleTextHeight);
2551         GET_SHAPE_CONFIG(CHECKBUTTON::TEXT_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonTextHeight);
2552
2553         GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION, __pCheckButton->GetOrientation(), minDimension);
2554         GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION_WITH_ANNEX, __pCheckButton->GetOrientation(), minDimensionWithAnnex);
2555
2556         FloatRectangle bounds(0.0f, 0.0f, __pCheckButton->GetBoundsF().width, __pCheckButton->GetBoundsF().height);
2557
2558         CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
2559         bool showTitle = __pCheckButton->GetShowTitle();
2560
2561         if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_ONOFF
2562                         || checkStyle == CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER)
2563         {
2564                 if (bounds.width < minDimension.width)
2565                 {
2566                         bounds.width = minDimension.width;
2567                 }
2568
2569                 if (bounds.height < minDimension.height)
2570                 {
2571                         bounds.height = minDimension.height;
2572                 }
2573         }
2574         else
2575         {
2576                 if (bounds.width < minDimensionWithAnnex.width)
2577                 {
2578                         bounds.width = minDimensionWithAnnex.width;
2579                 }
2580
2581                 if (bounds.height < minDimensionWithAnnex.height)
2582                 {
2583                         bounds.height = minDimensionWithAnnex.height;
2584                 }
2585         }
2586
2587         if (checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING || checkStyle == CHECK_BUTTON_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
2588         {
2589                 if (showTitle)
2590                 {
2591                         __textBounds.x = checkButtonLeftMargin;
2592                         __textBounds.y = checkButtonTopMargin + checkButtonTitleTextHeight;
2593                         __textBounds.width = bounds.width - checkButtonLeftMargin * 3 - checkButtonOnOffSlidingBitmapWidth;
2594                         __textBounds.height = bounds.height - checkButtonTopMargin * 2 - checkButtonTitleTextHeight;
2595                 }
2596                 else
2597                 {
2598                         __textBounds.x = checkButtonLeftMargin;
2599                         __textBounds.y = checkButtonTopMargin;
2600                         __textBounds.width = bounds.width - checkButtonLeftMargin * 3 - checkButtonOnOffSlidingBitmapWidth;
2601                         __textBounds.height = bounds.height - checkButtonTopMargin * 2;
2602                 }
2603         }
2604         else
2605         {
2606                 if (checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DETAILED_BUTTON || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DETAILED_BUTTON)
2607                 {
2608                         if (showTitle)
2609                         {
2610                                 __textBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth;
2611                                 __textBounds.y = checkButtonTopMargin + checkButtonTitleTextHeight;
2612                                 __textBounds.width = bounds.width - checkButtonLeftMargin * 4 - checkButtonBitmapWidth - checkButtonDetailedBitmapWidth;
2613                                 __textBounds.height = bounds.height - checkButtonTopMargin * 2 - checkButtonTitleTextHeight;
2614                         }
2615                         else
2616                         {
2617                                 __textBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth;
2618                                 __textBounds.y = checkButtonTopMargin;
2619                                 __textBounds.width = bounds.width - checkButtonLeftMargin * 4 - checkButtonBitmapWidth - checkButtonDetailedBitmapWidth;
2620                                 __textBounds.height = bounds.height - checkButtonTopMargin * 2;
2621                         }
2622                 }
2623                 else
2624                 {
2625                         if (showTitle)
2626                         {
2627                                 __textBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth;
2628                                 __textBounds.y = checkButtonTopMargin + checkButtonTitleTextHeight;
2629                                 __textBounds.width = bounds.width - checkButtonLeftMargin * 3 - checkButtonBitmapWidth;
2630                                 __textBounds.height = bounds.height - checkButtonTopMargin * 2 - checkButtonTitleTextHeight;
2631                         }
2632                         else
2633                         {
2634                                 __textBounds.x = checkButtonLeftMargin * 2 + checkButtonBitmapWidth;
2635                                 __textBounds.y = checkButtonTopMargin;
2636                                 __textBounds.width = bounds.width - checkButtonLeftMargin * 3 - checkButtonBitmapWidth;
2637                                 __textBounds.height = bounds.height - checkButtonTopMargin * 2;
2638                         }
2639                 }
2640         }
2641
2642         return E_SUCCESS;
2643 }
2644
2645 result
2646 _CheckButtonPresenter::CalculateButtonBounds(void)
2647 {
2648         float checkButtonLeftMargin = 0.0f;
2649         float checkButtonBitmapWidth = 0.0f;
2650         float checkButtonBitmapHeight = 0.0f;
2651         float checkButtonOnOffSlidingBitmapWidth = 0.0f;
2652         float checkButtonOnOffSlidingBitmapHeight = 0.0f;
2653         float checkButtonDetaieldBitmapWidth = 0.0f;
2654         float checkButtonDetaieldBitmapHeight = 0.0f;
2655
2656         FloatDimension minDimension(0.0f, 0.0f);
2657         FloatDimension minDimensionWithAnnex(0.0f, 0.0f);
2658
2659         GET_SHAPE_CONFIG(CHECKBUTTON::LEFT_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, checkButtonLeftMargin);
2660         GET_SHAPE_CONFIG(CHECKBUTTON::MARK_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonBitmapWidth);
2661         GET_SHAPE_CONFIG(CHECKBUTTON::MARK_BITMAP_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonBitmapHeight);
2662         GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonOnOffSlidingBitmapWidth);
2663         GET_SHAPE_CONFIG(CHECKBUTTON::ONOFF_SLIDING_BITMAP_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonOnOffSlidingBitmapHeight);
2664         GET_SHAPE_CONFIG(CHECKBUTTON::DETAILED_BITMAP_WIDTH, _CONTROL_ORIENTATION_PORTRAIT, checkButtonDetaieldBitmapWidth);
2665         GET_SHAPE_CONFIG(CHECKBUTTON::DETAILED_BITMAP_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, checkButtonDetaieldBitmapHeight);
2666
2667         GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION, __pCheckButton->GetOrientation(), minDimension);
2668         GET_DIMENSION_CONFIG(CHECKBUTTON::MIN_DIMENSION_WITH_ANNEX, __pCheckButton->GetOrientation(), minDimensionWithAnnex);
2669
2670         FloatRectangle bounds(0.0f, 0.0f, __pCheckButton->GetBoundsF().width, __pCheckButton->GetBoundsF().height);
2671
2672         CheckButtonStyle checkStyle = __pCheckButton->GetCheckButtonStyle();
2673
2674         if (checkStyle == CHECK_BUTTON_STYLE_MARK || checkStyle == CHECK_BUTTON_STYLE_MARK_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_ONOFF
2675                         || checkStyle == CHECK_BUTTON_STYLE_ONOFF_WITH_DIVIDER || checkStyle == CHECK_BUTTON_STYLE_RADIO || checkStyle == CHECK_BUTTON_STYLE_RADIO_WITH_DIVIDER)
2676         {
2677                 if (bounds.width < minDimension.width)
2678                 {
2679                         bounds.width = minDimension.width;
2680                 }
2681
2682                 if (bounds.height < minDimension.height)
2683                 {
2684                         bounds.height = minDimension.height;
2685                 }
2686         }
2687         else
2688         {
2689                 if (bounds.width < minDimensionWithAnnex.width)
2690                 {
2691                         bounds.width = minDimensionWithAnnex.width;
2692                 }
2693
2694                 if (bounds.height < minDimensionWithAnnex.height)
2695                 {
2696                         bounds.height = minDimensionWithAnnex.height;
2697                 }
2698         }
2699
2700         __defaultButtonBounds.x = checkButtonLeftMargin;
2701         __defaultButtonBounds.y = (bounds.height - checkButtonBitmapHeight) / 2;
2702         __defaultButtonBounds.width = checkButtonBitmapWidth;
2703         __defaultButtonBounds.height = checkButtonBitmapHeight;
2704
2705         __onOffSlidingButtonBounds.x = bounds.width - checkButtonLeftMargin - checkButtonOnOffSlidingBitmapWidth;
2706         __onOffSlidingButtonBounds.y = (bounds.height - checkButtonOnOffSlidingBitmapHeight) / 2;
2707         __onOffSlidingButtonBounds.width = checkButtonOnOffSlidingBitmapWidth;
2708         __onOffSlidingButtonBounds.height = checkButtonOnOffSlidingBitmapHeight;
2709
2710         __detailedButtonBounds.x = bounds.width - checkButtonLeftMargin - checkButtonDetaieldBitmapWidth;
2711         __detailedButtonBounds.y = (bounds.height - checkButtonDetaieldBitmapHeight) / 2;
2712         __detailedButtonBounds.width = checkButtonDetaieldBitmapWidth;
2713         __detailedButtonBounds.height = checkButtonDetaieldBitmapHeight;
2714
2715         return E_SUCCESS;
2716 }
2717
2718 FloatRectangle
2719 _CheckButtonPresenter::GetTitleTextBoundsF(void) const
2720 {
2721         return __titleTextBounds;
2722 }
2723
2724 FloatRectangle
2725 _CheckButtonPresenter::GetTextBoundsF(void) const
2726 {
2727         return __textBounds;
2728 }
2729
2730 FloatRectangle
2731 _CheckButtonPresenter::GetDefaultButtonBoundsF(void) const
2732 {
2733         return __defaultButtonBounds;
2734 }
2735
2736 FloatRectangle
2737 _CheckButtonPresenter::GetOnOffSlidingButtonBoundsF(void) const
2738 {
2739         return __onOffSlidingButtonBounds;
2740 }
2741
2742 FloatRectangle
2743 _CheckButtonPresenter::GetDetailedButtonBoundsF(void) const
2744 {
2745         return __detailedButtonBounds;
2746 }
2747
2748 result
2749 _CheckButtonPresenter::StartCheckAnimationTimer(void)
2750 {
2751         result r = E_SUCCESS;
2752         if (__pCheckAnimationTimer == null)
2753         {
2754                 __pCheckAnimationTimer = new (std::nothrow) Timer;
2755                 SysTryReturn(NID_UI_CTRL, (__pCheckAnimationTimer != null), E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memroy allocation failed.");
2756
2757                 r = __pCheckAnimationTimer->Construct(*this);
2758                 SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
2759         }
2760         else
2761         {
2762                 __pCheckAnimationTimer->Cancel();
2763         }
2764
2765         __pCheckAnimationTimer->Start(CHECK_ACTION_TIMER_PERIOD);
2766         SysTryCatch(NID_UI, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
2767
2768         return r;
2769 CATCH:
2770         ResetCheckAnimationTimer();
2771         return r;
2772 }
2773
2774 result
2775 _CheckButtonPresenter::ResetCheckAnimationTimer(void)
2776 {
2777         delete __pCheckAnimationTimer;
2778         __pCheckAnimationTimer = null;
2779
2780         return E_SUCCESS;
2781 }
2782
2783 void
2784 _CheckButtonPresenter::OnTimerExpired(Timer& timer)
2785 {
2786         __ratio++;
2787
2788         if (__ratio <= RATIO_MAX)
2789         {
2790                 StartCheckAnimationTimer();
2791                 DrawMarkAnimation();
2792         }
2793         else
2794         {
2795                 ResetCheckAnimationTimer();
2796                 __ratio = 10;
2797         }
2798
2799         return;
2800 }
2801
2802 void
2803 _CheckButtonPresenter::OnDrawFocus(void)
2804 {
2805         if (__pCheckButton->GetCheckButtonStatus() != _CHECK_BUTTON_STATUS_DISABLED)
2806         {
2807                 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2808                 __pCheckButton->Invalidate();
2809         }
2810
2811         return;
2812 }
2813
2814 void
2815 _CheckButtonPresenter::OnChildControlFocusMoved(const _Control& control)
2816 {
2817         return;
2818 }
2819
2820 bool
2821 _CheckButtonPresenter::IsChildControlFocusManage(void) const
2822 {
2823         return true;
2824 }
2825
2826 void
2827 _CheckButtonPresenter::OnFocusableStateChanged(bool focusalbeState)
2828 {
2829         return;
2830 }
2831
2832 void
2833 _CheckButtonPresenter::OnFocusModeStateChanged(void)
2834 {
2835         if (__pCheckButton->GetCheckButtonStatus() != _CHECK_BUTTON_STATUS_DISABLED)
2836         {
2837                 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
2838                 __pCheckButton->Invalidate();
2839         }
2840
2841         return;
2842 }
2843
2844 bool
2845 _CheckButtonPresenter::OnFocusGained(const _Control& source)
2846 {
2847         __highlightedIndex = 0;
2848
2849         if (__pCheckButton->IsFocusModeStateEnabled() == true)
2850         {
2851                 if (__pCheckButton->GetCheckButtonStatus() != _CHECK_BUTTON_STATUS_DISABLED)
2852                 {
2853                         __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2854                         __pCheckButton->Invalidate();
2855                 }
2856         }
2857
2858         return true;
2859 }
2860
2861 bool
2862 _CheckButtonPresenter::OnFocusLost(const _Control& source)
2863 {
2864         if (__pCheckButton->GetCheckButtonStatus() != _CHECK_BUTTON_STATUS_DISABLED)
2865         {
2866                 __pCheckButton->SetCheckButtonStatus(_CHECK_BUTTON_STATUS_NORMAL);
2867                 __pCheckButton->Invalidate();
2868         }
2869
2870         return true;
2871 }
2872 void
2873 _CheckButtonPresenter::DrawMarkAnimation(void)
2874 {
2875         Canvas* pCanvas = __pCheckButton->GetCanvasN();
2876         if (pCanvas == null)
2877         {
2878                 SysLog(NID_UI_CTRL, "Cannot get a canvas.");
2879
2880                 return;
2881         }
2882
2883         _CheckButtonStatus checkStatus = __pCheckButton->GetCheckButtonStatus();
2884
2885         if (checkStatus == _CHECK_BUTTON_STATUS_NORMAL)
2886         {
2887                 Bitmap* pMarkNormalBitmap = __pCheckButton->GetMarkBitmap(_CHECK_BUTTON_STATUS_NORMAL);
2888
2889                 if (__pCheckButton->IsSelected() && pMarkNormalBitmap)
2890                 {
2891                         FloatRectangle sourceRect(0.0f, 0.0f, pMarkNormalBitmap->GetWidthF() * __ratio * 0.1, pMarkNormalBitmap->GetHeightF());
2892                         FloatRectangle destRect(__defaultButtonBounds.x, __defaultButtonBounds.y, pMarkNormalBitmap->GetWidthF() * __ratio * 0.1, pMarkNormalBitmap->GetHeightF());
2893
2894                         pCanvas->DrawBitmap(destRect, *pMarkNormalBitmap, sourceRect);
2895                 }
2896         }
2897         else if (checkStatus == _CHECK_BUTTON_STATUS_DISABLED)
2898         {
2899                 Bitmap* pMarkDisabledBitmap = __pCheckButton->GetMarkBitmap(_CHECK_BUTTON_STATUS_DISABLED);
2900
2901                 if (__pCheckButton->IsSelected() && pMarkDisabledBitmap)
2902                 {
2903                         FloatRectangle sourceRect(0.0f, 0.0f, pMarkDisabledBitmap->GetWidthF() * __ratio * 0.1, pMarkDisabledBitmap->GetHeightF());
2904                         FloatRectangle destRect(__defaultButtonBounds.x, __defaultButtonBounds.y, pMarkDisabledBitmap->GetWidthF() * __ratio * 0.1, pMarkDisabledBitmap->GetHeightF());
2905
2906                         pCanvas->DrawBitmap(destRect, *pMarkDisabledBitmap, sourceRect);
2907                 }
2908         }
2909         else if (checkStatus == _CHECK_BUTTON_STATUS_PRESSED)
2910         {
2911                 Bitmap* pMarkPressedBitmap = __pCheckButton->GetMarkBitmap(_CHECK_BUTTON_STATUS_PRESSED);
2912
2913                 if (__pCheckButton->IsSelected() && pMarkPressedBitmap)
2914                 {
2915                         FloatRectangle sourceRect(0.0f, 0.0f, pMarkPressedBitmap->GetWidthF() * __ratio * 0.1, pMarkPressedBitmap->GetHeightF());
2916                         FloatRectangle destRect(__defaultButtonBounds.x, __defaultButtonBounds.y, pMarkPressedBitmap->GetWidthF() * __ratio * 0.1, pMarkPressedBitmap->GetHeightF());
2917
2918                         pCanvas->DrawBitmap(destRect, *pMarkPressedBitmap, sourceRect);
2919                 }
2920         }
2921         else if (checkStatus == _CHECK_BUTTON_STATUS_HIGHLIGHTED)
2922         {
2923                 Bitmap* pMarkHighlightedBitmap = __pCheckButton->GetMarkBitmap(_CHECK_BUTTON_STATUS_HIGHLIGHTED);
2924
2925                 if (__pCheckButton->IsSelected() && pMarkHighlightedBitmap)
2926                 {
2927                         FloatRectangle sourceRect(0.0f, 0.0f, pMarkHighlightedBitmap->GetWidthF() * __ratio * 0.1, pMarkHighlightedBitmap->GetHeightF());
2928                         FloatRectangle destRect(__defaultButtonBounds.x, __defaultButtonBounds.y, pMarkHighlightedBitmap->GetWidthF() * __ratio * 0.1, pMarkHighlightedBitmap->GetHeightF());
2929
2930                         pCanvas->DrawBitmap(destRect, *pMarkHighlightedBitmap, sourceRect);
2931                 }
2932         }
2933         else if (checkStatus == _CHECK_BUTTON_STATUS_SELECTED)
2934         {
2935                 Bitmap* pMarkSelectedBitmap = __pCheckButton->GetMarkBitmap(_CHECK_BUTTON_STATUS_SELECTED);
2936
2937                 if (__pCheckButton->IsSelected() && pMarkSelectedBitmap)
2938                 {
2939                         FloatRectangle sourceRect(0.0f, 0.0f, pMarkSelectedBitmap->GetWidthF() * __ratio * 0.1, pMarkSelectedBitmap->GetHeightF());
2940                         FloatRectangle destRect(__defaultButtonBounds.x, __defaultButtonBounds.y, pMarkSelectedBitmap->GetWidthF() * __ratio * 0.1, pMarkSelectedBitmap->GetHeightF());
2941
2942                         pCanvas->DrawBitmap(destRect, *pMarkSelectedBitmap, sourceRect);
2943                 }
2944         }
2945
2946         delete pCanvas;
2947
2948         return;
2949 }
2950
2951 }}} // Tizen::Ui::Controls