summaryrefslogtreecommitdiff
path: root/winrt/mupdf_cpp/MainPage.xaml
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-05-16 19:26:27 +0100
committerRobin Watts <robin.watts@artifex.com>2013-05-16 19:26:27 +0100
commit0451cf6d814f172f6370b46553865c66d0933c14 (patch)
tree9a571ef5495c955b6de7bc2f3e29124163100e56 /winrt/mupdf_cpp/MainPage.xaml
parent5157d7cac960316e76ac408d1f6ec1d24867bdb7 (diff)
parent4a7e2298fff3a1972fda5c537a8c5e7c6d8f8292 (diff)
downloadmupdf-0451cf6d814f172f6370b46553865c66d0933c14.tar.xz
Merge branch 'winRT2'
Diffstat (limited to 'winrt/mupdf_cpp/MainPage.xaml')
-rw-r--r--winrt/mupdf_cpp/MainPage.xaml258
1 files changed, 258 insertions, 0 deletions
diff --git a/winrt/mupdf_cpp/MainPage.xaml b/winrt/mupdf_cpp/MainPage.xaml
new file mode 100644
index 00000000..184b3668
--- /dev/null
+++ b/winrt/mupdf_cpp/MainPage.xaml
@@ -0,0 +1,258 @@
+<Page
+ x:Class="mupdf_cpp.MainPage"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="using:winapp"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ mc:Ignorable="d">
+
+ <Page.BottomAppBar>
+ <AppBar>
+ <Grid Margin="38,0,0,0">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+ <Slider x:Name="xaml_PageSlider" Minimum="0" Maximum="10" ValueChanged="Slider_ValueChanged" Grid.Column="0" Margin="10,0" VerticalAlignment="Center" />
+ <Button x:Name="Find_File" Style="{StaticResource OpenFileAppBarButtonStyle}" Tag="OpenFile" HorizontalAlignment="Right" Grid.Column="1" Click="Picker"/>
+ </Grid>
+ </AppBar>
+ </Page.BottomAppBar>
+ <Page.TopAppBar>
+ <AppBar x:Name="TopAppBar1" AutomationProperties.Name="Top App Bar" Loaded="topAppBar_Loaded">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ </Grid.RowDefinitions>
+ <StackPanel x:Name="LeftPanel" Orientation="Horizontal">
+ </StackPanel>
+ <StackPanel x:Name="RightPanel" Orientation="Horizontal" HorizontalAlignment="Right">
+ <Button x:Name="Search" Style="{StaticResource SearchAppBarButtonStyle}" Tag="Search" Click="Searcher"/>
+ <Button x:Name="Contents" Style="{StaticResource ContentsBarButtonStyle}" Tag="Contents" Click="ContentDisplay"/>
+ <Button x:Name="Links" Style="{StaticResource LinksAppBarButtonStyle}" Tag="Links" Click="Linker"/>
+ <Button x:Name="Reflow" Style="{StaticResource ReflowAppBarButtonStyle}" Tag="Reflow" Click="Reflower"/>
+ <Button x:Name="Help" Style="{StaticResource HelpAppBarButtonStyle}" Tag="Help"/>
+ </StackPanel>
+ </Grid>
+ </AppBar>
+ </Page.TopAppBar>
+
+ <Grid x:Name="xaml_OutsideGrid">
+ <Grid.Background>
+ <LinearGradientBrush EndPoint="-0.074,-0.068" StartPoint="1.027,1.024">
+ <GradientStop Color="Black"/>
+ <GradientStop Color="White"/>
+ <GradientStop Color="White" Offset="0.919"/>
+ <GradientStop Color="#FFCDCDCD" Offset="0.741"/>
+ <GradientStop Color="#FF909090" Offset="0.524"/>
+ <GradientStop Color="#FF737373" Offset="0.421"/>
+ <GradientStop Color="#FF2A2A2A" Offset="0.155"/>
+ <GradientStop Color="#FF1A1A1A" Offset="0.097"/>
+ <GradientStop Color="#FF040404" Offset="0.018"/>
+ <GradientStop Color="#FFB3B3B3" Offset="0.651"/>
+ <GradientStop Color="#FF989898" Offset="0.556"/>
+ <GradientStop Color="#FF666666" Offset="0.375"/>
+ <GradientStop Color="#FF4B4B4B" Offset="0.278"/>
+ <GradientStop Color="#FF3A3A3A" Offset="0.215"/>
+ </LinearGradientBrush>
+ </Grid.Background>
+
+ <Grid x:Name="xaml_MainGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SizeChanged="GridSizeChanged">
+ <Canvas x:Name="xaml_zoomCanvas" HorizontalAlignment="Center" VerticalAlignment="Center" ManipulationMode="All" >
+ <!-- Horizontal flip view -->
+ <FlipView x:Name="xaml_horiz_flipView" SelectionChanged="FlipView_SelectionChanged" VerticalAlignment="Center"
+ HorizontalAlignment="Center">
+ <FlipView.ItemsPanel>
+ <ItemsPanelTemplate>
+ <VirtualizingStackPanel Orientation="Horizontal"/>
+ </ItemsPanelTemplate>
+ </FlipView.ItemsPanel>
+ <FlipView.ItemTemplate>
+ <DataTemplate>
+ <ScrollViewer
+ ZoomMode="Enabled"
+ ViewChanged="ScrollChanged"
+ HorizontalScrollMode="Auto"
+ VerticalScrollMode="Auto"
+ VerticalSnapPointsType="None"
+ HorizontalSnapPointsType="None"
+ HorizontalScrollBarVisibility="Auto"
+ VerticalScrollBarVisibility="Auto"
+ MinZoomFactor="0.25"
+ MaxZoomFactor="4">
+ <Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="{Binding Height}" Width="{Binding Width}">
+ <Image Source="{Binding Image}" Width="{Binding Width}" Height="{Binding Height}"
+ Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0"/>
+ <!-- After much work, figured out how to have a binding for the rectangles. TextBox and LinkBox are
+ a collection that is in the other main collection used for the scroll viewer. It works
+ nicely and cleanly once you figure out how to set up all the templates and the bindings -->
+ <ItemsControl ItemsSource="{Binding Path=TextBox}">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <Canvas/>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemContainerStyle>
+ <Style TargetType="ContentPresenter">
+ <Setter Property="Canvas.Left" Value="{Binding Left}"/>
+ <Setter Property="Canvas.Top" Value="{Binding Top}"/>
+ </Style>
+ </ItemsControl.ItemContainerStyle>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <Rectangle Tag="{Binding Path=Index}" Width="{Binding Path=Width}" Height="{Binding Path=Height}" Fill="{Binding Path=Color}">
+ <Rectangle.RenderTransform>
+ <TranslateTransform X="{Binding Path=X}" Y="{Binding Path=Y}"/>
+ </Rectangle.RenderTransform>
+ </Rectangle>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+
+ <ItemsControl ItemsSource="{Binding Path=LinkBox}">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <Canvas/>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemContainerStyle>
+ <Style TargetType="ContentPresenter">
+ <Setter Property="Canvas.Left" Value="{Binding Left}"/>
+ <Setter Property="Canvas.Top" Value="{Binding Top}"/>
+ </Style>
+ </ItemsControl.ItemContainerStyle>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <Rectangle Tag="{Binding Path=Index}" Width="{Binding Path=Width}" Height="{Binding Path=Height}" Fill="{Binding Path=Color}" IsTapEnabled="True" Tapped="LinkTapped">
+ <Rectangle.RenderTransform>
+ <TranslateTransform X="{Binding Path=X}" Y="{Binding Path=Y}"/>
+ </Rectangle.RenderTransform>
+ </Rectangle>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+
+ </Canvas>
+ </ScrollViewer>
+ </DataTemplate>
+ </FlipView.ItemTemplate>
+ </FlipView>
+ <!-- Vertical flip view -->
+ <FlipView x:Name="xaml_vert_flipView" SelectionChanged="FlipView_SelectionChanged" VerticalAlignment="Center"
+ HorizontalAlignment="Center" IsEnabled="False" Opacity="0">
+ <FlipView.ItemsPanel>
+ <ItemsPanelTemplate>
+ <VirtualizingStackPanel Orientation="Vertical"/>
+ </ItemsPanelTemplate>
+ </FlipView.ItemsPanel>
+ <FlipView.ItemTemplate>
+ <DataTemplate>
+ <ScrollViewer
+ ZoomMode="Enabled"
+ ViewChanged="ScrollChanged"
+ HorizontalScrollMode="Auto"
+ VerticalScrollMode="Auto"
+ VerticalSnapPointsType="None"
+ HorizontalSnapPointsType="None"
+ HorizontalScrollBarVisibility="Auto"
+ VerticalScrollBarVisibility="Auto"
+ MinZoomFactor="0.25"
+ MaxZoomFactor="4">
+ <Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="{Binding Height}" Width="{Binding Width}">
+ <Image Source="{Binding Image}" Width="{Binding Width}" Height="{Binding Height}"
+ Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0"/>
+ <ItemsControl ItemsSource="{Binding Path=TextBox}">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <Canvas/>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemContainerStyle>
+ <Style TargetType="ContentPresenter">
+ <Setter Property="Canvas.Left" Value="{Binding Left}"/>
+ <Setter Property="Canvas.Top" Value="{Binding Top}"/>
+ </Style>
+ </ItemsControl.ItemContainerStyle>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <Rectangle Width="{Binding Path=Width}" Height="{Binding Path=Height}" Fill="{Binding Path=Color}" IsTapEnabled="True" Tapped="LinkTapped">
+ <Rectangle.RenderTransform>
+ <TranslateTransform X="{Binding Path=X}" Y="{Binding Path=Y}"/>
+ </Rectangle.RenderTransform>
+ </Rectangle>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+
+ <ItemsControl ItemsSource="{Binding Path=LinkBox}">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <Canvas/>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemContainerStyle>
+ <Style TargetType="ContentPresenter">
+ <Setter Property="Canvas.Left" Value="{Binding Left}"/>
+ <Setter Property="Canvas.Top" Value="{Binding Top}"/>
+ </Style>
+ </ItemsControl.ItemContainerStyle>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <Rectangle Width="{Binding Path=Width}" Height="{Binding Path=Height}" Fill="{Binding Path=Color}">
+ <Rectangle.RenderTransform>
+ <TranslateTransform X="{Binding Path=X}" Y="{Binding Path=Y}"/>
+ </Rectangle.RenderTransform>
+ </Rectangle>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </Canvas>
+ </ScrollViewer>
+ </DataTemplate>
+ </FlipView.ItemTemplate>
+ </FlipView>
+ </Canvas>
+ <ListView x:Name="xaml_ListView" Foreground="Black" HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch" Opacity="0" IsItemClickEnabled="True"
+ ItemClick="ContentSelected" SelectionMode="Single" IsEnabled="False">
+
+ <ListView.ItemTemplate>
+ <DataTemplate>
+ <StackPanel Margin="5,5,0,0" HorizontalAlignment="Left">
+ <TextBlock TextWrapping="Wrap" Text="{Binding StringMargin}" FontFamily="Segoe UI" FontSize="20" />
+ </StackPanel>
+ </DataTemplate>
+ </ListView.ItemTemplate>
+
+ <ListView.Background>
+ <SolidColorBrush Color="LightGray"></SolidColorBrush>
+ </ListView.Background>
+ </ListView>
+ </Grid>
+ <WebView x:Name="xaml_WebView" HorizontalAlignment="Stretch" Width="Auto" Height="Auto"
+ VerticalAlignment="Stretch" Visibility="Collapsed"
+ ScrollViewer.HorizontalScrollBarVisibility="Visible"
+ ScrollViewer.VerticalScrollBarVisibility="Visible"
+ ScrollViewer.VerticalScrollMode="Enabled"
+ ScrollViewer.HorizontalScrollMode="Enabled"
+ ScrollViewer.ZoomMode="Enabled"/>
+
+ <StackPanel x:Name="xaml_ProgressStack" Opacity="1" VerticalAlignment="Center" Visibility="Collapsed">
+ <Border BorderThickness="5" BorderBrush="Black" Margin="300">
+ <StackPanel Background="LightGray" >
+ <TextBlock HorizontalAlignment="Center" Margin="10"
+ Text="Text Search Progress" FontSize="20"/>
+ <ProgressBar x:Name="xaml_Progress" Margin="5" Height="15"
+ IsIndeterminate="False" Maximum="100" VerticalAlignment="Stretch" />
+ <Button HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10" Click="CancelSearch" Height="39">
+ <TextBlock HorizontalAlignment="Center" Text="Cancel"/>
+ </Button>
+ </StackPanel>
+ </Border>
+ </StackPanel>
+
+ </Grid>
+</Page>
+