}
}
+
void CtrlSliderCursor::onUpdate( Subject<VarPercent> &rVariable, void *arg )
{
(void)rVariable; (void)arg;
}
+void CtrlSliderBg::notifyLayout( int width, int height,
+ int xOffSet, int yOffSet )
+{
+ if( width > 0 && height > 0 )
+ {
+ CtrlGeneric::notifyLayout( width, height, xOffSet, yOffSet );
+ }
+ else
+ {
+ // Compute the resize factors
+ float factorX, factorY;
+ getResizeFactors( factorX, factorY );
+ // real background size
+ int width = m_bgWidth - (int)(m_padHoriz * factorX);
+ int height = m_bgHeight - (int)(m_padVert * factorY);
+ CtrlGeneric::notifyLayout( width, height );
+ }
+}
+
+
void CtrlSliderBg::onUpdate( Subject<VarPercent> &rVariable, void*arg )
{
(void)rVariable; (void)arg;
m_position = position;
- // Compute the resize factors
- float factorX, factorY;
- getResizeFactors( factorX, factorY );
- // real background size
- int width = m_bgWidth - (int)(m_padHoriz * factorX);
- int height = m_bgHeight - (int)(m_padVert * factorY);
-
- notifyLayout( width, height );
+ // redraw the entire control
+ notifyLayout();
}
/// Method called when the control is resized
virtual void onResize();
+ /// Method called to notify are to be updated
+ virtual void notifyLayout( int witdh = -1, int height = -1,
+ int xOffSet = 0, int yOffSet = 0 );
+
/// Get the type of control (custom RTTI)
virtual string getType() const { return "slider_bg"; }