Skip to content

Commit

Permalink
Added More Text Customizations
Browse files Browse the repository at this point in the history
  • Loading branch information
changbowen committed Oct 7, 2016
1 parent 44ae74e commit 4ac2e93
Show file tree
Hide file tree
Showing 12 changed files with 263 additions and 161 deletions.
8 changes: 4 additions & 4 deletions Application.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Startup="Application_Startup">
<Application.Resources>
<!--<ResourceDictionary>
<!--<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Localization/StringResources.zh-CN.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>-->
</Application.Resources>
</ResourceDictionary>
</Application.Resources>-->
</Application>
1 change: 1 addition & 0 deletions Application.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
dict.Source = New Uri("Localization/StringResources.xaml", UriKind.Relative)
End Select
Me.Resources.MergedDictionaries.Add(dict)

Dim win As New MainWindow
win.Show()
End Sub
Expand Down
2 changes: 1 addition & 1 deletion ControlWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Window x:Class="ControlWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="{Binding Mode=OneTime, Source={StaticResource control}, StringFormat='\{0} (F1)'}" Height="140" Width="355.786" ResizeMode="CanMinimize" Closing="Window_Closing" Icon="KenBurns.ico" PreviewKeyDown="Window_PreviewKeyDown">
Title="{Binding Mode=OneTime, Source={StaticResource control}, StringFormat='\{0} (F1)'}" Height="140" Width="355.786" ResizeMode="CanMinimize" Closing="Window_Closing" Icon="KenBurns.ico" PreviewKeyDown="Window_PreviewKeyDown" UseLayoutRounding="True">
<Canvas>
<Button x:Name="Btn_SwitchImage" Canvas.Left="10" Canvas.Top="10" Width="196" Height="24">
<Button.Content>
Expand Down
93 changes: 72 additions & 21 deletions EditWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
<Window x:Class="EditWindow"
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="{StaticResource edit slides}" Height="394" Width="619.5" Icon="KenBurns.ico" Loaded="Window_Loaded">
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="EditWindow"
Title="{StaticResource edit slides}" Height="520" Width="620" Icon="KenBurns.ico" Loaded="Window_Loaded" UseLayoutRounding="True">
<Grid>
<TextBlock HorizontalAlignment="Right" Margin="0,0,10,10" TextWrapping="Wrap" Text="{StaticResource star}" VerticalAlignment="Bottom" Width="283" Height="49"/>
<GroupBox Canvas.Left="10" Canvas.Top="10" Margin="10,10,298,10">
<GroupBox.Header>
<Run Text="{Binding Mode=OneTime, Source={StaticResource image list}, StringFormat='* {0}'}"/>
<Run Text="{Binding Mode=OneTime, Source={StaticResource image list}, StringFormat=* \{0\}}"/>
</GroupBox.Header>
<Grid>
<ListBox x:Name="LB_Pic" Margin="0,0,0,24" SelectionMode="Extended">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding [0]}"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>

