Fixed handling page up/down in menu lists in case there are several non selectable items in a row

This commit is contained in:
Klaus Schmidinger 2005-06-12 10:02:59 +02:00
parent 903a2d5850
commit 7a990fcf88
3 changed files with 54 additions and 19 deletions

View File

@ -1239,6 +1239,8 @@ Milos Kapoun <m.kapoun@cra.cz>
Udo Richter <udo_richter@gmx.de>
for refining the formula for making volume control more linear
for fixing handling lifetime when deciding whether to delete a recording
for reporting a problem in handling page up/down in menu lists in case there are
several non selectable items in a row
Sven Kreiensen <svenk@kammer.uni-hannover.de>
for his help in keeping 'channels.conf.terr' up to date

View File

@ -3578,7 +3578,7 @@ Video Disk Recorder Revision History
- Added cThread::SetPriority() and using it in cSectionHandler::Action() to
reduce the priority of the section handler threads (as suggested by Georg Acher).
2005-06-11: Version 1.3.26
2005-06-12: Version 1.3.26
- Updated the Estonian OSD texts (thanks to Arthur Konovalov).
- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
@ -3601,3 +3601,5 @@ Video Disk Recorder Revision History
- Removed an unnecessary #include from osd.c (thanks to Wolfgang Rohdewald).
- Fixed dropping EPG events that have a zero start time or duration, in case it's
an NVOD event (thanks to Chris Warren).
- Fixed handling page up/down in menu lists in case there are several non selectable
items in a row (thanks to Udo Richter for reporting this one).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: osdbase.c 1.15 2005/01/07 16:16:41 kls Exp $
* $Id: osdbase.c 1.16 2005/06/12 09:55:56 kls Exp $
*/
#include "osdbase.h"
@ -258,7 +258,8 @@ void cOsdMenu::CursorUp(void)
{
if (current > 0) {
int tmpCurrent = current;
while (--tmpCurrent >= 0 && !SelectableItem(tmpCurrent));
while (--tmpCurrent >= 0 && !SelectableItem(tmpCurrent))
;
if (tmpCurrent < 0)
return;
if (tmpCurrent >= first)
@ -282,7 +283,8 @@ void cOsdMenu::CursorDown(void)
if (current < last) {
int tmpCurrent = current;
while (++tmpCurrent <= last && !SelectableItem(tmpCurrent));
while (++tmpCurrent <= last && !SelectableItem(tmpCurrent))
;
if (tmpCurrent > last)
return;
if (tmpCurrent <= lastOnScreen)
@ -306,33 +308,62 @@ void cOsdMenu::CursorDown(void)
void cOsdMenu::PageUp(void)
{
int oldCurrent = current;
int oldFirst = first;
current -= displayMenuItems;
first -= displayMenuItems;
int last = Count() - 1;
if (current < 0)
current = 0;
if (first < 0)
first = current = 0;
if (!SelectableItem(current)) {
current -= (current > 0) ? 1 : -1;
first = min(first, current - 1);
first = 0;
int tmpCurrent = current;
while (!SelectableItem(tmpCurrent) && --tmpCurrent >= 0)
;
if (tmpCurrent < 0) {
tmpCurrent = current;
while (++tmpCurrent <= last && !SelectableItem(tmpCurrent))
;
}
current = tmpCurrent <= last ? tmpCurrent : -1;
if (current >= 0) {
if (current < first)
first = current;
else if (current - first >= displayMenuItems)
first = current - displayMenuItems + 1;
}
if (current != oldCurrent || first != oldFirst) {
Display();
DisplayCurrent(true);
}
Display();
DisplayCurrent(true);
}
void cOsdMenu::PageDown(void)
{
int oldCurrent = current;
int oldFirst = first;
current += displayMenuItems;
first += displayMenuItems;
int count = Count();
if (current > count - 1) {
current = count - 1;
first = max(0, count - displayMenuItems);
int last = Count() - 1;
int tmpCurrent = current;
while (!SelectableItem(tmpCurrent) && ++tmpCurrent <= last)
;
if (tmpCurrent > last) {
tmpCurrent = current;
while (--tmpCurrent >= 0 && !SelectableItem(tmpCurrent))
;
}
if (!SelectableItem(current)) {
current += (current < count - 1) ? 1 : -1;
first = max(first, current - displayMenuItems);
current = tmpCurrent > 0 ? tmpCurrent : -1;
if (current >= 0) {
if (current < first)
first = current;
else if (current - first >= displayMenuItems)
first = current - displayMenuItems + 1;
}
if (current != oldCurrent || first != oldFirst) {
Display();
DisplayCurrent(true);
}
Display();
DisplayCurrent(true);
}
void cOsdMenu::Mark(void)