--- a/mainwindow.cpp Sat Nov 27 09:58:18 2010 -0800
+++ b/mainwindow.cpp Mon Jan 17 09:08:22 2011 -0800
@@ -68,6 +68,8 @@
iMoveMenu->addAction(new IpeAction(ENextView, "Next view", "PgDown", this));
iMoveMenu->addAction(new IpeAction(EPreviousView, "Previous view", "PgUp", this));
+ iMoveMenu->addAction(new IpeAction(ENextPage, "Next page", "N", this));
+ iMoveMenu->addAction(new IpeAction(EPreviousPage, "Previous ", "P", this));
iMoveMenu->addAction(new IpeAction(EFirstView, "First view", "Home", this));
iMoveMenu->addAction(new IpeAction(ELastView, "Last view", "End", this));
iMoveMenu->addAction(new IpeAction(EJumpTo, "Jump to...", "J", this));
@@ -134,6 +136,12 @@
case EPreviousView:
nextView(-1);
break;
+ case ENextPage:
+ nextPage(+1);
+ break;
+ case EPreviousPage:
+ nextPage(-1);
+ break;
case EFirstView:
firstView();
break;
@@ -285,6 +293,19 @@
setView();
}
+void MainWindow::nextPage(int delta)
+{
+ int newPageNo = iPageNo + delta;
+ newPageNo = (newPageNo < 0 ? 0 : newPageNo);
+ newPageNo = (newPageNo > iDoc->countPages() - 1 ? iDoc->countPages() - 1 : newPageNo);
+ if (newPageNo != iPageNo)
+ {
+ iPageNo = newPageNo;
+ iViewNo = 0;
+ setView();
+ }
+}
+
void MainWindow::firstView()
{
iPageNo = 0;
--- a/mainwindow.h Sat Nov 27 09:58:18 2010 -0800
+++ b/mainwindow.h Mon Jan 17 09:08:22 2011 -0800
@@ -58,6 +58,7 @@
{
EOpen, EQuit, EFullScreen, EFitPage,
EZoomIn, EZoomOut, ENextView, EPreviousView, EFirstView, ELastView,
+ ENextPage, EPreviousPage,
ENumActions, EToggleTimeCounting, ETimeCountdown, ESetTime,
EJumpTo, EShowPresentation
};
@@ -67,6 +68,7 @@
// void zoom(int delta);
void nextView(int delta);
+ void nextPage(int delta);
void firstView();
void lastView();
void fitBox(const Rect &box, Canvas* canvas);