From 77ceaf6e2398957fe53a5056c24413b21e548f4b Mon Sep 17 00:00:00 2001 From: Michael Vrhel Date: Fri, 25 Oct 2013 23:01:21 -0700 Subject: Fix UI so that consistent zoom size is maintained as pages changed. Also fix issue that occurs in Windows 8.1 with an unhandled exception if a mouse scroll occurs before a document is even opened. Fix issue with keyboard based update of page slider. --- platform/winrt/mupdf_cpp/DocumentPage.h | 37 +++++++ platform/winrt/mupdf_cpp/MainPage.xaml | 2 +- platform/winrt/mupdf_cpp/MainPage.xaml.cpp | 158 +++++++++++++++++++++-------- platform/winrt/mupdf_cpp/MainPage.xaml.h | 11 +- 4 files changed, 160 insertions(+), 48 deletions(-) (limited to 'platform/winrt/mupdf_cpp') diff --git a/platform/winrt/mupdf_cpp/DocumentPage.h b/platform/winrt/mupdf_cpp/DocumentPage.h index 41c83bc3..336e6007 100644 --- a/platform/winrt/mupdf_cpp/DocumentPage.h +++ b/platform/winrt/mupdf_cpp/DocumentPage.h @@ -27,6 +27,8 @@ namespace mupdf_cpp int height; int width; double zoom; + int native_height; + int native_width; WriteableBitmap^ image; Page_Content_t content; IVector^ textbox; @@ -94,6 +96,7 @@ namespace mupdf_cpp throw ref new Platform::InvalidArgumentException(); } height = value; + DocumentPage::OnPropertyChanged("Height"); } } @@ -111,6 +114,40 @@ namespace mupdf_cpp throw ref new Platform::InvalidArgumentException(); } width = value; + DocumentPage::OnPropertyChanged("Width"); + } + } + property int NativeHeight + { + int get() + { + return native_height; + } + + void set(int value) + { + if (value < 0) + { + throw ref new Platform::InvalidArgumentException(); + } + native_height = value; + } + } + + property int NativeWidth + { + int get() + { + return native_width; + } + + void set(int value) + { + if (value < 0) + { + throw ref new Platform::InvalidArgumentException(); + } + native_width = value; } } diff --git a/platform/winrt/mupdf_cpp/MainPage.xaml b/platform/winrt/mupdf_cpp/MainPage.xaml index eaf096e3..a38ba136 100644 --- a/platform/winrt/mupdf_cpp/MainPage.xaml +++ b/platform/winrt/mupdf_cpp/MainPage.xaml @@ -14,7 +14,7 @@ - +