#include <FBaseErrorDefine.h>
#include <FGrp_BitmapImpl.h>
#include "FUiAnim_VisualElement.h"
-#include "FUiCtrl_SliderOverlay.h"
#include "FUi_ResourceManager.h"
+#include "FUi_EcoreEvasMgr.h"
+#include "FUi_EcoreEvas.h"
+#include "FUiCtrl_SliderOverlay.h"
+
using namespace Tizen::Graphics;
, __overlayTextColor(0)
, __pFont(null)
, __pOwner(null)
+ , __overlayWidth(-1.0f)
{
Tizen::Ui::Animations::_VisualElement* pBase = GetVisualElement();
_SliderOverlay::SetFont(Tizen::Graphics::Font* pFont)
{
__pFont = pFont;
+ __overlayWidth = -1.0f;
return;
}
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
(_FontImpl::GetInstance(*__pFont))->SetSize(overlayTextSize);
+
+ if (__overlayWidth == -1.0f)
+ {
+ int fixedValue = 999;
+ Tizen::Base::String fixedText;
+ fixedText.Append(fixedValue);
+ __pFont->GetTextExtent(fixedText, fixedText.GetLength(), textDim);
+ __overlayWidth = textDim.width + 2 * overlayLeftMargin;
+ }
+
__pFont->GetTextExtent(text, text.GetLength(), textDim);
if (text.GetLength() == SLIDER_OVERLAY_SINGLE_DIGIT)
return E_SYSTEM;
}
+result
+_SliderOverlay::OnBoundsChanging(const FloatRectangle& bounds)
+{
+ _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+ SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+ FloatRectangle newBounds( bounds.x, bounds.y , __overlayWidth, bounds.height);
+
+ pEcoreEvas->SetWindowBounds(*GetRootWindow(), newBounds);
+ result r = GetLastResult();
+ SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage);
+ return r;
+}
+
bool
_SliderOverlay::IsActivatedOnOpen(void) const
{
void SetFont(Tizen::Graphics::Font* pFont);
result DrawSliderOverlay(int positionX,int handleWidth, int value);
+ virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds);
virtual bool IsActivatedOnOpen(void) const;
virtual result OnAttachedToMainTree(void);
virtual result OnDetachingFromMainTree(void);
Tizen::Graphics::Font* __pFont;
_Control* __pOwner;
+ float __overlayWidth;
}; // _SliderOverlay