Commit eb176036 authored by Cyril Deguet's avatar Cyril Deguet
Browse files

* all: replaced remaining C callbacks by commands

parent a3eb8858
......@@ -27,14 +27,15 @@
#include "../src/os_timer.hpp"
AsyncQueue::AsyncQueue( intf_thread_t *pIntf ): SkinObject( pIntf )
AsyncQueue::AsyncQueue( intf_thread_t *pIntf ): SkinObject( pIntf ),
m_cmdFlush( this )
{
// Initialize the mutex
vlc_mutex_init( pIntf, &m_lock );
// Create a timer
OSFactory *pOsFactory = OSFactory::instance( pIntf );
m_pTimer = pOsFactory->createOSTimer( Callback( this, &doFlush ) );
m_pTimer = pOsFactory->createOSTimer( m_cmdFlush );
// Flush the queue every 10 ms
m_pTimer->start( 10, false );
......@@ -129,9 +130,8 @@ void AsyncQueue::flush()
}
void AsyncQueue::doFlush( SkinObject *pObj )
void AsyncQueue::CmdFlush::execute()
{
AsyncQueue *pThis = (AsyncQueue*)pObj;
// Flush the queue
pThis->flush();
m_pParent->flush();
}
......@@ -65,8 +65,8 @@ class AsyncQueue: public SkinObject
AsyncQueue( intf_thread_t *pIntf );
virtual ~AsyncQueue();
/// Callback for the timer
static void doFlush( SkinObject *pObj );
// Callback to flush the queue
DEFINE_CALLBACK( AsyncQueue, Flush );
};
......
......@@ -44,6 +44,23 @@ class Cmd##name: public CmdGeneric \
};
/// Macro to define a "callback" command inside a class
#define DEFINE_CALLBACK( parent, action ) \
class Cmd##action: public CmdGeneric \
{ \
public: \
Cmd##action( parent *pParent ): \
CmdGeneric( pParent->getIntf() ), m_pParent( pParent ) {} \
virtual ~Cmd##action() {} \
virtual void execute(); \
virtual string getType() const { return "Cmd" #parent #action; } \
private: \
parent *m_pParent; \
\
} m_cmd##action; \
friend class Cmd##action;
/// Base class for skins commands
class CmdGeneric: public SkinObject
{
......
......@@ -37,11 +37,11 @@ CtrlButton::CtrlButton( intf_thread_t *pIntf, const GenericBitmap &rBmpUp,
VarBool *pVisible ):
CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ),
m_rCommand( rCommand ), m_tooltip( rTooltip ),
m_cmdUpOverDownOver( pIntf, this ), m_cmdDownOverUpOver( pIntf, this ),
m_cmdDownOverDown( pIntf, this ), m_cmdDownDownOver( pIntf, this ),
m_cmdUpOverUp( pIntf, this ), m_cmdUpUpOver( pIntf, this ),
m_cmdDownUp( pIntf, this ), m_cmdUpHidden( pIntf, this ),
m_cmdHiddenUp( pIntf, this )
m_cmdUpOverDownOver( this ), m_cmdDownOverUpOver( this ),
m_cmdDownOverDown( this ), m_cmdDownDownOver( this ),
m_cmdUpOverUp( this ), m_cmdUpUpOver( this ),
m_cmdDownUp( this ), m_cmdUpHidden( this ),
m_cmdHiddenUp( this )
{
// Build the images of the button
OSFactory *pOsFactory = OSFactory::instance( pIntf );
......@@ -127,74 +127,74 @@ void CtrlButton::draw( OSGraphics &rImage, int xDest, int yDest )
void CtrlButton::CmdUpOverDownOver::execute()
{
m_pControl->captureMouse();
const OSGraphics *pOldImg = m_pControl->m_pImg;
m_pControl->m_pImg = m_pControl->m_pImgDown;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImg );
m_pParent->captureMouse();
const OSGraphics *pOldImg = m_pParent->m_pImg;
m_pParent->m_pImg = m_pParent->m_pImgDown;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
}
void CtrlButton::CmdDownOverUpOver::execute()
{
m_pControl->releaseMouse();
const OSGraphics *pOldImg = m_pControl->m_pImg;
m_pControl->m_pImg = m_pControl->m_pImgUp;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImg );
m_pParent->releaseMouse();
const OSGraphics *pOldImg = m_pParent->m_pImg;
m_pParent->m_pImg = m_pParent->m_pImgUp;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
// Execute the command associated to this button
m_pControl->m_rCommand.execute();
m_pParent->m_rCommand.execute();
}
void CtrlButton::CmdDownOverDown::execute()
{
const OSGraphics *pOldImg = m_pControl->m_pImg;
m_pControl->m_pImg = m_pControl->m_pImgUp;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImg );
const OSGraphics *pOldImg = m_pParent->m_pImg;
m_pParent->m_pImg = m_pParent->m_pImgUp;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
}
void CtrlButton::CmdDownDownOver::execute()
{
const OSGraphics *pOldImg = m_pControl->m_pImg;
m_pControl->m_pImg = m_pControl->m_pImgDown;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImg );
const OSGraphics *pOldImg = m_pParent->m_pImg;
m_pParent->m_pImg = m_pParent->m_pImgDown;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
}
void CtrlButton::CmdUpUpOver::execute()
{
const OSGraphics *pOldImg = m_pControl->m_pImg;
m_pControl->m_pImg = m_pControl->m_pImgOver;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImg );
const OSGraphics *pOldImg = m_pParent->m_pImg;
m_pParent->m_pImg = m_pParent->m_pImgOver;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
}
void CtrlButton::CmdUpOverUp::execute()
{
const OSGraphics *pOldImg = m_pControl->m_pImg;
m_pControl->m_pImg = m_pControl->m_pImgUp;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImg );
const OSGraphics *pOldImg = m_pParent->m_pImg;
m_pParent->m_pImg = m_pParent->m_pImgUp;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
}
void CtrlButton::CmdDownUp::execute()
{
m_pControl->releaseMouse();
m_pParent->releaseMouse();
}
void CtrlButton::CmdUpHidden::execute()
{
const OSGraphics *pOldImg = m_pControl->m_pImg;
m_pControl->m_pImg = NULL;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImg );
const OSGraphics *pOldImg = m_pParent->m_pImg;
m_pParent->m_pImg = NULL;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
}
void CtrlButton::CmdHiddenUp::execute()
{
const OSGraphics *pOldImg = m_pControl->m_pImg;
m_pControl->m_pImg = m_pControl->m_pImgUp;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImg );
const OSGraphics *pOldImg = m_pParent->m_pImg;
m_pParent->m_pImg = m_pParent->m_pImgUp;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImg );
}
......@@ -47,11 +47,11 @@ CtrlCheckbox::CtrlCheckbox( intf_thread_t *pIntf,
m_rVariable( rVariable ),
m_rCommand1( rCommand1 ), m_rCommand2( rCommand2 ),
m_tooltip1( rTooltip1 ), m_tooltip2( rTooltip2 ),
m_cmdUpOverDownOver( pIntf, this ), m_cmdDownOverUpOver( pIntf, this ),
m_cmdDownOverDown( pIntf, this ), m_cmdDownDownOver( pIntf, this ),
m_cmdUpOverUp( pIntf, this ), m_cmdUpUpOver( pIntf, this ),
m_cmdDownUp( pIntf, this ), m_cmdUpHidden( pIntf, this ),
m_cmdHiddenUp( pIntf, this )
m_cmdUpOverDownOver( this ), m_cmdDownOverUpOver( this ),
m_cmdDownOverDown( this ), m_cmdDownDownOver( this ),
m_cmdUpOverUp( this ), m_cmdUpUpOver( this ),
m_cmdDownUp( this ), m_cmdUpHidden( this ),
m_cmdHiddenUp( this )
{
// Build the images of the checkbox
OSFactory *pOsFactory = OSFactory::instance( pIntf );
......@@ -171,78 +171,78 @@ void CtrlCheckbox::draw( OSGraphics &rImage, int xDest, int yDest )
void CtrlCheckbox::CmdUpOverDownOver::execute()
{
m_pControl->captureMouse();
const OSGraphics *pOldImg = m_pControl->m_pImgCurrent;
m_pControl->m_pImgCurrent = m_pControl->m_pImgDown;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImgCurrent );
m_pParent->captureMouse();
const OSGraphics *pOldImg = m_pParent->m_pImgCurrent;
m_pParent->m_pImgCurrent = m_pParent->m_pImgDown;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImgCurrent );
}
void CtrlCheckbox::CmdDownOverUpOver::execute()
{
m_pControl->releaseMouse();
m_pParent->releaseMouse();
// Invert the state variable
const OSGraphics *pOldImg = m_pControl->m_pImgCurrent;
m_pControl->m_pImgCurrent = m_pControl->m_pImgUp;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImgCurrent );
const OSGraphics *pOldImg = m_pParent->m_pImgCurrent;
m_pParent->m_pImgCurrent = m_pParent->m_pImgUp;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImgCurrent );
// Execute the command
m_pControl->m_pCommand->execute();
m_pParent->m_pCommand->execute();
}
void CtrlCheckbox::CmdDownOverDown::execute()
{
const OSGraphics *pOldImg = m_pControl->m_pImgCurrent;
m_pControl->m_pImgCurrent = m_pControl->m_pImgUp;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImgCurrent );
const OSGraphics *pOldImg = m_pParent->m_pImgCurrent;
m_pParent->m_pImgCurrent = m_pParent->m_pImgUp;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImgCurrent );
}
void CtrlCheckbox::CmdDownDownOver::execute()
{
const OSGraphics *pOldImg = m_pControl->m_pImgCurrent;
m_pControl->m_pImgCurrent = m_pControl->m_pImgDown;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImgCurrent );
const OSGraphics *pOldImg = m_pParent->m_pImgCurrent;
m_pParent->m_pImgCurrent = m_pParent->m_pImgDown;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImgCurrent );
}
void CtrlCheckbox::CmdUpUpOver::execute()
{
const OSGraphics *pOldImg = m_pControl->m_pImgCurrent;
m_pControl->m_pImgCurrent = m_pControl->m_pImgOver;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImgCurrent );
const OSGraphics *pOldImg = m_pParent->m_pImgCurrent;
m_pParent->m_pImgCurrent = m_pParent->m_pImgOver;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImgCurrent );
}
void CtrlCheckbox::CmdUpOverUp::execute()
{
const OSGraphics *pOldImg = m_pControl->m_pImgCurrent;
m_pControl->m_pImgCurrent = m_pControl->m_pImgUp;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImgCurrent );
const OSGraphics *pOldImg = m_pParent->m_pImgCurrent;
m_pParent->m_pImgCurrent = m_pParent->m_pImgUp;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImgCurrent );
}
void CtrlCheckbox::CmdDownUp::execute()
{
m_pControl->releaseMouse();
m_pParent->releaseMouse();
}
void CtrlCheckbox::CmdUpHidden::execute()
{
const OSGraphics *pOldImg = m_pControl->m_pImgCurrent;
m_pControl->m_pImgCurrent = NULL;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImgCurrent );
const OSGraphics *pOldImg = m_pParent->m_pImgCurrent;
m_pParent->m_pImgCurrent = NULL;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImgCurrent );
}
void CtrlCheckbox::CmdHiddenUp::execute()
{
const OSGraphics *pOldImg = m_pControl->m_pImgCurrent;
m_pControl->m_pImgCurrent = m_pControl->m_pImgUp;
m_pControl->notifyLayoutMaxSize( pOldImg, m_pControl->m_pImgCurrent );
const OSGraphics *pOldImg = m_pParent->m_pImgCurrent;
m_pParent->m_pImgCurrent = m_pParent->m_pImgUp;
m_pParent->notifyLayoutMaxSize( pOldImg, m_pParent->m_pImgCurrent );
}
......
......@@ -134,21 +134,4 @@ class CtrlGeneric: public SkinObject, public Observer<VarBool>
typedef CountedPtr<CtrlGeneric> CtrlGenericPtr;
// Macro to define a control action command
#define DEFINE_CALLBACK( control, action ) \
class Cmd##action: public CmdGeneric \
{ \
public: \
Cmd##action( intf_thread_t *pIntf, control *pControl ): \
CmdGeneric( pIntf ), m_pControl( pControl) {} \
virtual ~Cmd##action() {} \
virtual void execute(); \
virtual string getType() const { return "Cmd" #control #action; } \
private: \
control *m_pControl; \
\
} m_cmd##action; \
friend class Cmd##action;
#endif
......@@ -37,9 +37,9 @@ CtrlMove::CtrlMove( intf_thread_t *pIntf, WindowManager &rWindowManager,
CtrlFlat( pIntf, rHelp, pVisible ), m_fsm( pIntf ),
m_rWindowManager( rWindowManager ),
m_rCtrl( rCtrl ), m_rWindow( rWindow ),
m_cmdMovingMoving( pIntf, this ),
m_cmdStillMoving( pIntf, this ),
m_cmdMovingStill( pIntf, this )
m_cmdMovingMoving( this ),
m_cmdStillMoving( this ),
m_cmdMovingStill( this )
{
m_pEvt = NULL;
m_xPos = 0;
......@@ -98,33 +98,33 @@ void CtrlMove::handleEvent( EvtGeneric &rEvent )
void CtrlMove::CmdStillMoving::execute()
{
EvtMouse *pEvtMouse = (EvtMouse*)m_pControl->m_pEvt;
EvtMouse *pEvtMouse = (EvtMouse*)m_pParent->m_pEvt;
m_pControl->m_xPos = pEvtMouse->getXPos();
m_pControl->m_yPos = pEvtMouse->getYPos();
m_pParent->m_xPos = pEvtMouse->getXPos();
m_pParent->m_yPos = pEvtMouse->getYPos();
m_pControl->captureMouse();
m_pParent->captureMouse();
m_pControl->m_rWindowManager.startMove( m_pControl->m_rWindow );
m_pParent->m_rWindowManager.startMove( m_pParent->m_rWindow );
}
void CtrlMove::CmdMovingMoving::execute()
{
EvtMotion *pEvtMotion = (EvtMotion*)m_pControl->m_pEvt;
EvtMotion *pEvtMotion = (EvtMotion*)m_pParent->m_pEvt;
int xNewLeft = pEvtMotion->getXPos() - m_pControl->m_xPos +
m_pControl->m_rWindow.getLeft();
int yNewTop = pEvtMotion->getYPos() - m_pControl->m_yPos +
m_pControl->m_rWindow.getTop();
int xNewLeft = pEvtMotion->getXPos() - m_pParent->m_xPos +
m_pParent->m_rWindow.getLeft();
int yNewTop = pEvtMotion->getYPos() - m_pParent->m_yPos +
m_pParent->m_rWindow.getTop();
m_pControl->m_rWindowManager.move( m_pControl->m_rWindow, xNewLeft, yNewTop );
m_pParent->m_rWindowManager.move( m_pParent->m_rWindow, xNewLeft, yNewTop );
}
void CtrlMove::CmdMovingStill::execute()
{
m_pControl->releaseMouse();
m_pParent->releaseMouse();
m_pControl->m_rWindowManager.stopMove();
m_pParent->m_rWindowManager.stopMove();
}
......@@ -40,8 +40,8 @@ CtrlRadialSlider::CtrlRadialSlider( intf_thread_t *pIntf,
VarBool *pVisible ):
CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ), m_numImg( numImg ),
m_rVariable( rVariable ), m_minAngle( minAngle ), m_maxAngle( maxAngle ),
m_cmdUpDown( pIntf, this ), m_cmdDownUp( pIntf, this ),
m_cmdMove( pIntf, this )
m_cmdUpDown( this ), m_cmdDownUp( this ),
m_cmdMove( this )
{
// Build the images of the sequence
OSFactory *pOsFactory = OSFactory::instance( getIntf() );
......@@ -107,27 +107,27 @@ void CtrlRadialSlider::onUpdate( Subject<VarPercent> &rVariable )
void CtrlRadialSlider::CmdUpDown::execute()
{
EvtMouse *pEvtMouse = (EvtMouse*)m_pControl->m_pEvt;
EvtMouse *pEvtMouse = (EvtMouse*)m_pParent->m_pEvt;
// Change the position of the cursor, in non-blocking mode
m_pControl->setCursor( pEvtMouse->getXPos(), pEvtMouse->getYPos(), false );
m_pParent->setCursor( pEvtMouse->getXPos(), pEvtMouse->getYPos(), false );
m_pControl->captureMouse();
m_pParent->captureMouse();
}
void CtrlRadialSlider::CmdDownUp::execute()
{
m_pControl->releaseMouse();
m_pParent->releaseMouse();
}
void CtrlRadialSlider::CmdMove::execute()
{
EvtMouse *pEvtMouse = (EvtMouse*)m_pControl->m_pEvt;
EvtMouse *pEvtMouse = (EvtMouse*)m_pParent->m_pEvt;
// Change the position of the cursor, in blocking mode
m_pControl->setCursor( pEvtMouse->getXPos(), pEvtMouse->getYPos(), true );
m_pParent->setCursor( pEvtMouse->getXPos(), pEvtMouse->getYPos(), true );
}
......
......@@ -37,12 +37,12 @@ CtrlResize::CtrlResize( intf_thread_t *pIntf, CtrlFlat &rCtrl,
GenericLayout &rLayout, const UString &rHelp,
VarBool *pVisible ):
CtrlFlat( pIntf, rHelp, pVisible ), m_fsm( pIntf ), m_rCtrl( rCtrl ),
m_rLayout( rLayout ), m_cmdOutStill( pIntf, this ),
m_cmdStillOut( pIntf, this ),
m_cmdStillStill( pIntf, this ),
m_cmdStillResize( pIntf, this ),
m_cmdResizeStill( pIntf, this ),
m_cmdResizeResize( pIntf, this )
m_rLayout( rLayout ), m_cmdOutStill( this ),
m_cmdStillOut( this ),
m_cmdStillStill( this ),
m_cmdStillResize( this ),
m_cmdResizeStill( this ),
m_cmdResizeResize( this )
{
m_pEvt = NULL;
m_xPos = 0;
......@@ -105,87 +105,87 @@ void CtrlResize::handleEvent( EvtGeneric &rEvent )
void CtrlResize::CmdOutStill::execute()
{
OSFactory *pOsFactory = OSFactory::instance( m_pControl->getIntf() );
OSFactory *pOsFactory = OSFactory::instance( m_pParent->getIntf() );
pOsFactory->changeCursor( OSFactory::kResizeNWSE );
}
void CtrlResize::CmdStillOut::execute()
{
OSFactory *pOsFactory = OSFactory::instance( m_pControl->getIntf() );
OSFactory *pOsFactory = OSFactory::instance( m_pParent->getIntf() );
pOsFactory->changeCursor( OSFactory::kDefaultArrow );
}
void CtrlResize::CmdStillStill::execute()
{
OSFactory *pOsFactory = OSFactory::instance( m_pControl->getIntf() );
OSFactory *pOsFactory = OSFactory::instance( m_pParent->getIntf() );
pOsFactory->changeCursor( OSFactory::kResizeNWSE );
}
void CtrlResize::CmdStillResize::execute()
{
EvtMouse *pEvtMouse = (EvtMouse*)m_pControl->m_pEvt;
EvtMouse *pEvtMouse = (EvtMouse*)m_pParent->m_pEvt;
// Set the cursor
OSFactory *pOsFactory = OSFactory::instance( m_pControl->getIntf() );
OSFactory *pOsFactory = OSFactory::instance( m_pParent->getIntf() );
pOsFactory->changeCursor( OSFactory::kResizeNWSE );
m_pControl->m_xPos = pEvtMouse->getXPos();
m_pControl->m_yPos = pEvtMouse->getYPos();
m_pParent->m_xPos = pEvtMouse->getXPos();
m_pParent->m_yPos = pEvtMouse->getYPos();
m_pControl->captureMouse();
m_pParent->captureMouse();
m_pControl->m_width = m_pControl->m_rLayout.getWidth();
m_pControl->m_height = m_pControl->m_rLayout.getHeight();
m_pParent->m_width = m_pParent->m_rLayout.getWidth();
m_pParent->m_height = m_pParent->m_rLayout.getHeight();
}
void CtrlResize::CmdResizeStill::execute()
{
// Set the cursor
OSFactory *pOsFactory = OSFactory::instance( m_pControl->getIntf() );
OSFactory *pOsFactory = OSFactory::instance( m_pParent->getIntf() );
pOsFactory->changeCursor( OSFactory::kResizeNWSE );
m_pControl->releaseMouse();
m_pParent->releaseMouse();
}
void CtrlResize::CmdResizeResize::execute()
{
EvtMotion *pEvtMotion = (EvtMotion*)m_pControl->m_pEvt;
EvtMotion *pEvtMotion = (EvtMotion*)m_pParent->m_pEvt;
// Set the cursor
OSFactory *pOsFactory = OSFactory::instance( m_pControl->getIntf() );
OSFactory *pOsFactory = OSFactory::instance( m_pParent->getIntf() );
pOsFactory->changeCursor( OSFactory::kResizeNWSE );
int newWidth = pEvtMotion->getXPos() - m_pControl->m_xPos + m_pControl->m_width;
int newHeight = pEvtMotion->getYPos() - m_pControl->m_yPos + m_pControl->m_height;
int newWidth = pEvtMotion->getXPos() - m_pParent->m_xPos + m_pParent->m_width;
int newHeight = pEvtMotion->getYPos() - m_pParent->m_yPos + m_pParent->m_height;
// Check boundaries
if( newWidth < m_pControl->m_rLayout.getMinWidth() )
if( newWidth < m_pParent->m_rLayout.getMinWidth() )
{
newWidth = m_pControl->m_rLayout.getMinWidth();
newWidth = m_pParent->m_rLayout.getMinWidth();
}
if( newWidth > m_pControl->m_rLayout.getMaxWidth() )
if( newWidth > m_pParent->m_rLayout.getMaxWidth() )
{
newWidth = m_pControl->m_rLayout.getMaxWidth();
newWidth = m_pParent->m_rLayout.getMaxWidth();
}
if( newHeight < m_pControl->m_rLayout.getMinHeight() )
if( newHeight < m_pParent->m_rLayout.getMinHeight() )
{
newHeight = m_pControl->m_rLayout.getMinHeight();
newHeight = m_pParent->m_rLayout.getMinHeight();
}
if( newHeight > m_pControl->m_rLayout.getMaxHeight() )
if( newHeight > m_pParent->m_rLayout.getMaxHeight() )
{
newHeight = m_pControl->m_rLayout.getMaxHeight();
newHeight = m_pParent->m_rLayout.getMaxHeight();
}
// Create a resize command
CmdGeneric *pCmd = new CmdResize( m_pControl->getIntf(), m_pControl->m_rLayout,
CmdGeneric *pCmd = new CmdResize( m_pParent->getIntf(), m_pParent->m_rLayout,
newWidth, newHeight );
// Push the command in the asynchronous command queue
AsyncQueue *pQueue = AsyncQueue::instance( m_pControl->getIntf() );
AsyncQueue *pQueue = AsyncQueue::instance( m_pParent->getIntf() );
pQueue->remove( "resize" );
pQueue->push( CmdGenericPtr( pCmd ) );
}
......@@ -50,9 +50,9 @@ CtrlSliderCursor::CtrlSliderCursor( intf_thread_t *pIntf,
CtrlGeneric( pIntf, rHelp, pVisible ), m_fsm( pIntf ),
m_rVariable( rVariable ), m_tooltip( rTooltip ),
m_width( rCurve.getWidth() ), m_height( rCurve.getHeight() ),
m_cmdOverDown( pIntf, this ), m_cmdDownOver( pIntf, this ),
m_cmdOverUp( pIntf, this ), m_cmdUpOver( pIntf, this ),
m_cmdMove( pIntf, this ), m_cmdScroll( pIntf, this ),
m_cmdOverDown( this ), m_cmdDownOver( this ),
m_cmdOverUp( this ), m_cmdUpOver( this ),