<ListBox x:Name="LB_Pic" Margin="0,0,0,24" SelectionMode="Extended" DisplayMemberPath="[0]"/>
<Button x:Name="Btn_Up" Content="" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="22"/>
<Button x:Name="Btn_Down" Content="" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="22" Margin="26,0,0,0"/>
<Button x:Name="Btn_Reset" Content="{StaticResource reset list}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="88" Height="22" ToolTip="{StaticResource tip_resetlist}"/>
Expand All @@ -27,24 +20,82 @@
<Button x:Name="Btn_Save" Content="{StaticResource save}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="64" Margin="0,0,79,10" Height="28" IsDefault="True"/>
<Button x:Name="Btn_Cancel" Content="{StaticResource cancel}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="64" Margin="0,0,10,10" Height="28" IsCancel="True"/>
<Grid Margin="0,10,12,59" HorizontalAlignment="Right" Width="281">
<Grid.Resources>
<Style TargetType="TextBox">
<Setter Property="Margin" Value="2"/>
<Setter Property="BorderBrush" Value="LightSteelBlue"/>
</Style>
<Style TargetType="ComboBox">
<Setter Property="Margin" Value="2"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="{x:Null}"/>
<Setter Property="BorderBrush" Value="LightSteelBlue"/>
</Style>
<Style TargetType="TextBlock">
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="Slider">
<Setter Property="Margin" Value="2"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<ObjectDataProvider x:Key="AllColors" ObjectInstance="{x:Type Colors}" MethodName="GetProperties"/>
<CollectionViewSource x:Key="SortedFonts" Source="{Binding Source={x:Static Fonts.SystemFontFamilies}}">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="Source" Direction="Ascending"/>
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="22*"/>
<RowDefinition Height="22*"/>
<RowDefinition Height="22*"/>
<RowDefinition Height="32*"/>
<RowDefinition Height="32*"/>
<RowDefinition Height="32*"/>
<RowDefinition Height="32*"/>
<RowDefinition Height="32*"/>
<RowDefinition Height="32*"/>
<RowDefinition Height="32*"/>
<RowDefinition Height="32*"/>
<RowDefinition Height="250*"/>
</Grid.RowDefinitions>
<TextBlock TextWrapping="Wrap" Text="{Binding Mode=OneTime, Source={StaticResource onscreen date}, StringFormat='\{0}:'}" VerticalAlignment="Center"/>
<TextBlock Text="{Binding Mode=OneTime, Source={StaticResource onscreen date}, StringFormat=\{0\}}"/>
<CheckBox x:Name="CB_Title" Grid.Row="1" VerticalAlignment="Center" ToolTip="{StaticResource tip_titleslide}">
<Run Text="{Binding Mode=OneTime, Source={StaticResource title slide}, StringFormat=* \{0\}}"/>
</CheckBox>
<TextBlock x:Name="T_DateShown" TextWrapping="Wrap" Text="{StaticResource none}" Grid.Column="1" VerticalAlignment="Center"/>
<TextBlock TextWrapping="Wrap" Text="{Binding Mode=OneTime, Source={StaticResource text shown}, StringFormat=* \{0\}:}" VerticalAlignment="Center" Grid.Row="2"/>
<TextBox x:Name="TB_TextShown" Grid.Column="1" Grid.Row="2" VerticalAlignment="Center"/>
<Image x:Name="IMG_Preview" Grid.Row="3" Grid.ColumnSpan="2" Margin="8"/>
<TextBlock x:Name="T_DateShown" Text="{StaticResource none}" Grid.Column="1"/>
<TextBlock Text="{Binding Mode=OneTime, Source={StaticResource text shown}, StringFormat=* \{0\}}" Grid.Row="2"/>
<TextBlock Text="{Binding Mode=OneTime, Source={StaticResource font family}, StringFormat=* \{0\}}" Grid.Row="3"/>
<TextBlock Text="{Binding Mode=OneTime, Source={StaticResource font size ratio}, StringFormat=* \{0\}}" Grid.Row="4"/>
<TextBlock Text="{Binding Mode=OneTime, Source={StaticResource font color}, StringFormat=* \{0\}}" Grid.Row="5"/>
<TextBlock Text="{Binding Mode=OneTime, Source={StaticResource font offset hor}, StringFormat=* \{0\}}" Grid.Row="6"/>
<TextBlock Text="{Binding Mode=OneTime, Source={StaticResource font offset ver}, StringFormat=* \{0\}}" Grid.Row="7"/>
<TextBox x:Name="TB_Text" Grid.Column="1" Grid.Row="2"/>
<ComboBox x:Name="CbB_FontFamily" Grid.Column="1" Grid.Row="3" SelectedValuePath="Source" ItemsSource="{Binding Source={StaticResource SortedFonts}}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Source}" FontFamily="{Binding Source}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<Slider x:Name="Sld_FontSize" Grid.Column="1" Grid.Row="4" IsDirectionReversed="True" Maximum="30" Minimum="1" SmallChange="1" LargeChange="5" Value="12"/>
<ComboBox x:Name="CbB_FontColor" Grid.Column="1" Grid.Row="5" ItemsSource="{Binding Source={StaticResource AllColors}}" SelectedValuePath="Name">
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel MaxWidth="190"/>
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
<ComboBox.ItemTemplate>
<DataTemplate>
<Border BorderThickness="1" BorderBrush="Gray" CornerRadius="2" Width="16" Height="16" Margin="2" Background="{Binding Name}" ToolTip="{Binding Name}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<Slider x:Name="Sld_FontOffsetH" Grid.Column="1" Grid.Row="6" Maximum="100" Minimum="-100" SmallChange="1" LargeChange="10"/>
<Slider x:Name="Sld_FontOffsetV" Grid.Column="1" Grid.Row="7" Maximum="100" Minimum="-100" SmallChange="1" LargeChange="10"/>
<Image x:Name="IMG_Preview" Grid.Row="100" Grid.ColumnSpan="2" Margin="8"/>
</Grid>

</Grid>
Expand Down
Loading

0 comments on commit 4ac2e93

Please sign in to comment.