* $Id$
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
- * Olivier Teulière <ipkiss@via.ecp.fr>
+ * Olivier Teulière <ipkiss@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <math.h>
# include "solaris_specific.h" // for lrint
#endif
-#define SCROLL_STEP 0.05
+#define SCROLL_STEP 0.05f
#define LINE_INTERVAL 1 // Number of pixels inserted between 2 lines
}
-void CtrlList::onUpdate( Subject<VarList> &rList )
+void CtrlList::onUpdate( Subject<VarList> &rList, void *arg )
{
autoScroll();
m_pLastSelected = NULL;
}
-void CtrlList::onUpdate( Subject<VarPercent> &rPercent )
+void CtrlList::onUpdate( Subject<VarPercent> &rPercent, void *arg )
{
// Get the size of the control
const Position *pPos = getPosition();
int direction = ((EvtScroll&)rEvent).getDirection();
double percentage = m_rList.getPositionVar().get();
+ double step = 2.0 / (double)m_rList.size();
if( direction == EvtScroll::kUp )
{
- percentage += SCROLL_STEP;
+ percentage += step;
}
else
{
- percentage -= SCROLL_STEP;
+ percentage -= step;
}
m_rList.getPositionVar().set( percentage );
}
int yPos = 0;
for( it = m_rList[m_lastPos]; it != m_rList.end() && yPos < height; it++ )
{
- UString *pStr = (UString*)((*it).m_cString.get());
- uint32_t color = ( (*it).m_playing ? m_playColor : m_fgColor );
+ UString *pStr = (UString*)(it->m_cString.get());
+ uint32_t color = ( it->m_playing ? m_playColor : m_fgColor );
// Draw the text
GenericBitmap *pText = m_rFont.drawString( *pStr, color, width );