Просмотр исходного кода

Compdfkit(win) - 搜索替换调整UI,整理文案

weixiangjie 1 год назад
Родитель
Сommit
6729b9862a

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Edit/PDFImageEdit/PDFImageEditControl/PDFImageEditControl.xaml

@@ -41,7 +41,7 @@
             <local:CPDFImageRotateUI x:Name="RotateUI" FontSize="16"></local:CPDFImageRotateUI>
             <Grid Margin="0,10,0,0">
                 <TextBlock Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_Rotation}" FontFamily="Microsoft YaHei" FontSize="14" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
-                <TextBox x:Name="RotationTxb" HorizontalAlignment="Right" VerticalContentAlignment="Center" Width="110" Height="32" LostFocus="RotationTxb_LostFocus" PreviewKeyDown="RotationTxb_PreviewKeyDown"></TextBox>
+                <TextBox Padding="5,0,5,0" x:Name="RotationTxb" HorizontalAlignment="Right" VerticalContentAlignment="Center" Width="110" Height="32" LostFocus="RotationTxb_LostFocus" PreviewKeyDown="RotationTxb_PreviewKeyDown"></TextBox>
             </Grid>
         </StackPanel>
         

+ 4 - 4
Demo/Examples/Compdfkit_Tools/PDFView/PDFSearch/PDFSearchControl/CPDFSearchControl.xaml

@@ -130,8 +130,8 @@
                     <Image Source="{StaticResource ImageDrawing}" Width="25" Height="25" Margin="0,0,0,0"></Image>
                 </MenuItem.Header>
                 
-                <MenuItem IsCheckable="True" x:Name="CaseChb" Header="Case Sensitive"></MenuItem>
-                <MenuItem IsCheckable="True" x:Name="MatchChb" Header="Match Word"></MenuItem>
+                <MenuItem IsCheckable="True" x:Name="CaseChb" Header="{Binding Converter={StaticResource BotaResourceConverter}, ConverterParameter=Chb_Case}"></MenuItem>
+                <MenuItem IsCheckable="True" x:Name="MatchChb" Header="{Binding Converter={StaticResource BotaResourceConverter}, ConverterParameter=Chb_Match}"></MenuItem>
             </MenuItem>
         </Menu>
 
@@ -142,8 +142,8 @@
         
         <Border x:Name="ReplaceBorder" Grid.Row="2" Background="White" Height="120">
             <StackPanel Margin="10" HorizontalAlignment="Center" Width="{Binding ElementName=ReplaceBorder,Path=ActualWidth}">
-                <Button Content="替换全部" Margin="25,10,25,10" Height="30" Background="#2D3D62" Foreground="White" Style="{StaticResource ButtonHoverStyle}"></Button>
-                <Button Content="替换当前" Margin="25,0,25,0" Height="30" Background="#E2E3E6" Foreground="Black" Style="{StaticResource ButtonHoverStyle}"></Button>
+                <Button Content="{Binding Converter={StaticResource BotaResourceConverter}, ConverterParameter=Button_Replace}" Margin="25,10,25,10" Height="30" Background="#2D3D62" Foreground="White" Style="{StaticResource ButtonHoverStyle}"></Button>
+                <Button Content="{Binding Converter={StaticResource BotaResourceConverter}, ConverterParameter=Button_ReplaceAll}" Margin="25,0,25,0" Height="30" Background="#E2E3E6" Foreground="Black" Style="{StaticResource ButtonHoverStyle}"></Button>
             </StackPanel>
         </Border>
         

+ 5 - 3
Demo/Examples/Compdfkit_Tools/PDFView/PDFSearch/PDFSearchUI/CPDFSearchInputUI.xaml

@@ -56,7 +56,7 @@
             <TextBox Name="ReplaceTextBox" VerticalContentAlignment="Center" Height="30" KeyDown="SearchTextBox_KeyDown" Padding="5,0,30,0"></TextBox>
             <TextBlock VerticalAlignment="Center" IsHitTestVisible="False" Margin="10,0,0,0" Foreground="#999999" 
                        Visibility="{Binding ElementName=ReplaceTextBox,Path=Text,Converter={StaticResource TextLengthToVisibilityConverter}}"
-                       Text="{Binding Converter={StaticResource BotaResourceConverter},ConverterParameter=Holder_Search}"></TextBlock>
+                       Text="{Binding Converter={StaticResource BotaResourceConverter},ConverterParameter=Holder_Replace}"></TextBlock>
             
             <Border Visibility="{Binding ElementName=ReplaceTextBox,Path=Text,Converter={StaticResource InvertTextLengthToVisibilityConverter}}"
                     HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0"
@@ -71,7 +71,8 @@
         
         <Grid Grid.Row="1" Grid.Column="1">
             <DockPanel>
-                <Button Background="Transparent" BorderThickness="0" Width="20" Height="20" FontSize="14" HorizontalAlignment="Left" Click="Previous_Click">
+                <Button Background="Transparent" BorderThickness="0" Width="20" Height="20" FontSize="14" HorizontalAlignment="Left" Click="Previous_Click" 
+                        ToolTip="{Binding Converter={StaticResource BotaResourceConverter},ConverterParameter=Button_Prev}">
                     <Viewbox>
                         <Path StrokeThickness="1.5" Stroke="#999999">
                             <Path.Data>
