}
}
{
- Color color;
- bool isPixmanSupported = !this->__useStableRenderer && bitmap.GetMaskingColor(color ) != E_SUCCESS && alphaConstant >= 255;
+ bool isPixmanSupported = (!this->__useStableRenderer) && (alphaConstant >= 255);
+
+ if (isPixmanSupported)
+ {
+ Color color;
+
+ isPixmanSupported = !((bitmap.GetBitsPerPixel() == 16) && (bitmap.GetMaskingColor(color) == E_SUCCESS));
+ }
+
if (isPixmanSupported)
{
_Util::Rectangle<int> outRect = { 0, 0, -1, -1 };
#define EXTRACT_CANVASEX(pVar, canvas) Tizen::Graphics::_Canvas * pVar = canvas._pNativeCanvas
#define EXTRACT_BITMAPEX(pVar, bitmap) Tizen::Graphics::_Bitmap * pVar = Tizen::Graphics::_GetBitmapEx(bitmap)
-#define EXTRACT_FONTEX(pVar, font) Tizen::Graphics::_Font * pVar = Tizen::Graphics::GetFontEx(font)
+#define EXTRACT_FONTEX(pVar, font) Tizen::Graphics::_Font * pVar = Tizen::Graphics::_GetFontEx(font)
#define EXTRACT_SCALED_BITMAPEX(pVar, bitmap) Tizen::Graphics::_Bitmap * pVar = Tizen::Graphics::_GetScaledBitmapEx(bitmap)
#define IsSucceeded(X) (!IsFailed(X))
{
_OSP_EXPORT_ bool _TestGetTextExtentList(Tizen::Graphics::Font& font, const Tizen::Base::String& string, std::vector<std::pair<int, int> >& outList)
{
- _Font* pInternalFont = GetFontEx(font);
+ _Font* pInternalFont = _GetFontEx(font);
_Util::String text(string.GetPointer(), string.GetLength());
_Util::AccumList<_Util::Pair<int, int> > outAccumList;
};
inline _Font*
-GetFontEx(const Tizen::Graphics::_FontImpl& font)
+_GetFontEx(const Tizen::Graphics::_FontImpl& font)
{
const _FontImplHack* pFontImplHack = static_cast <const _FontImplHack*>(&font);
return (pFontImplHack) ? pFontImplHack->GetFontEx() : null;
}
inline _Font*
-GetFontEx(const Tizen::Graphics::Font& font)
+_GetFontEx(const Tizen::Graphics::Font& font)
{
const _FontImpl* pFontImpl = _FontImpl::GetInstance(font);
- return (pFontImpl) ? GetFontEx(*pFontImpl) : null;
+ return (pFontImpl) ? _GetFontEx(*pFontImpl) : null;
}
}} // Tizen::Graphics
resource/FUi_ResourceStringLoader.cpp
resource/FUi_ResourceConfigLoader.cpp
resource/FUi_ResourceConfigParser.cpp
+ resource/FUi_ResourceFocusUiConfig.cpp
## EFFECTS
effects/FUiEffects_EffectErrorMessages.cpp
effects/FUiEffects_EffectManagerImpl.cpp
}
void
+_ContainerImpl::DeleteAllChildren(_ContainerImpl* pChild, bool detachSystemChild)
+{
+ ArrayList* pList = static_cast <ArrayList*>(pChild->GetChildrenPublic());
+ int count = pList->GetCount();
+ for (int index = 0; index < count; index++)
+ {
+ Container* pContainer = dynamic_cast <Container*>(pList->GetAt(index));
+ result r = GetLastResult();
+ if (IsFailed(r))
+ {
+ SysAssert(r == E_OUT_OF_RANGE);
+ SysLogException(NID_UI,
+ E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is out of range (index = %d, count = %d.)",
+ index, GetChildCount());
+ return;
+ }
+
+ if (pContainer)
+ {
+ _ContainerImpl* pContainerImpl = _ContainerImpl::GetInstance(*pContainer);
+ DeleteAllChildren(pContainerImpl, detachSystemChild);
+ pContainer->Destroy();
+ }
+ else
+ {
+ Control* pControl = static_cast <Control*>(pList->GetAt(index));
+ result r = GetLastResult();
+ if (IsFailed(r))
+ {
+ SysAssert(r == E_OUT_OF_RANGE);
+ SysLogException(NID_UI,
+ E_OUT_OF_RANGE, "[E_OUT_OF_RANGE] The specified index is out of range (index = %d, count = %d.)",
+ index, GetChildCount());
+ return;
+ }
+ _ControlImpl* pControlImpl = _ControlImpl::GetInstance(*pControl);
+ if (pControlImpl)
+ {
+ if (detachSystemChild || pControlImpl->GetCore().GetArea() != _CONTROL_AREA_SYSTEM)
+ {
+ pControl->Destroy();
+ }
+ }
+ }
+ }
+}
+
+void
_ContainerImpl::RemoveAllChildren(bool detachSystemChild)
{
ClearLastResult();
GetCore().DetachAllChildren(detachSystemChild);
SysAssert(GetLastResult() == E_SUCCESS);
+ DeleteAllChildren(this, detachSystemChild);
if (detachSystemChild)
{
- __controlPublics.RemoveAll(true);
+ __controlPublics.RemoveAll(false);
}
else
{
continue;
}
- r = __controlPublics.Remove(pControl->GetPublic(), true);
+ r = __controlPublics.Remove(pControl->GetPublic(), false);
SysAssert(r == E_SUCCESS);
}
}
#include "FUiAnim_VisualElementImpl.h"
#include "FUiCtrl_Form.h"
#include "FUiCtrl_Frame.h"
+#include "FUi_ContainerImpl.h"
using namespace std;
using namespace Tizen::Base;
delete __pAccessibilityContainer;
__pAccessibilityContainer = null;
+
+ if (__pFocusVisualElement)
+ {
+ __pFocusVisualElement.release();
+ }
}
// E_OUT_OF_MEMORY
pCanvas->SetBackgroundColor(0x55555555);
pCanvas->Clear();
Bitmap* pBitmap = null;
- result r = GET_BITMAP_CONFIG_N(ACCESSIBILITY::POPUP_BG, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
+ result r = GET_BITMAP_CONFIG_N(FOCUSUI::FOCUS, BITMAP_PIXEL_FORMAT_ARGB8888, pBitmap);
if (r == E_SUCCESS)
{
_IControlDelegate& delegate = GetControlDelegate();
delegate.OnDrawFocus();
}
+
+void
+_Control::MakeFocusList(const _Control* pControl, IListT<_Control*>* pFocusControlList) const
+{
+ int childCount = pControl->GetChildCount();
+ for(int i = 0; i < childCount; i++)
+ {
+ _Control* pChildControl = pControl->GetChild(i);
+ Rectangle rect = pChildControl->GetAbsoluteBounds();
+ unique_ptr<IEnumeratorT<_Control*> > pEnum (pFocusControlList->GetEnumeratorN());
+ int index = 0;
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ _Control* pEnumeratorControl = null;
+ pEnum->GetCurrent(pEnumeratorControl);
+ if (pEnumeratorControl != null)
+ {
+ Rectangle enumeratorRect = pEnumeratorControl->GetAbsoluteBounds();
+ if(enumeratorRect.y > rect.y)
+ {
+ break;
+ }
+ else if (enumeratorRect.y == rect.y)
+ {
+ if(enumeratorRect.x > rect.x)
+ {
+ break;
+ }
+ }
+
+ index ++;
+ }
+ }
+ pFocusControlList->InsertAt(pChildControl, index);
+ }
+}
+
+void
+_Control::MakeChildContainerFocusList(const _Control* pControl, int startIndex , IListT<_Control*>* pFocusControlList) const
+{
+ unique_ptr<IListT<_Control*> > pTempList (new (std::nothrow) ArrayListT<_Control*>);
+ SysTryReturnVoidResult(NID_UI_CTRL, pTempList, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
+ MakeFocusList(pControl, pTempList.get());
+
+ unique_ptr<IEnumeratorT<_Control*> > pTempEnum(pTempList->GetEnumeratorN());
+ int index = ++startIndex;
+ while (pTempEnum->MoveNext() == E_SUCCESS)
+ {
+ _Control* pEnumeratorControl = null;
+ pTempEnum->GetCurrent(pEnumeratorControl);
+ pFocusControlList->InsertAt(pEnumeratorControl, index);
+ index ++;
+ }
+}
+
+Tizen::Base::Collection::IListT<_Control*>*
+_Control::GetFocusListN(void) const
+{
+ unique_ptr<IListT<_Control*> > pControlFocusList (new (std::nothrow) ArrayListT<_Control*>);
+ SysTryReturn(NID_UI_CTRL, pControlFocusList, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ MakeFocusList(this, pControlFocusList.get());
+
+ unique_ptr<IEnumeratorT<_Control*> > pEnum(pControlFocusList->GetEnumeratorN());
+ SysTryReturn(NID_UI_CTRL, pEnum, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ int i =0;
+ int nextContainerIndex = -1;
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ _Control* pEnumeratorControl = null;
+ pEnum->GetCurrent(pEnumeratorControl);
+ _ContainerImpl* pTempContainerImpl = dynamic_cast<_ContainerImpl*>(static_cast <_ControlImpl* >(pEnumeratorControl->GetUserData()));
+
+ if (pTempContainerImpl != null && (nextContainerIndex < i))
+ {
+ if (pEnumeratorControl->IsChildControlFocusManage() == false)
+ {
+ MakeChildContainerFocusList(pEnumeratorControl, i, pControlFocusList.get());
+ nextContainerIndex = i;
+ pEnum.reset(pControlFocusList->GetEnumeratorN());
+ i = -1;
+ }
+ }
+ i++;
+ }
+ return pControlFocusList.release();
+}
}} // Tizen::Ui
_TransactionNode*
_AnimationManager::GetCurrentTransaction(bool withGroup) const
{
+ // default transaction is always committed.
+ if (__pCurrentTransaction && __pCurrentTransaction->IsCommitted())
+ {
+ return null;
+ }
+
if (withGroup == false)
{
return __pCurrentTransactionExceptGroup;
imagePath = _BitmapImpl::GetInstance(*pBackgroundBitmap)->GetFileName();
}
- if (imagePath.IsEmpty() == false && __pButton->GetText() == L"" && __pButton->GetBitmap(status) == null)
+ if (imagePath.IsEmpty() == false && __pButton->GetText() == L""
+ && __pButton->GetBitmap(_BUTTON_STATUS_NORMAL) == null && __pButton->GetBitmap(_BUTTON_STATUS_DISABLED) == null
+ && __pButton->GetBitmap(_BUTTON_STATUS_PRESSED) == null && __pButton->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED) == null)
{
__pBase->SetBackgroundColor(_Colorf(
(float)bgColor.GetRed() / 255, (float)bgColor.GetGreen() / 255, (float)bgColor.GetBlue() / 255, (float)bgColor.GetAlpha() / 255));
pDateTimeBar->__pOwner = &owner;
- // if SetActivationEnabled is removed, then remove IsActivatedOnOpen CallBack as well.
- pDateTimeBar->SetActivationEnabled(false);
-
pDateTimeBar->__pDateTimeBarPresenter = _DateTimeBarPresenter::CreateInstanceN(*pDateTimeBar);
r = GetLastResult();
SysTryCatch(NID_UI_CTRL, pDateTimeBar->__pDateTimeBarPresenter != null, , r,
return null;
}
-bool
-_DateTimeBar::IsActivatedOnOpen(void) const
-{
- return false;
-}
-
result
_DateTimeBar::SetPositionAndAlignment(const FloatPoint& point, _DateTimeBarAlignment alignment)
{
{
SetOwner(__pOwner);
- int itemWidth = 0;
+ return _Window::OnAttachedToMainTree();
+}
- if (GetSelectedBoxId() == DATETIME_ID_MONTH)
- {
- GET_SHAPE_CONFIG(DATETIMEBAR::MONTH_ITEM_WIDTH, _ControlManager::GetInstance()->GetOrientation(), itemWidth);
- }
- else if (GetSelectedBoxId() == DATETIME_ID_YEAR)
- {
- GET_SHAPE_CONFIG(DATETIMEBAR::YEAR_ITEM_WIDTH, _ControlManager::GetInstance()->GetOrientation(), itemWidth);
- }
- else
- {
- GET_SHAPE_CONFIG(DATETIMEBAR::DAY_ITEM_WIDTH, _ControlManager::GetInstance()->GetOrientation(), itemWidth);
- }
+void
+_DateTimeBar::OnActivated(void)
+{
+ RefreshItems();
+ SetTouchCapture(true, true);
- __pDateTimeBarPresenter->SetInitialAnimationValue(itemWidth);
+ return _Window::OnActivated();
+}
- __pDateTimeBarPresenter->StartAnimationEffect();
+void
+_DateTimeBar::OnDeactivated(void)
+{
+ ReleaseTouchCapture();
- SetTouchCapture(true, true);
+ GetOwner()->Invalidate();
- return _Window::OnAttachedToMainTree();
+ return _Window::OnDeactivated();
}
result
_DateTimeBar::OnDetachingFromMainTree(void)
{
- ReleaseTouchCapture();
-
return _Window::OnDetachingFromMainTree();
}
return __parentWindowBounds;
}
+void
+_DateTimeBar::RefreshItems(void)
+{
+ float itemWidth = 0;
+
+ if (GetSelectedBoxId() == DATETIME_ID_MONTH)
+ {
+ GET_SHAPE_CONFIG(DATETIMEBAR::MONTH_ITEM_WIDTH, _ControlManager::GetInstance()->GetOrientation(), itemWidth);
+ }
+ else if (GetSelectedBoxId() == DATETIME_ID_YEAR)
+ {
+ GET_SHAPE_CONFIG(DATETIMEBAR::YEAR_ITEM_WIDTH, _ControlManager::GetInstance()->GetOrientation(), itemWidth);
+ }
+ else
+ {
+ GET_SHAPE_CONFIG(DATETIMEBAR::DAY_ITEM_WIDTH, _ControlManager::GetInstance()->GetOrientation(), itemWidth);
+ }
+
+ __pDateTimeBarPresenter->SetInitialAnimationValue(itemWidth);
+
+ __pDateTimeBarPresenter->StartAnimationEffect();
+
+ return;
+}
+
bool
_DateTimeBar::OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element)
{
, __pBgColorReplacementBitmap(null)
, __pArrowColorReplacementBitmap(null)
, __isInitialAnimation(false)
- , __initialAnimationValue(0)
+ , __initialAnimationValue(0.0f)
, __pFont(null)
{
}
__isInitialAnimation = true;
__distance = -10.0f;
- if (__initialAnimationValue >= 0 )
+ if (__initialAnimationValue >= 0.0f )
{
- __initialAnimationValue = __initialAnimationValue + _CoordinateSystemUtils::ConvertToInteger(__distance);
+ __initialAnimationValue = __initialAnimationValue + __distance;
StartFlickAnimationTimer();
LoadItems();
}
else
{
- __initialAnimationValue = 0;
+ __initialAnimationValue = 0.0f;
__isInitialAnimation = false;
ResetFlickAnimationTimer();
ValidateAndAdjustStartPosition();
}
void
-_DateTimeBarPresenter::SetInitialAnimationValue(int animationValue)
+_DateTimeBarPresenter::SetInitialAnimationValue(float animationValue)
{
__initialAnimationValue = animationValue;
return;
return;
}
-void
-_Edit::SetPressedGuideTextColor(const Color& color)
-{
- __pressedGuideTextColor = color;
-
- return;
-}
-
-Color
-_Edit::GetPressedGuideTextColor(void) const
-{
- return __pressedGuideTextColor;
-}
-
result
_Edit::SetPropertyAutoResizingEnabled(const Variant& enable)
{
{
FloatRectangle absoluteBounds = GetAbsoluteBoundsF();
+ SetFocused(true);
+
if (absoluteBounds.y != __absoluteBounds.y || absoluteBounds.height != __absoluteBounds.height)
{
CalculateDateTimeBarPosition();
if (boxId < DATETIME_ID_YEAR || boxId > DATETIME_ID_DAY)
{
__selectedId = DATETIME_ID_NONE;
- return true;
+ return false;
}
int minValue = -1;
}
__selectedId = boxId;
-
- __pEditDate->Invalidate();
-
return true;
}
_DateTimeId boxId = DATETIME_ID_NONE;
boxId = GetBoxIdFromPosition(point);
-
- if (boxId != __selectedId)
+ if (boxId != __selectedId || boxId == DATETIME_ID_NONE)
{
+ if (__pEditDate->GetDateTimeBar() != null && __pEditDate->GetDateTimeBar()->IsActivated())
+ {
+ __pEditDate->GetDateTimeBar()->SetVisibleState(false);
+ __pEditDate->GetDateTimeBar()->Close();
+ }
+
+ Draw();
__selectedId = DATETIME_ID_NONE;
+ SetLastSelectedId(__selectedId);
+
+ return true;
}
SetLastSelectedId(__selectedId);
- __selectedId = DATETIME_ID_NONE;
__lastSelectedValue = "";
_DateTimeUtils dateTimeUtils;
PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
}
- __pEditDate->Invalidate();
+ Draw();
- if (__pEditDate->GetDateTimeBar() != null && GetLastSelectedId() != DATETIME_ID_NONE)
+ if ((__pEditDate->GetDateTimeBar() != null) && (GetLastSelectedId() != DATETIME_ID_NONE))
{
FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f);
bounds = GetDateAreaBounds(GetLastSelectedId());
bounds.x += absoluteBounds.x;
__pEditDate->GetDateTimeBar()->CalculateArrowBounds(bounds);
- __pEditDate->GetDateTimeBar()->SetVisibleState(true);
- __pEditDate->GetDateTimeBar()->Close();
- __pEditDate->GetDateTimeBar()->Open();
+
+ if (__pEditDate->GetDateTimeBar()->IsActivated())
+ {
+ __pEditDate->GetDateTimeBar()->RefreshItems();
+ }
+ else
+ {
+ __pEditDate->GetDateTimeBar()->SetVisibleState(true);
+ __pEditDate->GetDateTimeBar()->Open();
+ }
}
+ __selectedId = DATETIME_ID_NONE;
return true;
}
__selectedId = DATETIME_ID_NONE;
- __pEditDate->Invalidate();
-
return true;
}
__selectedId = DATETIME_ID_NONE;
}
- __pEditDate->Invalidate();
return false;
}
{
__touchMoveHandled = true;
__selectedId = DATETIME_ID_NONE;
- __pEditDate->Invalidate();
+
return;
}
{
__pGuideTextObject->SetForegroundColor(__pEdit->GetGuideTextColor(), 0, __pGuideTextObject->GetTextLength());
- if (GetSearchBarFlag())
- {
- if (__isTouchPressed)
- {
- __pGuideTextObject->SetForegroundColor(__pEdit->GetPressedGuideTextColor(), 0, __pGuideTextObject->GetTextLength());
- }
- }
-
if (__isGuideTextColorChanged == true && __pEdit->IsSettingGuideTextColor() == false)
{
__pGuideTextObject->SetForegroundColor(__pEdit->GetTextColor(EDIT_STATUS_NORMAL), 0, __pGuideTextObject->GetTextLength());
return __pEditModel->IsAutoResizingEnabled();
}
-result
-_EditPresenter::SetDefaultFont(void)
-{
- result r = E_SUCCESS;
-
- Font* pControlFont = null;
- _ControlOrientation orientation = __pEdit->GetOrientation();
- float defaultFontSize = 0.0f;
- GET_SHAPE_CONFIG(EDIT::DEFAULT_FONT_SIZE, orientation, defaultFontSize);
-
- __isFontInitialized = false;
- __contentFontSize = defaultFontSize;
- __contentFontStyle = FONT_STYLE_PLAIN;
- pControlFont = __pEdit->GetFallbackFont();
- if (pControlFont)
- {
- AdjustFont(*pControlFont);
- }
-
- return r;
-}
-
float
_EditPresenter::CalculateFlexibleHeightF(void)
{
{
FloatRectangle absoluteBounds = GetAbsoluteBoundsF();
+ SetFocused(true);
+
if (absoluteBounds.y != __absoluteBounds.y || absoluteBounds.height != __absoluteBounds.height)
{
CalculateDateTimeBarPosition();
{
result r = E_SUCCESS;
- Font font;
Color textColor;
_DateTimeId boxId = DATETIME_ID_NONE;
}
else if (boxId == DATETIME_ID_AMPM)
{
+ __selectedId = boxId;
__bounds = ampmBounds;
+ Draw();
}
else
{
__selectedId = DATETIME_ID_NONE;
return false;
}
- __selectedId = boxId;
- __pEditTime->Draw();
+ __selectedId = boxId;
return true;
}
_DateTimeId boxId = GetBoxIdFromPosition(point);
- if (boxId < 0)
+ if (boxId != __selectedId || boxId == DATETIME_ID_NONE)
{
- __selectedId = DATETIME_ID_NONE;
- }
+ if (__pEditTime->GetDateTimeBar() != null && __pEditTime->GetDateTimeBar()->IsActivated())
+ {
+ __pEditTime->GetDateTimeBar()->SetVisibleState(false);
+ __pEditTime->GetDateTimeBar()->Close();
+ }
+
+ Draw();
- if (boxId != __selectedId)
- {
__selectedId = DATETIME_ID_NONE;
+ SetLastSelectedId(__selectedId);
+
+ return true;
}
SetLastSelectedId(__selectedId);
- __selectedId = DATETIME_ID_NONE;
__lastSelectedValue = "";
_DateTimeUtils dateTimeUtils;
+
if (GetLastSelectedId() == DATETIME_ID_HOUR)
{
int hours = GetHour();
__lastSelectedValue.Format(10, L"%02d", GetMinute());
PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
}
-
- if (GetLastSelectedId() == DATETIME_ID_AMPM)
+ else if (GetLastSelectedId() == DATETIME_ID_AMPM)
{
SetAmEnabled(!GetAmEnabled());
__pEditTime->FireTimeChangeEvent(TIME_INTERNAL_CHANGE_SAVED);
__pEditTime->UpdateAccessibilityElement();
PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
+
+ __selectedId = DATETIME_ID_NONE;
+
+ if (__pEditTime->GetDateTimeBar() != null && __pEditTime->GetDateTimeBar()->IsActivated())
+ {
+ __pEditTime->GetDateTimeBar()->SetVisibleState(false);
+ __pEditTime->GetDateTimeBar()->Close();
+ }
+
+ Draw();
+
+ return true;
}
- __pEditTime->Draw();
+ Draw();
- if (__pEditTime->GetDateTimeBar() != null && boxId != DATETIME_ID_AMPM && GetLastSelectedId() != DATETIME_ID_NONE)
+ if ((__pEditTime->GetDateTimeBar() != null) && (boxId != DATETIME_ID_AMPM) && (GetLastSelectedId() != DATETIME_ID_NONE))
{
FloatRectangle bounds(0.0f, 0.0f, 0.0f, 0.0f);
bounds = GetDisplayAreaBoundsFromHoursStyle(GetLastSelectedId());
bounds.x += absoluteBounds.x;
__pEditTime->GetDateTimeBar()->CalculateArrowBounds(bounds);
- __pEditTime->GetDateTimeBar()->SetVisibleState(true);
- __pEditTime->GetDateTimeBar()->Close();
- __pEditTime->GetDateTimeBar()->Open();
+
+ if (__pEditTime->GetDateTimeBar()->IsActivated())
+ {
+ __pEditTime->GetDateTimeBar()->RefreshItems();
+ }
+ else
+ {
+ __pEditTime->GetDateTimeBar()->SetVisibleState(true);
+ __pEditTime->GetDateTimeBar()->Open();
+ }
}
+ __selectedId = DATETIME_ID_NONE;
return true;
}
__selectedId = DATETIME_ID_NONE;
- __pEditTime->Draw();
-
return true;
}
__selectedId = DATETIME_ID_NONE;
}
- __pEditTime->Invalidate();
return false;
}
{
__touchMoveHandled = true;
__selectedId = DATETIME_ID_NONE;
- __pEditTime->Invalidate();
+
return;
}
return true;
}
-void
-_Form::MakeFocusList(const _Control* pControl, IListT<_Control*>* pFocusControlList) const
-{
- int childCount = pControl->GetChildCount();
- for(int i = 0; i < childCount; i++)
- {
- _Control* pChildControl = pControl->GetChild(i);
- Rectangle rect = pChildControl->GetAbsoluteBounds();
- unique_ptr<IEnumeratorT<_Control*> > pEnum (pFocusControlList->GetEnumeratorN());
- int index = 0;
- while (pEnum->MoveNext() == E_SUCCESS)
- {
- _Control* pEnumeratorControl = null;
- pEnum->GetCurrent(pEnumeratorControl);
- if (pEnumeratorControl != null)
- {
- Rectangle enumeratorRect = pEnumeratorControl->GetAbsoluteBounds();
- if(enumeratorRect.y > rect.y)
- {
- break;
- }
- else if (enumeratorRect.y == rect.y)
- {
- if(enumeratorRect.x > rect.x)
- {
- break;
- }
- }
-
- index ++;
- }
- }
- pFocusControlList->InsertAt(pChildControl, index);
- }
-}
-
-void
-_Form::MakeChildContainerFocusList(_Control* pControl, int startIndex) const
-{
- unique_ptr<IListT<_Control*> > pTempList (new (std::nothrow) ArrayListT<_Control*>);
- SysTryReturnVoidResult(NID_UI_CTRL, pTempList, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory is insufficient.");
- MakeFocusList(pControl, pTempList.get());
-
- unique_ptr<IEnumeratorT<_Control*> > pTempEnum(pTempList->GetEnumeratorN());
- int index = ++startIndex;
- while (pTempEnum->MoveNext() == E_SUCCESS)
- {
- _Control* pEnumeratorControl = null;
- pTempEnum->GetCurrent(pEnumeratorControl);
- __pFocusControlList->InsertAt(pEnumeratorControl, index);
- index ++;
- }
-}
-
IListT<_Control*>*
_Form::GetFocusList(void) const
{
if(!__pFocusControlList)
{
- __pFocusControlList.reset(new (std::nothrow) ArrayListT<_Control*>);
- SysTryReturn(NID_UI, __pFocusControlList, null, E_SYSTEM, "[E_OUT_OF_MEMORY] Memory is insufficient.");
- MakeFocusList(this, __pFocusControlList.get());
-
- unique_ptr<IEnumeratorT<_Control*> > pEnum(__pFocusControlList->GetEnumeratorN());
- int i =0;
- int nextContainerIndex = -1;
- while ( pEnum->MoveNext() == E_SUCCESS)
- {
- _Control* pEnumeratorControl = null;
- pEnum->GetCurrent(pEnumeratorControl);
- _ContainerImpl* pTempContainerImpl = dynamic_cast<_ContainerImpl*>(static_cast <_ControlImpl* >(pEnumeratorControl->GetUserData()));
-
- if (pTempContainerImpl != null && (nextContainerIndex < i))
- {
- if (pEnumeratorControl->IsChildControlFocusManage() == false)
- {
- MakeChildContainerFocusList(pEnumeratorControl, i);
- nextContainerIndex = i;
- pEnum.reset(__pFocusControlList->GetEnumeratorN());
- i = -1;
- }
- }
- i++;
- }
- __pFocusControlList->InsertAt(dynamic_cast<_Control*> (const_cast<_Form*>(this)), 0);
+ __pFocusControlList.reset(GetFocusListN());
+ __pFocusControlList->InsertAt(const_cast<_Form*>(this), 0);
}
-
return __pFocusControlList.get();
}
if (isChecked)
{
- FireIconListViewItemEvent(EVENT_TYPE_ITEM_SELECTED, index, ICON_LIST_VIEW_ITEM_UNCHECKED);
+ FireIconListViewItemEvent(EVENT_TYPE_ITEM_SELECTED, index, ICON_LIST_VIEW_ITEM_CHECKED);
}
else
{
- FireIconListViewItemEvent(EVENT_TYPE_ITEM_SELECTED, index, ICON_LIST_VIEW_ITEM_CHECKED);
+ FireIconListViewItemEvent(EVENT_TYPE_ITEM_SELECTED, index, ICON_LIST_VIEW_ITEM_UNCHECKED);
}
break;
}
}
}
+void
+_Popup::UpdateClientBounds(const FloatDimension& size, FloatRectangle& clientBounds)
+{
+ float y = 0.0f;
+
+ float titleHeight = 0.0f;
+ float titleLetfMargin = 0.0f;
+ float titleRightMargin = 0.0f;
+
+ _ControlOrientation orientation;
+
+ orientation = GetOrientation();
+
+ GET_SHAPE_CONFIG(POPUP::TITLE_HEIGHT, orientation, titleHeight);
+ GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_LEFT_MARGIN, orientation, titleLetfMargin);
+ GET_SHAPE_CONFIG(POPUP::TITLE_TEXT_RIGHT_MARGIN, orientation, titleRightMargin);
+
+ if (HasTitle())
+ {
+ y = titleHeight;
+ }
+
+ clientBounds.x = titleLetfMargin;
+ clientBounds.y = y;
+
+ clientBounds.width = size.width - (titleLetfMargin + titleRightMargin);
+ clientBounds.height = size.height - y;
+}
+
}}} // Tizen::Ui::Controls
, __isUsableCancelButton(false)
, __isUserContainerBounds(false)
, __isCancelActionInProgress(false)
+ , __isUserGuideTextColor(false)
, __keypadAction(CORE_KEYPAD_ACTION_SEARCH)
, __pBackgroundBitmap(null)
, __backgroundColor(Color())
{
case SEARCH_FIELD_STATUS_DISABLED:
GET_COLOR_CONFIG(SEARCHBAR::EDIT_BG_DISABLED, __color[i]);
+ GET_COLOR_CONFIG(SEARCHBAR::EDIT_TEXT_DISABLED, __textColor[i]);
GET_COLOR_CONFIG(SEARCHBAR::GUIDE_TEXT_DISABLED, __guideTextColor[i]);
break;
case SEARCH_FIELD_STATUS_HIGHLIGHTED:
GET_COLOR_CONFIG(SEARCHBAR::EDIT_BG_NORMAL, __color[i]);
+ GET_COLOR_CONFIG(SEARCHBAR::EDIT_TEXT_HIGHLIGHTED, __textColor[i]);
GET_COLOR_CONFIG(SEARCHBAR::GUIDE_TEXT_HIGHLIGHTED, __guideTextColor[i]);
break;
default:
GET_COLOR_CONFIG(SEARCHBAR::EDIT_BG_NORMAL, __color[i]);
+ GET_COLOR_CONFIG(SEARCHBAR::EDIT_TEXT_NORMAL, __textColor[i]);
GET_COLOR_CONFIG(SEARCHBAR::GUIDE_TEXT_NORMAL, __guideTextColor[i]);
break;
}
editBounds.width = (editBounds.width > searchFieldMinWidth) ? editBounds.width : searchFieldMinWidth;
editBounds.height = (editBounds.height > searchFieldMinHeight) ? editBounds.height : searchFieldMinHeight;
-
__pEdit = _Edit::CreateEditN();
r = GetLastResult();
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
__pEdit->SetColor(editStatus, __color[status]);
}
+ __pEdit->SetTextColor(EDIT_TEXT_COLOR_NORMAL, __textColor[SEARCH_FIELD_STATUS_NORMAL]);
+ __pEdit->SetTextColor(EDIT_TEXT_COLOR_DISABLED, __textColor[SEARCH_FIELD_STATUS_DISABLED]);
+ __pEdit->SetTextColor(EDIT_TEXT_COLOR_HIGHLIGHTED, __textColor[SEARCH_FIELD_STATUS_HIGHLIGHTED]);
+
__pEdit->ReplaceDefaultBackgroundBitmapForSearchBar();
- __pEdit->SetPressedGuideTextColor(__guideTextColor[SEARCH_FIELD_STATUS_HIGHLIGHTED]);
__pEdit->SetKeypadAction(__keypadAction);
SysTryReturn(NID_UI_CTRL, __pEdit, E_SYSTEM, E_SYSTEM,
"[E_SYSTEM] A system error has occurred. The edit instance is null.");
+ __isUserGuideTextColor = true;
return __pEdit->SetGuideTextColor(color);
}
void
_SearchBar::OnDraw(void)
{
- SearchFieldStatus searchFieldStatus = GetCurrentStatus();
- SetGuideTextColor(__guideTextColor[searchFieldStatus]);
+ if (!__isUserGuideTextColor)
+ {
+ SearchFieldStatus status = GetCurrentStatus();
+ __pEdit->SetGuideTextColor(__guideTextColor[status]);
+ }
__pSearchBarPresenter->Draw();
return;
r = _CustomListItemImpl::CreateTableViewItem(tableViewItemParams);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+ if (GetItemCount(groupIndex) == 0 && groupIndex > __pListImpl->__topGroup)
+ {
+ __pListImpl->__bottomGroup++;
+ }
+
+ if (groupIndex < __pListImpl->__topGroup)
+ {
+ __pListImpl->__topGroup = groupIndex;
+ }
+
return __pListImpl->GetTableViewGroupItemAt(groupIndex);
}
pCustomListItem->__pCustomListItemImpl->__pTableViewGroupItemData = null;
}
+ if (__pListImpl->GetItemCountAt(groupIndex) == 0)
+ {
+ if (groupIndex == __pListImpl->__topGroup)
+ {
+ if (__pListImpl->__topGroup < __pListImpl->__bottomGroup)
+ {
+ __pListImpl->__topGroup++;
+ }
+ }
+ else if (groupIndex < __pListImpl->__topGroup)
+ {
+ __pListImpl->__topGroup--;
+ }
+ if (__pListImpl->__bottomGroup != 0)
+ {
+ __pListImpl->__bottomGroup--;
+ }
+ }
+
delete pItem;
return true;
}
}
}
+ else if (__pListImpl->__isFullUpdate == true)
+ {
+ __pListImpl->RemoveFromItemsList(groupIndex, (__pListImpl->GetSubItemCountAt(groupIndex) - 1), false);
+ }
delete pItem;
pItem = null;
, __bottomGroup(0)
, __topGroup(0)
, __loadedCount(0)
+ , __isFullUpdate(false)
, __pItemProvider(null)
, __directDelete(false)
, __forceScroll(false)
return E_SUCCESS;
}
- if (groupIndex <= __topGroup)
+ if (groupIndex <= __bottomGroup)
{
- __topGroup++;
__bottomGroup++;
}
+ if (groupIndex < __topGroup)
+ {
+ __topGroup++;
+ }
+
if (__pItemProvider == null)
{
r = CreateItemProvider();
SysTryReturn(NID_UI_CTRL, (groupIndex >= 0 && groupIndex < __groupsList.GetCount()),
E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. groupIndex (%d).", groupIndex);
- SysTryReturn(NID_UI_CTRL, (index >= GetTopItemIndex(groupIndex) && index <= (GetSubItemCountAt(groupIndex) + GetTopItemIndex(groupIndex))), E_INVALID_ARG, E_INVALID_ARG,
- "[E_INVALID_ARG] Invalid argument is used. index (%d).", index);
-
_TableViewItemParams tableViewItemParams;
tableViewItemParams.pItem = (const_cast<CustomListItem*>(&item));
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM,
"[%s] A system error has occurred. Failed to create an item.", GetErrorMessage(r));
- r = InsertIntoItemsList(item, groupIndex, (index - GetTopItemIndex(groupIndex)));
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
+ int subItemCount = GetSubItemCountAt(groupIndex);
+ if (index < (subItemCount + GetTopItemIndex(groupIndex)) && (index >= GetTopItemIndex(groupIndex)))
+ {
+ r = InsertIntoItemsList(item, groupIndex, (index - GetTopItemIndex(groupIndex)));
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
+ }
_SlidableGroupObject* pGroupObject = dynamic_cast<_SlidableGroupObject*>(const_cast<Object*>(__groupsList.GetAt(groupIndex)));
SysTryReturn(NID_UI_CTRL, pGroupObject, E_SYSTEM, E_SYSTEM,
SysTryReturn(NID_UI_CTRL, pGroupObject, E_SYSTEM, E_SYSTEM,
"[E_SYSTEM] A system error has occurred. Failed to get _SlidableGroupObject at index (%d).", groupIndex);
- result r = E_SUCCESS;
Boolean* pChecked = null;
int itemIndex = 0;
- int subItemCount = GetSubItemCountAt(groupIndex);
- for (itemIndex = pGroupObject->__itemCount; itemIndex >= 0; itemIndex--)
+ for (itemIndex = (GetItemCountAt(groupIndex) - 1); itemIndex >= 0; itemIndex--)
{
pChecked = dynamic_cast<Boolean*>(pGroupObject->__pCheckedList->GetAt(itemIndex));
if (pChecked && pChecked->ToBool() == true)
{
- if (pGroupObject->__pCheckedList != null)
- {
- pGroupObject->__pCheckedList->RemoveAt(itemIndex, true);
- }
-
- __directDelete = true;
-
- if (itemIndex < (subItemCount + pGroupObject->__topIndex) && (itemIndex >= pGroupObject->__topIndex))
- {
- RemoveFromItemsList(groupIndex, (itemIndex - pGroupObject->__topIndex));
- }
-
- r = GetCore().RefreshTableView(groupIndex, itemIndex, TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE);
- if (r != E_SUCCESS)
- {
- SysLog(NID_UI_CTRL, "Group item with index %d not removed successFully.", groupIndex);
- }
-
- __directDelete = false;
-
- CallUnloadItemCb(groupIndex, itemIndex);
- pGroupObject->__itemCount--;
+ RemoveItemAt(groupIndex, itemIndex, 0);
}
}
result
_SlidableGroupedListImpl::RemoveAllItemsAt(int groupIndex)
{
- result r = E_SUCCESS;
SysTryReturn(NID_UI_CTRL, (groupIndex >= 0 && groupIndex < __groupsList.GetCount()),
E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. groupIndex (%d).", groupIndex);
- _SlidableGroupObject* pGroupObject = dynamic_cast<_SlidableGroupObject*>(__groupsList.GetAt(groupIndex));
- SysTryReturn(NID_UI_CTRL, pGroupObject, E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] A system error has occurred. Failed to get _SlidableGroupObject at index (%d).", groupIndex);
-
- __directDelete = true;
-
- for (int itemCount = 0; itemCount < GetSubItemCountAt(groupIndex);)
- {
- r = RemoveItemAt(groupIndex, 0, 0);
- if (r != E_SUCCESS)
- {
- SysLog(NID_UI_CTRL, "Group item with index %d not removed successFully.", groupIndex);
- }
- }
-
- __directDelete = false;
+ int itemIndex = 0;
- if (pGroupObject->__pCheckedList != null)
+ for (itemIndex = (GetItemCountAt(groupIndex) - 1); itemIndex >= 0; itemIndex--)
{
- pGroupObject->__pCheckedList->RemoveAll(true);
+ RemoveItemAt(groupIndex, itemIndex, 0);
}
- pGroupObject->__itemCount = 0;
-
return E_SUCCESS;
}
for (groupCount = 0; groupCount < __groupsList.GetCount(); groupCount++)
{
- RemoveAllItemsAt(groupCount);
+ _SlidableGroupObject* pGroupObject = dynamic_cast<_SlidableGroupObject*>(__groupsList.GetAt(groupCount));
+ SysTryReturn(NID_UI_CTRL, pGroupObject, 0, E_SYSTEM,
+ "[E_SYSTEM] A system error has occurred. Failed to get _SlidableGroupObject at index (%d).", groupCount);
+
+ pGroupObject->__itemCount = 0;
+ pGroupObject->__topIndex = 0;
+
}
- __pItemProvider->firstTime = true;
+ __isFullUpdate = true;
+ GetCore().UpdateTableView();
+ __isFullUpdate = false;
+ __pItemProvider->firstTime = true;
+ __topGroup = 0;
return E_SUCCESS;
}
int subItemCount = GetSubItemCountAt(groupIndex);
- SysTryReturn(NID_UI_CTRL, (index >= 0 && index < subItemCount),
+ SysTryReturn(NID_UI_CTRL, (index >= 0 && index < pGroupObject->__itemCount),
E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument is used. index (%d).", index);
- if (!(index < pGroupObject->__topIndex + subItemCount))
+ __directDelete = true;
+
+ if (pGroupObject->__pCheckedList != null)
{
- pGroupObject->__itemCount--;
- return E_SUCCESS;
+ pGroupObject->__pCheckedList->RemoveAt(index, true);
}
- __directDelete = true;
-
- RemoveFromItemsList(groupIndex, index);
+ if (index < (subItemCount + pGroupObject->__topIndex) && (index >= pGroupObject->__topIndex))
+ {
+ RemoveFromItemsList(groupIndex, (index - pGroupObject->__topIndex));
+ }
result r = GetCore().RefreshTableView(groupIndex, index, TABLE_VIEW_REFRESH_TYPE_ITEM_REMOVE);
if (r != E_SUCCESS)
SysLog(NID_UI_CTRL, "Group item with index %d not removed successFully.", groupIndex);
}
- if (pGroupObject->__pCheckedList != null)
- {
- pGroupObject->__pCheckedList->RemoveAt(index, true);
- }
-
__directDelete = false;
CallUnloadItemCb(groupIndex, index);
using namespace Tizen::Base;
using namespace Tizen::Ui::Animations;
using namespace Tizen::Graphics::_Text;
+using namespace Tizen::Base::Runtime;
namespace Tizen { namespace Ui { namespace Controls
{
: __pSlider(null)
, __pSliderModel(null)
, __pSliderOverlay(null)
+ , __pSlideTimer(null)
, __pResourceBgTopBitmap(null)
, __pResourceBgMiddleBitmap(null)
, __pResourceBgBottomBitmap(null)
, __handleX(0)
, __isSliderPressed(false)
, __isNeedToBeUpdated(true)
- , __isBubblingBlocked(false)
, __isResourceLoaded(false)
, __isCustomHandle(false)
, __isCustomPressedTextColor(false)
, __groupStyle(GROUP_STYLE_NONE)
, __fontSize(0.0f)
, __barOffset(0.0f)
+ , __isTimerRunning(false)
+ , __currentPosition(0.0f, 0.0f)
{
}
delete __pSliderOverlay;
__pSliderOverlay = null;
+ if (__pSlideTimer != null)
+ {
+ __pSlideTimer->Cancel();
+ delete __pSlideTimer;
+ __pSlideTimer = null;
+ }
+
delete __pResourceBgTopBitmap;
__pResourceBgTopBitmap = null;
}
int
-_SliderPresenter::CalculateSliderValue(int positionX, int offsetX)
+_SliderPresenter::CalculateSliderValue(float positionX, float offsetX)
{
int minValue = __pSliderModel->GetMinValue();
int maxValue = __pSliderModel->GetMaxValue();
return false;
}
- Point point = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition());
+ if (__pSlideTimer == null)
+ {
+ __pSlideTimer = new (std::nothrow) Timer;
+ SysTryReturn(NID_UI_CTRL, __pSlideTimer != null, true, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ result r = __pSlideTimer->Construct(*this);
+ if (r != E_SUCCESS)
+ {
+ delete __pSlideTimer;
+ __pSlideTimer = null;
- __isBubblingBlocked = false;
+ return true;
+ }
+ }
- if (__pSlider->IsEnabled() == true && __handleRect.Contains(FloatPoint(point.x, point.y)) == true)
+ FloatPoint point = touchinfo.GetCurrentPosition();
+
+ if (__handleRect.Contains(point) == true)
{
+ __isSliderPressed = true;
+
int candidateValue = CalculateSliderValue(point.x, point.x - __handleRect.x);
__pSliderModel->SetValue(candidateValue);
__pSlider->SetAccessibilityElementValue();
- __isSliderPressed = true;
- __isBubblingBlocked = true;
-
if (__pSlider->GetStyle() & _SLIDER_STYLE_OVERLAY)
{
__pSliderOverlay->Open(false);
__pSlider->Invalidate();
}
- return __isBubblingBlocked;
+ return __isSliderPressed;
}
bool
return false;
}
- Point point = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition());
- bool isBubblingBlocked = __isBubblingBlocked;
+ if (__pSlideTimer != null)
+ {
+ __isTimerRunning = false;
+ __pSlideTimer->Cancel();
+ }
+
+ FloatPoint point = touchinfo.GetCurrentPosition();
Canvas* pCanvas = __pSlider->GetCanvasN();
SysTryReturn(NID_UI_CTRL, pCanvas != null, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get the canvas.");
- if (point.x >= (pCanvas->GetBounds().x + pCanvas->GetBounds().width))
+ if (point.x >= (pCanvas->GetBoundsF().x + pCanvas->GetBoundsF().width))
{
- point.x = pCanvas->GetBounds().x + pCanvas->GetBounds().width;
+ point.x = pCanvas->GetBoundsF().x + pCanvas->GetBoundsF().width;
}
if (__isSliderPressed == true)
pAdjustmentEvent->Fire(*pEventArg);
}
+ return true;
}
- return isBubblingBlocked;
+ return false;
}
bool
return false;
}
- Point point = _CoordinateSystemUtils::ConvertToInteger(touchinfo.GetCurrentPosition());
- bool isBubblingBlocked = __isBubblingBlocked;
+ if (__isSliderPressed == false)
+ {
+ return false;
+ }
+
+ FloatPoint point = touchinfo.GetCurrentPosition();
Canvas* pCanvas = __pSlider->GetCanvasN();
- SysTryReturn(NID_UI_CTRL, pCanvas != null, false, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get the canvas.");
+ SysTryReturn(NID_UI_CTRL, pCanvas != null, true, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get the canvas.");
- if (point.x >= (pCanvas->GetBounds().x + pCanvas->GetBounds().width))
+ if (point.x >= (pCanvas->GetBoundsF().x + pCanvas->GetBoundsF().width))
{
- point.x = pCanvas->GetBounds().x + pCanvas->GetBounds().width;
+ point.x = pCanvas->GetBoundsF().x + pCanvas->GetBoundsF().width;
}
+ __currentPosition.x = point.x;
+ __currentPosition.y = point.y;
- if (__isSliderPressed == false)
+ if ( __isTimerRunning == false )
{
- return false;
+ __isTimerRunning = true;
+ __pSlideTimer->Start(__timerValue);
}
- if (__pSlider->IsEnabled() == false)
- {
- __isSliderPressed = false;
- return false;
- }
+ return true;
+}
- float handleHalfWidth = __handleRect.width / 2.0f;
- int oldValue = __pSliderModel->GetValue();
- int candidateValue = CalculateSliderValue(point.x, handleHalfWidth);
+void
+_SliderPresenter::OnTimerExpired(Timer& timer)
+{
+ __isTimerRunning = false;
+
+ float handleHalfWidth = __handleRect.width / 2;
+ int candidateValue = CalculateSliderValue(__currentPosition.x, handleHalfWidth);
__pSliderModel->SetValue(candidateValue);
__pSlider->SetAccessibilityElementValue();
__pSlider->Draw();
__pSlider->Show();
- if (oldValue != candidateValue)
+ // Slider Event Fire
+ _SliderEvent* pSliderEvent = dynamic_cast <_SliderEvent*>(__pSlider->GetSliderEvent());
+ if (pSliderEvent != null)
{
- // Slider Event Fire
- _SliderEvent* pSliderEvent = dynamic_cast <_SliderEvent*>(__pSlider->GetSliderEvent());
- if (pSliderEvent != null)
- {
- Tizen::Base::Runtime::IEventArg* pEventArg = _SliderEvent::CreateSliderEventArgN(candidateValue);
- result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, pEventArg != null, true, r, "[%s] Propagating.", GetErrorMessage(r));
+ Tizen::Base::Runtime::IEventArg* pEventArg = _SliderEvent::CreateSliderEventArgN(candidateValue);
- pSliderEvent->Fire(*pEventArg);
+ if( pEventArg == null)
+ {
+ return;
}
+
+ pSliderEvent->Fire(*pEventArg);
}
- return isBubblingBlocked;
+ return;
}
bool
_SplitPanel::_SplitPanel()
: __pSplitPanelPresenter(null)
, __pTapGesture(null)
+ , __pFirstPaneParent(null)
+ , __pSecondPaneParent(null)
, __pFirstPane(null)
, __pSecondPane(null)
, __splitPanelDividerDirection(SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
_ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT;
pSplitPanel = new (std::nothrow) _SplitPanel;
- SysTryReturn(NID_UI_CTRL, pSplitPanel, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ SysTryReturn(NID_UI_CTRL, pSplitPanel, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = pSplitPanel->Construct(splitPanelDividerStyle, splitPanelDividerDirection);
if (r != E_SUCCESS)
pSplitPanel->__dividerPosition[_SPLIT_PANEL_HORIZONTAL_DIVIDER_ORIENTATION_LANDSCAPE] = rect.height / 2.0f;
pSplitPanel->__pTapGesture = new (std::nothrow) _TouchTapGestureDetector;
- SysTryCatch(NID_UI_CTRL, pSplitPanel->__pTapGesture, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ SysTryCatch(NID_UI_CTRL, pSplitPanel->__pTapGesture, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
pSplitPanel->AddGestureDetector(*(pSplitPanel->__pTapGesture));
r = pSplitPanel->__pTapGesture->AddGestureListener(*pSplitPanel);
result r = E_SUCCESS;
__pDividerVisualElement = new (std::nothrow) VisualElement();
- SysTryReturnResult(NID_UI_CTRL, __pDividerVisualElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ SysTryReturnResult(NID_UI_CTRL, __pDividerVisualElement, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = __pDividerVisualElement->Construct();
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to construct divider visual element.", GetErrorMessage(r));
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to attach divider visual element.", GetErrorMessage(r));
__pSplitPanelPresenter = new (std::nothrow) _SplitPanelPresenter;
- SysTryCatch(NID_UI_CTRL, __pSplitPanelPresenter != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] The memory is insufficient.");
+ SysTryCatch(NID_UI_CTRL, __pSplitPanelPresenter != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
r = __pSplitPanelPresenter->Construct(*this, splitPanelDividerStyle, splitPanelDividerDirection);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to construct presenter.", GetErrorMessage(r));
+ __pFirstPaneParent = _Control::CreateControlN();
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, __pFirstPaneParent != null, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pSecondPaneParent = _Control::CreateControlN();
+ r = GetLastResult();
+ SysTryCatch(NID_UI_CTRL, __pSecondPaneParent != null, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ __pFirstPaneParent->SetBackgroundColor(Color(0,0,0,0));
+ __pSecondPaneParent->SetBackgroundColor(Color(0,0,0,0));
+
+ r = AttachChild(*__pFirstPaneParent);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = AttachChild(*__pSecondPaneParent);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
return r;
CATCH:
__pDividerVisualElement = null;
}
- delete __pSplitPanelPresenter;
- __pSplitPanelPresenter = null;
+ if (__pSplitPanelPresenter)
+ {
+ delete __pSplitPanelPresenter;
+ __pSplitPanelPresenter = null;
+ }
+
+ if (__pFirstPaneParent)
+ {
+ if (__pFirstPane)
+ {
+ __pFirstPaneParent->DetachChild(*__pFirstPane);
+ }
+
+ DetachChild(*__pFirstPaneParent);
+
+ delete __pFirstPaneParent;
+ __pFirstPaneParent = null;
+ }
+
+ if (__pSecondPaneParent)
+ {
+ if (__pSecondPane)
+ {
+ __pSecondPaneParent->DetachChild(*__pSecondPane);
+ }
+
+ DetachChild(*__pSecondPaneParent);
+
+ delete __pSecondPaneParent;
+ __pSecondPaneParent = null;
+ }
return r;
}
if (__pDividerVisualElement)
{
+ GetVisualElement()->DetachChild(*__pDividerVisualElement);
+
__pDividerVisualElement->Destroy();
__pDividerVisualElement = null;
}
+ if (__pFirstPaneParent)
+ {
+ DetachChild(*__pFirstPaneParent);
+
+ delete __pFirstPaneParent;
+ __pFirstPaneParent = null;
+ }
+
+ if (__pSecondPaneParent)
+ {
+ DetachChild(*__pSecondPaneParent);
+
+ delete __pSecondPaneParent;
+ __pSecondPaneParent = null;
+ }
+
ClearLastResult();
}
{
__pSplitPanelEvent = _SplitPanelEvent::CreateInstanceN(*this);
r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, __pSplitPanelEvent, r, r, "[%s] Propagating.", GetErrorMessage(r))
+ SysTryReturn(NID_UI_CTRL, __pSplitPanelEvent, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pSplitPanelEvent->AddListener(listener);
}
_SplitPanel::RemoveSplitPanelEventListener(const _ISplitPanelEventListener& listener)
{
SysTryReturn(NID_UI_CTRL, __pSplitPanelEvent, E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] System error occurred.")
+ "[E_SYSTEM] System error occurred.");
__pSplitPanelEvent->RemoveListener(listener);
if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
{
- r = AttachChild(*pControl);
+ r = __pFirstPaneParent->AttachChild(*pControl);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pFirstPane = pControl;
}
else
{
- r = AttachChild(*pControl);
+ r = __pSecondPaneParent->AttachChild(*pControl);
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pSecondPane = pControl;
_Control*
_SplitPanel::GetPane(SplitPanelPaneOrder paneOrder) const
{
- SysTryReturn(NID_UI_CTRL, __pSplitPanelPresenter != null, null, E_SYSTEM,
- "[E_SYSTEM] System error occurred.");
-
if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
{
return const_cast <_Control*>(__pFirstPane);
}
- else
+
+ return const_cast <_Control*>(__pSecondPane);
+}
+
+_Control*
+_SplitPanel::GetPaneParent(SplitPanelPaneOrder paneOrder) const
+{
+ if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
{
- return const_cast <_Control*>(__pSecondPane);
+ return const_cast <_Control*>(__pFirstPaneParent);
}
+
+ return const_cast <_Control*>(__pSecondPaneParent);
}
result
_SplitPanel::SetDividerStyle(SplitPanelDividerStyle splitPanelDividerStyle)
{
- SysTryReturn(NID_UI_CTRL, __pSplitPanelPresenter != null, E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] System error occurred.");
-
__pSplitPanelPresenter->SetDividerStyle(splitPanelDividerStyle);
return E_SUCCESS;
_SplitPanel::SetDividerPosition(float position)
{
const float width = GetBoundsF().width;
+ const float height = GetBoundsF().height;
+ int configValue = 0;
+ float margin = 0.0f;
+ _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
+
+ if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
+ {
+ GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, configValue);
+ }
+ else
+ {
+ GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, configValue);
+ }
- if ((0.0f > position) || (width < position))
+ margin = _CoordinateSystemUtils::ConvertToFloat(configValue);
+
+ if ((0.0f > position) ||
+ ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) && ((width - margin) < position)) ||
+ ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_HORIZONTAL) && ((height - margin) < position)))
{
return E_OUT_OF_RANGE;
}
}
}
- _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
-
if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
{
if (GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
{
if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED)
{
- SysLog(NID_UI_CTRL, "[E_SYSTEM] System error occurred. This functionality is not supported for divider style fixed");
+ SysLog(NID_UI_CTRL, "[E_SYSTEM] System error occurred. This functionality is not supported for divider style fixed.");
return E_SUCCESS;
}
- _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
-
const float width = GetBoundsF().width;
+ const float height = GetBoundsF().height;
+ int configValue = 0;
float margin = 0.0f;
+ _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
+
if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
{
- GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, margin);
+ GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, configValue);
}
else
{
- GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, margin);
+ GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, configValue);
}
- if ((0.0f > position) || ((width - margin) < position) || (position < GetMinimumDividerPosition()))
+ margin = _CoordinateSystemUtils::ConvertToFloat(configValue);
+
+ if ((0.0f > position) ||
+ ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) && ((width - margin) < position)) ||
+ ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_HORIZONTAL) && ((height - margin) < position)) ||
+ (position < GetMinimumDividerPosition()))
{
return E_OUT_OF_RANGE;
}
}
const float width = GetBoundsF().width;
+ const float height = GetBoundsF().height;
+ int configValue = 0;
+ float margin = 0.0f;
+ _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
- if ((0.0f > position) || (width < position) || (position > GetMaximumDividerPosition()))
+ if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
{
- return E_OUT_OF_RANGE;
+ GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, configValue);
+ }
+ else
+ {
+ GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, configValue);
}
- _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
+ margin = _CoordinateSystemUtils::ConvertToFloat(configValue);
+
+ if ((0.0f > position) ||
+ ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL) && ((width - margin) < position)) ||
+ ((GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_HORIZONTAL) && ((height - margin) < position)) ||
+ (position > GetMaximumDividerPosition()))
+ {
+ return E_OUT_OF_RANGE;
+ }
if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
{
result
_SplitPanel::MaximizePane(SplitPanelPaneOrder paneOrder)
{
- SysTryReturn(NID_UI_CTRL, __pSplitPanelPresenter != null, E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] System error occurred.");
-
- __pSplitPanelPresenter->MaximizePane(paneOrder);
-
- return E_SUCCESS;
+ return __pSplitPanelPresenter->MaximizePane(paneOrder);
}
bool
_SplitPanel::IsPaneMaximized(SplitPanelPaneOrder paneOrder) const
{
- SysTryReturn(NID_UI_CTRL, __pSplitPanelPresenter != null, false, E_SYSTEM,
- "[E_SYSTEM] System error occurred.");
-
return __pSplitPanelPresenter->IsPaneMaximized(paneOrder);
}
result
_SplitPanel::RestorePane(void)
{
- SysTryReturn(NID_UI_CTRL, __pSplitPanelPresenter != null, E_SYSTEM, E_SYSTEM,
- "[E_SYSTEM] System error occurred.");
-
- __pSplitPanelPresenter->RestorePane();
-
- return E_SUCCESS;
+ return __pSplitPanelPresenter->RestorePane();
}
result
_SplitPanel::SendSplitPanelEvent(_SplitPanelEventStatus status)
{
result r = E_SUCCESS;
+ IEventArg* pEventArg = null;
if (__pSplitPanelEvent)
{
- IEventArg* pEventArg = _SplitPanelEvent::CreateSplitPanelEventArgN(status);
+ pEventArg = _SplitPanelEvent::CreateSplitPanelEventArgN(status);
r = GetLastResult();
SysTryReturn(NID_UI_CTRL, pEventArg, r, r, "[%s] Propagating.", GetErrorMessage(r));
result
_SplitPanel::OnAttachedToMainTree(void)
{
+ String hintText = L"";
+ FloatRectangle dividerRect(0.0f, 0.0f, 0.0f, 0.0f);
+ _AccessibilityContainer* pContainer = null;
+
if (likely(!(_AccessibilityManager::IsActivated())))
{
return E_SUCCESS;
}
- _AccessibilityContainer* pContainer = GetAccessibilityContainer();
+ pContainer = GetAccessibilityContainer();
if (pContainer)
{
if (__pDividerVisualElement)
{
- FloatRectangle dividerRect = __pSplitPanelPresenter->GetDividerRectangle();
- String hintText = L"";
+ dividerRect = __pSplitPanelPresenter->GetDividerRectangle();
if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED)
{
hintText = String(L"Drag scroll, double tap and move to adjust split area");
}
- __pAccessibilityElement = new _AccessibilityElement(true);
+ __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
SysTryReturn(NID_UI_CTRL, __pAccessibilityElement, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
__pAccessibilityElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(dividerRect));
bool
_SplitPanel::OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
{
- SetDividerPosition(GetDividerPosition() + 5);
+ SetDividerPosition(GetDividerPosition() + ACCESSIBILITY_DIVIDER_POSITION_OFFSET);
Invalidate();
return true;
_SplitPanel::OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
{
- SetDividerPosition(GetDividerPosition() - 5);
+ SetDividerPosition(GetDividerPosition() - ACCESSIBILITY_DIVIDER_POSITION_OFFSET);
Invalidate();
return true;
using namespace Tizen::Ui;
using namespace Tizen::Graphics;
using namespace Tizen::Ui::Animations;
+using namespace Tizen::Base;
namespace Tizen { namespace Ui { namespace Controls
{
, __pDividerThumbBitmap(null)
, __transactionIdMaximize(0)
, __transactionIdRestore(0)
- , __controlAnimatorAnimationInterpolator(ANIMATION_INTERPOLATOR_LINEAR)
- , __visualElementAnimationInterpolator(L"Linear")
+ , __controlAnimatorInterpolator(ANIMATION_INTERPOLATOR_LINEAR)
+ , __visualElementInterpolator(L"Linear")
{
GET_COLOR_CONFIG(SPLITPANEL::DIVIDER_BG_NORMAL, __dividerBackgroundColor);
GET_COLOR_CONFIG(SPLITPANEL::DIVIDER_BG_PRESSED, __dividerPressedBackgroundColor);
AdjustDividerRectangle();
- __controlAnimatorAnimationInterpolator = ANIMATION_INTERPOLATOR_EASE_IN;
- __visualElementAnimationInterpolator = L"EaseIn";
+ __controlAnimatorInterpolator = ANIMATION_INTERPOLATOR_EASE_IN;
+ __visualElementInterpolator = L"EaseIn";
return E_SUCCESS;
Bitmap* pThumbBitmap = null;
dividerPosition = __pSplitPanel->GetDividerPosition();
+ pThumbBitmap = __pDividerThumbBitmap;
if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
{
- pThumbBitmap = __pDividerThumbBitmap;
if ((positionX >= dividerPosition)
&& (positionX <= dividerPosition + pThumbBitmap->GetWidthF()))
{
}
else
{
- pThumbBitmap = __pDividerThumbBitmap;
if ((positionY >= dividerPosition)
&& (positionY <= dividerPosition + pThumbBitmap->GetHeightF()))
{
}
point = touchinfo.GetCurrentPosition();
+ pThumbBitmap = __pDividerThumbBitmap;
if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
{
return false;
}
- pThumbBitmap = __pDividerThumbBitmap;
-
if (point.x <= __pSplitPanel->GetBoundsF().width - pThumbBitmap->GetWidthF())
{
__pSplitPanel->SetDividerPosition(point.x);
return false;
}
- pThumbBitmap = __pDividerThumbBitmap;
-
if (point.y <= __pSplitPanel->GetBoundsF().height - pThumbBitmap->GetHeightF())
{
__pSplitPanel->SetDividerPosition(point.y);
if (__splitPanelDividerPressed == true)
{
__splitPanelDividerPressed = false;
+
Draw();
}
{
return E_SUCCESS;
}
- else if (GetAnimationStatus() == ANIMATOR_STATUS_PLAYING)
+ else if (GetTransactionStatus() == ANIMATION_TRANSACTION_STATUS_PLAYING)
{
AnimationTransaction::Stop(__transactionIdMaximize);
AnimationTransaction::Stop(__transactionIdRestore);
RecalcSplitPanel();
- ChangePaneOrder(paneOrder);
-
AnimationTransaction::Begin(__transactionIdMaximize);
if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RIGHT);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = AnimatePaneParent(_SPLIT_PANEL_ANIMATION_RIGHT);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
r = AnimatePane(_SPLIT_PANEL_ANIMATION_RIGHT);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
}
r = AnimateDivider(_SPLIT_PANEL_ANIMATION_LEFT);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = AnimatePaneParent(_SPLIT_PANEL_ANIMATION_LEFT);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
r = AnimatePane(_SPLIT_PANEL_ANIMATION_LEFT);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
}
r = AnimateDivider(_SPLIT_PANEL_ANIMATION_BOTTOM);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = AnimatePaneParent(_SPLIT_PANEL_ANIMATION_BOTTOM);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
r = AnimatePane(_SPLIT_PANEL_ANIMATION_BOTTOM);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
}
r = AnimateDivider(_SPLIT_PANEL_ANIMATION_TOP);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = AnimatePaneParent(_SPLIT_PANEL_ANIMATION_TOP);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
r = AnimatePane(_SPLIT_PANEL_ANIMATION_TOP);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
}
{
return E_SUCCESS;
}
- else if (GetAnimationStatus() == ANIMATOR_STATUS_PLAYING)
+ else if (GetTransactionStatus() == ANIMATION_TRANSACTION_STATUS_PLAYING)
{
AnimationTransaction::Stop(__transactionIdMaximize);
AnimationTransaction::Stop(__transactionIdRestore);
r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = AnimatePaneParent(_SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
r = AnimatePane(_SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
}
r = AnimateDivider(_SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+ r = AnimatePaneParent(_SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL);
+ SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
+
r = AnimatePane(_SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
}
result
_SplitPanelPresenter::Draw(void)
{
- if (__pSplitPanelModel->GetPaneMaximumState() == false && GetAnimationStatus() == ANIMATOR_STATUS_STOPPED)
+ if (__pSplitPanelModel->GetPaneMaximumState() == false && GetTransactionStatus() == ANIMATION_TRANSACTION_STATUS_STOPPED)
{
FloatRectangle dividerBounds(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle dividerThumbBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ Canvas* pCanvas = null;
//adjust divider rectangle
AdjustDividerRectangle();
- Canvas* pCanvas = __pSplitPanel->GetDividerVisualElement()->GetCanvasN();
+ pCanvas = __pSplitPanel->GetDividerVisualElement()->GetCanvasN();
SysTryReturnResult(NID_UI_CTRL, pCanvas != null, GetLastResult(), "Propagating.");
- pCanvas->Clear();
-
- //resize pane
- SetPaneBounds();
-
- dividerBounds = __dividerRectangle;
- dividerBounds.x = 0.0f;
- dividerBounds.y = 0.0f;
-
- if (__splitPanelDividerPressed == true)
+ if (pCanvas)
{
- pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerPressedBackgroundBitmap);
- }
- else
- {
- pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerBackgroundBitmap);
- }
+ pCanvas->Clear();
- //draw divider
- pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerBackgroundEffectBitmap);
+ //resize pane
+ SetPaneBounds();
- //draw divider thumb
- if (__pSplitPanelModel->GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
- {
- dividerThumbBounds = __dividerThumbRectangle;
- if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
+ dividerBounds = __dividerRectangle;
+ dividerBounds.x = 0.0f;
+ dividerBounds.y = 0.0f;
+
+ if (__splitPanelDividerPressed == true)
{
- dividerThumbBounds.x = 0.0f;
+ pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerPressedBackgroundBitmap);
}
else
{
- dividerThumbBounds.y = 0.0f;
+ pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerBackgroundBitmap);
}
- pCanvas->DrawBitmap(dividerThumbBounds, *__pDividerThumbBitmap);
- }
+ //draw divider
+ pCanvas->DrawNinePatchedBitmap(dividerBounds, *__pDividerBackgroundEffectBitmap);
+
+ //draw divider thumb
+ if (__pSplitPanelModel->GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
+ {
+ dividerThumbBounds = __dividerThumbRectangle;
+ if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
+ {
+ dividerThumbBounds.x = 0.0f;
+ }
+ else
+ {
+ dividerThumbBounds.y = 0.0f;
+ }
+
+ pCanvas->DrawBitmap(dividerThumbBounds, *__pDividerThumbBitmap);
+ }
- delete pCanvas;
+ delete pCanvas;
+ }
}
return E_SUCCESS;
{
r = GET_BITMAP_CONFIG_N(SPLITPANEL::VERTICAL_DIVIDER_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerBackgroundEffectBitmap);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
+
r = GET_BITMAP_CONFIG_N(SPLITPANEL::VERTICAL_DIVIDER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerThumbBitmap);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
}
{
r = GET_BITMAP_CONFIG_N(SPLITPANEL::HORIZONTAL_DIVIDER_BG_EFFECT, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerBackgroundEffectBitmap);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
+
r = GET_BITMAP_CONFIG_N(SPLITPANEL::HORIZONTAL_DIVIDER_BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, __pDividerThumbBitmap);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Failed to load bitmap.", GetErrorMessage(r));
}
__pDividerPressedBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDividerBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), __dividerPressedBackgroundColor);
- r = GetLastResult();
- SysTryCatch(NID_UI_CTRL, (__pDividerPressedBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(r));
+ SysTryCatch(NID_UI_CTRL, (__pDividerPressedBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(GetLastResult()));
__pDividerBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*pDividerBackgroundBitmap, Color::GetColor(COLOR_ID_MAGENTA), __dividerBackgroundColor);
- r = GetLastResult();
- SysTryCatch(NID_UI_CTRL, (__pDividerBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(r));
+ SysTryCatch(NID_UI_CTRL, (__pDividerBackgroundBitmap != null), , r, "[%s] Failed to get replacement color bitmap.", GetErrorMessage(GetLastResult()));
delete pDividerBackgroundBitmap;
_SplitPanelPresenter::OnBoundsChanged(void)
{
RecalcSplitPanel();
+
return;
}
FloatPoint panePostion(0.0f, 0.0f);
_Control* pFirstPane = null;
_Control* pSecondPane = null;
+ _Control* pFirstPaneParent = null;
+ _Control* pSecondPaneParent = null;
clientBounds = __pSplitPanel->GetBoundsF();
pFirstPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST);
-
pSecondPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND);
+ pFirstPaneParent = __pSplitPanel->GetPaneParent(SPLIT_PANEL_PANE_ORDER_FIRST);
+ pSecondPaneParent = __pSplitPanel->GetPaneParent(SPLIT_PANEL_PANE_ORDER_SECOND);
+
clientBounds.x = clientBounds.y = 0.0f;
if (IsPaneMaximized(SPLIT_PANEL_PANE_ORDER_FIRST))
}
}
+ if (pFirstPaneParent != null)
+ {
+ r = pFirstPaneParent->SetBounds(firstPaneBounds);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ }
+
+ if (pSecondPaneParent != null)
+ {
+ r = pSecondPaneParent->SetBounds(secondPaneBounds);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ }
+
//set Pane bounds
if (pFirstPane != null)
{
- r = pFirstPane->SetBounds(firstPaneBounds);
-
- if (r != E_SUCCESS)
+ if (pFirstPane->IsResizable())
{
- panePostion.x = firstPaneBounds.x;
- panePostion.y = firstPaneBounds.y;
-
- r = pFirstPane->SetPosition(panePostion);
+ r = pFirstPane->SetBounds(firstPaneBounds);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
}
-
+
+ r = pFirstPane->SetPosition(Point(0.0f, 0.0f));
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
}
if (pSecondPane != null)
{
- r = pSecondPane->SetBounds(secondPaneBounds);
-
- if (r != E_SUCCESS)
+ if (pSecondPane->IsResizable())
{
- panePostion.x = secondPaneBounds.x;
- panePostion.y = secondPaneBounds.y;
-
- r = pSecondPane->SetPosition(panePostion);
+ r = pSecondPane->SetBounds(secondPaneBounds);
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
}
-
+
+ r = pSecondPane->SetPosition(Point(0.0f, 0.0f));
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
}
__setFirstDividerPositionChangeEvent = false;
__pSplitPanel->SendSplitPanelEvent(_SPLIT_PANEL_EVENT_DIVIDER_POSITION_CHANGE);
}
+
+ pFirstPane->Invalidate(true);
+ pSecondPane->Invalidate(true);
}
return r;
dividerPosition = __pSplitPanel->GetDividerPosition();
clientBounds = __pSplitPanel->GetBoundsF();
- if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
- {
- pThumbBitmap = __pDividerThumbBitmap;
+ pThumbBitmap = __pDividerThumbBitmap;
- if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
- {
- GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, width);
- }
- else
- {
- GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, width);
- }
+ if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
+ {
+ GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, width);
+ GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height);
+ }
+ else
+ {
+ GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, width);
+ GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height);
+ }
+ if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
+ {
height = clientBounds.height;
- if (height > 0)
+ if (height > 0.0f)
{
__dividerRectangle = FloatRectangle(dividerPosition, 0.0f, width, height);
__dividerThumbRectangle = FloatRectangle(dividerPosition, ((height - pThumbBitmap->GetHeightF()) / 2.0f), pThumbBitmap->GetWidthF(), pThumbBitmap->GetHeightF());
}
else
{
- pThumbBitmap = __pDividerThumbBitmap;
-
- if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
- {
- GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height);
- }
- else
- {
- GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height);
- }
-
width = clientBounds.width;
if (width > 0.0f)
__pSplitPanel->SetDividerVisualElementBounds(__dividerRectangle);
}
-void
-_SplitPanelPresenter::ChangePaneOrder(SplitPanelPaneOrder paneOrder)
-{
- result r = E_SUCCESS;
- _Control* pFirstPane = null;
- _Control* pSecondPane = null;
-
- if (paneOrder == SPLIT_PANEL_PANE_ORDER_FIRST)
- {
- pFirstPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_FIRST);
- SysTryReturnVoidResult(NID_UI_CTRL, pFirstPane != null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
-
- r = __pSplitPanel->DetachChild(*pFirstPane);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = __pSplitPanel->AttachChild(*pFirstPane);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- }
- else
- {
- pSecondPane = __pSplitPanel->GetPane(SPLIT_PANEL_PANE_ORDER_SECOND);
- SysTryReturnVoidResult(NID_UI_CTRL, pSecondPane != null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(r));
-
- r = __pSplitPanel->DetachChild(*pSecondPane);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
- r = __pSplitPanel->AttachChild(*pSecondPane);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- }
-
- return;
-}
-
result
_SplitPanelPresenter::AnimateDivider(int destination)
{
result r = E_SUCCESS;
FloatRectangle dividerBoundsStart(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle dividerBoundsEnd(0.0f, 0.0f, 0.0f, 0.0f);
- FloatRectangle dividerBounds(0, 0, 0, 0);
- FloatRectangle clientBounds(0, 0, 0, 0);
- FloatRectangle firstPaneBounds(0, 0, 0, 0);
- Control* pFirstPanelControl = null;
+ FloatRectangle dividerBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle firstPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ _Control* pFirstPaneParent = null;
VisualElement* pVisualElementDivider = null;
VisualElementPropertyAnimation* pAnimationDivider = null;
- const IVisualElementAnimationTimingFunction* pTimingFunction = VisualElementAnimation::GetTimingFunctionByName(__visualElementAnimationInterpolator);
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, pTimingFunction != null, r, "Propagating.");
-
- pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, pFirstPanelControl != null, r, "Propagating.");
+ pFirstPaneParent = __pSplitPanel->GetPaneParent(SPLIT_PANEL_PANE_ORDER_FIRST);
+ SysTryReturnResult(NID_UI_CTRL, pFirstPaneParent != null, GetLastResult(), "Propagating.");
pVisualElementDivider = __pSplitPanel->GetDividerVisualElement();
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, pVisualElementDivider != null, r, "Propagating.");
+ SysTryReturnResult(NID_UI_CTRL, pVisualElementDivider != null, GetLastResult(), "Propagating.");
pVisualElementDivider->RemoveAllAnimations();
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- pAnimationDivider = new (std::nothrow) VisualElementPropertyAnimation();
- SysTryReturnResult(NID_UI_CTRL, pAnimationDivider != null, E_OUT_OF_MEMORY, " Memory allocation failed.")
-
- r = pAnimationDivider->SetPropertyName(L"bounds");
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
-
- r = pAnimationDivider->SetDuration(ANIMATION_DURATION);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+ SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, GetLastResult(), "Propagating.");
- pAnimationDivider->SetTimingFunction(pTimingFunction);
- r = GetLastResult();
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+ pAnimationDivider = GetVisualElementAnimation(L"bounds");
+ SysTryReturnResult(NID_UI_CTRL, pAnimationDivider != null, GetLastResult(), "Propagating.");
dividerBounds = pVisualElementDivider->GetBounds();
clientBounds = __pSplitPanel->GetBoundsF();
- firstPaneBounds = pFirstPanelControl->GetBoundsF();
+ firstPaneBounds = pFirstPaneParent->GetBoundsF();
dividerBoundsStart = dividerBounds;
clientBounds.x = clientBounds.y = 0.0f;
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
pVisualElementDivider->AddAnimation(L"Bounds", *pAnimationDivider);
- r = GetLastResult();
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , GetLastResult(), "Propagating.");
CATCH:
delete pAnimationDivider;
- return r;
+ return r;
}
result
_SplitPanelPresenter::AnimatePane(int destination)
{
- result r = E_SUCCESS;
Rectangle clientBounds(0, 0, 0, 0);
Rectangle firstPaneBounds(0, 0, 0, 0);
Rectangle secondPaneBounds(0, 0, 0, 0);
Rectangle dividerRectangle(0, 0, 0, 0);
- Control* pFirstPanelControl = null;
- Control* pSecondPanelControl = null;
+ Control* pFirstPaneControl = null;
+ Control* pSecondPaneControl = null;
ControlAnimator* pControlAnimatorFirstPane = null;
ControlAnimator* pControlAnimatorSecondPane = null;
- FloatAnimation animationHidePane = FloatAnimation(ANIMATION_ALPHA_SHOW, ANIMATION_ALPHA_HIDE, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
- FloatAnimation animationShowPane = FloatAnimation(ANIMATION_ALPHA_HIDE, ANIMATION_ALPHA_SHOW, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
+ FloatAnimation hidePane(ANIMATION_ALPHA_SHOW, ANIMATION_ALPHA_HIDE, ANIMATION_DURATION, __controlAnimatorInterpolator);
+ FloatAnimation showPane(ANIMATION_ALPHA_HIDE, ANIMATION_ALPHA_SHOW, ANIMATION_DURATION, __controlAnimatorInterpolator);
- pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, pFirstPanelControl != null, r, "Propagating.");
+ pFirstPaneControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
+ pSecondPaneControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_SECOND);
- pSecondPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_SECOND);
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, pSecondPanelControl != null, r, "Propagating.");
-
- pControlAnimatorFirstPane = pFirstPanelControl->GetControlAnimator();
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, pControlAnimatorFirstPane != null, r, "Propagating.");
-
- pControlAnimatorSecondPane = pSecondPanelControl->GetControlAnimator();
- r = GetLastResult();
- SysTryReturnResult(NID_UI_CTRL, pControlAnimatorSecondPane != null, r, "Propagating.");
+ pControlAnimatorFirstPane = pFirstPaneControl->GetControlAnimator();
+ pControlAnimatorSecondPane = pSecondPaneControl->GetControlAnimator();
clientBounds = __pSplitPanel->GetBounds();
- firstPaneBounds = pFirstPanelControl->GetBounds();
- secondPaneBounds = pSecondPanelControl->GetBounds();
+ firstPaneBounds = pFirstPaneControl->GetBounds();
+ secondPaneBounds = pSecondPaneControl->GetBounds();
clientBounds.x = clientBounds.y = 0;
case _SPLIT_PANEL_ANIMATION_RIGHT:
{
Rectangle secondPaneEndBounds = secondPaneBounds;
- secondPaneEndBounds.x = clientBounds.x + clientBounds.width + dividerRectangle.width;
+ secondPaneEndBounds.x = clientBounds.width + dividerRectangle.width;
- RectangleAnimation animationMaximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
- RectangleAnimation animationMinimizeSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
-
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ RectangleAnimation maximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->IsResizable())
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, maximizeFirstPane);
+ }
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
- if (pFirstPanelControl->GetShowState() == false)
+ if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == true)
{
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, hidePane);
}
}
break;
case _SPLIT_PANEL_ANIMATION_LEFT:
{
Rectangle firstPaneEndBounds = firstPaneBounds;
- firstPaneEndBounds.x = clientBounds.x - firstPaneBounds.width - dividerRectangle.width;
-
- RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
- RectangleAnimation animationMinimizeFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
+ firstPaneEndBounds.x = -(firstPaneBounds.width + dividerRectangle.width);
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->IsResizable())
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
+ }
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
- if (pSecondPanelControl->GetShowState() == false)
+ if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == true)
{
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, hidePane);
}
}
break;
case _SPLIT_PANEL_ANIMATION_TOP:
{
Rectangle firstPaneEndBounds = firstPaneBounds;
- firstPaneEndBounds.y = clientBounds.y - firstPaneBounds.height - dividerRectangle.height;
+ firstPaneEndBounds.y = -(firstPaneBounds.height + dividerRectangle.height);
- RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
- RectangleAnimation animationMinimizeFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
+ RectangleAnimation animationMaximizeSecondPane = RectangleAnimation(secondPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->IsResizable())
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeSecondPane);
+ }
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
- if (pSecondPanelControl->GetShowState() == false)
+ if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == true)
{
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, hidePane);
}
}
break;
case _SPLIT_PANEL_ANIMATION_BOTTOM:
{
Rectangle secondPaneEndBounds = secondPaneBounds;
- secondPaneEndBounds.y = clientBounds.y + clientBounds.height + dividerRectangle.height;
-
- RectangleAnimation animationMaximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
- RectangleAnimation animationMinimizeSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
+ secondPaneEndBounds.y = clientBounds.height + dividerRectangle.height;
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMaximizeFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationMaximizeFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ RectangleAnimation maximizeFirstPane = RectangleAnimation(firstPaneBounds, clientBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationMinimizeSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->IsResizable())
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, maximizeFirstPane);
+ }
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationHidePane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
- if (pFirstPanelControl->GetShowState() == false)
+ if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == true)
{
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, hidePane);
}
}
break;
Rectangle firstPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST));
Rectangle secondPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND));
- RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
- RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
+ secondPaneEndBounds.x = secondPaneEndBounds.y = 0;
- // Restore Pane 1
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
+ RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- // Restore Pane 2
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->IsResizable())
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
+ }
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->IsResizable())
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
+ }
if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
{
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
}
else
{
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
}
}
break;
Rectangle firstPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST));
Rectangle secondPaneEndBounds = _CoordinateSystemUtils::ConvertToInteger(GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND));
- RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
- RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorAnimationInterpolator);
+ secondPaneEndBounds.x = secondPaneEndBounds.y = 0;
- // Restore Pane 1
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ RectangleAnimation animationRestoreFirstPane = RectangleAnimation(firstPaneBounds, firstPaneEndBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
+ RectangleAnimation animationRestoreSecondPane = RectangleAnimation(secondPaneBounds, secondPaneEndBounds, ANIMATION_DURATION, __controlAnimatorInterpolator);
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreFirstPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
-
- // Restore Pane 2
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->IsResizable())
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreFirstPane);
+ }
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_POSITION, animationRestoreSecondPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->IsResizable())
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_SIZE, animationRestoreSecondPane);
+ }
if (__pSplitPanelModel->GetMaximizedPaneOrder() == SPLIT_PANEL_PANE_ORDER_FIRST)
{
- r = pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorSecondPane && pSecondPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorSecondPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
}
else
{
- r = pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, animationShowPane);
- SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
+ if (pControlAnimatorFirstPane && pFirstPaneControl->GetShowState() == false)
+ {
+ pControlAnimatorFirstPane->StartUserAnimation(ANIMATION_TARGET_ALPHA, showPane);
+ }
}
}
break;
return E_SUCCESS;
}
+result
+_SplitPanelPresenter::AnimatePaneParent(int destination)
+{
+ result r = E_SUCCESS;
+ _Control* pFirstPane = null;
+ _Control* pSecondPane = null;
+ VisualElement* pVEFirstPane = null;
+ VisualElement* pVESecondPane = null;
+ VisualElementPropertyAnimation* pAnimationFirstPane = null;
+ VisualElementPropertyAnimation* pAnimationSecondPane = null;
+
+ FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle firstPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle secondPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle dividerRectangle(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle firstPaneStartBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle firstPaneEndBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle secondPaneStartBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ FloatRectangle secondPaneEndBounds(0.0f, 0.0f, 0.0f, 0.0f);
+
+ pFirstPane = __pSplitPanel->GetPaneParent(SPLIT_PANEL_PANE_ORDER_FIRST);
+ pSecondPane = __pSplitPanel->GetPaneParent(SPLIT_PANEL_PANE_ORDER_SECOND);
+
+ if (pFirstPane)
+ {
+ pVEFirstPane = pFirstPane->GetVisualElement();
+ SysTryReturnResult(NID_UI_CTRL, pVEFirstPane != null, GetLastResult(), "Propagating.");
+
+ pVEFirstPane->RemoveAllAnimations();
+ }
+
+ if (pSecondPane)
+ {
+ pVESecondPane = pSecondPane->GetVisualElement();
+ SysTryReturnResult(NID_UI_CTRL, pVESecondPane != null, GetLastResult(), "Propagating.");
+
+ pVESecondPane->RemoveAllAnimations();
+ }
+
+ pAnimationFirstPane = GetVisualElementAnimation(L"bounds");
+ SysTryReturnResult(NID_UI_CTRL, pAnimationFirstPane != null, GetLastResult(), "Propagating.");
+
+ pAnimationSecondPane = GetVisualElementAnimation(L"bounds");
+ SysTryReturnResult(NID_UI_CTRL, pAnimationSecondPane != null, GetLastResult(), "Propagating.");
+
+ clientBounds = __pSplitPanel->GetBoundsF();
+ firstPaneBounds = pFirstPane->GetBoundsF();
+ secondPaneBounds = pSecondPane->GetBoundsF();
+
+ clientBounds.x = clientBounds.y = 0.0f;
+
+ dividerRectangle = __dividerRectangle;
+
+ switch (destination)
+ {
+ case _SPLIT_PANEL_ANIMATION_RIGHT:
+ {
+ firstPaneStartBounds = firstPaneBounds;
+ firstPaneEndBounds = clientBounds;
+
+ secondPaneStartBounds = secondPaneBounds;
+ secondPaneEndBounds = secondPaneBounds;
+ secondPaneEndBounds.x = clientBounds.width + dividerRectangle.width;
+ }
+ break;
+ case _SPLIT_PANEL_ANIMATION_LEFT:
+ {
+ firstPaneStartBounds = firstPaneBounds;
+ firstPaneEndBounds = firstPaneBounds;
+ firstPaneEndBounds.x = -(firstPaneBounds.width + dividerRectangle.width);
+
+ secondPaneStartBounds = secondPaneBounds;
+ secondPaneEndBounds = clientBounds;
+ }
+ break;
+ case _SPLIT_PANEL_ANIMATION_TOP:
+ {
+ firstPaneStartBounds = firstPaneBounds;
+ firstPaneEndBounds = firstPaneBounds;
+ firstPaneEndBounds.y = -(firstPaneBounds.height + dividerRectangle.height);
+
+ secondPaneStartBounds = secondPaneBounds;
+ secondPaneEndBounds = clientBounds;
+ }
+ break;
+ case _SPLIT_PANEL_ANIMATION_BOTTOM:
+ {
+ firstPaneStartBounds = firstPaneBounds;
+ firstPaneEndBounds = clientBounds;
+
+ secondPaneStartBounds = secondPaneBounds;
+ secondPaneEndBounds = secondPaneBounds;
+ secondPaneEndBounds.y = clientBounds.height + dividerRectangle.height;
+ }
+ break;
+ case _SPLIT_PANEL_ANIMATION_RESTORE_HORIZONTAL:
+ {
+ firstPaneStartBounds = firstPaneBounds;
+ firstPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST);
+
+ secondPaneStartBounds = secondPaneBounds;
+ secondPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND);
+ }
+ break;
+ case _SPLIT_PANEL_ANIMATION_RESTORE_VERTICAL:
+ {
+ firstPaneStartBounds = firstPaneBounds;
+ firstPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_FIRST);
+
+ secondPaneStartBounds = secondPaneBounds;
+ secondPaneEndBounds = GetRestorePaneBounds(SPLIT_PANEL_PANE_ORDER_SECOND);
+ }
+ break;
+ }
+
+ if (pFirstPane)
+ {
+ r = pAnimationFirstPane->SetStartValue(firstPaneStartBounds);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+
+ r = pAnimationFirstPane->SetEndValue(firstPaneEndBounds);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+
+ pFirstPane->SetBounds(firstPaneEndBounds);
+
+ if (pVEFirstPane)
+ {
+ pVEFirstPane->AddAnimation(L"Bounds", *pAnimationFirstPane);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , GetLastResult(), "Propagating.");
+ }
+ }
+
+ if (pSecondPane)
+ {
+ r = pAnimationSecondPane->SetStartValue(secondPaneStartBounds);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+
+ r = pAnimationSecondPane->SetEndValue(secondPaneEndBounds);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+
+ pSecondPane->SetBounds(secondPaneEndBounds);
+
+ if (pVESecondPane)
+ {
+ pVESecondPane->AddAnimation(L"Bounds", *pAnimationSecondPane);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , GetLastResult(), "Propagating.");
+ }
+ }
+
+CATCH:
+
+ delete pAnimationFirstPane;
+ delete pAnimationSecondPane;
+
+ return r;
+}
+
Control*
_SplitPanelPresenter::GetPaneControl(SplitPanelPaneOrder paneOrder)
{
SplitPanel& splitPanelPublic = pSplitPanelImpl->GetPublic();
pControl = splitPanelPublic.GetPane(paneOrder);
- SysTryReturn(NID_UI_CTRL, pControl != null, null, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+ SysTryReturn(NID_UI_CTRL, pControl != null, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
return pControl;
}
-AnimatorStatus
-_SplitPanelPresenter::GetAnimationStatus(void)
+AnimationTransactionStatus
+_SplitPanelPresenter::GetTransactionStatus(void)
{
- result r = E_SUCCESS;
-
- Control* pFirstPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_FIRST);
- r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, pFirstPanelControl != null, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
-
- Control* pSecondPanelControl = GetPaneControl(SPLIT_PANEL_PANE_ORDER_SECOND);
- r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, pSecondPanelControl != null, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
-
- ControlAnimator* pControlAnimatorFirstPane = pFirstPanelControl->GetControlAnimator();
- r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
-
- ControlAnimator* pControlAnimatorSecondPane = pSecondPanelControl->GetControlAnimator();
- r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, ANIMATOR_STATUS_STOPPED, r, "[%s] Propagating.", GetErrorMessage(r));
-
- if (pControlAnimatorFirstPane->GetStatus() == ANIMATOR_STATUS_STOPPED && pControlAnimatorSecondPane->GetStatus() == ANIMATOR_STATUS_STOPPED)
+ if (AnimationTransaction::GetStatus(__transactionIdMaximize) == ANIMATION_TRANSACTION_STATUS_STOPPED &&
+ AnimationTransaction::GetStatus(__transactionIdRestore) == ANIMATION_TRANSACTION_STATUS_STOPPED)
{
- return ANIMATOR_STATUS_STOPPED;
+ return ANIMATION_TRANSACTION_STATUS_STOPPED;
}
- return ANIMATOR_STATUS_PLAYING;
+ return ANIMATION_TRANSACTION_STATUS_PLAYING;
}
FloatRectangle
{
float width = 0.0f;
float height = 0.0f;
+ float dividerPosition = 0.0f;
+ FloatRectangle clientBounds(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle firstPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
FloatRectangle secondPaneBounds(0.0f, 0.0f, 0.0f, 0.0f);
+ _ControlOrientation orientation = _CONTROL_ORIENTATION_PORTRAIT;
- float dividerPosition = __pSplitPanel->GetDividerPosition();
+ dividerPosition = __pSplitPanel->GetDividerPosition();
- FloatRectangle clientBounds = __pSplitPanel->GetBoundsF();
+ clientBounds = __pSplitPanel->GetBoundsF();
- _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
+ orientation = _ControlManager::GetInstance()->GetOrientation();
- if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
+ if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
{
- if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
- {
- GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, width);
- }
- else
- {
- GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, width);
- }
+ GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, width);
+ GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height);
+ }
+ else
+ {
+ GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, width);
+ GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height);
+ }
+ if (__pSplitPanel->GetDividerDirection() == SPLIT_PANEL_DIVIDER_DIRECTION_VERTICAL)
+ {
height = clientBounds.height;
if (height > 0.0f)
}
else
{
- if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_MOVABLE)
- {
- GET_SHAPE_CONFIG(SPLITPANEL::MOVABLE_DIVIDER_THICKNESS, orientation, height);
- }
- else
- {
- GET_SHAPE_CONFIG(SPLITPANEL::FIXED_DIVIDER_THICKNESS, orientation, height);
- }
-
width = clientBounds.width;
if (width > 0.0f)
return secondPaneBounds;
}
+VisualElementPropertyAnimation*
+_SplitPanelPresenter::GetVisualElementAnimation(Tizen::Base::String propertyName)
+{
+ result r = E_SUCCESS;
+ VisualElementPropertyAnimation* pAnimation = null;
+
+ const IVisualElementAnimationTimingFunction* pTimingFunction = VisualElementAnimation::GetTimingFunctionByName(__visualElementInterpolator);
+ SysTryReturn(NID_UI_CTRL, pTimingFunction != null, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
+
+ pAnimation = new (std::nothrow) VisualElementPropertyAnimation();
+ SysTryReturn(NID_UI_CTRL, pAnimation != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ r = pAnimation->SetPropertyName(propertyName);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+
+ r = pAnimation->SetDuration(ANIMATION_DURATION);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Propagating.");
+
+ pAnimation->SetTimingFunction(pTimingFunction);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , GetLastResult(), "Propagating.");
+
+ return pAnimation;
+
+CATCH:
+ delete pAnimation;
+
+ return null;
+}
+
}}} // Tizen::Ui::Controls
, __isPressedTimerEnabled(false)
, __isReleasedTimerEnabled(false)
, __pressedControl(TABLE_VIEW_ITEM_PRESSED_NONE)
+ , __releasedControl(TABLE_VIEW_ITEM_PRESSED_NONE)
, __pCheckedTimer(null)
, __isCheckedTimerEnabled(false)
, __isCheckedAnimationEnabled(false)
return true;
}
+ if(__isReleasedTimerEnabled)
+ {
+ StopTouchReleasedTimer();
+ FireItemTouchReleased();
+ }
+
__annexOnOffHandlerMoved = false;
__touchStartPosition = touchinfo.GetCurrentPosition(); // +++ check floating
+ if (&source == this)
+ {
+ __pressedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
+ }
+ else if (&source == __pItemAnnex)
+ {
+ __pressedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
- __itemSelected = true;
+ if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING ||
+ __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
+ {
+ __annexOnOffTouchPosition = touchinfo.GetCurrentPosition().x; // +++ check floating
+ }
+ }
+ else if (IsIndividualSelectionEnabled(source))
+ {
+ __pressedControl = TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL;
+ }
+ else
+ {
+ __pressedControl = TABLE_VIEW_ITEM_PRESSED_NONE;
+ }
if (!IsIndividualSelectionEnabled(source))
{
return true;
}
- if (__isPressedTimerEnabled)
+ if (&source == this)
{
- StopTouchPressedTimer();
+ __releasedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
+ }
+ else if (&source == __pItemAnnex)
+ {
+ __releasedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
+ }
+ else if (IsIndividualSelectionEnabled(source))
+ {
+ __releasedControl = TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL;
+ }
+ else
+ {
+ __releasedControl = TABLE_VIEW_ITEM_PRESSED_NONE;
}
- if(!__itemTouchMoved && !IsContextItem())
+ if(!__itemTouchMoved && __isPressedTimerEnabled)
{
- if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ITEM)
- {
- __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
- SetItemChanged(true);
- Invalidate();
- }
- else if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
- {
- if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
- {
- __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
- SetChecked(true);
- DrawAnnexStyle();
- }
- else if (__annexStyle != TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING &&
- __annexStyle != TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
- {
- __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
- SetItemChanged(true);
- Invalidate();
- }
- }
- else
- {
- if(__pressedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL)
- {
- __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
- SetItemChanged(true);
- Invalidate();
- }
- }
+ StopTouchPressedTimer();
- if (&source == this)
- {
- __pressedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
- }
- else if (&source == __pItemAnnex)
- {
- __pressedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
- }
- else if (IsIndividualSelectionEnabled(source))
+ if(!IsContextItem())
{
- __pressedControl = TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL;
- }
- else
- {
- __pressedControl = TABLE_VIEW_ITEM_PRESSED_NONE;
+ FireItemTouchPressed();
}
StartTouchReleasedTimer();
-
return true;
}
- if (&source == this)
- {
- __pressedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
- }
- else if (&source == __pItemAnnex)
+ FireItemTouchReleased();
+ return true;
+}
+
+void
+_TableViewItem::FireItemTouchPressed()
+{
+ __itemSelected = true;
+
+ if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ITEM)
{
- __pressedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
+ __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
+ SetItemChanged(true);
+ Invalidate();
}
- else if (IsIndividualSelectionEnabled(source))
+ else if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
{
- __pressedControl = TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL;
+ if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
+ {
+ __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
+ SetChecked(true);
+ DrawAnnexStyle();
+ }
+ else if (__annexStyle != TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING &&
+ __annexStyle != TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
+ {
+ __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
+ SetItemChanged(true);
+ Invalidate();
+ }
}
else
{
- __pressedControl = TABLE_VIEW_ITEM_PRESSED_NONE;
+ if(__pressedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL)
+ {
+ __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
+ SetItemChanged(true);
+ Invalidate();
+ }
}
- FireItemTouchRelease();
- return true;
}
void
-_TableViewItem::FireItemTouchRelease()
+_TableViewItem::FireItemTouchReleased()
{
bool fireItemEvent = false;
bool selectedItem = true;
bool checked = IsChecked();
fireItemEvent = true;
- if (__pressedControl == TABLE_VIEW_ITEM_PRESSED_ITEM)
+ if (__releasedControl == TABLE_VIEW_ITEM_PRESSED_ITEM)
{
if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK)
|| (__annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO)
SetCheckedAnimationEnabled(!checked);
}
}
- else if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
+ else if(__releasedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
{
if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
{
}
else
{
- if(__pressedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL)
+ if(__releasedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL)
{
if ((__annexStyle == TABLE_VIEW_ANNEX_STYLE_MARK)
|| (__annexStyle == TABLE_VIEW_ANNEX_STYLE_RADIO)
}
else
{
- if (__pressedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
+ if (__releasedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
{
if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING ||
__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
_UiTouchEventDelivery
_TableViewItem::OnPreviewTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
{
- return _UI_TOUCH_EVENT_DELIVERY_FORCED_YES;
+ return _UI_TOUCH_EVENT_DELIVERY_YES;
}
_UiTouchEventDelivery
else if (&timer == __pPressedTimer)
{
__isPressedTimerEnabled = false;
-
- if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ITEM)
- {
- __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
- SetItemChanged(true);
- Invalidate();
- }
- else if(__pressedControl == TABLE_VIEW_ITEM_PRESSED_ANNEX)
- {
- if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_DETAILED)
- {
- __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
- SetChecked(true);
- DrawAnnexStyle();
- }
- else if (__annexStyle != TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING &&
- __annexStyle != TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
- {
- __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL;
- SetItemChanged(true);
- Invalidate();
- }
- }
- else
- {
- if(__pressedControl != TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL)
- {
- __drawingStatus = TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED;
- SetItemChanged(true);
- Invalidate();
- }
- }
+ FireItemTouchPressed();
}
else if(&timer == __pReleasedTimer)
{
__isReleasedTimerEnabled = false;
- FireItemTouchRelease();
+ FireItemTouchReleased();
}
}
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage);
__isPressedTimerEnabled = true;
-
- if (&source == this)
- {
- __pressedControl = TABLE_VIEW_ITEM_PRESSED_ITEM;
- }
- else if (&source == __pItemAnnex)
- {
- __pressedControl = TABLE_VIEW_ITEM_PRESSED_ANNEX;
-
- if (__annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING ||
- __annexStyle == TABLE_VIEW_ANNEX_STYLE_ONOFF_SLIDING_WITH_DIVIDER)
- {
- __annexOnOffTouchPosition = touchinfo.GetCurrentPosition().x; // +++ check floating
- }
- }
- else if (IsIndividualSelectionEnabled(source))
- {
- __pressedControl = TABLE_VIEW_ITEM_PRESSED_INDIVIDUAL;
- }
- else
- {
- __pressedControl = TABLE_VIEW_ITEM_PRESSED_NONE;
- }
}
return r;
CATCH:
- if (__isPressedTimerEnabled)
+ if (__isPressedTimerEnabled && __pPressedTimer != null)
{
__pPressedTimer->Cancel();
}
return r;
}
+void
+_TableViewItem::StopTouchPressedTimer(void)
+{
+ result r = E_SUCCESS;
+
+ SysTryReturnVoidResult(NID_UI_CTRL, __pPressedTimer != null, E_SYSTEM, "[E_SYSTEM] Timer is invalid.");
+
+ if (__isPressedTimerEnabled)
+ {
+ r = __pPressedTimer->Cancel();
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ __isPressedTimerEnabled = false;
+
+ return;
+}
+
result
_TableViewItem::StartTouchReleasedTimer()
{
result r = E_SUCCESS;
- if (__pReleasedTimer == null)
+ if(__pReleasedTimer != null)
{
- __pReleasedTimer = new (std::nothrow) Timer();
- SysTryCatch(NID_UI_CTRL, __pReleasedTimer != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
-
- r = __pReleasedTimer->Construct(*this);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage);
+ delete __pReleasedTimer;
+ __pReleasedTimer = null;
}
- r = __pReleasedTimer->Start(TOUCH_RELREASED_DURATION);
+ __pReleasedTimer = new (std::nothrow) Timer();
+ SysTryCatch(NID_UI_CTRL, __pReleasedTimer != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
+ r = __pReleasedTimer->Construct(*this);
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage);
+
+ r = __pReleasedTimer->Start(TOUCH_RELEASED_DURATION);
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage);
__isReleasedTimerEnabled = true;
}
void
-_TableViewItem::StopTouchPressedTimer(void)
+_TableViewItem::StopTouchReleasedTimer(void)
{
result r = E_SUCCESS;
- SysTryReturnVoidResult(NID_UI_CTRL, __pPressedTimer != null, E_SYSTEM, "[E_SYSTEM] Timer is invalid.");
+ SysTryReturnVoidResult(NID_UI_CTRL, __pReleasedTimer != null, E_SYSTEM, "[E_SYSTEM] Timer is invalid.");
- if (__isPressedTimerEnabled)
+ if (__isReleasedTimerEnabled)
{
- r = __pPressedTimer->Cancel();
+ r = __pReleasedTimer->Cancel();
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
}
- __isPressedTimerEnabled = false;
+ __isReleasedTimerEnabled = false;
return;
}
{
if (!IsScrollEnabled())
{
- return 0;
+ return 0.0f;
}
- ResetSweepItem();
-
if (IsScrollAnimationRunning())
{
if (__scrollPositionOnFlickStarted > newPosition)
TableViewItemTag itemPos = {groupIndex, itemIndex};
StopAllItemAnimation();
+ ResetSweepItem();
if (!__pListModel->IsLoadedItem(groupIndex, itemIndex))
{
result r = GetLastResult();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ ResetSweepItem();
+
ScrollTo(scrollDistance + GetScrollPosition());
r = GetLastResult();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
__pTextBuffer[length] = 0;
- pTextObject->RemoveAll();
+ pTextObject->RemoveAll(true);
TextSimple* pSimpleText = new (std::nothrow)TextSimple(__pTextBuffer, length, TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL, pFont);
SysTryCatch(NID_UI_CTRL, pSimpleText != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
, __isEditModeEnabled(true)
, __pDescriptionTextVisualElement(null)
, __pDescriptionTextTextObject(null)
- , __pDescriptionTextFont(null)
, __isTokenEditingFinished(false)
, __prevScrollValue(0.0f)
, __scrollValue(0.0f)
, __isTouchMoveInProgress(false)
, __isTitleSliding(false)
, __touchPressInfo(Point(-1, -1))
+ , __editContentFontSize(0.0f)
{
}
{
result r = E_SUCCESS;
float descriptionTextSize = 0.0f;
+ Font *pFont = null;
+ float editFontSize = 0.0f;
__pDescriptionTextTextObject = new (std::nothrow) TextObject();
SysTryReturnResult(NID_UI_CTRL, __pDescriptionTextTextObject != null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
GET_SHAPE_CONFIG(TOKENEDIT::DESCRIPTION_TEXT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, descriptionTextSize);
- __pDescriptionTextFont = new (std::nothrow) Font();
- SysTryCatch(NID_UI_CTRL, __pDescriptionTextFont != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+ pFont = GetFont();
+ SysTryCatch(NID_UI_CTRL, pFont != null, , r, "[%s] Propagating.", GetErrorMessage(r));
- r = __pDescriptionTextFont->Construct(GetTitleFontFaceName(), FONT_STYLE_PLAIN, descriptionTextSize);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- r = __pDescriptionTextTextObject->SetFont(__pDescriptionTextFont, 0, __pDescriptionTextTextObject->GetTextLength());
+ editFontSize = GetTextSize();
+ (_FontImpl::GetInstance(*pFont))->SetSize(descriptionTextSize);
+
+ r = __pDescriptionTextTextObject->SetFont(pFont, 0, __pDescriptionTextTextObject->GetTextLength());
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ (_FontImpl::GetInstance(*pFont))->SetSize(editFontSize);
+
return r;
CATCH:
delete __pDescriptionTextTextObject;
__pDescriptionTextTextObject = null;
- delete __pDescriptionTextFont;
- __pDescriptionTextFont = null;
-
return r;
}
delete __pDescriptionTextTextObject;
__pDescriptionTextTextObject = null;
- if (__pDescriptionTextFont)
- {
- delete __pDescriptionTextFont;
- __pDescriptionTextFont = null;
- }
-
if (__pTimingFunction)
{
delete __pTimingFunction;
float textSize = 0.0f;
GET_SHAPE_CONFIG(TOKENEDIT::TEXT_SIZE, orientation, textSize);
- Font* pFont = new (std::nothrow) Font();
- SysTryCatch(NID_UI_CTRL, pFont != null, , r = E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
-
- r = pFont->Construct(FONT_STYLE_PLAIN, textSize);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
-
- SetFont(*pFont);
+ __editContentFontSize = textSize;
- delete pFont;
- pFont = null;
+ _EditPresenter::SetTextSize(__editContentFontSize);
__pTokenList = new (std::nothrow) Collection::LinkedList();
SysTryCatch(NID_UI_CTRL, __pTokenList != null, , r = E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
delete pTokenEditModel;
pTokenEditModel = null;
- delete pFont;
- pFont = null;
-
delete __pTokenBgBitmap;
__pTokenBgBitmap = null;
pTokenCanvas->Clear();
Color selectedTokenColor = GetTokenEditColor(EXPANDABLE_EDIT_AREA_TOKEN_STATUS_SELECTED);
+ Bitmap* pReplacementColorBackgroundBitmap = null;
if (__pTokenBgBitmap)
{
- Bitmap* pReplacementColorBackgroundBitmap = null;
pReplacementColorBackgroundBitmap = _BitmapImpl::GetColorReplacedBitmapN(*__pTokenBgBitmap, Color::GetColor(COLOR_ID_MAGENTA), selectedTokenColor);
if (_BitmapImpl::CheckNinePatchedBitmapStrictly(*pReplacementColorBackgroundBitmap))
delete pTokenCanvas;
pTokenCanvas = null;
+
+ delete pReplacementColorBackgroundBitmap;
}
}
else
SysTryReturnVoidResult(NID_UI_CTRL, pCanvas, E_SYSTEM, "[E_SYSTEM] A system error has occurred. Failed to get visual element of Control.");
_EditPresenter::DrawText(*pCanvas);
+
+ delete pCanvas;
+ pCanvas = null;
}
}
}
}
else
{
- //DrawText(canvas);
DrawText();
InitializeCursor();
}
{
SysTryReturnResult(NID_UI_CTRL, !__isEditingToken, E_SYSTEM, "An invalid argument is given.");
- //DrawText(canvas);
DrawText();
InitializeCursor();
}
if (__isTokenEditingFinished)
{
- _EditPresenter::SetDefaultFont();
-
__isEditingToken = false;
__edittingTokenIndex = -1;
+ _EditPresenter::SetTextSize(__editContentFontSize);
+
__isTokenEditingFinished = false;
}
r = __pTokenList->InsertAt(*pToken, index);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to insert token.", GetErrorMessage(r));
- if (__isEditingToken)
- {
- _EditPresenter::SetFont(*(pToken->pFont));
- }
-
r = ClearText();
r = CalculateTokenPositionFromIndex(index);
r = ClearText();
SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, "Failed to clear text object.");
- _EditPresenter::SetDefaultFont();
+ _EditPresenter::SetTextSize(__editContentFontSize);
}
r = __pTokenList->RemoveAt(index, true);
SysAssertf(__pDescriptionTextTextObject != null, "The TextObject instance is null.");
- __pDescriptionTextTextObject->RemoveAll();
+ __pDescriptionTextTextObject->RemoveAll(true);
pSimpleText = new (std::nothrow)TextSimple(pTempString, length, TEXT_ELEMENT_SOURCE_TYPE_INTERNAL);
__pDescriptionTextTextObject->AppendElement(*pSimpleText);
float descriptionTextSize = 0.0f;
GET_SHAPE_CONFIG(TOKENEDIT::DESCRIPTION_TEXT_SIZE, _CONTROL_ORIENTATION_PORTRAIT, descriptionTextSize);
- pDescriptionFont = new (std::nothrow) Font();
- SysTryReturn(NID_UI_CTRL, pDescriptionFont != null, false, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
-
- r = pDescriptionFont->Construct(GetTitleFontFaceName(), FONT_STYLE_PLAIN, descriptionTextSize);
-
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- r = __pDescriptionTextTextObject->SetFont(pDescriptionFont, 0, __pDescriptionTextTextObject->GetTextLength());
-
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+ pDescriptionFont = GetFont();
+ if (pDescriptionFont)
+ {
+ float editFontSize = GetTextSize();
+ (_FontImpl::GetInstance(*pDescriptionFont))->SetSize(descriptionTextSize);
- delete __pDescriptionTextFont;
- __pDescriptionTextFont = null;
+ r = __pDescriptionTextTextObject->SetFont(pDescriptionFont, 0, __pDescriptionTextTextObject->GetTextLength());
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error has occurred. SetFont failed");
- __pDescriptionTextFont = pDescriptionFont;
+ (_FontImpl::GetInstance(*pDescriptionFont))->SetSize(editFontSize);
+ }
}
pRootElement = __pTokenEdit->GetVisualElement();
__pDescriptionTextTextObject->Draw(*_CanvasImpl::GetInstance(*pDescriptionTextCanvas));
delete pDescriptionTextCanvas;
- return true;
-CATCH:
- if (pDescriptionFont == __pDescriptionTextFont)
- {
- __pDescriptionTextFont = null;
- }
- delete pDescriptionFont;
+ return true;
+CATCH:
if (__pDescriptionTextVisualElement != null)
{
__pDescriptionTextVisualElement->Destroy();
float tokenHeight = 0.0f;
float tokenVerticalSpacing = 0.0f;
float tokenTextLeftMargin = 0.0f;
+ float tokenFontSize = 0.0f;
_ControlOrientation orientation = __pTokenEdit->GetOrientation();
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_HEIGHT, orientation, tokenHeight);
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_VERTICAL_SPACING, orientation, tokenVerticalSpacing);
GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_LEFT_MARGIN, orientation, tokenTextLeftMargin);
+ GET_SHAPE_CONFIG(TOKENEDIT::TOKEN_TEXT_SIZE, orientation, tokenFontSize);
_Token* pToken = static_cast <_Token*>(__pTokenList->GetAt(index));
SysTryReturnResult(NID_UI_CTRL, pToken != null, E_SYSTEM, "A system error has occurred. The _Token instance is null");
{
SetText(pToken->GetText());
}
- pToken->pTextObject->RemoveAll();
+ pToken->pTextObject->RemoveAll(true);
}
- _EditPresenter::SetFont(*(pToken->pFont));
+
+ __editContentFontSize = GetTextSize();
+ _EditPresenter::SetTextSize(tokenFontSize);
SetTextBounds(tempTextDspRect);
__isEditingToken = false;
__edittingTokenIndex = -1;
- _EditPresenter::SetDefaultFont();
+ _EditPresenter::SetTextSize(__editContentFontSize);
__isTokenEditingFinished = false;
ClearText();
return _EditPresenter::SetFlexBounds(bounds);
}
+result
+_TokenEditPresenter::SetTextSize(const int size)
+{
+ result r = E_SUCCESS;
+ if (__isEditingToken)
+ {
+ __editContentFontSize = size;
+ }
+ else
+ {
+ r = _EditPresenter::SetTextSize(size);
+ }
+
+ return r;
+}
+
+result
+_TokenEditPresenter::SetTextSize(const float size)
+{
+ result r = E_SUCCESS;
+ if (__isEditingToken)
+ {
+ __editContentFontSize = size;
+ }
+ else
+ {
+ r = _EditPresenter::SetTextSize(size);
+ }
+
+ return r;
+}
+
bool
_TokenEditPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo)
{
__pressedTokenIndex = -1;
__edittingTokenIndex = -1;
__isEditingToken = false;
- _EditPresenter::SetDefaultFont();
+ _EditPresenter::SetTextSize(__editContentFontSize);
__isTokenEditingFinished = false;
AdjustFlexibleHeight();
if (itemIndex != -1 && itemIndex == currentSelectedItemIndex && __pItems.at(itemIndex) != null) // same item selected
{
- if (!IsInitialDraw())
+ if (!IsInitialDraw() && fire)
{
PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
}
if (__pItems.at(itemIndex) != null)
{
- if (!IsInitialDraw())
+ if (!IsInitialDraw() && fire)
{
PLAY_FEEDBACK(_RESOURCE_FEEDBACK_PATTERN_TAP);
}
dimension = pParent->TranslateSize(dimension);
bounds.height = dimension.height;
- if (__transparent)
+ if (__transparent || !IsVisible())
{
bounds.y -= bounds.height;
}
blockWidth[0] = minItemLength;
}
+ tabLeftMargin = footerLeftMargin;
+ itemButtonLeftGap = footerLeftMargin;
+ __itemArea.width -= ((tabLeftMargin + iconSize + itemButtonLeftGap) * 2);
+
+ if (blockWidth[0] > __itemArea.width)
+ {
+ blockWidth[0] = __itemArea.width;
+ }
+
if (__header == true && __style == TOOLBAR_TEXT && GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) // sip
{
__pItems.at(0)->SetBounds(FloatRectangle((GetSizeF().width - blockWidth[0]) / 2, sipFooterItemTopMargin, blockWidth[0], itemHeight));
blockWidth[1] = minItemLength;
}
+ tabLeftMargin = footerLeftMargin;
+ itemButtonLeftGap = footerLeftMargin;
+ __itemArea.width -= ((tabLeftMargin + iconSize + itemButtonLeftGap) * 2);
+
+ if (blockWidth[0] > (__itemArea.width - itemGap * 2) / 2)
+ {
+ blockWidth[0] = (__itemArea.width - itemGap * 2) / 2;
+ }
+
+ if (blockWidth[1] > (__itemArea.width - itemGap * 2) / 2)
+ {
+ blockWidth[1] = (__itemArea.width - itemGap * 2) / 2;
+ }
+
if (__header == true && __style == TOOLBAR_TEXT && GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) // sip
{
__pItems.at(0)->SetBounds(FloatRectangle(GetSizeF().width / 2 - itemGap - blockWidth[0], sipFooterItemTopMargin, blockWidth[0], itemHeight));
result FireActionEvent(int actionId);
result FireDateTimeChangeEvent(_DateTimeChangeStatus status);
- virtual bool IsActivatedOnOpen(void) const;
virtual void OnDraw(void);
virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
virtual void OnTouchMoveHandled(const Tizen::Ui::_Control& control);
virtual result OnAttachedToMainTree(void);
virtual result OnDetachingFromMainTree(void);
+ virtual void OnActivated(void);
+ virtual void OnDeactivated(void);
virtual bool OnFlickGestureDetected(_TouchFlickGestureDetector& gesture);
virtual bool OnFlickGestureCanceled(_TouchFlickGestureDetector& gesture);
void AddAccessibilityElement(const Tizen::Graphics::FloatRectangle& itemBounds, const Tizen::Base::String& itemText);
void SetFont(Tizen::Graphics::Font& pFont);
void SetParentWindowBounds(Tizen::Graphics::FloatRectangle& parentWindowBounds);
Tizen::Graphics::FloatRectangle GetParentWindowBounds() const;
+ void RefreshItems(void);
// accessibility listener
virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element);
virtual bool OnFlickGestureDetected(int distanceX,int distanceY,int duration);
void StartFlickAnimation(void);
void StartAnimationEffect(void);
- void SetInitialAnimationValue(int animationValue);
+ void SetInitialAnimationValue(float animationValue);
void SetFont(Tizen::Graphics::Font& pFont);
virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element);
result DeleteCharacterAt(int index);
result DeleteCharacterAtCursorPosition(void);
void SetCursorDisabled(bool disabled);
- void SetPressedGuideTextColor(const Tizen::Graphics::Color& color);
- Tizen::Graphics::Color GetPressedGuideTextColor(void) const;
result HideKeypad(void);
void InitializeColorInformation(void);
void SetViewModeColorInformation(bool enabled);
result SetEllipsisPosition(EllipsisPosition position);
virtual result SetFlexBounds(const Tizen::Graphics::Rectangle& bounds);
virtual result SetFlexBounds(const Tizen::Graphics::FloatRectangle& bounds);
- result SetTextSize(const int size);
- result SetTextSize(const float size);
+ virtual result SetTextSize(const int size);
+ virtual result SetTextSize(const float size);
result SetFont(const Tizen::Graphics::Font& font);
result AdjustFont(Tizen::Graphics::Font& font, _EditFontChange fontChange = EDIT_FONT_CHANGE_CONTENT);
result SetFontType(const Tizen::Base::String& typefaceName, unsigned long styleMask);
bool GetCursorChangedFlag(void) const;
void SetAutoShrinkModeEnabled(bool enable);
bool IsAutoShrinkModeEnabled(void) const;
- result SetDefaultFont(void);
void SetEditGroupStyle(GroupStyle groupStyle);
void ScrollPanelToCursorPosition(bool show = true);
void SetSearchBarFlag(bool enabled);
// Focus UI
Tizen::Base::Collection::IListT<_Control*>* GetFocusList(void) const;
- void MakeFocusList(const _Control* pControl, Tizen::Base::Collection::IListT<_Control*>* pFocusControlList) const;
- void MakeChildContainerFocusList(_Control* pControl, int startIndex) const;
// Accessor
protected:
virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds);
virtual bool IsLayoutChangable(void) const;
virtual void OnOwnerChanged(_Control* pOldOwner);
+ virtual void UpdateClientBounds(const Tizen::Graphics::FloatDimension& size, Tizen::Graphics::FloatRectangle& clientBounds);
// Accessor
public:
bool __isUsableCancelButton;
bool __isUserContainerBounds;
bool __isCancelActionInProgress;
+ bool __isUserGuideTextColor;
CoreKeypadAction __keypadAction;
int __bottomGroup;
int __topGroup;
int __loadedCount;
+ bool __isFullUpdate;
_SlidableGroupedListItemProvider* __pItemProvider;
Tizen::Base::Collection::LinkedList __slidableListenersList;
Tizen::Base::Collection::LinkedList __itemListenersList;
class _SliderPresenter
: public Tizen::Base::Object
+ , public Tizen::Base::Runtime::ITimerEventListener
{
public:
virtual ~_SliderPresenter(void);
result SetThumbBitmap(SliderThumbStatus status, const Tizen::Graphics::Bitmap& bitmap);
void SetThumbTextColor(SliderThumbStatus status, const Tizen::Graphics::Color& color);
+ virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
+
private:
- int CalculateSliderValue(int positionX, int offsetX);
+ int CalculateSliderValue(float positionX, float offsetX);
result Resize(void);
result LoadBitmap(void);
result DrawSlider(void);
Tizen::Graphics::FloatRectangle __barRect;
Tizen::Graphics::FloatRectangle __handleRect;
+ Tizen::Base::Runtime::Timer* __pSlideTimer;
+
Tizen::Graphics::Bitmap* __pResourceBgTopBitmap;
Tizen::Graphics::Bitmap* __pResourceBgMiddleBitmap;
Tizen::Graphics::Bitmap* __pResourceBgBottomBitmap;
bool __isSliderPressed;
bool __isNeedToBeUpdated;
- bool __isBubblingBlocked;
bool __isResourceLoaded;
bool __isCustomHandle;
bool __isCustomPressedTextColor;
GroupStyle __groupStyle;
float __fontSize;
float __barOffset;
+
+ bool __isTimerRunning;
+
+ Tizen::Graphics::FloatPoint __currentPosition;
+ static const int __timerValue = 5;
}; // _SliderPresenter
}}} // Tizen::Ui::Controls
virtual bool OnAccessibilityValueIncreased(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
virtual bool OnAccessibilityValueDecreased(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
-
public:
result AddSplitPanelEventListener(const _ISplitPanelEventListener& listener);
result RemoveSplitPanelEventListener(const _ISplitPanelEventListener& listener);
result SetPane(_Control* pControl, SplitPanelPaneOrder paneOrder);
_Control* GetPane(SplitPanelPaneOrder paneOrder) const;
+ _Control* GetPaneParent(SplitPanelPaneOrder paneOrder) const;
result SetDividerStyle(SplitPanelDividerStyle splitPanelDividerStyle);
SplitPanelDividerStyle GetDividerStyle(void) const;
_SplitPanel& operator =(const _SplitPanel& rhs);
private:
+ static const float ACCESSIBILITY_DIVIDER_POSITION_OFFSET = 5.0f;
+
_SplitPanelPresenter* __pSplitPanelPresenter;
_TouchTapGestureDetector* __pTapGesture;
+ Tizen::Ui::_Control* __pFirstPaneParent;
+ Tizen::Ui::_Control* __pSecondPaneParent;
Tizen::Ui::_Control* __pFirstPane;
Tizen::Ui::_Control* __pSecondPane;
void ChangePaneOrder(SplitPanelPaneOrder paneOrder);
result AnimateDivider(int destination);
result AnimatePane(int destination);
+ result AnimatePaneParent(int destination);
Tizen::Ui::Control* GetPaneControl(SplitPanelPaneOrder paneOrder);
- Tizen::Ui::Animations::AnimatorStatus GetAnimationStatus(void);
+ Tizen::Ui::Animations::AnimationTransactionStatus GetTransactionStatus(void);
Tizen::Graphics::FloatRectangle GetRestorePaneBounds(SplitPanelPaneOrder paneOrder);
+ Tizen::Ui::Animations::VisualElementPropertyAnimation* GetVisualElementAnimation(Tizen::Base::String propertyName);
private:
_SplitPanelPresenter(const _SplitPanelPresenter& value);
int __transactionIdMaximize;
int __transactionIdRestore;
- Tizen::Ui::Animations::AnimationInterpolatorType __controlAnimatorAnimationInterpolator;
- Tizen::Base::String __visualElementAnimationInterpolator;
+ Tizen::Ui::Animations::AnimationInterpolatorType __controlAnimatorInterpolator;
+ Tizen::Base::String __visualElementInterpolator;
}; // _SplitPanelPresenter;
result StartTouchPressedTimer(const _Control& source, const _TouchInfo& touchinfo);
void StopTouchPressedTimer(void);
result StartTouchReleasedTimer(void);
+ void StopTouchReleasedTimer(void);
private:
_TableViewItem(const _TableViewItem&);
result CreateItemCover(void);
result CreateItemDivider(void);
result CreateItemAnnexDivider(void);
- void FireItemTouchRelease(void);
+ void FireItemTouchReleased(void);
+ void FireItemTouchPressed(void);
private:
void* __pAppInfo;
bool __isPressedTimerEnabled;
bool __isReleasedTimerEnabled;
TableViewItemPressedControl __pressedControl;
+ TableViewItemPressedControl __releasedControl;
Tizen::Base::Runtime::Timer* __pCheckedTimer;
bool __isCheckedTimerEnabled;
static const int DEFAULT_CAPTURED_CONTROL_COUNT = 10;
static const int CHECKED_ANIMATION_DURATION = 30;
static const int TOUCH_PRESSED_DURATION = 100;
- static const int TOUCH_RELREASED_DURATION = 50;
+ static const int TOUCH_RELEASED_DURATION = 50;
static const int MAX_CHECKED_COUNT = 10;
static const float INSENSITIVE = 0.16f;
static const float SENSITIVE = 0.08f;
virtual bool OnFocusLost(void);
virtual result SetFlexBounds(const Tizen::Graphics::FloatRectangle& bounds);
+ virtual result SetTextSize(const int size);
+ virtual result SetTextSize(const float size);
// Touch callbacks
virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
Tizen::Graphics::FloatRectangle __descriptionTextRect;
- Tizen::Graphics::Font* __pDescriptionTextFont;
-
bool __isTokenEditingFinished;
float __prevScrollValue;
Tizen::Graphics::Point __touchPressInfo;
+ int __editContentFontSize;
+
}; // _TokenEditPresenter
result AddChild(_ControlImpl* pChild, bool transferOwnership = true);
result RemoveChild(_ControlImpl* pChild, bool deallocate = true);
result RemoveChild(int index);
+ void DeleteAllChildren(_ContainerImpl* pChild, bool detachSystemChild = true);
void RemoveAllChildren(bool detachSystemChild = true);
result MoveChildToTop(const _ControlImpl& child);
result MoveChildBefore(const _ControlImpl& targetChild, const _ControlImpl& child);
void SetNativeObjectFocusable(bool focusable);
// Focus UI
- void SetPreviousFocus(_Control* pPreviousFocus);
- void SetNextFocus(_Control* pNextFocus);
- _Control* GetPreviousFocus() const;
- _Control* GetNextFocus() const;
- void DrawFocus(void);
+ void SetPreviousFocus(_Control* pPreviousFocus);
+ void SetNextFocus(_Control* pNextFocus);
+ _Control* GetPreviousFocus() const;
+ _Control* GetNextFocus() const;
+ void DrawFocus(void);
+ Tizen::Base::Collection::IListT<_Control*>* GetFocusListN(void) const;
// Clipping
bool IsClipToParent(void) const;
void SetEventListener(_IntToType<_UI_EVENT_FOCUS>, _IFocusEventListener* pListener);
void SetEventListener(_IntToType<_UI_EVENT_NOTIFICAITON>, _INotificationEventListener* pListener);
+// Focus Ui
+ void MakeFocusList(const _Control* pControl, Tizen::Base::Collection::IListT<_Control*>* pFocusControlList) const;
+ void MakeChildContainerFocusList(const _Control* pControl, int startIndex, Tizen::Base::Collection::IListT<_Control*>* pFocusControlList) const;
+
private:
_ControlHandle __controlHandle;
Tizen::Base::String __name;
if (__pCurrentLayout != null)
{
- LayoutRect calculatedRect;
- GetItemWindowRect(calculatedRect);
- calculatedRect.w = measuredWidth;
- calculatedRect.h = measuredHeight;
- SetItemWindowRect(calculatedRect);
+ LayoutRect containerClientRect = {0.0f, 0.0f, measuredWidth, measuredHeight};
+ ConvertWindowToClientBounds(containerClientRect, containerClientRect);
- ConvertWindowToClientBounds(calculatedRect, calculatedRect);
-
- LayoutSize containerSize = {calculatedRect.w, calculatedRect.h};
+ LayoutSize containerSize = {containerClientRect.w, containerClientRect.h};
SetIntendedWindowSize(containerSize);
__pCurrentLayout->OnLayout(measuredWidth, measuredHeight, true);
float wrapContentWidth = 0.0f;
float wrapContentHeight = 0.0f;
- Tizen::Graphics::FloatDimension size = __pOuterControl->GetItemContentSize();
-
- if (size.width > 0 || size.height > 0)
- {
- __contentSizeState = true;
- wrapContentWidth = size.width;
- wrapContentHeight = size.height;
- }
- else
+ if (widthMode == WRAP_CONTENT || heightMode == WRAP_CONTENT)
{
- wrapContentWidth = width;
- wrapContentHeight = height;
+ Tizen::Graphics::FloatDimension size = __pOuterControl->GetItemContentSize();
+ if (size.width > 0.0f || size.height > 0.0f)
+ {
+ __contentSizeState = true;
+ wrapContentWidth = size.width;
+ wrapContentHeight = size.height;
+ }
+ else
+ {
+ __contentSizeState = false;
+ wrapContentWidth = width;
+ wrapContentHeight = height;
+ }
}
if (widthMode == NONE_MODE)
#include <new>
#include <FBaseSysLog.h>
+#include "FUi_Math.h"
#include "FUi_LayoutLayoutItemProxy.h"
#include "FUi_LayoutLayoutContainer.h"
LayoutItemProxy::GetItemWindowRect(LayoutRect& itemRect) const
{
SysAssertf(__pItem != null, "LayoutItem is invalid");
- if (__calculatedRect.x == 0 && __calculatedRect.y == 0 && __calculatedRect.w == 0 && __calculatedRect.h == 0)
+ if (_FloatCompare(__calculatedRect.x, 0.0f) && _FloatCompare(__calculatedRect.y, 0.0f) && _FloatCompare(__calculatedRect.w, 0.0f) && _FloatCompare(__calculatedRect.h, 0.0f))
{
__pItem->GetItemWindowRect(itemRect);
}
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+#include "FUi_ResourceConfigMacro.h"
+
+START_UI_CONFIG(FOCUSUI);
+{
+ ADD_IMAGE_CONFIG(FOCUS,#00_focus.#.png);
+}
+END_UI_CONFIG(FOCUSUI);
+
ADD_SHAPE_CONFIG(FOOTER_ITEM_BUTTON_STYLE_ICON_SIZE, 48);
ADD_SHAPE_CONFIG(FOOTER_ITEM_BUTTON_STYLE_ICON_SIZE_WITH_TEXT, 40);
ADD_SHAPE_CONFIG(FOOTER_ITEM_BUTTON_STYLE_SIDE_MARGIN, 28);
- ADD_SHAPE_CONFIG(FOOTER_ITEM_BUTTON_STYLE_ITEM_GAP, 10);
+ ADD_SHAPE_CONFIG(FOOTER_ITEM_BUTTON_STYLE_ITEM_GAP, 8);
ADD_SHAPE_CONFIG(FOOTER_ITEM_TEXT_TOP_MARGIN, 0);
ADD_SHAPE_CONFIG(ITEM_MINIMUM_WIDTH, 60);
ADD_SHAPE_CONFIG(COMMON_MINIMUM_MARGIN, 8);
ADD_COLOR_CONFIG(EDIT_BG_DISABLED, $W031D);
ADD_COLOR_CONFIG(GUIDE_TEXT_NORMAL, $W032);
ADD_COLOR_CONFIG(GUIDE_TEXT_DISABLED, $W032D);
- ADD_COLOR_CONFIG(GUIDE_TEXT_HIGHLIGHTED, $W032P);
+ ADD_COLOR_CONFIG(GUIDE_TEXT_HIGHLIGHTED, $W032);
+ ADD_COLOR_CONFIG(EDIT_TEXT_NORMAL, $W032P);
+ ADD_COLOR_CONFIG(EDIT_TEXT_DISABLED, $W032D);
+ ADD_COLOR_CONFIG(EDIT_TEXT_HIGHLIGHTED, $W032P);
ADD_COLOR_CONFIG(ICON_BG_NORMAL, $F041i);
ADD_COLOR_CONFIG(ICON_BG_DISABLED, $F041iD);
ADD_COLOR_CONFIG(CONTENT_AREA_BG_NORMAL, $B013);