return GetCore().GetSizeF();
}
-result
-_ControlImpl::SetBounds(const Rectangle& bounds, bool callBoundsChangeCallbacks, bool callUpdateBoundsOfVisualElement)
+void
+ _ControlImpl::UpdateBuilderBounds(const Tizen::Graphics::FloatRectangle& bounds)
+{
+ FloatRectangle builderBounds;
+
+ _ControlOrientation controlOrientation = _CONTROL_ORIENTATION_PORTRAIT;
+ bool exist = GetBuilderBoundsF(controlOrientation, builderBounds);
+ if (exist)
+ {
+ if (IsAttachedToMainTree())
+ {
+ _ControlImplManager* pControlImplManager = _ControlImplManager::GetInstance();
+ OrientationStatus orientation = pControlImplManager->GetFormOrientationStatus(this);
+
+ if (orientation == ORIENTATION_STATUS_NONE)
+ {
+ return;
+ }
+
+ if (orientation == ORIENTATION_STATUS_LANDSCAPE
+ || orientation == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+ {
+ SetBuilderBounds(_CONTROL_ORIENTATION_LANDSCAPE, bounds);
+ }
+ else
+ {
+ SetBuilderBounds(_CONTROL_ORIENTATION_PORTRAIT, bounds);
+ }
+ }
+ else
+ {
+ SetBuilderBounds(_CONTROL_ORIENTATION_PORTRAIT, bounds);
+ SetBuilderBounds(_CONTROL_ORIENTATION_LANDSCAPE, bounds);
+ }
+ }
+}
+
+void
+_ControlImpl::UpdateBuilderSize(const Tizen::Graphics::FloatDimension& dimension)
{
- Rectangle builderBounds;
+ FloatRectangle builderBounds;
_ControlOrientation controlOrientation = _CONTROL_ORIENTATION_PORTRAIT;
- bool exist = GetBuilderBounds(controlOrientation, builderBounds);
- if (exist)
- {
- if (IsAttachedToMainTree())
- {
- _ControlImplManager* pControlImplManager = _ControlImplManager::GetInstance();
- OrientationStatus orientation = pControlImplManager->GetFormOrientationStatus(this);
+ _ControlImplManager* pControlImplManager = _ControlImplManager::GetInstance();
+ OrientationStatus orientation = pControlImplManager->GetFormOrientationStatus(this);
- if (orientation == ORIENTATION_STATUS_NONE)
- {
- return GetCore().SetBounds(bounds, callBoundsChangeCallbacks, callUpdateBoundsOfVisualElement);
- }
+ if (orientation == ORIENTATION_STATUS_LANDSCAPE
+ || orientation == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+ {
+ controlOrientation = _CONTROL_ORIENTATION_LANDSCAPE;
+ }
- if (orientation == ORIENTATION_STATUS_LANDSCAPE
- || orientation == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
- {
- SetBuilderBounds(_CONTROL_ORIENTATION_LANDSCAPE, bounds);
- }
- else
- {
- SetBuilderBounds(_CONTROL_ORIENTATION_PORTRAIT, bounds);
- }
- }
- else
- {
- SetBuilderBounds(_CONTROL_ORIENTATION_PORTRAIT, bounds);
- SetBuilderBounds(_CONTROL_ORIENTATION_LANDSCAPE, bounds);
- }
+ bool exist = GetBuilderBoundsF(controlOrientation, builderBounds);
+ if (exist)
+ {
+ builderBounds.width = dimension.width;
+ builderBounds.height = dimension.height;
+ UpdateBuilderBounds(builderBounds);
}
+}
+
+result
+_ControlImpl::SetBounds(const Rectangle& bounds, bool callBoundsChangeCallbacks, bool callUpdateBoundsOfVisualElement)
+{
+ UpdateBuilderBounds(_CoordinateSystemUtils::ConvertToFloat(bounds));
return GetCore().SetBounds(bounds, callBoundsChangeCallbacks, callUpdateBoundsOfVisualElement);
}
result
_ControlImpl::SetBounds(const FloatRectangle& bounds, bool callBoundsChangeCallbacks, bool callUpdateBoundsOfVisualElement)
{
- FloatRectangle builderBounds;
- _ControlOrientation controlOrientation = _CONTROL_ORIENTATION_PORTRAIT;
- bool exist = GetBuilderBoundsF(controlOrientation, builderBounds);
- if (exist)
- {
- if (IsAttachedToMainTree())
- {
- _ControlImplManager* pControlImplManager = _ControlImplManager::GetInstance();
- OrientationStatus orientation = pControlImplManager->GetFormOrientationStatus(this);
-
- if (orientation == ORIENTATION_STATUS_LANDSCAPE
- || orientation == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
- {
- SetBuilderBoundsF(_CONTROL_ORIENTATION_LANDSCAPE, bounds);
- }
- else
- {
- SetBuilderBoundsF(_CONTROL_ORIENTATION_PORTRAIT, bounds);
- }
- }
- else
- {
- SetBuilderBoundsF(_CONTROL_ORIENTATION_PORTRAIT, bounds);
- SetBuilderBoundsF(_CONTROL_ORIENTATION_LANDSCAPE, bounds);
- }
- }
+ UpdateBuilderBounds(bounds);
return GetCore().SetBounds(bounds, callBoundsChangeCallbacks, callUpdateBoundsOfVisualElement);
}
result
_ControlImpl::SetSize(const Dimension& size)
{
+ UpdateBuilderSize(_CoordinateSystemUtils::ConvertToFloat(size));
return GetCore().SetSize(size);
}
result
_ControlImpl::SetSize(const FloatDimension& size)
{
+ UpdateBuilderSize(size);
return GetCore().SetSize(size);
}
}
result
-_ControlImpl::SetBuilderBoundsF(_ControlOrientation orientation, const FloatRectangle& bounds)
+_ControlImpl::SetBuilderBounds(_ControlOrientation orientation, const FloatRectangle& bounds)
{
ClearLastResult();
virtual void OnFontInfoRequested(unsigned long& style, int& size);
virtual void OnFontInfoRequested(unsigned long& style, float& size);
virtual void OnBackgroundColorChanged(Tizen::Graphics::Color& backgroundColor);
- virtual void OnDrawFocus(void);
+ virtual void OnDrawFocus(void);
virtual void OnChildControlFocusMoved(const _Control& control);
// Event Callbacks
bool GetBuilderBounds(_ControlOrientation orientation, Tizen::Graphics::Rectangle& bounds) const;
bool GetBuilderBoundsF(_ControlOrientation orientation, Tizen::Graphics::FloatRectangle& bounds) const;
result SetBuilderBounds(_ControlOrientation orientation, const Tizen::Graphics::Rectangle& bounds);
- result SetBuilderBoundsF(_ControlOrientation orientation, const Tizen::Graphics::FloatRectangle& bounds);
+ result SetBuilderBounds(_ControlOrientation orientation, const Tizen::Graphics::FloatRectangle& bounds);
+ void UpdateBuilderBounds(const Tizen::Graphics::FloatRectangle& bounds);
+ void UpdateBuilderSize(const Tizen::Graphics::FloatDimension& dimension);
// Layout
bool IsLayoutable(void) const;