@@ -81,7 +82,8 @@
                     </Viewbox>
                 </Button>
                 
-                <Button Background="Transparent" BorderThickness="0" Width="20" Height="20" FontSize="14" HorizontalAlignment="Right" Click="Next_Click">
+                <Button Background="Transparent" BorderThickness="0" Width="20" Height="20" FontSize="14" HorizontalAlignment="Right" Click="Next_Click"
+                        ToolTip="{Binding Converter={StaticResource BotaResourceConverter},ConverterParameter=Button_Next}">
                     <Viewbox>
                         <Path StrokeThickness="1.5" Stroke="#999999">
                             <Path.Data>

+ 81 - 0
Demo/Examples/Compdfkit_Tools/Strings/Bota.Designer.cs

@@ -86,6 +86,15 @@ namespace Compdfkit_Tools.Strings.Common {
             }
         }
         
+        /// <summary>
+        ///   Looks up a localized string similar to Next.
+        /// </summary>
+        internal static string Button_Next {
+            get {
+                return ResourceManager.GetString("Button_Next", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   Looks up a localized string similar to OK.
         /// </summary>
@@ -95,6 +104,60 @@ namespace Compdfkit_Tools.Strings.Common {
             }
         }
         
+        /// <summary>
+        ///   Looks up a localized string similar to Previous.
+        /// </summary>
+        internal static string Button_Prev {
+            get {
+                return ResourceManager.GetString("Button_Prev", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Replace.
+        /// </summary>
+        internal static string Button_Replace {
+            get {
+                return ResourceManager.GetString("Button_Replace", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Replace All.
+        /// </summary>
+        internal static string Button_ReplaceAll {
+            get {
+                return ResourceManager.GetString("Button_ReplaceAll", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Search.
+        /// </summary>
+        internal static string Button_Search {
+            get {
+                return ResourceManager.GetString("Button_Search", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Ignore Case.
+        /// </summary>
+        internal static string Chb_Case {
+            get {
+                return ResourceManager.GetString("Chb_Case", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Whole Words only.
+        /// </summary>
+        internal static string Chb_Match {
+            get {
+                return ResourceManager.GetString("Chb_Match", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   Looks up a localized string similar to Bookmark Title.
         /// </summary>
@@ -104,6 +167,24 @@ namespace Compdfkit_Tools.Strings.Common {
             }
         }
         
+        /// <summary>
+        ///   Looks up a localized string similar to Find.
+        /// </summary>
+        internal static string Holder_Find {
+            get {
+                return ResourceManager.GetString("Holder_Find", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to Replace with.
+        /// </summary>
+        internal static string Holder_Replace {
+            get {
+                return ResourceManager.GetString("Holder_Replace", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   Looks up a localized string similar to Search.
         /// </summary>

+ 27 - 0
Demo/Examples/Compdfkit_Tools/Strings/Bota.resx

@@ -123,4 +123,31 @@
     <data name="Tip_Result" xml:space="preserve">
         <value>result found</value>
     </data>
+    <data name="Button_Replace" xml:space="preserve">
+        <value>Replace</value>
+    </data>
+    <data name="Holder_Find" xml:space="preserve">
+        <value>Find</value>
+    </data>
+    <data name="Holder_Replace" xml:space="preserve">
+        <value>Replace with</value>
+    </data>
+    <data name="Button_Prev" xml:space="preserve">
+        <value>Previous</value>
+    </data>
+    <data name="Button_Next" xml:space="preserve">
+        <value>Next</value>
+    </data>
+    <data name="Button_ReplaceAll" xml:space="preserve">
+        <value>Replace All</value>
+    </data>
+    <data name="Chb_Case" xml:space="preserve">
+        <value>Ignore Case</value>
+    </data>
+    <data name="Chb_Match" xml:space="preserve">
+        <value>Whole Words only</value>
+    </data>
+    <data name="Button_Search" xml:space="preserve">
+        <value>Search</value>
+    </data>
 </root>

+ 27 - 0
Demo/Examples/Compdfkit_Tools/Strings/Bota.zh.resx

@@ -116,4 +116,31 @@
     <data name="Tip_Result" xml:space="preserve">
         <value>查询结果</value>
     </data>
+    <data name="Button_Replace" xml:space="preserve">
+        <value>替换</value>
+    </data>
+    <data name="Holder_Find" xml:space="preserve">
+        <value>查找</value>
+    </data>
+    <data name="Holder_Replace" xml:space="preserve">
+        <value>替换为</value>
+    </data>
+    <data name="Button_Prev" xml:space="preserve">
+        <value>上一个</value>
+    </data>
+    <data name="Button_Next" xml:space="preserve">
+        <value>下一个</value>
+    </data>
+    <data name="Button_ReplaceAll" xml:space="preserve">
+        <value>全部替换</value>
+    </data>
+    <data name="Chb_Case" xml:space="preserve">
+        <value>区分大小写</value>
+    </data>
+    <data name="Chb_Match" xml:space="preserve">
+        <value>全词匹配</value>
+    </data>
+    <data name="Button_Search" xml:space="preserve">
+        <value>搜索</value>
+    </data>
 </root>