int hour = GetHour();
int minute = GetMinute();
- if (__24hours == false)
+ if (!__24hours)
{
int max = DATETIME_HOUR_MAX_FOR_24NOTATION;
__amEnable = amEnable;
int hour = GetHour();
- if (__amEnable == true)
+ if (__amEnable)
{
__ampmString = textAm;
if (hour >= DATETIME_HOUR_MAX_FOR_24NOTATION)
hourBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR);
minuteBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE);
- if (__24hours == false)
+ if (!__24hours)
{
ampmBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM);
colonBounds.x = hourBounds.x + hourBounds.width + colonMargin;
colonBounds.y = hourBounds.y + (hourBounds.height - colonBounds.height) / 2.0f;
- if (__title.IsEmpty() == false)
+ if (!__title.IsEmpty())
{
r = DrawTitle(*pCanvas);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
r = DrawColon(*pCanvas, colonBounds);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- if (__24hours == false)
+ if (!__24hours)
{
r = DrawResourceBitmap(*pCanvas, ampmBounds, pReplacementBitmap);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
FloatRectangle hoursBounds(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle minutesBounds(0.0f, 0.0f, 0.0f, 0.0f);
- if (__24hours == false)
+ if (!__24hours)
{
ampmBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM);
}
return displayBoxId;
}
- if (hoursBounds.Contains(point) == true)
+ if (hoursBounds.Contains(point))
{
displayBoxId = DATETIME_ID_HOUR;
}
- else if (minutesBounds.Contains(point) == true)
+ else if (minutesBounds.Contains(point))
{
displayBoxId = DATETIME_ID_MINUTE;
}
- else if (ampmBounds.Contains(point) == true)
+ else if (ampmBounds.Contains(point))
{
displayBoxId = DATETIME_ID_AMPM;
}
}
_KeyCode keyCode = keyInfo.GetKeyCode();
- int minValue = -1;
- int maxValue = -1;
- int displayValue = -1;
-
- _DateTimeId boxId = DATETIME_ID_HOUR;
-
switch (keyCode)
{
case _KEY_RIGHT:
__pEditTime->Invalidate();
break;
}
-
case _KEY_LEFT:
{
__isEnterKeyPressed = false;
break;
}
+ default:
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool
+_EditTimePresenter::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
+{
+ if (!__isFocused)
+ {
+ return false;
+ }
+ _KeyCode keyCode = keyInfo.GetKeyCode();
+
+ if (__isAnimating)
+ {
+ VisualElement *pEditTimeElement = __pEditTime->GetVisualElement();
+ result r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, (pEditTimeElement != null), false, r, "[%s] Propagating.", GetErrorMessage(r));
+ pEditTimeElement->RemoveAllAnimations();
+ }
+
+ int minValue = -1;
+ int maxValue = -1;
+ int displayValue = -1;
+
+ _DateTimeId boxId = DATETIME_ID_HOUR;
+
+ switch (keyCode)
+ {
case _KEY_ENTER:
{
__isEnterKeyPressed = true;
hourBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_HOUR);
minuteBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_MINUTE);
- if (__24hours == false)
+ if (!__24hours)
{
ampmBounds = GetDisplayAreaBoundsFromHoursStyle(DATETIME_ID_AMPM);
}
{
if (__pEditTime->GetDateTimeBar() != null)
{
- if (__24hours == false)
+ if (!__24hours)
{
if (GetHour() == 0)
{
if (__pEditTime->GetDateTimeBar()->IsActivated())
{
+ __pEditTime->GetDateTimeBar()->RemoveAllAnimations();
__pEditTime->GetDateTimeBar()->Close();
+ __pEditTime->GetDateTimeBar()->SetVisibleState(true);
__pEditTime->GetDateTimeBar()->Open();
}
else
editTimeHeight = __pEditTime->GetBoundsF().height;
}
- if (__title.IsEmpty() == false)
+ if (!__title.IsEmpty())
{
SetTitleBounds();
if (!__isEditTimeInitialized)