gui/widget/listframe: change up/down to use setSelectedLine()

This commit is contained in:
martii
2013-07-20 15:47:24 +02:00
committed by [CST] Focus
parent d63de0902d
commit 47100f9920

View File

@@ -512,21 +512,7 @@ void CListFrame::scrollLineDown(const int lines)
if( !(m_nMode & SCROLL)) return;
if( m_nNrOfLines <= 1) return;
if(m_nSelectedLine < m_nNrOfLines - 1) {
m_nSelectedLine++;
// check if the cursor moves out of the window
if(m_nSelectedLine - m_nCurrentLine > m_nLinesPerPage-1) {
// yes, scroll to next page
//TRACE("[CListFrame] m_nSelectedLine: %d, \r\n",m_nSelectedLine);
scrollPageDown(1);
} else {
refreshLine(m_nSelectedLine-lines);
refreshLine(m_nSelectedLine);
}
} else {
setSelectedLine(0);
}
setSelectedLine((m_nSelectedLine + lines) % (m_nNrOfLines - 1));
}
void CListFrame::scrollLineUp(const int lines)
@@ -535,20 +521,7 @@ void CListFrame::scrollLineUp(const int lines)
if( !(m_nMode & SCROLL)) return;
if( m_nNrOfLines <= 1) return;
if(m_nSelectedLine > 0) {
m_nSelectedLine--;
// check if the cursor moves out of the window
if(m_nSelectedLine < m_nCurrentLine ) {
// yes, scroll to next page
//TRACE("[CListFrame] m_nSelectedLine: %d, \r\n",m_nSelectedLine);
scrollPageUp(1);
} else {
refreshLine(m_nSelectedLine+lines);
refreshLine(m_nSelectedLine);
}
} else if(m_nSelectedLine == 0) {
setSelectedLine(m_nNrOfLines - 1);
}
setSelectedLine((m_nNrOfLines - lines + m_nSelectedLine - 1) % (m_nNrOfLines - 1));
}
void CListFrame::scrollPageDown(const int pages)