, __init(false)
, __callBoundsChange(false)
, __prevPos(0.0f, 0.0f)
+ , __boundsChangedInternally(false)
+ , __boundsChangedExternally(false)
{
//empty statement
}
FloatRectangle bounds = GetCenterAlignedRect(dim.width, dim.height);
__init = true;
_centerAlign = true;
-
+ __boundsChangedInternally = true;
r = SetBounds(bounds);
+ __boundsChangedInternally = false;
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
return GetCore().Initialize(hasTitle, bounds);
}
{
_centerAlign = true;
- if(GetXmlBounds(bounds))
+ if (__boundsChangedExternally)
{
- bounds = GetCenterAlignedRect(bounds.width, bounds.height);
+ bounds = GetCenterAlignedRect(GetBounds().width, GetBounds().height);
+ __boundsChangedInternally = true;
+ r = SetBounds(bounds);
+ __boundsChangedInternally = false;
}
else
{
- bounds = GetCenterAlignedRect(GetBounds().width, GetBounds().height);
+
+ if(GetXmlBounds(bounds))
+ {
+ bounds = GetCenterAlignedRect(bounds.width, bounds.height);
+ }
+ else
+ {
+ bounds = GetCenterAlignedRect(GetBounds().width, GetBounds().height);
+ }
+ __boundsChangedInternally = true;
+ r = SetBounds(bounds);
+ __boundsChangedInternally = false;
}
- r = SetBounds(bounds);
+
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
}
else
{
- if(GetXmlBounds(bounds))
+ if (!__boundsChangedExternally)
{
- r = SetBounds(bounds);
+ if(GetXmlBounds(bounds))
+ {
+ __boundsChangedInternally = true;
+ r = SetBounds(bounds);
+ __boundsChangedInternally = false;
+ }
}
+
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
}
void
_PopupImpl::OnBoundsChanged(void)
{
+ if (!__boundsChangedInternally && __init)
+ {
+ __boundsChangedExternally = true;
+ }
+
FloatRectangle rect = GetBoundsF();
if (__init)
{
}
_centerAlign = true;
-
+ __boundsChangedInternally = true;
result r = SetBounds(rect, true);
+ __boundsChangedInternally = false;
if (IsFailed(r))
{
// Error propagation fall through