From 99247bbc3bb0478e5c0ec8f7dccde1b4fe125a5f Mon Sep 17 00:00:00 2001
From: p4plus2 <p4plus2@gmail.com>
Date: Wed, 10 Dec 2014 23:19:22 -0800
Subject: [PATCH] Feature: Added page up/down support

---
 src/platform/wxwidgets/editor-movie.cpp | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/platform/wxwidgets/editor-movie.cpp b/src/platform/wxwidgets/editor-movie.cpp
index 2cf6bb6..48f55a3 100644
--- a/src/platform/wxwidgets/editor-movie.cpp
+++ b/src/platform/wxwidgets/editor-movie.cpp
@@ -767,8 +767,8 @@ private:
 		void on_mouse(wxMouseEvent& e);
 		void on_popup_menu(wxCommandEvent& e);
 		uint64_t moviepos;
-	private:
 		int get_lines();
+	private:
 		void render(text_framebuffer& fb, unsigned long long pos);
 		void on_mouse0(unsigned x, unsigned y, bool polarity, bool shift, unsigned X, unsigned Y);
 		void on_mouse1(unsigned x, unsigned y, bool polarity);
@@ -2418,6 +2418,19 @@ void wxeditor_movie::on_keyboard_down(wxKeyEvent& e)
 {
 	CHECK_UI_THREAD;
 	handle_wx_keyboard(inst, e, true);
+    
+	int64_t pos = moviepanel->moviepos;
+	if(e.GetKeyCode() == WXK_PAGEUP){
+		pos -= lines_to_display;
+	}else if(e.GetKeyCode() == WXK_PAGEDOWN){
+		pos += lines_to_display;
+	}else{
+        return;
+    }
+	
+	moviepanel->moviepos = max((int64_t)0, min((int64_t)(moviepanel->get_lines() - lines_to_display), pos));
+	moviepanel->signal_repaint();
+    
 }
 
 void wxeditor_movie::on_keyboard_up(wxKeyEvent& e)
-- 
2.2.0

