Parcourir la source

compdfkit(win) - 调整角度输入框UI,修复搜索按钮bug

weixiangjie il y a 1 an
Parent
commit
47bf1edf1e

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Common/BarControl/CPDFBOTABarControl.xaml

@@ -4,7 +4,7 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              mc:Ignorable="d" 
-             d:DesignHeight="800" d:DesignWidth="300">
+             d:DesignHeight="800" d:DesignWidth="300" Loaded="CPDFBOTABarControl_OnLoaded">
     <UserControl.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>

+ 19 - 8
Demo/Examples/Compdfkit_Tools/Common/BarControl/CPDFBOTABarControl.xaml.cs

@@ -41,19 +41,21 @@ namespace Compdfkit_Tools.PDFControl
         private ToggleButton thumbnailButton;
         private ToggleButton annotButton;
         private ToggleButton searchButton;
-        private CPDFSearchControl searchControl = new CPDFSearchControl();
+        private CPDFSearchControl searchControl;
         private ToggleButton signatureButton;
         ToggleButton checkBtn;
 
         public bool ReplaceFunctionEnabled
         {
-            set
-            {
-                if (searchControl?.ReplaceTog != null)
-                {
-                    searchControl.ReplaceTog.Visibility = value ? Visibility.Visible : Visibility.Collapsed;
-                }
-            }
+            get;
+            set;
+            // set
+            // {
+            //     if (searchControl?.ReplaceTog != null)
+            //     {
+            //         searchControl.ReplaceTog.Visibility = value ? Visibility.Visible : Visibility.Collapsed;
+            //     }
+            // }
         }
 
         private Dictionary<BOTATools,ToggleButton> botaToolBtnDic;
@@ -407,6 +409,7 @@ namespace Compdfkit_Tools.PDFControl
                                         searchControl.InitWithPDFViewer(pdfViewer);
                                     }
                                 }
+                                searchControl.ReplaceTog.Visibility = ReplaceFunctionEnabled ? Visibility.Visible : Visibility.Collapsed;
                                 SetBotaTool(searchControl);
                                 checkBtn = searchButton;
                             }
@@ -493,5 +496,13 @@ namespace Compdfkit_Tools.PDFControl
                 control.LoadSignatureList();
             }
         }
+
+        private void CPDFBOTABarControl_OnLoaded(object sender, RoutedEventArgs e)
+        {
+            if(searchControl!=null && searchControl.ReplaceTog!=null)
+            {
+                searchControl.ReplaceTog.Visibility = ReplaceFunctionEnabled ? Visibility.Visible : Visibility.Collapsed;
+            }
+        }
     }
 }

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

@@ -39,7 +39,10 @@
          
         <StackPanel Grid.Row="2"  Margin="0,33,0,0" >
             <local:CPDFImageRotateUI x:Name="RotateUI" FontSize="16"></local:CPDFImageRotateUI>
-            <TextBox x:Name="RotationTxb" HorizontalAlignment="Right" VerticalContentAlignment="Center" Width="120" Height="32" Margin="0,10,0,0" LostFocus="RotationTxb_LostFocus" PreviewKeyDown="RotationTxb_PreviewKeyDown"></TextBox>
+            <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>
+            </Grid>
         </StackPanel>
         
         <local:CPDFImageFlipUI x:Name="FlipUI" Grid.Row="3" FontSize="16" Margin="0,10,0,0"></local:CPDFImageFlipUI>

+ 18 - 0
Demo/Examples/Compdfkit_Tools/Strings/PropertyPanel.Designer.cs

@@ -392,6 +392,15 @@ namespace Compdfkit_Tools.Strings {
             }
         }
         
+        /// <summary>
+        ///   Looks up a localized string similar to - 180° to 180°.
+        /// </summary>
+        internal static string Holder_Rotation {
+            get {
+                return ResourceManager.GetString("Holder_Rotation", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   Looks up a localized string similar to Text Field 1.
         /// </summary>
@@ -698,6 +707,15 @@ namespace Compdfkit_Tools.Strings {
             }
         }
         
+        /// <summary>
+        ///   Looks up a localized string similar to Rotation Angle.
+        /// </summary>
+        internal static string Property_Rotation {
+            get {
+                return ResourceManager.GetString("Property_Rotation", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   Looks up a localized string similar to Start.
         /// </summary>

+ 6 - 0
Demo/Examples/Compdfkit_Tools/Strings/PropertyPanel.resx

@@ -510,4 +510,10 @@
   <data name="Tip_Default" xml:space="preserve">
     <value>Select an item in the item list to make it the default option.</value>
   </data>
+  <data name="Property_Rotation" xml:space="preserve">
+    <value>Rotation Angle</value>
+  </data>
+  <data name="Holder_Rotation" xml:space="preserve">
+    <value>- 180° to 180°</value>
+  </data>
 </root>

+ 6 - 0
Demo/Examples/Compdfkit_Tools/Strings/PropertyPanel.zh.resx

@@ -510,4 +510,10 @@
   <data name="Tip_Default" xml:space="preserve">
     <value>选中一项使其成为默认选项</value>
   </data>
+  <data name="Property_Rotation" xml:space="preserve">
+    <value>任意角度</value>
+  </data>
+  <data name="Holder_Rotation" xml:space="preserve">
+    <value>-180 ~ 180 度</value>
+  </data>
 </root>